Event processing method and system, electronic equipment and storage medium

By standardizing the processing of enterprise-level events and matching them with a notification strategy library, combined with hierarchical caching and non-relational database storage, the complexity and inefficiency of event processing in cross-system collaboration are solved, achieving efficient and unified management of multi-source events and accurate notifications.

CN121193607APending Publication Date: 2025-12-23GUANGZHOU HUYA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511284069.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

In enterprise-level event handling, cross-system collaboration is hampered by high communication costs, complexity, and inefficiency caused by differences in data formats. Existing technologies struggle to achieve standardization and efficient interaction of multi-source events.

Method used

By establishing a one-to-one correspondence between event types and event type data structures, source events are standardized, and precise matching and notification are achieved by combining a notification strategy library. A hierarchical caching mechanism and non-relational database storage are adopted to ensure unified management and efficient processing of events.

Benefits of technology

It achieves unified standardization of multi-source events, reduces the complexity of cross-system integration, improves event processing efficiency and notification accuracy, enhances inter-system collaboration efficiency and data flow capabilities, and ensures the robustness and scalability of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121193607A_ABST
    Figure CN121193607A_ABST
Patent Text Reader

Abstract

The invention relates to the field of internet event operation and maintenance, in particular to an event processing method and system, electronic equipment and a storage medium. The method comprises the steps that a source event is obtained, according to preset event types and event type data structures, the source event is standardized to obtain a standard event, and the event types correspond to the event type data structures one to one; matching the standard event according to each notification strategy in a notification strategy library, and taking the matched standard event as a notification event; and sending the notification event according to a preset notification mode. According to the method, standardized acquisition and processing of each source event can be realized, so that the complexity and the cost of docking between the systems are reduced, and the collaborative efficiency and the data flow capability between the systems are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of Internet event operation and maintenance, and more particularly to an event processing method and system, an electronic device and a storage medium. BACKGROUND

[0002] In today's digital enterprise operating environment, enterprise-level events refer to events generated by various systems within an enterprise, including changes, alarms and process events. Since business operations in an enterprise rely on the coordinated work of multiple interrelated systems, a large number of enterprise-level events are generated in the process of handling business by each system. These enterprise-level events need to be effectively exchanged between systems to break down information silos, enable different systems to timely perceive the state changes of each other, and achieve seamless connection of business processes, rational allocation of resources, and rapid response to abnormal situations.

[0003] However, in actual existing interaction scenarios, the communication cost is high when systems collaborate. Different systems and teams often need to communicate and coordinate a lot to obtain the required data, and frequently develop customized interfaces, which not only consumes a lot of manpower and time cost, but also makes subsequent maintenance work extremely difficult. Furthermore, the sources of events within an enterprise are diverse, but these events lack a unified standard, which makes the process of event access and interaction relatively complex, seriously affecting the accurate transmission and effective use of data. In the prior art, an event-driven architecture is usually used to realize asynchronous communication between systems by means of a message queue or an event bus, or to uniformly manage multiple system interfaces through an interface gateway, but the standardization and efficient interaction of multi-source events cannot be well solved. SUMMARY

[0004] The present application provides an event processing method, system, electronic device and storage medium for realizing standardized collection and processing of source events, thereby reducing the complexity and cost of system interfacing and improving the collaborative efficiency and data flow capacity between systems.

[0005] According to a first aspect of the present application, an event processing method is provided, the method comprising: obtaining a source event and performing standardized processing on the source event to obtain a standard event according to a preset event type and an event type data structure, the event type and the event type data structure being one-to-one corresponding; matching the standard event according to each notification strategy in a notification strategy library, and taking the matched standard event as a notification event; sending the notification event according to a preset notification mode.

[0006] It can be understood that by constructing a one-to-one correspondence between event type and event type data structure, the multi-source heterogeneous source events are converted into standard events of a unified standard, effectively eliminating the management complexity caused by data format differences; relying on the pre-set notification strategy library to realize the matching of events and notification strategies ensures that only standard events that meet the conditions trigger the notification process; at the same time, combined with the pre-set notification mode configuration, various communication channels can be flexibly called for accurate push, significantly improving the efficiency of event processing and the accuracy of notification, reducing the cost of manual intervention, and realizing the full-link automated closed-loop management from event collection to notification distribution.

[0007] Optionally, the standardization processing of the source event according to the pre-set event type and event type data structure to obtain a standard event comprises: determining an event type corresponding to the source event; determining a corresponding event type data structure according to the corresponding event type; obtaining attribute data of the source event according to the corresponding event type data structure; standardizing the attribute data of the source event according to the corresponding event type data structure to obtain a standard event.

