CN114896084A - Event processing method and device, electronic equipment and storage medium - Google Patents

Event processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114896084A
CN114896084A CN202210494063.1A CN202210494063A CN114896084A CN 114896084 A CN114896084 A CN 114896084A CN 202210494063 A CN202210494063 A CN 202210494063A CN 114896084 A CN114896084 A CN 114896084A
Authority
CN
China
Prior art keywords
event
time
record
verification
events
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210494063.1A
Other languages
Chinese (zh)
Inventor
楚振江
宋晓东
侯京超
王常瑞
张晓利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210494063.1A priority Critical patent/CN114896084A/en
Publication of CN114896084A publication Critical patent/CN114896084A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides an event processing method and device, electronic equipment and a storage medium, and relates to the technical field of computers, in particular to the technical field of cloud computing. The specific implementation scheme comprises the following steps: receiving an operation event issued by an event issuer; screening the operation events to determine the operation events corresponding to each event consumer; and performing ordered verification and abnormal interruption verification on the operation events corresponding to different event consumers respectively, and sending the verified operation events to the corresponding event consumers respectively for execution. According to the scheme, the operation events to be sent to different event consumers are orderly detected and abnormally interrupted, so that the duplicate removal effect of the operation events can be realized, the interrupted operation events can be continuously transmitted in time, and the operation events can be effectively transmitted and executed.

Description

