Event processing method and system and event-driven architecture

By deploying index cache and associated queues in the event bus, and combining dynamic regulators to monitor traffic and generate feature items in real time, the overload and computational resource waste problems of the event bus in the EDA architecture are solved, and efficient event distribution and resource utilization are achieved.

CN121705048APending Publication Date: 2026-03-20HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411312307.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies, event-driven architecture (EDA) faces the risk of overload and waste of computing resources when the event bus distributes events to be consumed through the raw channel. This is especially true when the traffic of different types of events is uneven, which leads to an increase in computing power and overload of the message server.

Method used

An index cache is deployed in the event bus to store feature items for filtering events to be consumed. These events are then directly distributed to the corresponding business targets through associated queues. Combined with a dynamic regulator that monitors event traffic in real time to generate feature items, the amount of filtering computation is reduced, thus minimizing waste of computing resources and the risk of overload.

Benefits of technology

By filtering and directly distributing events to be consumed, the processing pressure on the event bus is reduced, the waste of computing resources and the overload of the message server are avoided, and the efficiency and scalability of the system are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121705048A_ABST
    Figure CN121705048A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of message processing, in particular to an event processing method and system and an event-driven architecture. The event processing method is applied to an EDA (event driven architecture), an index cache is deployed in an event bus of the EDA, feature items used for screening events to be consumed are stored in the index cache, the feature items point to an association queue, and the association queue is used for associating the events to be consumed. The method comprises the following steps: determining whether a to-be-consumed event in an event bus is matched with a feature item in the index cache or not; if the to-be-consumed event is matched with the feature item in the index cache, the to-be-consumed event is distributed to an associated queue pointed by the matched feature item, and the associated queue is used for distributing the to-be-consumed event to a corresponding service target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of message processing technology, specifically to an event processing method, system, and event-driven architecture. Background Technology

[0002] Event-Driven Architecture (EDA) comprises event producers, an event bus, and event consumers, i.e., business targets. Event producers are specifically used to create and publish events. The event bus transmits events from event producers to business targets. Business targets subscribe to and listen for events on the event bus, and once an event occurs, the business target processes it accordingly. EDA architecture has become the mainstream architecture for microservices, offering advantages such as loose coupling, scalability, and agility.

[0003] The subscription-based consumption model is a specific implementation of EDA architecture. In this model, the event bus distributes events through raw channel topics deployed within it. However, when distributing events through raw channel topics, all events to be consumed need to be calculated before determining which events should be distributed to the business target, resulting in a waste of computing resources. Moreover, if the traffic of other types of events to be consumed is too large, the computational load on the message server where the event bus resides can be amplified infinitely, leading to the risk of message server overload. Summary of the Invention

[0004] To address the issues of overload risk and wasted computing resources when the event bus in the existing EDA architecture distributes events to be consumed through the raw channel, this invention provides an event processing method, system, and event-driven architecture.

[0005] In a first aspect, embodiments of the present invention provide an event processing method. The method is applied to an event-driven architecture (EDA) architecture. An index cache is deployed in the event bus of the EDA architecture. The index cache stores feature items used to filter events to be consumed. These feature items point to an associated queue. The method includes:

[0006] Determine whether the events to be consumed in the event bus match the features in the index cache;

[0007] If the event to be consumed matches a feature in the index cache, the event to be consumed will be distributed to the associated queue pointed to by the matching feature. The associated queue is used to distribute the event to the corresponding business target.

[0008] This invention employs an index cache within the event bus, storing feature items to filter events awaiting consumption. This identifies events with low hit rates from all pending events, reducing the computational load of event bus filtering. By leveraging the index relationship between feature items and associated queues, the identified events are directly distributed to their corresponding associated queues for further distribution to business targets, mitigating the risk of overload caused by computational expansion on the message service side.

[0009] Furthermore, the feature items in the index cache are determined according to the rule features of the preset event subscription rules, so as to filter the events to be consumed that have the preset event subscription rule features.

[0010] Furthermore, in order to filter and distribute events to be consumed, the index cache contains multiple feature items;

[0011] Multiple features are determined based on the rule features of different preset event subscription rules;

[0012] Multiple feature items point to different associated queues, and each associated queue corresponds to a different business objective.

[0013] Furthermore, when distributing events to be consumed, the feature items in the index cache are determined according to the rule features of the preset event subscription rules, including:

[0014] The feature item contains at least one feature field extracted from the preset event subscription rules;

[0015] The feature also includes a feature index, which points to the associated queue.