[0008] It can be understood that according to the pre-set event type, the source event type is accurately identified, and the corresponding event type data structure is obtained. After systematically extracting the attribute data of the source event, the attribute data is standardized according to the event type data structure, and finally a standard event with a unified format and complete fields is generated. This process effectively eliminates the heterogeneity of the source event, and converts events of different sources and different forms into standard events with consistent structure and clear semantics, significantly improving the standardization, readability and machine-parsable of the standard event, providing a high-quality data basis for subsequent standard event storage, retrieval and notification, while reducing the adaptation complexity when interfacing across systems, enhancing the compatibility and expansion capability of event processing.

[0009] Optionally, the notification strategy is pre-set and stored in the notification strategy library according to the event type and the corresponding event type data structure.

[0010] It can be understood that based on the differentiated characteristics of the event type and the differentiated field characteristics of the event type data structure, the corresponding notification strategy can be set, which not only avoids the logical loopholes that may be caused by the traditional fuzzy matching strategy, but also ensures the high accuracy of the notification triggering condition; at the same time, the structured storage of the notification strategy library makes the configuration, maintenance and expansion of the notification strategy more convenient, supports dynamic adjustment of the parameters corresponding to the notification strategy according to the event type, significantly improves the flexibility and manageability of the notification mechanism, and lays a reliable foundation for subsequent efficient execution of multi-dimensional and multi-channel notification distribution.

[0011] Optionally, the notification mode is written in a notification policy; when the notification event is matched according to the notification policy, the notification mode is obtained from the notification policy matched by the notification event, and the notification event is sent according to the obtained notification mode.

[0012] It can be understood that by integrating the notification mode into the notification policy, intelligent closed-loop management of notification event notification is realized. When the accurate matching of the standard event and the notification policy is completed, the corresponding notification mode can be parsed from the corresponding notification policy at the same time, and the notification sending action can be directly executed based on the notification mode, avoiding the redundant operation of separately maintaining the notification mode in the traditional mode. Through the strong association mechanism of the notification policy and the notification mode, it is ensured that different event types can automatically adapt to the most suitable notification mode, greatly improving the efficiency and accuracy of notification distribution, and reducing the risk of missed and wrong notifications caused by human configuration errors.

[0013] Optionally, the method further comprises: caching the standard event in a first partition queue according to an event type of the standard event; wherein the first partition queue belongs to a preset first message queue, and different event types correspond to different first partition queues; When each notification policy in the notification policy library is matched with the standard event, the standard event in the first partition queue is matched with each notification policy in the notification policy library in turn.

[0014] It can be understood that by establishing a hierarchical caching mechanism based on event types, the efficiency of event processing is significantly improved. The standardized events are divided into dedicated first partition queues under the first message queue according to event types, forming physically isolated logical storage units; when the notification policy matching is performed, each first partition queue can independently drive the standard event and the notification policy of the notification policy library to be compared in turn, which not only avoids the disorderly competition of full-quantity events, but also realizes the batch centralized processing of the same type of standard events, effectively reducing the interference risk of cross-type standard events. At the same time, the order control of the queue ensures the rigor and integrity of the notification policy matching, so that the event processing has higher throughput, lower delay and stronger scalability, providing a stable and orderly data input basis for the subsequent notification link.

[0015] Optionally, the method further comprises: caching the notification event in a second partition queue according to an event type of the notification event, wherein the second partition queue belongs to a preset second message queue, and different event types correspond to different second partition queues; When the notification event in the second partition queue is sent according to the corresponding notification mode, the notification event in the second partition queue is sent in turn according to the corresponding notification mode.

[0016] It can be understood that, by constructing the two-level partition queue system based on the event type, fine management and efficient distribution of the notification event are realized. The notification event that has matched the notification strategy is divided into the second partition queue according to the event type, forming a logically isolated queue. When the notification is sent, the notification event in each second partition queue can be orderly dequeued and sent according to the corresponding notification mode, which not only avoids mutual interference between different notification modes, but also guarantees the batch processing efficiency of the same type of notification event. This design significantly improves the concurrent processing capability of the notification task, reduces the resource competition risk caused by mixed use of multiple channels, and ensures the integrity and timeliness of the notification sending through the queue order control, thereby providing a reliable buffer mechanism for accurate reach of large-scale notification events.

[0017] Optionally, the method further comprises: storing the standard events buffered in the first message queue in a plurality of storage nodes; writing the standard events stored in the storage nodes into a non-relational database; synchronously pushing the standard events in the non-relational database to a retrieval component providing an event retrieval function in real time.

[0018] It can be understood that, the standard events in the first message queue are distributedly stored in a plurality of storage nodes to realize load balancing and fault tolerance redundancy, and then the data in the storage nodes are batch written into a non-relational database to meet the high-concurrency read-write demand. At the same time, the events in the non-relational database are dynamically pushed to the retrieval component through a real-time synchronization mechanism, forming a complete data link from event buffering, persistent storage to real-time retrieval. This design not only guarantees the integrity and security of the standard event data, but also makes the historical events traceable and analyzable, significantly improves the event retrieval efficiency and data mining capability, and reduces the risk of data loss caused by single point failure, thereby enhancing the robustness and scalability of the method.