Event processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing an event, an electronic device, a storage medium, and a computer program product.
Background
With the emergence of cloud-native technology, cloud-native deployment has become a trend for future development, and online service deployment of large companies has been migrated from common containers to cloud-native environments.
Disclosure of Invention
The present disclosure provides an event processing method, apparatus, electronic device, storage medium, and computer program product.
According to an aspect of the present disclosure, there is provided an event processing method, including:
receiving an operation event issued by an event issuer;
screening the operation events to determine the operation events corresponding to each event consumer;
and performing ordered verification and abnormal interruption verification on the operation events corresponding to different event consumers respectively, and sending the verified operation events to the corresponding event consumers respectively for execution.
According to an aspect of the present disclosure, there is provided an event processing apparatus including:
the event access module is used for receiving the operation event issued by the event issuing party;
the event distribution module is used for screening the operation events to determine the operation events corresponding to each event consumer;
and the event adaptation module is used for carrying out ordered verification and abnormal interruption verification on the operation events corresponding to different event consumers respectively and sending the verified operation events to the corresponding event consumers for execution.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the event processing method of any of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the event processing method of any embodiment of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the event handling method of any embodiment of the present disclosure.
According to the technology disclosed by the invention, the operation events to be sent to different event consumers are orderly detected and abnormally interrupted, so that the duplicate removal effect of the operation events can be realized, and the interrupted operation events can be transmitted continuously in time, thereby ensuring that the operation events can be effectively transmitted and executed.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1a is a schematic diagram of the components of an event bus provided in accordance with an embodiment of the present disclosure;
FIG. 1b is a schematic flow chart diagram illustrating an event processing method according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart diagram illustrating a further event processing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart diagram illustrating a further event processing method according to an embodiment of the present disclosure;
FIG. 4 is a schematic flow chart diagram illustrating a further event processing method according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a program update using an event bus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an event processing apparatus according to an embodiment of the present disclosure;
fig. 7 is a block diagram of an electronic device for implementing an event processing method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the common application of the computer cloud technology and cloud native, a computer service party can use a plurality of cloud service providers as a service construction platform of the computer service party, and construct a reasonable cloud native architecture of self services according to different characteristics and package composition of different cloud service providers, for example, purchasing and using storage services at a cloud service provider A, purchasing computing and traffic services at a cloud service provider B, purchasing caching and content distribution services at a cloud service provider C, and the like. Therefore, on the computer service side, computer program services in a plurality of cloud service systems need to be managed, that is, a plurality of cloud service systems need to be operated. In this scenario, the event publisher according to the scheme of the present disclosure may be a business system of any computer business party, the event consumer is a plurality of cloud service systems that provide cloud services for the computer business system, and the event consumer may respond to the operation event and perform a corresponding operation, so as to implement an operation on a computer program service on the cloud service system.
In order to ensure that the operation event issued by the event issuer can be efficiently and smoothly transmitted to the event consumer, the present disclosure constructs an event bus connecting the event issuer and the event consumer, and referring to fig. 1a, a schematic diagram of the event bus is shown, in which the event bus includes three components, namely an event access component, an event distribution component, and an event adapter. The event access part mainly realizes the operation event released by the access service system (namely an event releasing party); the event distribution module is mainly used for distributing the accessed operation events in different queues so as to determine the operation events corresponding to each cloud service system, wherein the message queues are divided according to different cloud service systems (namely event consumers); each cloud service system corresponds to an event adapter, the event adapters are used for butting the corresponding cloud service systems, operation events are obtained from corresponding message queues in the butting process, and the checksum sending of the operation events is completed. The specific flow of the event processing method based on the event bus can be seen in the following embodiments.
Fig. 1b is a schematic flow diagram of an event processing method according to an embodiment of the present disclosure, where this embodiment is applicable to a case where a service system operates multiple cloud service systems that are docked in a cloud native network architecture system. The method can be executed by an event processing device which is realized in a software and/or hardware mode and is integrated on the electronic equipment.
Specifically, referring to fig. 1b, the event processing method is as follows:
s101, receiving an operation event issued by an event issuing party.
In the embodiment of the present disclosure, the event publisher may be a business system of any computer business party, and the event consumer is a plurality of cloud service systems providing cloud services for the computer business system, so the operation event may be an event that is published by the business system and performs corresponding operations on a computer program service deployed in the cloud service system, for example, the operation event may be an event that performs capacity expansion, lifting configuration, parameter setting, start-stop service or data update on the computer program service deployed in the cloud service system, and in addition, the operation event may also be another event, which is not limited specifically herein.
In the embodiment of the disclosure, the operation events issued by the event issuing party can be received in batch through the preset application program interface, that is, the issuing party interacts with the preset application program interface and sends the generated operation events to the application program interface, so as to realize that the operation events access the bus. It should be noted that, in the present disclosure, the application program interface is used to receive the operation event, and in order to ensure that the operation event issued by the event issuer can be timely and accurately received, the state of the application program interface needs to be normal. Therefore, the flow data and the access time-consuming data accessed to the application program interface can be counted, whether the state of the application program interface is normal or not is monitored according to the counting result, if the state is not normal, an abnormal alarm is given, the application program interface is repaired quickly, and the operation event issued by the issuing party can be accessed normally.
S102, screening the operation events to determine the operation events corresponding to each event consumer.
In the embodiment of the present disclosure, for the accessed operation events, it is necessary to determine the destination of each operation event, that is, to determine to which event consumer each operation event needs to be delivered. Therefore, the accessed operation events need to be filtered, for example, the filtering is performed according to the preset filtering field, and the operation event corresponding to each event consumer is determined according to the filtering result. Illustratively, ten operation events with the numbers of 1-10 are accessed, and the operation events with the numbers of 1-3 need to be transmitted to the event consumer A, the operation events with the numbers of 4-7 need to be transmitted to the event consumer B, and the operation events with the numbers of 8-10 need to be transmitted to the event consumer C, which are determined by field screening. Thus, the operation events corresponding to the event consumer A can be determined to be the events numbered 1-3; the operation events corresponding to the event consumer B are the events numbered from 4 to 7; the operation events corresponding to the event consumer C are the events numbered 8-10.
S103, carrying out ordered verification and abnormal interruption verification on the operation events corresponding to different event consumers respectively, and sending the verified operation events to the corresponding event consumers for execution.
After determining the operation event corresponding to each event consumer, the interface with each event consumer needs to be completed to implement the transmission of the operation event to the corresponding event consumer. In the process of docking with each event consumer, orderly checking and abnormal interruption checking are required to be carried out on the operation events corresponding to different event consumers, wherein the purpose of orderly checking is to ensure that each operation event can be executed according to the time dimension sequence and to discard the detected repeated operation events; the purpose of the abort check is to detect an operation event in an abort state and to continue to transmit the operation event in the abort state. And further sending the operation events passing the verification to the corresponding event consumers according to the rules for execution. It should be noted that, because the system interfaces of different event consumers are different, when an operation event passing the verification is sent to each event consumer, a corresponding request needs to be constructed according to the details of the system interface of the event consumer, so as to implement the sending of the operation event. In addition, because the time-consuming speed and the calling capacity of the system interfaces of different event consumers in butt joint are different, when the operation event is sent to each event consumer, the sending speed of the operation event needs to be controlled according to the actual situation, and the phenomenon that the transmission of the operation event is influenced due to interruption caused by the fact that the number of the operation events sent at one time is too large is avoided.
Further, after the operation event is sent to the corresponding event consuming party for execution, the execution result of the operation event is obtained from each event consuming party, if the execution is successful, the message is fed back to the event issuing party, and if the execution is failed, an abnormal notification alarm is given.
According to the scheme, the operation events to be sent to different event consumers are orderly detected and the abnormal interruption is detected, so that the duplicate removal effect of the operation events can be realized, the interrupted operation events can be continuously transmitted in time, and the operation events can be effectively transmitted and executed.
Fig. 2 is a flow chart diagram of yet another event processing method according to an embodiment of the present disclosure. The method is executed by a preset event bus, and referring to fig. 2, the event processing method specifically includes:
s201, receiving an operation event issued by an event issuing party.
S202, reconstructing the event description of the operation event according to the preset unified description field.
In the embodiment of the present disclosure, the operation events accessed to the event bus through S201 all carry corresponding event detail contents, and the event descriptions of the operation events are reconstructed according to the preset unified description field and the event detail contents, so that the event descriptions of all the accessed operation events are constructed based on the unified description field, which can facilitate management of the operation events in the event bus, where the unified description field includes at least one of an event unique identifier, an event type, an event source, an event time, event detail contents, an operation target, an adjustment copy number, a timeout time setting, and a result callback address.
Illustratively, see Table 1, which shows an illustration of the unified description field.
TABLE 1 unified description field Table
Figure BDA0003624865230000061
And S203, performing deduplication processing on the received operation events according to the event unique identifier in the event description corresponding to each operation event.
In the message delivery mechanism, in order to ensure that the message can be accepted by the other party, the sending party adopts a repeated sending mechanism. Based on this, in the embodiment of the present disclosure, an idea of performing deduplication on a received operation event is proposed. Since the event unique identifier (e.g. event id) can uniquely characterize an operation event, the received operation event can be deduplicated according to the event id of each operation event, and the procedure is as follows: storing each received operation event into a preset database according to an event id, and when one operation event is stored, using the event id of the operation event as a query key word to query whether the record of the same event id exists in the preset database, if so, indicating that the operation event corresponding to the event id has repetition, and discarding the repeated operation event, thereby realizing the function of removing the repetition of the operation event.
S204, screening the operation events to determine the operation events corresponding to each event consumer.
S205, orderly checking and abnormal interruption checking are carried out on the operation events corresponding to different event consumers, and the operation events passing the checking are sent to the corresponding event consumers to be executed.
The processes of S204 to S205 can refer to the description of the above embodiments, and are not described herein again.
In the embodiment of the disclosure, the event description of the operation event is reconstructed by using the uniform description field, so that the operation event is conveniently processed in an event bus; in the access phase of the operation event, the event id of the operation event can be used for realizing the effect of removing the duplicate of the operation event.
Fig. 3 is a flow chart diagram of yet another event processing method according to an embodiment of the present disclosure. The method is executed by a preset event bus, and referring to fig. 3, the event processing method specifically includes:
s301, receiving the operation event issued by the event issuing party.
S302, the received operation events are sequentially distributed to different message queues, wherein each message queue is uniquely associated with one event consumer in advance.
S303, filtering the operation events in each message queue according to the filtering fields associated with each message queue, and determining the operation events corresponding to each event consumer according to the filtering result.
In the embodiment of the disclosure, the event publisher is any computer business system; the event consumers are a plurality of cloud service systems which provide cloud services for the computer service systems. Based on this, a plurality of message queues can be divided according to different event consumers in advance, so that each message queue is uniquely associated with one event consumer in advance. The received operation events are distributed to different message queues in sequence, and then the operation events in each message queue are filtered according to the filtering fields associated with each message queue, namely the operation events which do not belong to the message queue are discarded. Illustratively, the preset message queue has queue a, queue B and queue C, and if the received operation events are events numbered 1 to 10, the 10 operation events are respectively sent to queue a, queue B and queue C, and then queue a, queue B and queue C filter the 10 operation events according to their associated filter fields, and discard the operation events that do not satisfy the condition, so that the remaining operation events in queue a, queue B and queue C are events corresponding to the event consumers associated with queue a, queue B and queue C.
In another optional implementation, the filtering logic of each message queue is moved forward, that is, the received operation events are filtered according to the filtering logic of each queue, that is, the message queue to which each operation event belongs is determined, and then each operation event is sent to the corresponding message queue, so that the operation event sent to the message queue is the event corresponding to the event consumer associated with the message queue.
S304, carrying out ordered verification and abnormal interruption verification on the operation events corresponding to different event consumers respectively, and sending the operation events passing the verification to the corresponding event consumers respectively for execution.
Illustratively, the event consumer a associated with the queue a is taken as an example for explanation, in the present solution, an operation event can be concurrently obtained from the queue a through a plurality of preset program instances, and then the obtained operation event is subjected to sequential check and abnormal interruption check, and then the operation event passing the check is sent to the respective corresponding event consumer a for execution.
In the embodiment of the disclosure, the operation events corresponding to each event consumer can be quickly and accurately screened out through the filtering fields associated with each message queue.
Fig. 4 is a flowchart illustrating a further event processing method according to an embodiment of the present disclosure. Referring to fig. 4, the event processing method is specifically as follows:
s401, receiving the operation event issued by the event issuing party.
S402, screening the operation events to determine the operation events corresponding to each event consumer.
The processes of S401 to S402 can refer to the above embodiments, and are not described herein again.
And S403, orderly checking the operation events corresponding to different event consumers.
The purpose of the ordered checking is to ensure that the operation events can be executed according to the time dimension sequence, that is, it is required to ensure that the operation events with the earlier creation time are executed before the operation events with the later creation time, and the detected repeated operation events are discarded. Therefore, when the order check is performed, the creation time of each operation event is recorded for the operation event corresponding to any event consumer, and the order check is performed according to the creation time of each operation event, wherein the creation time of each operation event can be determined according to the value of the time field in the event description of each operation event. The specific process is as follows:
and aiming at any operation event corresponding to any event consumer, constructing a first storage keyword key for the operation event according to the fixed field and the event description of the operation event, and determining the event creation time and the event unique identifier associated with the first storage keyword. Illustratively, the first storage key is constructed as "key _ order _ key _ $ { paasType } _$ { app }", where "eventhub _ order _ key _" is a fixed string, paasType is a type code of a cloud service system (i.e., an event consumer) handled by the adapter, and app is a target operation application name of an operation event. The stored value corresponding to the first storage key in the first database contains event creation time event _ time and event unique identification event _ id information, for example, event _ time ═ 2022-01-1110:10: 10.
Further, whether a first target event record with the same storage keyword exists in the first database or not is inquired according to the first storage keyword. If the event record does not exist, adding an event record comprising the first storage keyword, the event creation time associated with the first storage keyword and the unique event identifier in the first database, and setting the validity period (for example, 7 days) of the event record, wherein the ordered check passes. And if so, performing ordered verification according to the event creation time of the operation event and the event creation time in the first target event record. Specifically, if the event creation time of the operation event is less than the event creation time in the first target event record, it indicates that other operation events whose creation time is later than that of the operation event pass the verification, and in order to ensure that the operation events can be executed according to the time dimension sequence, the ordered verification of the operation event cannot pass; if the event creating time of the operation event is equal to the event creating time in the first target event record, judging whether the event unique identifier of the operation event is the same as the event unique identifier in the first target event record, if so, indicating that the operation event is repeated with the operation event recorded in the first target event record, and at the moment, discarding the operation event to achieve the duplicate removal effect, wherein the ordered verification fails; otherwise, if the event unique identifier of the operation event is different from the event unique identifier in the first target event record, it indicates that the operation event is different from the operation event recorded in the first target event record, and at this time, the record in the first database needs to be updated, that is, the event record including the first storage keyword, the event creation time associated with the first storage keyword, and the event unique identifier is added to the first database, and the validity period of the event record is set, and the ordered check is passed. In addition, if the event creating time of the operation event is greater than the event creating time in the first target event record, the event record comprising the first storage keyword, the event creating time associated with the first storage keyword and the event unique identifier is added in the first database, the validity period of the event record is set, and the ordered verification is passed.
S404, checking abnormal interruption of the operation events corresponding to different event consumers.
Optionally, for each operation event corresponding to any event consumer, the event state and the time for starting to execute the check (optionally, the time for the operation event to enter the adapter) of each operation event are recorded, and the abort check is performed according to the event state and the time for starting to execute the check of each operation event. The specific implementation process is as follows:
firstly, aiming at any operation event corresponding to any event consumer, according to a fixed field and an event unique identifier of the operation event, a second storage keyword is constructed for the operation event, and the execution starting verification time and the event state associated with the second storage keyword are determined. Illustratively, the constructed second storage key is "key ═ eventhub _ $ { event _ id }", where "eventhub _" is a fixed character string and event _ id is event id, that is, an event unique identifier. The stored value corresponding to the second storage key includes a start execution check time start _ time (optionally, the time when the operation event enters the adapter) and an event status, where the field content is, for example, start _ time ═ 2022-01-1110:12:10, and the status may be a successful success status, a failed status, and an ongoing status.
Further, according to the second storage key words, whether a second target event record with the same storage key words exists in a second database or not is inquired; if the operation event does not exist, adding an event record in the second database, namely adding an event record which comprises a second storage keyword and execution starting verification time and an event state associated with the second storage keyword, setting a validity period (for example, 2 hours) of the event record, and starting adaptation processing, wherein the adaptation processing mainly comprises event sending speed control and construction of a corresponding request according to system interface characteristics of a corresponding cloud service system (an event consumer) so as to send the operation event to the corresponding cloud service system, and then calling back an execution result of the operation event so as to update the state of the operation event; if the operation event exists, performing abnormal interrupt check according to the event state of the operation event and the starting execution check time in the second target event record, specifically, if the event state of the operation event is in the sending process, determining the time difference between the current time and the starting execution check time in the second target event record; if the time difference is within a first time interval (for example, within 0-2 minutes), determining that the operation event is a repeated event, and ending the processing flow of the operation event; if the time difference value is within a second time interval (for example, within 2-20 minutes), determining that the operation event is an event interrupted due to an abnormality, performing salvaging on the operation event signal, and updating the execution starting verification time of the operation event to be the salvaging time, and further starting to execute an adaptive flow, namely sending the salvaging operation event to a corresponding event consumer for execution, and calling back an execution result; if the time difference is within a third time interval (e.g., greater than 20 minutes), the operational event is determined to be a timeout event and discarded.
It should be noted that if the event state is successful or failed, the processing state of the current operation event signal is determined, and the call-back and response skipping processing on the upstream service system is performed, and the process is ended.
And S405, sending the operation events passing the verification to the corresponding event consumers for execution.
In the embodiment of the disclosure, the order check is performed according to the creation time of the operation events, so that the operation events can be executed according to the time dimension sequence, and the event duplicate removal is realized; and through the event state and the time for starting to execute the check, the operation event interrupted due to the abnormality in the bus can be accurately found, and the interrupted operation event is continuously transmitted. Thus, through two kinds of verification, the operation event can be ensured to be effectively transmitted and executed.
Based on the above embodiments, the event processing method based on the event bus is now exemplified, and the front-end product line application on the event bus can be used to distribute information attribution and classification of the program application, and update the whole process of the basic cache information of the program application, and the whole process can be referred to fig. 5.
Referring to fig. 5, in a meta information task center of a business system, first, a number (e.g., 30 ten thousand) of computer applications to update meta information is obtained, a list of each computer program application is obtained, and the computing information is packaged and distributed to an event bus, where the packaged information includes a type of 1001 identifier, and an adaptor in the event bus distributes a computing task of one computer program application to a computing system 1001 according to the type 1001, where the computing system 1001 is composed of multiple program instances, so that different computing tasks of the computer applications can be executed concurrently. In the application, the calculation task comprises two specific calculation functions, including an application grouping calculation function and a tag updating calculation function, wherein the application grouping function is to calculate information (including algorithms such as rule calculation, directional intervention and the like) of a product line, a module and the like to which the program application belongs according to meta information of the computer program application, and the tag updating is to compare new and old tag attributes of the computer program application, delete old tags and add new tags.
After the application grouping function of the computing system 1001 is calculated, the calculation result is stored in the database, and a task of updating the cache 1002 by the corresponding program application after the data calculation is sent out and is accessed to an interface of the event bus. The event bus is adapted according to type 1002 and forwarded to the computing system 1002, and the computing task includes a computing task of updating the data cache. The computing system 1002 will first go to the database to obtain the updated data, perform formatting encapsulation after getting the data, form the data format required by the cache, and write the new data into the cache, thereby replacing the old data in the cache, and achieving the effect of updating the data cache.
By the application, the original cloud information computing task of tens of hours is changed into distributed computing task processing, the computing task and data cache updating of all 30 ten thousand program applications are completed within one hour, interruption point continuous transmission and retry are supported, and the efficiency of the whole meta information task is improved.
Fig. 6 is a schematic structural diagram of an event processing apparatus according to an embodiment of the present disclosure, where the embodiment is applicable to a case where a business system operates a plurality of docked cloud service systems in a cloud native network architecture system. Referring to fig. 6, it includes:
the event access module 601 is configured to receive an operation event issued by an event issuer;
an event distribution module 602, configured to perform screening processing on the operation events to determine an operation event corresponding to each event consumer;
the event adaptation module 603 is configured to perform ordered checking and abnormal interruption checking on the operation events corresponding to different event consumers, and send the checked operation events to the corresponding event consumers for execution.
On the basis of the foregoing embodiment, optionally, the event adaptation module includes an ordered checking unit, configured to:
and recording the creation time of each operation event aiming at the operation event corresponding to any event consumer, and performing ordered verification according to the creation time of each operation event.
On the basis of the foregoing embodiment, optionally, the ordered checking unit includes:
the first storage word construction subunit is used for constructing a first storage keyword for any operation event corresponding to any event consumer according to the fixed field and the event description of the operation event, and determining event creation time and an event unique identifier associated with the first storage keyword;
the first query subunit is used for querying whether a first database has a first target event record with the same storage keyword or not according to the first storage keyword;
the first checking subunit is used for adding an event record comprising a first storage keyword, event creation time associated with the first storage keyword and an event unique identifier in the first database if the first checking subunit does not exist, setting the validity period of the event record, and passing the ordered checking;
the second checking subunit is used for carrying out ordered checking according to the event creating time of the operation event and the event creating time in the first target event record if the operation event exists;
on the basis of the foregoing embodiment, optionally, the second check subunit is specifically configured to:
if the event creating time of the operation event is less than the event creating time in the first target event record, the ordered verification fails;
if the event creating time of the operation event is equal to the event creating time in the first target event record, judging whether the event unique identifier of the operation event is the same as the event unique identifier in the first target event record, if so, orderly checking and failing;
if the event creating time of the operation event is greater than the event creating time in the first target event record, adding an event record comprising a first storage keyword, the event creating time associated with the first storage keyword and the event unique identifier in the first database, setting the validity period of the event record, and passing the ordered verification.
On the basis of the foregoing embodiment, optionally, the event adaptation module includes an abort checking unit, configured to:
and recording the event state and the time for starting to execute the verification of each operation event aiming at each operation event corresponding to any event consumer, and performing abnormal interruption verification according to the event state and the time for starting to execute the verification of each operation event.
On the basis of the foregoing embodiment, optionally, the abort checking unit includes:
the second storage word construction subunit is used for constructing a second storage keyword for any operation event corresponding to any event consumer according to the fixed field and the event unique identifier of the operation event, and determining the starting execution verification time and the event state associated with the second storage keyword;
the second query subunit is used for querying whether a second target event record with the same storage keyword exists in a second database according to the second storage keyword;
the third checking subunit is used for adding an event record which comprises a second storage keyword, a starting execution checking time and an event state related to the second storage keyword in the second database if the second storage keyword does not exist, and setting the validity period of the event record;
and the fourth checking subunit is used for performing the abnormal interruption checking according to the event state of the operation event and the starting checking time in the second target event record if the operation event exists.
On the basis of the foregoing embodiment, optionally, the fourth syndrome unit is specifically configured to:
if the event state of the operation event is in the process of sending, determining a time difference value between the current time and the time for starting to execute the verification in the second target event record;
if the time difference value is in the first time length interval, determining that the operation event is a repeated event, and ending the processing flow of the operation event;
if the time difference value is in a second time length interval, determining that the operation event is an event interrupted due to abnormality, salvaging the operation event signal, and updating the starting execution verification time of the operation event as salvaging time;
and if the time difference value is in the third duration interval, determining that the operation event is an overtime event, and discarding the operation event.
On the basis of the above embodiment, optionally, the method further includes:
the reconstruction module is used for reconstructing the event description of the operation event according to the preset unified description field; wherein, the uniform description field comprises at least one item of event unique identification, event type, event source, event time, event detail content, operation target, adjusting copy number, overtime setting and result callback address
On the basis of the above embodiment, optionally, the method further includes:
and the duplication eliminating module is used for carrying out duplication eliminating treatment on the received operation events according to the event unique identifier in the event description corresponding to each operation event.
On the basis of the foregoing embodiment, optionally, the event distribution module includes:
the distribution unit is used for sequentially distributing the received operation events to different message queues; each message queue is uniquely associated with an event consumer in advance;
and the filtering unit is used for filtering the operation events in each message queue according to the filtering fields associated with each message queue and determining the operation events corresponding to each event consumer according to the filtering result.
On the basis of the above embodiment, optionally, the event publisher is any computer business system; the event consumers are a plurality of cloud service systems which provide cloud services for the computer business systems.
The event processing device provided by the embodiment of the disclosure can execute the event processing method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method. Reference may be made to the description of any method embodiment of the disclosure for a matter not explicitly described in this embodiment.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 comprises a computing unit 701, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM)702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 701 executes the respective methods and processes described above, such as the event processing method. For example, in some embodiments, the event processing methods may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM702 and/or communications unit 709. When the computer program is loaded into the RAM703 and executed by the computing unit 701, one or more steps of the event handling method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the event handling method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (21)