[0016] Furthermore, the feature items in the index cache are determined based on the rule features of the preset event subscription rules, including:

[0017] The preset event subscription rules are the event subscription rules corresponding to target event types with a hit rate lower than the set value;

[0018] The hit rate is the probability of identifying a specified type of event from all events to be consumed on the event bus.

[0019] Furthermore, the event bus also includes a dynamic regulator, which is used to determine the target event type based on the traffic of each type of event to be consumed in the event bus, and generate feature items based on the event subscription rules corresponding to the target event type.

[0020] The features in the index cache are determined based on the features generated by the dynamic adjuster.

[0021] Furthermore, the dynamic regulator is used to determine the target event type based on the flow of each type of event to be consumed in the event bus, including:

[0022] Real-time monitoring of the traffic of various types of events to be consumed in the event bus;

[0023] Based on the traffic of each type of event to be consumed, the hit rate of each type of event is determined. The hit rate is the probability of identifying the corresponding type of event to be consumed from all events to be consumed in the event bus.

[0024] Event types with a hit rate lower than the set value are identified as target event types.

[0025] This invention provides an embodiment that monitors events to be consumed in the event bus in real time. When a target event type appears in the event bus, feature items are generated and the index cache is updated in a timely manner. This helps the event bus to determine the events with a high hit rate from all events to be consumed in a timely manner, avoiding the event bus from distributing them through the original channel and reducing the processing pressure on the event bus.

[0026] Furthermore, when there are no low-hit-rate target event types in the event bus, there will be no waste of computing resources or overload issues. To achieve the distribution of high-hit-rate events to be consumed, the method also includes:

[0027] If the event to be consumed does not match the feature item in the index cache, the event to be consumed will be pushed to the original channel and distributed to the corresponding business target for consumption according to the event subscription rule corresponding to the event to be consumed.

[0028] Secondly, embodiments of the present invention provide an event processing system. The system is applied to an event-driven architecture (EDA) architecture, which includes an event bus, an index cache, and an associated queue. The index cache and the associated queue are deployed within the event bus.

[0029] The index cache stores feature items used to filter events to be consumed; these feature items point to the associated queue.

[0030] The event bus is used to determine whether the event to be consumed in the event bus matches the feature in the index cache. If the event to be consumed matches the feature in the index cache, the event to be consumed is dispatched to the associated queue pointed to by the matching feature.

[0031] The associated queue is used to distribute events to be consumed to the corresponding business objectives.

[0032] Furthermore, the event bus also includes: a dynamic regulator;

[0033] The dynamic regulator is used to determine the target event type based on the traffic of each type of event to be consumed in the event bus, and to generate feature items according to the target event subscription rules corresponding to the target event type.

[0034] The features in the index cache are determined based on the features generated by the dynamic adjuster.

[0035] Furthermore, the dynamic regulator is used to determine the target event type based on the flow of each type of event to be consumed in the event bus, including:

[0036] Real-time monitoring of the traffic of various types of events to be consumed in the event bus;

[0037] Based on the traffic of each type of event to be consumed, the hit rate of each type of event is determined. The hit rate is the probability of identifying the corresponding type of event to be consumed from all events to be consumed in the event bus.

[0038] Event types with a hit rate lower than the set value are identified as target event types.

[0039] Furthermore, the event bus is also used to push the event to be consumed to the original channel when the feature items in the index cache do not match, and distribute it to the corresponding business target for consumption through the event subscription rules corresponding to the event to be consumed.

[0040] Thirdly, embodiments of the present invention provide an event-driven EDA architecture, including several event producers, several business objectives, and an event processing system as described in any of the second aspects;

[0041] Event producers are used to generate events to be consumed and send these events to the event bus of the event processing system.

[0042] Business objectives are used to consume events that are intended for consumption. Attached Figure Description

[0043] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] like Figure 1 The diagram shown is a schematic of an EDA architecture.

[0045] like Figure 2 The diagram shown is a structural schematic of another EDA architecture;

[0046] like Figure 3 The diagram shown is a structural schematic of another EDA architecture;

[0047] like Figure 4 The diagram shown is a structural schematic of another EDA architecture;

[0048] like Figure 5 The diagram shown is a structural schematic of an event processing system provided in an embodiment of the present invention.

[0049] like Figure 6 The diagram shown is a flowchart of an event handling method provided by an embodiment of the present invention;

[0050] like Figure 7 The diagram shown is a flowchart of an embodiment of an event handling method provided by the present invention. Detailed Implementation