[0019] According to a second aspect of the present application, an event processing system is provided, the system comprising: a standard event module configured to acquire a source event, and perform standardization processing on the source event according to a preset event type and an event type data structure to obtain a standard event, the event type and the event type data structure being in one-to-one correspondence; a notification event acquisition module configured to match the standard event according to each notification strategy in a notification strategy library, and take the matched standard event as a notification event; a notification module configured to send the notification event according to a preset notification mode.

[0020] According to a third aspect of the present application, an electronic device is provided, comprising: a memory for storing one or more computer programs; a processor, when the one or more computer programs are executed by the processor, implements the event processing method of the first aspect described above.

[0021] According to a fourth aspect of the present application, a computer readable storage medium is provided, the computer readable storage medium stores computer instructions, the computer instructions are used to make the processor execute and implement the event processing method of the first aspect described above.

[0022] Based on any one of the above aspects, the event processing method, system, electronic device and storage medium provided by the embodiments of the present application can achieve the following benefits: · Unified standardization of multi-source events, facilitating unified management and reducing communication costs: Through the one-to-one correspondence between the preset event type and the event type data structure, heterogeneous events from different sources are converted into unified standardized events, covering key steps such as determining event types, matching corresponding event type data structures, extracting attribute data and standardizing according to specifications, so that multi-source events that are originally scattered and have different formats have consistent data forms. The standardized standard events can be stored in a non-relational database, and the non-relational database provides efficient standard event query capabilities through a retrieval component, significantly reducing the cost of repeated confirmation and manual analysis caused by data differences. At the same time, the unified management interface and operation logic reduce the communication barriers when cross-department collaboration, realize the unified control of the whole life cycle of the source event, and effectively improve the collaborative efficiency within the organization.

[0023] · Differentiate event types for source events and improve notification accuracy and efficiency by matching notification strategies: By establishing a deep association mechanism between event types and notification strategies, and based on a pre-defined notification strategy library, the corresponding notification strategy can be automatically matched to obtain a notification event according to the event characteristics of the standard event, and the matched notification event can be notified according to the notification strategy, avoiding the resource waste of the traditional one-size-fits-all mode, not only improving the pertinence of the notification event and the corresponding notification content, but also shortening the response time to the event through strategic execution, making the notification efficiency highly consistent with the business needs.

[0024] • Tiered caching and asynchronous processing mechanisms ensure the high performance and reliability of the method: A dual-partition queue architecture is designed to handle high-concurrency scenarios. The first partition queue is divided according to event type, realizing the orderly backlog and tiered consumption of standardized events; the second partition queue is for notification events that have matched the notification strategy, classifying notification events according to event type and queuing them for sending. This tiered caching mechanism effectively isolates the pressure peaks of event access and notification distribution. Combined with the distributed deployment of storage nodes and the persistence capabilities of non-relational databases, it ensures both the rapid throughput of massive standard events and avoids the risk of single points of failure. In addition, the design of real-time synchronization of standard events to the retrieval component makes historical standard events traceable and analyzable, providing a data foundation for subsequent event trend prediction and decision optimization, and comprehensively improving the robustness and scalability of the method. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0026] Figure 1 This is an illustrative application scenario diagram of an event handling method provided in this embodiment.

[0027] Figure 2 This is a flowchart of an event handling method provided in this embodiment.

[0028] Figure 3 This is a flowchart for obtaining standard events provided in this embodiment.

[0029] Figure 4 A flowchart of the standard cache events provided in this embodiment.

[0030] Figure 5 The flowchart for the cache notification event provided in this embodiment is shown.

[0031] Figure 6 A flowchart of the standard events for storage provided in this embodiment.

[0032] Figure 7 This is a schematic diagram of a functional module for event handling provided in this embodiment.

[0033] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this embodiment. Detailed Implementation

[0034] The drawings in the present application are only used for illustrative description, and cannot be understood as limitation to the present application. In order to better illustrate the following embodiments, some components in the drawings will be omitted, enlarged or reduced, and do not represent the actual product size; it is understandable for those skilled in the art that some well-known structures and their descriptions in the drawings can be omitted.