1. An event processing method, comprising:
receiving an operation event issued by an event issuer;
screening the operation events to determine the operation events corresponding to each event consumer;
and carrying out ordered verification and abnormal interruption verification on the operation events corresponding to different event consumers respectively, and sending the operation events passing the verification to the corresponding event consumers respectively for execution.
2. The method of claim 1, wherein the orderly checking of the operation events respectively corresponding to different event consumers comprises:
and recording the creation time of each operation event aiming at the operation event corresponding to any event consumer, and carrying out ordered verification according to the creation time of each operation event.
3. The method of claim 2, wherein the recording of the creation time of each operation event and the sequential checking according to the creation time of each operation event for the operation event corresponding to any event consumer comprises:
aiming at any operation event corresponding to any event consumer, constructing a first storage keyword for the operation event according to a fixed field and the event description of the operation event, and determining event creation time and an event unique identifier associated with the first storage keyword;
inquiring whether a first database has a first target event record with the same storage keyword or not according to the first storage keyword;
if the event record does not exist, adding an event record comprising the first storage keyword, the event creation time associated with the first storage keyword and the unique event identifier in the first database, setting the validity period of the event record, and passing the ordered verification;
and if so, performing ordered verification according to the event creation time of the operation event and the event creation time in the first target event record.
4. The method of claim 3, wherein performing an ordered check based on the event creation time of the operational event and the event creation time in the first target event record comprises:
if the event creation time of the operation event is less than the event creation time in the first target event record, the ordered verification fails;
if the event creating time of the operation event is equal to the event creating time in the first target event record, judging whether the event unique identifier of the operation event is the same as the event unique identifier in the first target event record, if so, orderly checking is not passed;
if the event creating time of the operation event is greater than the event creating time in the first target event record, adding an event record comprising the first storage keyword, the event creating time associated with the first storage keyword and the event unique identifier in the first database, setting the validity period of the event record, and passing the ordered verification.
5. The method of claim 1, wherein performing abort checks on respective corresponding operational events of different event consumers comprises:
and recording the event state and the time for starting to execute the verification of each operation event aiming at each operation event corresponding to any event consumer, and performing abnormal interruption verification according to the event state and the time for starting to execute the verification of each operation event.
6. The method of claim 5, wherein for each operation event corresponding to any event consumer, recording an event state and a time for starting to perform check-up, and performing abort check-up according to the event state and the time for starting to perform check-up, comprises:
aiming at any operation event corresponding to any event consumer, constructing a second storage keyword for the operation event according to the fixed field and the event unique identifier of the operation event, and determining the starting execution verification time and the event state associated with the second storage keyword;
inquiring whether a second database has a second target event record with the same storage keyword or not according to the second storage keyword;
if the event record does not exist, adding the event record which comprises the second storage keyword and the starting execution verification time and the event state related to the second storage keyword into the second database, and setting the validity period of the event record;
and if the operation event exists, performing abnormal interrupt check according to the event state of the operation event and the starting execution check time in the second target event record.
7. The method of claim 6, wherein performing abort checking based on the event status of the operational event and the start execution check time in the second target event record comprises:
if the event state of the operation event is in progress, determining a time difference value between the current time and the time for starting to execute the verification in the second target event record;
if the time difference value is in a first time length interval, determining that the operation event is a repeated event, and ending the processing flow of the operation event;
if the time difference value is in a second time length interval, determining that the operation event is an event interrupted due to abnormality, salvaging the operation event signal, and updating the starting execution verification time of the operation event as salvaging time;
and if the time difference value is in a third time length interval, determining that the operation event is an overtime event, and discarding the operation event.
8. The method of claim 1, after receiving the operation event published by the event publisher, further comprising:
reconstructing the event description of the operation event according to a preset unified description field; the uniform description field comprises at least one of an event unique identifier, an event type, an event source, event time, event detail content, an operation target, an adjustment copy number, timeout time setting and a result callback address.
9. The method of claim 8, further comprising:
and according to the event unique identifier in the event description corresponding to each operation event, carrying out deduplication processing on the received operation events.
10. The method of claim 1, wherein the filtering the operation events to determine the operation events corresponding to each event consumer comprises:
the received operation events are distributed to different message queues in sequence; each message queue is uniquely associated with an event consumer in advance;
and filtering the operation events in each message queue according to the filtering fields associated with each message queue, and determining the operation events corresponding to each event consumer according to the filtering result.
11. The method of any of claims 1-10, wherein the event publisher is any computer business system; the event consumers are a plurality of cloud service systems providing cloud services for the computer service system.
12. An event processing apparatus comprising:
the event access module is used for receiving the operation event issued by the event issuing party;
the event distribution module is used for screening the operation events to determine the operation events corresponding to each event consumer;
and the event adaptation module is used for carrying out ordered verification and abnormal interruption verification on the operation events corresponding to different event consumers respectively and sending the operation events passing the verification to the corresponding event consumers respectively for execution.
13. The apparatus of claim 12, wherein the event adaptation module comprises an ordered checking unit to:
and recording the creation time of each operation event aiming at the operation event corresponding to any event consumer, and carrying out ordered verification according to the creation time of each operation event.
14. The apparatus of claim 13, wherein the ordered parity element comprises:
the first storage word construction subunit is used for constructing a first storage keyword for any operation event corresponding to any event consumer according to the fixed field and the event description of the operation event, and determining event creation time and an event unique identifier associated with the first storage keyword;
the first query subunit is used for querying whether a first database has a first target event record with the same storage keyword or not according to the first storage keyword;
the first checking subunit is used for adding an event record comprising the first storage keyword, event creation time associated with the first storage keyword and an event unique identifier in the first database if the first checking subunit does not exist, setting the validity period of the event record, and passing the ordered checking;
and the second checking subunit is used for performing ordered checking according to the event creating time of the operation event and the event creating time in the first target event record if the operation event exists.
15. The apparatus according to claim 14, wherein the second syndrome unit is specifically configured to:
if the event creation time of the operation event is less than the event creation time in the first target event record, the ordered verification fails;
if the event creating time of the operation event is equal to the event creating time in the first target event record, judging whether the event unique identifier of the operation event is the same as the event unique identifier in the first target event record, if so, orderly checking is not passed;
if the event creating time of the operation event is greater than the event creating time in the first target event record, adding an event record comprising the first storage keyword, the event creating time associated with the first storage keyword and the event unique identifier in the first database, setting the validity period of the event record, and passing the ordered verification.
16. The apparatus of claim 12, wherein the event adaptation module comprises an abort check unit to:
and recording the event state and the time for starting to execute the verification of each operation event aiming at each operation event corresponding to any event consumer, and performing abnormal interruption verification according to the event state and the time for starting to execute the verification of each operation event.
17. The apparatus of claim 16, wherein the abort check unit comprises:
the second storage word construction subunit is used for constructing a second storage keyword for any operation event corresponding to any event consumer according to the fixed field and the event unique identifier of the operation event, and determining the starting execution verification time and the event state associated with the second storage keyword;
the second query subunit is used for querying whether a second database has a second target event record with the same storage keyword or not according to the second storage keyword;
a third checking subunit, configured to add, if the event record does not exist, an event record including the second storage keyword, the start execution checking time associated with the second storage keyword, and the event state, and set an expiration date of the event record;
and the fourth checking subunit is used for performing abnormal interrupt checking according to the event state of the operation event and the starting execution checking time in the second target event record if the operation event exists.
18. The apparatus according to claim 17, wherein the fourth syndrome unit is specifically configured to:
if the event state of the operation event is in progress, determining a time difference value between the current time and the time for starting to execute the verification in the second target event record;
if the time difference value is in a first time length interval, determining that the operation event is a repeated event, and ending the processing flow of the operation event;
if the time difference value is in a second time length interval, determining that the operation event is an event interrupted due to abnormity, fishing back the operation event signal, and updating the time for starting to execute the verification of the operation event to be fishing back time;
and if the time difference value is in a third time length interval, determining that the operation event is an overtime event, and discarding the operation event.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-11.
21. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-11.
CN202210494063.1A 2022-04-29 2022-04-29 Event processing method and device, electronic equipment and storage medium Pending CN114896084A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210494063.1A CN114896084A (en) 2022-04-29 2022-04-29 Event processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210494063.1A CN114896084A (en) 2022-04-29 2022-04-29 Event processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114896084A true CN114896084A (en) 2022-08-12