[0051] Before describing the embodiments of this application, the relevant technologies and technical issues will be explained first.

[0052] Event-Driven Architecture (EDA) comprises event producers, an event bus, and event consumers, i.e., business targets. In an EDA system, event producers, the event bus, and event consumers are deployed in a distributed manner. Event producers are specifically used to create and publish events. The event bus is used to transmit events from event producers to business targets. Business targets subscribe to and listen for events to be consumed on the event bus; once a consumed event occurs, the business target processes it accordingly. EDA architecture has become the mainstream architecture for microservices, offering advantages such as loose coupling, scalability, and agility.

[0053] like Figure 1 The diagram shown is a schematic representation of an EDA architecture. (See also...) Figure 1 The EDA architecture contains N event producers, each capable of generating events and sending them to the event bus. The EDA architecture also includes N business targets for consuming events. The event bus in the EDA architecture filters and distributes the events generated by each event producer to the corresponding business targets for consumption.

[0054] The subscription-based consumption model is a specific implementation of EDA architecture. In this model, the event bus distributes events through its deployed primary channel topics. In an EDA architecture based on this model, the primary channels in the event bus determine the correspondence between each event to be consumed and the corresponding business objective based on preset subscription rules, and then distribute these events to the appropriate business objectives. However, when distributing events according to the subscription rules, the primary channels cannot directly determine which events need to be distributed to the corresponding business objectives from all the events to be consumed on the event bus. Instead, they need to perform calculations on all events to determine which ones to distribute to the business objectives. This results in some computing resources being used for other types of events to be consumed, leading to a waste of computing resources. Furthermore, if the traffic of other types of events to be consumed is too high, the computational load on the message server where the event bus resides can be amplified infinitely, potentially causing the message server to overload.

[0055] The following is an illustration using a specific example.

[0056] like Figure 2 The diagram shown is a schematic representation of an EDA architecture, specifically a subscription-based consumption model. (See also...) Figure 2 The event producer generates three types of events: OBS events, MRS events, and ECS events, and inputs them into the event bus. The raw channel topics of the event bus distribute the three types of events to the corresponding business targets for consumption according to event subscription rules. For example, OBS events need to be sent to business target 1 for execution, MRS events need to be sent to business target 2 for execution, and ECS events need to be sent to business target 3 for execution.

[0057] When distributing MRS events to business target 2, it's impossible to directly identify the MRS event from all events; therefore, calculations must be performed on all events before the MRS event can be determined. When the OBS event traffic is 10,000 QPS, the MRS event traffic is 10 QPS, and the ECS event traffic is 10 QPS, the hit rate for directly identifying the MRS event from all events is only 0.000998. When determining the MRS event, it's highly likely that the high-traffic OBS event will be hit instead of the MRS event requiring distribution, resulting in a waste of computing resources. Furthermore, the excessively high OBS event traffic can also lead to overload risks on the message server running the event bus.

[0058] In related technologies, the above problems are addressed by splitting the event bus. Specifically, multiple event channels can be artificially created based on business type and event classification to break down events, sending different types of events to different event buses, and then distributing them to various business targets via the event bus.

[0059] like Figure 3 The diagram shown illustrates the structure of an EDA architecture, specifically an EDA architecture divided into multiple event buses. See also... Figure 3 The event bus is divided into event bus 1, event bus 2, and event bus 3. Each event to be consumed enters the corresponding event bus, and is then distributed to the business target for consumption according to the event subscription rules in each event bus.

[0060] However, since event channels are resource-intensive, deploying an event bus in a message server is not suitable for scenarios involving massive event buses and raw channels, as this would consume a significant amount of disk storage space and memory. The substantial expansion of event buses and raw channels necessitates scaling up the message resources of the message server to meet the demands.

[0061] In related technologies, the above problems are also addressed by deprecating the event bus. Specifically, the event bus can be abandoned, and the distribution of events to be consumed can be achieved through the memory of the devices deployed by message producers or business targets. Figure 4 The diagram shown is a schematic representation of an EDA architecture. (See also...) Figure 4 The event bus is deprecated. After a consumer event is generated, it is directly distributed to the corresponding business target by the event producer's memory after calculation.

[0062] However, while this method reduces the computational load handled by the event bus, the actual computational load is not reduced; it is merely shifted from the message server to the message producer or business target. Furthermore, abandoning the event bus prevents event persistence, archiving and replaying of events to be consumed, and displaying the trajectory of events to be consumed.

[0063] To address this issue, embodiments of the present invention provide an event processing system and an event processing method to solve the problems of wasted computing resources caused by excessively large differences in traffic between different types of events in a many-to-many target scenario of the event bus, and the risk of overload on the message server caused by the infinite amplification of the computing load in the message server where the event bus is located.

[0064] like Figure 5 The image shows an event processing system provided in an embodiment of the present invention. See also... Figure 5The event processing system is applied to the EDA architecture. Besides event producers, an event bus, and business objectives, the EDA architecture also includes an index cache and an associated queue, both of which are deployed within the event bus. The event producer... Figure 5 Not shown in the image.

[0065] The index cache is used to store the feature items for filtering events to be consumed, and each feature item points to a pre-associated queue.

[0066] The event bus is used to determine whether the event to be consumed entering the event bus matches the feature in the index cache. If the event to be consumed matches the feature in the index cache, the event to be consumed is directly dispatched to the associated queue pointed to by the matching feature.

[0067] Optionally, the event bus is also used to push the event to be consumed to the original channel when the event to be consumed does not match the feature item in the index cache, and distribute it to the corresponding business target for consumption according to the event subscription rule corresponding to the event to be consumed.

[0068] The associated queue is used to distribute received events to be consumed to the corresponding business objectives.

[0069] See Figure 5 The event processing system also includes a dynamic regulator. The dynamic regulator can be deployed in a distributed manner with the event bus.

[0070] The dynamic regulator determines the target event type based on the traffic volume of various types of events to be consumed in the event bus, and generates feature items according to the target event rules corresponding to the target event type. The generated feature items are sent to the index cache for storage; that is, the feature items used to filter events to be consumed in the index cache are all determined by the feature items generated by the dynamic regulator. The target event is a low-traffic event that is not easily selected during event distribution in the event bus.

[0071] The dynamic regulator specifically includes an extraction module, a sending module, and a monitoring module.

[0072] The extraction module is used to perform rule feature extraction on the preset event subscription rules of the target event type, and extract feature items from them. The sending module is used to send the extracted feature items to the index cache.

[0073] The monitoring module is used to monitor the traffic of various types of events to be consumed in the event bus in real time in order to determine the target event type.

[0074] Specifically, the monitoring module monitors the traffic of each type of event to be consumed in the event bus in real time, and determines the hit rate of each type of event based on the traffic of each type of event to be consumed. That is, it determines the probability of a corresponding type of event to be consumed from all the events to be consumed in the event bus. When the hit rate of a certain event type is lower than a set value, the event type with a hit rate lower than the set value can be determined as the target event type.

[0075] Optionally, the monitoring module of the dynamic regulator can be deployed within the dynamic regulator or as a standalone device distributed with the dynamic regulator. When the monitoring module is distributed with the dynamic regulator, it independently monitors the traffic of various types of events to be consumed in the event bus and sends a notification to the dynamic regulator when a target event type is identified. In the case of a distributed deployment, a response module is also deployed within the dynamic regulator. The response module receives messages sent by the detection module, and when it receives a notification from the dynamic regulator, it determines the existence of a target event type and performs the corresponding operation through the extraction and sending modules.

[0076] like Figure 6 As shown, this is an example of an event handling method provided by an embodiment of the present invention. This method is applied to events such as... Figure 5 The event handling system shown includes the following specific steps:

[0077] S601, determine whether the event to be consumed in the event bus matches the feature in the index cache.

[0078] Specifically, the index cache stores several rules defined according to preset event subscription rules, used to filter events that possess the characteristics of the preset event subscription rules. It determines whether there are fields in the events to be consumed that match the features, thus determining whether the events to be consumed match the features.

[0079] The various feature items in the index cache are determined based on the rule characteristics of different preset event subscription rules, and each points to a different associated queue. Each feature item contains at least one feature field extracted from the preset event subscription rule, and also contains a feature index to point to the associated queue, so as to establish the correspondence between the feature field and the associated queue.

[0080] Furthermore, each associated queue corresponds to a different business objective. Therefore, an index cache establishes a correspondence between feature items, associated queues, and business objectives.

[0081] Among them, the preset event subscription rule is the event subscription rule corresponding to the target event type with a hit rate lower than the set value. That is, it is the event subscription rule corresponding to the event type with a probability of identifying a specified type of event to be consumed from all the events to be consumed in the event bus that is lower than the preset value.

[0082] S602, if the event to be consumed matches a feature in the index cache, the event to be consumed is distributed to the associated queue pointed to by the matching feature. The associated queue is used to distribute the event to be consumed to the corresponding business target.

[0083] Optionally, if the event to be consumed does not match the feature item in the index cache, the event to be consumed is pushed to the original channel and distributed to the corresponding business target for consumption according to the event subscription rule corresponding to the event to be consumed.

[0084] This invention employs an index cache, storing feature items within it to filter events awaiting consumption in the event bus. This identifies events with low hit rates from all pending events, reducing the computational load of the event bus filtering process. By leveraging the index relationship between feature items and associated queues, the identified events are directly distributed to their corresponding associated queues for further distribution to business targets, mitigating the overload risk caused by the increased computational load on the message service side.

[0085] In this embodiment of the invention, it is also necessary to monitor the various types of events to be consumed in the event bus to determine the target event type and generate feature items to update the feature items stored in the index cache.

[0086] Specifically, the dynamic regulator monitors the traffic of each type of consumed event in the event bus in real time, and determines the hit rate of each type of event based on the traffic of each type of consumed event. The determined hit rate of each type of event is determined by the ratio of the traffic of the corresponding type of event to the total traffic of all events to be consumed, and is used to represent the probability of identifying the corresponding type of event to be consumed from all events to be consumed on the event bus.

[0087] The hit rate of each type of pending event is compared with a set value to determine if it is lower than the preset value. When the hit rate of a certain type of pending event is lower than the set value, it means that the probability of directly identifying that type of pending event from all pending events is low, and some computing resources will be wasted on other types of pending events. Therefore, it is not suitable to perform distribution through the original channel and the corresponding event subscription rules. Thus, event types with a hit rate lower than the set value are identified as target event types.

[0088] After determining the target event type, the preset event subscription rule corresponding to the target event type is identified from all event subscription rules. The rule features of the preset event subscription rule are then extracted to obtain feature items. These feature items are then sent to the index cache for storage.

[0089] The index cache receives and stores the feature items sent by the dynamic regulator, and points to the associated queue through the feature index of each feature item to establish the correspondence between the feature item and the associated queue. This allows the event to be consumed to be directly distributed to the associated queue when it is determined that the event matches the feature.

[0090] This invention provides an embodiment that monitors events to be consumed in the event bus in real time. When a target event type appears in the event bus, feature items are generated and the index cache is updated in a timely manner. This helps the event bus to determine the events with a high hit rate from all events to be consumed in a timely manner, avoiding the event bus from distributing them through the original channel and reducing the processing pressure on the event bus.

[0091] The following is a specific embodiment of the present invention, through which the above-described event handling method is illustrated. Figure 7 The diagram shown is a flowchart of this embodiment.

[0092] See Figure 7 Event producers generate OBS events and ECS events as events to be consumed and push them to the same event bus. The dynamic regulator's monitoring module monitors the events to be consumed on the event bus. Since the traffic of OBS events is 10,000 QPS and the traffic of ECS events is 100 QPS, the dynamic regulator can calculate that the hit rate of OBS events is 0.99 and the hit rate of ECS events is 0.01. Comparing the hit rates of OBS events and ECS events with preset values, it can be determined that the hit rate of ECS events is lower than the preset value, and the ECS event type is determined as the target event type.

[0093] The dynamic regulator determines the preset event subscription rule corresponding to the ECS event from all event subscription rules and extracts the rule features of the preset event subscription rule. When the preset event subscription rule is ((($,source IN('HC.ECS')))AND(($,type IN('ECS:CloudTrace;ConsoleAction','ECS:CloudTrace;ApiCall')))), the rule features extracted are source and type. Two feature items are generated accordingly, one containing the source feature field and the other containing the type feature field. Both feature items are sent to the index cache for storage.

[0094] The index cache stores received feature items and builds a feature index to determine the relationship with the associated queue. Key: id / source / type, Value: broker0 / queue0. That is, events to be consumed that match the source and type are pushed to the associated queue queue0, and then sent to the corresponding business target for consumption through the associated queue queue0.

[0095] The event bus determines whether an event to be consumed matches a feature stored in the index cache. If the ECS event contains a `source` field and matches a feature in the index cache, it is pushed to the associated queue `queue0` based on the feature index, and `queue0` then sends it to the corresponding business target for consumption. If the OBS event does not match a feature in the index cache, it is pushed to the raw channel and distributed to the corresponding business target for consumption according to the event subscription rules corresponding to the OBS event.

[0096] It should also be noted that in the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0097] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0098] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0099] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0100] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments of this application can be implemented using electronic hardware, computer software, or a combination of electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0101] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0102] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. The protection scope of this application should be determined by the protection scope of the claims.

Claims

1. An event handling method, characterized in that, The method is applied to an event-driven architecture (EDA) architecture, where an index cache is deployed in the event bus. The index cache stores feature items used to filter events to be consumed, and these feature items point to an associated queue. The method includes: Determine whether the events to be consumed in the event bus match the feature items in the index cache; If the event to be consumed matches a feature in the index cache, the event to be consumed is distributed to the associated queue pointed to by the matching feature, and the associated queue is used to distribute the event to the corresponding business target.

2. The method according to claim 1, characterized in that, The feature items in the index cache are determined according to the rule features of the preset event subscription rules, so as to filter the events to be consumed that have the preset event subscription rule features.

3. The method according to claim 2, characterized in that, The index cache contains multiple feature items; The multiple feature items are determined according to the rule features of different preset event subscription rules; Each of the aforementioned feature items points to a different associated queue, and each associated queue corresponds to a different business objective.

4. The method according to claim 2, characterized in that, The feature items in the index cache are determined according to the rule features of the preset event subscription rules, including: The feature item includes at least one feature field extracted from the preset event subscription rule; The feature item also includes a feature index, which points to the associated queue.

5. The method according to claim 2, characterized in that, The feature items in the index cache are determined according to the rule features of the preset event subscription rules, including: The preset event subscription rule is the event subscription rule corresponding to the target event type with a hit rate lower than the set value; The hit rate is the probability of identifying a specified type of event from all events to be consumed on the event bus.

6. The method according to claim 1, characterized in that, The EDA architecture also includes a dynamic regulator, which is used to determine the target event type based on the traffic of each type of event to be consumed in the event bus, and generate feature items according to the event subscription rules corresponding to the target event type. The feature items in the index cache are determined based on the feature items generated by the dynamic adjuster.

7. The method according to claim 6, characterized in that, The dynamic regulator is used to determine the target event type based on the traffic of each type of event to be consumed in the event bus, including: Real-time monitoring of the traffic of various types of events to be consumed in the event bus; Based on the traffic of each type of event to be consumed, the hit rate of each type of event is determined. The hit rate is the probability of identifying the corresponding type of event to be consumed from all events to be consumed in the event bus. Event types with a hit rate lower than a set value are identified as the target event types.

8. The method according to claim 1, characterized in that, The method further includes: If the event to be consumed does not match the feature item in the index cache, the event to be consumed is pushed to the original channel and distributed to the corresponding business target for consumption according to the event subscription rule corresponding to the event to be consumed.

9. An event processing system, characterized in that, The system is applied to an event-driven architecture (EDA) architecture, which includes an event bus, an index cache, and an associated queue. The index cache and the associated queue are deployed within the event bus. The index cache is used to store feature items for filtering events to be consumed, and the feature items point to the associated queue; The event bus is used to determine whether the event to be consumed in the event bus matches the feature item in the index cache. If the event to be consumed matches the feature item in the index cache, the event to be consumed is distributed to the associated queue pointed to by the matching feature item. The associated queue is used to distribute the events to be consumed to the corresponding business targets.

10. The system according to claim 9, characterized in that, The EDA architecture also includes: a dynamic regulator; The dynamic regulator is used to determine the target event type based on the traffic of each type of event to be consumed in the event bus, and to generate feature items according to the target event subscription rules corresponding to the target event type. The feature items in the index cache are determined based on the feature items generated by the dynamic adjuster.

11. The system according to claim 10, characterized in that, The dynamic regulator is used to determine the target event type based on the traffic of each type of event to be consumed in the event bus, including: Real-time monitoring of the traffic of various types of events to be consumed in the event bus; Based on the traffic of each type of event to be consumed, the hit rate of each type of event is determined. The hit rate is the probability of identifying the corresponding type of event to be consumed from all events to be consumed in the event bus. Event types with a hit rate lower than a set value are identified as the target event types.

12. The system according to claim 9, characterized in that, The event bus is also used to push the event to be consumed to the original channel when the event to be consumed does not match the feature item in the index cache, and distribute it to the corresponding business target for consumption according to the event subscription rule corresponding to the event to be consumed.

13. An event-driven EDA architecture, characterized in that, It includes several event producers, several business objectives, and an event processing system as described in any one of claims 9-12; The event producer is used to generate events to be consumed and send the events to be consumed to the event bus of the event processing system; The business objective is used to consume the events to be consumed.