[0035] In order to enable those skilled in the art to better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0036] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0037] In a digital enterprise operation environment, enterprise-level events refer to events generated by various systems within an enterprise, including but not limited to employee operation records, automated script execution results, system state changes, real-time alarm information, and business process node states. These key events need to be efficiently communicated across departments and systems to support decision-making, response, and business collaboration. However, due to the dispersion of event sources and the diversity of data forms, in the traditional mode, different systems rely on customized interface development for data interaction, which not only leads to high communication and coordination costs and great interface maintenance difficulty, but also lacks a unified event field model, semantic specification, and format standard, making the collection, transmission, and consumption of multi-source events face problems such as poor compatibility and complex analysis. Although modern technology has introduced message queues to achieve asynchronous communication, centralized management through event buses, or application programming interface (API) gateway aggregation services, these solutions still have significant limitations. Message queues only focus on message delivery and do not address event content standardization, event buses are limited to specific scenarios and lack global specifications, and API gateway aggregation services are essentially interface call patterns, all of which cannot effectively unify the data model and semantics of multi-source events. Moreover, most systems lack event lifecycle management capabilities, leading to serious challenges in event standardization, multi-source access uniformity, inter-system collaboration efficiency, and event governance capabilities, making it difficult to meet the needs of enterprise-level efficient collaboration and fine-grained operation.

[0038] The embodiment provides a technical solution that can solve the above problems. The specific embodiments of the application will be described in detail below with reference to the accompanying drawings.

[0039] Exemplarily, an application scenario diagram of an event processing method provided by the embodiment of the application is shown in FIG. 1. As shown in FIG. 1, the application scenario at least includes a server 100 and a terminal 200 that can communicate with the server 100, the server 100 has functions of event collection, event processing, event notification, and event storage, etc.; the terminal 200 has functions of event collection, event processing, event notification, event storage, event reception, and event display, etc. Figure 1

[0040] It can be understood that the server 100 can be an independent electronic device or a cluster composed of multiple electronic devices; the terminal 200 can be a smartphone terminal, a personal computer, a tablet computer, a vehicle-mounted terminal, etc., but is not limited thereto.

[0041] ​In an implementable mode, the server 100 and the terminal 200 can respectively execute an event processing method provided by the embodiments of the present application, or alternatively, the event processing method provided by the embodiments of the present application can be partially executed in the server 100 and partially executed in the terminal 200.

[0042] As shown in Figure 2 The embodiments of the present application provide an event processing method, which can be divided into the following steps: S110, obtaining a source event, and performing standardized processing on the source event to obtain a standard event according to a preset event type and an event type data structure, wherein the event type and the event type data structure are in one-to-one correspondence; In the embodiments of the present application, the source event can be an enterprise-level event generated by a system related to maintaining the efficient operation of an enterprise in a digital operation scenario of the enterprise, and the system includes but is not limited to a database system for recording data, a financial system for connecting revenue and expenditure, a clock-in system for management, and the like, and the enterprise-level event includes but is not limited to an operation event of each employee, a system event triggered by an automatic script of each system, a system event of data change of each system, an alarm event of system failure of each system, and a process event contained in processing of a certain business of each system. It can be understood that in the embodiments of the present application, the source event can refer to the enterprise-level event described above, which is generated by each system in the enterprise.

[0043] It can be understood that because the system related to maintaining the efficient operation of the enterprise includes several systems, the processing habits and the focus of data perception of each system are different, and therefore the event format and the corresponding fields generated by each system are different. If the events generated by each system are simply combined, managed and notified to other systems, the events of each system cannot be efficiently and uniformly managed, and it can also cause events on the same process to be completed by multiple systems, so that the event formats are different, and communication barriers exist, which is not conducive to the efficient operation of the enterprise. Therefore, the source events of multiple sources and different structures need to be standardized.

[0044] Preferably, in the embodiments of the present application, the preset event type can include a system event type and a manual input event type. The source event belonging to the system event type refers to a corresponding system event generated by operation in the system, and the system event is generated by the system; the source event belonging to the manual input event type refers to an event generated by manual input or modification of data, and the characteristic is that the data change is directly caused by human operation. Such events are commonly used in scenarios such as background management and data correction, for example, an administrator modifying user rights events, manually updating configuration information events, and the like.

[0045] Preferably, the system event types can include an instantaneous event type and a continuous event type. The source event belonging to the instantaneous event type generally refers to an event occurring at a specific time point and ending immediately, which is characterized by a clear trigger time and a short execution period. Such events are usually triggered by user operations or system automation, such as user login operations, button click operations, system alarm triggers, and the like.

[0046] The source event belonging to the continuous event type refers to an event occurring continuously over a period of time, which has the characteristics of a start time, an end time, and a most recent update time. Such events are usually used to describe events that need to be continuously tracked for process or state changes, such as events triggered by system maintenance windows, events generated by user sessions, events generated by task execution processes, and the like. For example, when a user needs to perform an input data operation on a database, the processes of "waiting for submission", "waiting for review", "waiting for execution", and "execution completed" are required, and the system generates a system event for each process to record the progress of the process to facilitate subsequent fault tracing.

[0047] In this embodiment, a unified format data structure needs to be set for the source event. Preferably, the data structure can be a JSON (JavaScript Object Notation) data structure. Preferably, the data structure includes a plurality of event fields, including public fields and custom fields. The public fields include, but are not limited to, an event type field, an event description field, an event level field, an occurrence timestamp field, and an event creator field. The custom fields vary depending on the event type. Preferably, the custom fields of the manually entered event type can include a pre-change data snapshot field, a post-change data snapshot field, and a change time field, the custom fields of the instantaneous event type can be empty, and the custom fields of the continuous event type can include an end timestamp field and an update timestamp field. By combining different custom fields, an event type data structure with different fields is formed, and the event type and the event type data structure correspond one-to-one.

[0048] Specifically, as shown in Figure 3 According to the preset event type and the event type data structure, the source event is standardized to obtain a standard event, including: S111, determining the event type corresponding to the source event; S112, determining the corresponding event type data structure according to the corresponding event type; S113, obtaining attribute data of the source event according to the corresponding event type data structure; S114, standardize the attribute data of the source event according to the corresponding event type data structure to obtain a standard event.

[0049] In this embodiment, after the source event is obtained, the event type of the source event needs to be determined, so that the corresponding event type data structure can be determined according to the event type. It can be understood that the event type data structure includes a plurality of event fields, and the attribute data of the source event needs to be obtained according to the event fields, and the attribute data is filled into the corresponding event fields, the standardization processing of the source event is completed, and the corresponding standard event is obtained.

[0050] In this embodiment, after the source event is obtained, the source event can be standardized by using the above-mentioned standardization processing method, so as to unify the standardization process of the source event and improve the standardization efficiency.

[0051] There is a new implementation, when the source event is standardized, the above-mentioned standardization processing method can also be arranged into a software development kit (SDK, Software Development Kit) for use by each system. In actual application, the software development kit of the standardization processing method can be introduced into each system, when the system needs to standardize a source event, the method in the SDK can be directly called, and the source event is standardized according to the corresponding event type data structure. For the system that cannot directly introduce the SDK, the standardization processing method can also be called through the hypertext transfer protocol (HTTP, Hypertext Transfer Protocol) interface, and the source event is standardized according to the corresponding event type data structure.

[0052] S120, according to each notification strategy in the notification strategy library, the standard event is matched, and the matched standard event is defined as a notification event; In this embodiment, the notification strategy library stores a plurality of notification strategies, and each notification strategy can set one or more matching conditions, which can be compared with the standard event one by one. If the standard event satisfies the matching condition of a notification strategy, it means that the standard event matches the notification strategy, and the standard event is defined as a notification event.

[0053] Preferably, the method further comprises a task scheduling step, which is provided with a retry mechanism. When a failure occurs in the notification event due to network jitter or insufficient scheduling resources, the retry mechanism of the task scheduling step is triggered to re-perform the notification task of the notification event. The retry mechanism includes a preset retry upper limit value and a waiting time between two retries. For example, the preset retry upper limit value can be set to three to five times to prevent the resource consumption caused by the unlimited triggering of the retry mechanism. The waiting time can be a fixed value, for example, the waiting time can be set to 5 seconds, or an exponential backoff algorithm can be used to obtain the waiting time, specifically as follows: wherein, is the waiting time of the current time, is the initial waiting time, is the number of times of the current retry.

[0054] Preferably, the task scheduling step is further provided with a failure alarm mechanism. When a failure occurs in the notification event due to network jitter or insufficient scheduling resources, the failure alarm mechanism of the task scheduling step is triggered when the retry number is exhausted and the normal state cannot be restored, and the related attribute information such as the cause and time of the failure is collected. The attribute information is arranged as alarm content, and the alarm content is alarmed by selecting a corresponding alarm channel. Preferably, an alarm strategy can also be set to focus on the alarm of the notification event with key data, and a suppression alarm strategy can be set to avoid repeated redundant alarms.

[0055] Preferably, the task scheduling step further comprises a priority configuration. For each failure alarm, a priority corresponding thereto is provided to indicate the importance of the failure alarm. The task scheduling component can sort the received failure alarms according to the priority, so that the failure alarms with high priority are preferentially alarmed, and the failure alarms with low priority are subsequently alarmed, thereby ensuring the stability and reliability of the alarm task.

[0056] Specifically, the notification strategy is preset and stored in the notification strategy library according to the event type and the corresponding event type data structure.

[0057] In this embodiment, because the event information carried by different event types is different, the fields corresponding to the attribute data contained in the corresponding event type data structure are also different. The preset notification strategy according to the event type and the corresponding event type data structure can accurately match the standard event that needs to be notified, thereby realizing accurate notification.

[0058] For example, one notification strategy can be set as: {event type: instantaneous event; event level: serious; event description: clock-in failure; specified notification method: email}. The partial attribute information of a certain standard event is as follows: {Event type: instantaneous event; Event level: severe; Event description: check-in failed; ...} If the standard event matches the notification strategy, the standard event can be identified as a notification event.

[0059] Storing multiple notification policies in a notification policy library enables unified management of notification policies, avoids redundant configuration, and significantly improves the maintainability and adaptability of notification policies.

[0060] Specifically, the notification method is written into the notification policy; when a notification event is obtained by matching the standard event according to the notification policy, the notification method is also obtained from the notification policy matched by the notification event, and the notification event is sent according to the obtained notification method.

[0061] In this embodiment, the notification strategy also includes a preset corresponding notification method. When a standard event matches the notification strategy, a notification needs to be sent using the notification method set by the notification strategy. Preferably, the notification method includes, but is not limited to, HTTP port call notification, message queue integrated notification, email notification, etc.

[0062] S130. Send the notification event according to the preset notification method.

[0063] In this embodiment, after a standard event is matched with a corresponding notification strategy, it becomes a notification event, and a preset notification method can be obtained accordingly, and a notification event is generated in the manner of the notification method.

[0064] Preferably, the notification strategy further includes setting corresponding notification objects. These notification objects are stored in a notification object database. The notification strategy can link to the notification objects in the database, and when a notification event executes a notification task, it needs to send a notification to the notification objects in the notification strategy using the set notification method. The notification objects include, but are not limited to, various systems and internal personnel within the enterprise.

[0065] Specifically, such as Figure 4 As shown, the method further includes: S210. According to the event type of the standard event, cache the standard event in the first partition queue; wherein, the first partition queue belongs to a preset first message queue, and different event types correspond to different first partition queues; In the embodiment, the standard events can be cached into the second message queue. The first message queue can preset corresponding first partition queues according to the event types of the standard events, so that the standard events of the same event type are cached in the same first partition queue. Preferably, in order to ensure the reliability of storage, the number of the first partition queues is generally greater than the number of the event types of the standard events. For example, the number of the first partition queues can be three times the number of the event types. It can be understood that each first partition queue has a set corresponding partition characteristic value for marking the event type of the first partition queue for storage.

[0066] Specifically, after obtaining the standard event, the event type field of the standard event is extracted and taken as an event type characteristic value, and the event type characteristic value is taken as a credential for storing the standard event in the corresponding first partition queue. The event type characteristic value of the standard event is subjected to hash calculation to obtain an event characteristic value, and the partition characteristic values of all the first partition queues are traversed. If the event characteristic value matches a partition characteristic value, the standard event is stored in the corresponding first partition queue.

[0067] S220, when matching the standard event according to each notification policy in the notification policy library, the standard events in the first partition queue are matched with each notification policy in the notification policy library in turn.

[0068] In the embodiment, the standard events in the first message queue can be stored in the first partition queue according to the event type. When matching the standard event according to each notification policy in the notification policy library, the standard events in each first partition queue can be matched with each notification policy in the notification policy library in turn, so that the orderliness and stability of the matching work are improved.

[0069] Preferably, in order to prevent the delay from rising due to the backlog of the source event standardization processing, and even cause the background to crash when the backlog is serious, in the embodiment, a memory buffer for caching the standard events is further provided, which belongs to the first level storage design of the method. The memory buffer can set the number of temporarily stored standard events, and is used for temporarily storing the standard events. When the number of the standard events in the memory buffer reaches a preset number, or the duration of the standard events in the memory buffer from the last time of storage to the current time exceeds a preset time threshold, the standard events are stored into the first message queue again, wherein the first message queue belongs to the second level storage design of the method.

[0070] Specifically, as shown in Figure 5 The method further comprises: S310, caching the notification event in a second partition queue according to an event type of the notification event, wherein the second partition queue belongs to a preset second message queue, and different event types correspond to different second partition queues; In this embodiment, for the notification event that completes matching, it can be cached into the second message queue. The second message queue can preset corresponding second partition queues according to the event type of the notification event, so as to realize caching of notification events of the same event type in the same second partition queue. It can be understood that each second partition queue has a set corresponding partition characteristic value for marking the event type stored in the second partition queue.

[0071] Specifically, after obtaining the notification event, the event type field of the notification event is extracted and taken as an event type characteristic value, and the event type characteristic value is taken as a credential for storing the notification event in the corresponding second partition queue. The event type characteristic value of the notification event is hashed to obtain an event characteristic value, and the partition characteristic values of all second partition queues are traversed. If the event characteristic value matches a partition characteristic value, the notification event is stored in the corresponding second partition queue.

[0072] S320, when the notification event is sent according to the notification mode corresponding to the notification strategy, the notification events in the second partition queue are sent in turn according to the corresponding notification mode.

[0073] In this embodiment, the notification events in the second message queue can be stored in partitions according to the event type. When the notification events are sent according to the notification mode corresponding to the notification strategy, the notification events in each second partition queue are sent in turn according to the corresponding notification mode, which improves the orderliness and stability of the sending work.

[0074] Preferably, if the source event belongs to the manual input event type, an independent notification mechanism is further provided to be compatible with the important data or correction information input manually in an emergency. Specifically, when the source event is manually input, it can be selected whether to be independently notified. If yes, the notification mode, notification object and other related notification information need to be additionally input, so that when the source event becomes a standard event after completing the standardization processing, the notification object can be directly notified based on the notification information, without completing the matching with the notification strategy, thereby improving the timeliness of the notification of the standard event belonging to the manual input event type.

[0075] Specifically, as shown in Figure 6 The method further comprises: S410, storing the standard event cached in the first message queue in a plurality of storage nodes; In the embodiment, the standard events are cached in the first message queue, which belongs to the second level storage design set in the embodiment. In the embodiment, a third level storage design, i.e., a plurality of storage nodes, is also set. When the standard events cached in the first message queue meet preset storage conditions, the standard events are stored in the plurality of distributed storage nodes. The storage nodes can be flexibly added or deleted, and the storage space can be flexibly adjusted to avoid single point bottleneck. When the standard events are more, the storage nodes can be added to improve the storage efficiency, and when the standard events are less, the storage nodes can be reduced to reduce the storage cost.

[0076] S420, write the standard events stored in the storage nodes into the non-relational database; In order to avoid the loss of data corresponding to the standard events or maintain the traceability of the standard events, in the embodiment, a non-relational database is also provided, which belongs to the third level storage design in the embodiment and can realize the persistent storage of the standard events. Because the sources of the standard events are various, the event types are different, and the event fields contained in different event types also have great differences. In addition, with the development of enterprises, the event types can be continuously added or adjusted. If a traditional relational database is used, it is difficult to flexibly respond to the dynamic changes of the event types due to the limitation of the fixed table structure. Therefore, in the embodiment, a non-relational database is used, and a document model is used to store the standard events and the corresponding data. Each event type can correspond to an independent set, and the dynamic addition and deletion of the event fields are supported, so that the diversification and scalability requirements of the storage structure corresponding to the standard events are effectively met.

[0077] S430, synchronizing the standard events in the non-relational database to a retrieval component providing an event retrieval function in real time.

[0078] In order to realize the retrieval and traceability of the standard events and the event query, in the embodiment, a retrieval component providing an event retrieval function is provided. The retrieval component performs well in search and analysis, but it does not support a large number of operations for storing and processing the standard events, and cannot meet the strong consistency requirement of the storage scene. Therefore, the standard events in the non-relational database need to be synchronized to the retrieval component providing the event retrieval function in real time, so as to realize the centralized management of the standard events in the non-relational database and the unified retrieval and traceability of the standard events in the retrieval component. Specifically, the non-relational database can be used as a data source of the standard events, ensures that all the standard events are uniformly checked and processed by the non-relational database, and is quickly searched and analyzed by the retrieval component, so as to form a "storage + retrieval" separated architecture and improve the flexibility and maintainability.

[0079] As shown in Figure 7 The embodiment of the application also provides an event processing system. Optionally, the system comprises: a standard event module 511, a notification event obtaining module 512, and a notification module 513, wherein: The standard event module 511 is configured to obtain a source event, and perform standardization processing on the source event according to a preset event type and an event type data structure to obtain a standard event, the event type and the event type data structure being in one-to-one correspondence. In this embodiment, the standard event module 511 can be configured to perform Figure 2 The step S110 is shown, and the specific description of the standard event module 511 can refer to the description of the step S110.

[0080] The notification event obtaining module 512 is configured to match the standard event according to each notification strategy in a notification strategy library, and take the matched standard event as a notification event. In this embodiment, the notification event obtaining module 512 can be configured to perform Figure 2 The step S120 is shown, and the specific description of the notification event obtaining module 512 can refer to the description of the step S120.

[0081] The notification module 513 is configured to send the notification event in a preset notification mode.

[0082] In this embodiment, the notification module 513 can be configured to perform Figure 2 The step S130 is shown, and the specific description of the notification module 513 can refer to the description of the step S130.

[0083] The application further provides an electronic device, as shown in Figure 8 The electronic device includes a memory 611, a processor 612, a communication module 613, and an input / output interface 614, and optionally, the memory 611, the processor 612, the communication module 613, and the input / output interface 614 can be connected and communicated through a bus 615.

[0084] The memory 611 is configured to store one or more computer programs, and transmit the codes of the computer programs to the processor 612; when the one or more computer programs are executed by the processor 612, an event processing method in the application is implemented.

[0085] Optionally, the electronic device can be connected to a network through the communication module 613 to communicate with other devices such as terminals or servers through the network to realize the interaction of data. The electronic device can be various forms of digital computers, such as desktop computers, servers, workstations, mainframe computers or other types of computers. The electronic device can also be various forms of mobile terminals, such as smartphones, tablet computers, wearable devices (such as helmets, glasses, watches, etc.) and other similar mobile terminals.

[0086] Optionally, the electronic device can connect the required input / output devices such as keyboards, display devices, etc. through the input / output interface 614. The electronic device itself can have a display device, and other display devices can also be connected through the input / output interface 614. Optionally, storage devices such as hard disks, etc. can also be connected through the input / output interface 614, so that the data in the electronic device can be stored in the storage device, or the data in the storage device can be read, and the data in the storage device can also be stored in the memory 611. It can be understood that the input / output interface 614 can be a wired interface or a wireless interface. According to different actual application scenarios, the devices connected with the input / output interface 614 can be a component of the electronic device, or an external device connected with the electronic device when needed.

[0087] Optionally, the memory 611 can be a volatile memory and / or a non-volatile memory. The volatile memory can be a random access memory, etc. The non-volatile memory can be a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory or a flash memory, etc.

[0088] Optionally, the computer program stored in the memory 611 can be divided into one or more modules, which are stored in the memory 611 and executed by the processor 612 to complete the method provided by the embodiment. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.

[0089] Optionally, the processor 612 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 612 include, but are not limited to, a central processing unit, a graphics processing unit, a digital signal processor, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, and can also be any appropriate controller, microcontroller, processor, etc. The processor 612 executes various methods and processes of the embodiments, for example, an event processing method of the embodiments.

[0090] Optionally, the bus 615 can include a path for transmitting information. According to different functions, the bus 615 can be divided into an address bus, a data bus, a control bus, etc.

[0091] In an optional implementation, the embodiments of the present application also provide a computer storage medium having a computer program stored thereon, and the computer program enables a computer to execute the method of the method embodiments when executed by the computer. Part or all of the computer program can be loaded and / or installed on the memory 611 of the electronic device. When the computer program is executed by the processor 612, one or more steps of an event processing method of the embodiments of the present application can be executed.

[0092] Optionally, the computer-readable storage medium can be a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, etc.

[0093] Obviously, the above-described embodiments of the present application are only examples for clearly illustrating the technical solutions of the present application, and are not intended to limit the specific embodiments of the present application. Any modification, equivalent replacement, and improvement made within the spirit and principle of the claims of the present application shall be included in the protection scope of the claims of the present application.

Claims

1. An event handling method, characterized in that, The method includes: Obtain source events and, based on preset event types and event type data structures, standardize the source events to obtain standard events, wherein the event types and event type data structures correspond one-to-one; The standard events are matched against each notification policy in the notification policy library, and the matched standard events are used as notification events. The notification event is sent according to the preset notification method.

2. The method according to claim 1, characterized in that, The standardization process, which involves processing the source events according to preset event types and event type data structures to obtain standard events, includes: Determine the event type corresponding to the source event; Determine the corresponding event type data structure based on the corresponding event type; The attribute data of the source event is obtained according to the corresponding event type data structure; The attribute data of the source event is standardized according to the corresponding event type data structure to obtain a standard event.

3. The method according to claim 1, characterized in that, The notification strategy is preset and stored in the notification strategy library based on the event type and the corresponding event type data structure.

4. The method according to claim 1, characterized in that, The notification method is written into the notification policy; when a notification event is obtained by matching the standard event according to the notification policy, the notification method is also obtained from the notification policy matched by the notification event, and the notification event is sent according to the obtained notification method.

5. The method according to claim 2, characterized in that, The method further includes: According to the event type of the standard event, the standard event is cached in the first partition queue; wherein, the first partition queue belongs to a preset first message queue, and different event types correspond to different first partition queues; When matching the standard events according to each notification policy in the notification policy library, the standard events in the first partition queue are matched with each notification policy in the notification policy library in turn.

6. The method according to claim 2, characterized in that, The method further includes: According to the event type of the notification event, the notification event is cached in a second partition queue, wherein the second partition queue belongs to a preset second message queue, and different event types correspond to different second partition queues; When the notification event is sent according to the notification method corresponding to the notification policy, the notification events in the second partition queue are sent sequentially according to the corresponding notification method.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: The standard events cached in the first message queue are stored in several storage nodes; Write standard events stored in the storage node to a non-relational database; The standard events in the non-relational database are synchronized in real time to the retrieval component that provides event retrieval functionality.

8. An event processing system, characterized in that, The system includes: The standard event module is used to acquire source events and, according to preset event types and event type data structures, standardize the source events to obtain standard events, wherein the event types and event type data structures correspond one-to-one. The notification event acquisition module is used to match the standard events according to each notification policy in the notification policy library, and use the matched standard events as notification events. The notification module is used to send the notification event according to a preset notification method.

9. An electronic device, characterized in that, include: Memory, used to store one or more computer programs; A processor, when the one or more computer programs are executed by the processor, implements an event handling method as described in any one of claims 1-7.

10. A computer-readable storage medium storing computer instructions for causing a processor to execute an event handling method as described in any one of claims 1-7.