Family

ID=82721602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210494063.1A Pending CN114896084A (en) 2022-04-29 2022-04-29 Event processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114896084A (en)

Similar Documents

Publication Publication Date Title
US11176517B2 (en) System and method for anomaly detection and deduplication of electronic data feeds
US20160294651A1 (en) Method, apparatus, and computer program product for monitoring an electronic data exchange
US20200286014A1 (en) Information updating method and device
CN110895472A (en) Method and device for identifying service change
CN112860342A (en) Method, device, equipment, system and storage medium for microservice configuration
US10127329B2 (en) Processing large XML files by splitting and hierarchical ordering
CN111179080B (en) Order processing method and order processing device
CN107633026B (en) data synchronization exception handling method and device and server
CN113590172A (en) Code file publishing method, device, equipment and storage medium
US11243979B1 (en) Asynchronous propagation of database events
CN112948081A (en) Method, device and equipment for processing task in delayed mode and storage medium
CN111738728A (en) Transaction compensation method and device
JP2012089049A (en) Computer system and server
CN114896084A (en) Event processing method and device, electronic equipment and storage medium
CN112148762A (en) Statistical method and device for real-time data stream
CN115510036A (en) Data migration method, device, equipment and storage medium
CN113806312A (en) File processing method and device, electronic equipment and storage medium
CN110688355A (en) Method and device for changing container state
CN111210349A (en) Virtual asset transfer hosting method and device, electronic equipment and storage medium
CN113157405A (en) Method and device for retrying breakpoint of business process
CN112925623A (en) Task processing method and device, electronic equipment and medium
CN112241332A (en) Interface compensation method and device
CN110795445A (en) Concurrent task processing method and device, server equipment and medium
CN111290927A (en) Data monitoring method and device
CN113595870B (en) Push message processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination