CN110968438B - Asynchronous notification method and device of event message, electronic equipment and storage medium - Google Patents

Asynchronous notification method and device of event message, electronic equipment and storage medium Download PDF

Info

Publication number
CN110968438B
CN110968438B CN201911211516.XA CN201911211516A CN110968438B CN 110968438 B CN110968438 B CN 110968438B CN 201911211516 A CN201911211516 A CN 201911211516A CN 110968438 B CN110968438 B CN 110968438B
Authority
CN
China
Prior art keywords
event message
event
registration information
database
preset
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.)
Active
Application number
CN201911211516.XA
Other languages
Chinese (zh)
Other versions
CN110968438A (en
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.)
Jiangsu Manyun Software Technology Co Ltd
Original Assignee
Jiangsu Manyun Software 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 Jiangsu Manyun Software Technology Co Ltd filed Critical Jiangsu Manyun Software Technology Co Ltd
Priority to CN201911211516.XA priority Critical patent/CN110968438B/en
Publication of CN110968438A publication Critical patent/CN110968438A/en
Application granted granted Critical
Publication of CN110968438B publication Critical patent/CN110968438B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • 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
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides an event message asynchronous notification method, an event message asynchronous notification device, electronic equipment and a storage medium, wherein the event message asynchronous notification method comprises the following steps: monitoring a log of a database, analyzing the log to acquire update information of the database, and updating the database based on the execution of business operation; generating an event message based on preset event registration information and the acquired updating information of the database; and sending the event message to an event message queue, wherein the event message in the event message queue is used for an event message receiving end to consume the event message from the event message queue based on the preset event registration information. On one hand, the method and the device provided by the invention avoid the consistency problem existing in sending the event message after the same system executes the service operation to update the database; on the other hand, the service code for updating the database and the code for sending the event message are isolated, so that the decoupling of the service code and the event push code is realized.

Description

Event message asynchronous notification method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an event message asynchronous notification method, an event message asynchronous notification device, an electronic device, and a storage medium.
Background
With the rapid development of the internet era, in order to avoid the business system being too complex, the business system is usually implemented in a microservice mode. That is, a complex service system is divided into several mutually independent subsystems, and the subsystems need to communicate with each other.
Micro-services were originally proposed by Martin Fowler and James Lewis in 2014, the micro-service architecture style is a way to develop a single application using a set of small services, each service runs in its own process and communicates using a lightweight mechanism, usually HTTP API, these services are built based on business capabilities and can be deployed independently through an automated deployment mechanism, these services are implemented using different programming languages and different data storage technologies, and keep a minimum of centralized management.
In the business execution process of these subsystems, the following scenarios will exist: after the subsystem A needs to update the database, certain event information updated based on the database is sent to the subsystem B, and after the subsystem B receives the event information, the subsystem B carries out self service processing. In a commonly used distributed microservice service system at present, a subsystem a generally updates a database first, and after the database is updated successfully, an interface of a subsystem B is called to send an event message to the subsystem B. However, since the subsystem a needs to go through network transmission for updating data and sending event messages, the consistency between the updated data and the event messages cannot be guaranteed in percentage (for example, after the subsystem a updates data successfully, if network jitter occurs, the problem of inconsistency between the updated data and the event messages will occur). It may also result in subsystem a coupling the update database code and the messaging code.
For such a mode, on one hand, the event provider is divided into two steps of operations, there is no way to ensure consistency between the two steps of operations, dirty data is generated once an exception occurs between the two steps of operations, and a system or a manual work is subsequently needed to repair the dirty data; on the other hand, the event provider needs to provide event delivery parameters, with the service code and the event delivery code coupled together.
Therefore, how to solve the above-mentioned problems of database update and event message inconsistency and code coupling in a distributed system in microservice mode is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The present invention is directed to a method, an apparatus, an electronic device, and a storage medium for asynchronous notification of an event message, which overcome at least some of the limitations and disadvantages of the related art.
According to an aspect of the present invention, there is provided an event message asynchronous notification method, including:
monitoring a log of a database, analyzing the log to acquire update information of the database, and updating the database based on the execution of business operation;
generating an event message based on preset event registration information and the acquired updating information of the database; and
and sending the event message to an event message queue, wherein the event message in the event message queue is used for an event message receiving end to consume the event message from the event message queue based on the preset event registration information.
In some embodiments of the present invention, the preset event registration information is registered in an event management platform by the event message receiving end, and the preset event registration information at least includes a table name, a field, and configuration information of the field.
In some embodiments of the present invention, the converting the acquired update information of the database into the event message based on the preset event registration information includes:
and based on the preset event registration information, when the acquired update information of the database hits the table name, the field and the configuration information of the field in the preset event registration information, generating an event message associated with the event message receiving end.
In some embodiments of the present invention, when a plurality of event message receiving terminals register the same preset event registration information in the event management platform, the event message generated based on the preset event registration information is consumed by the plurality of event message receiving terminals synchronously or asynchronously.
In some embodiments of the present invention, the plurality of event message receiving ends are divided into a plurality of event message receiving groups, when one of the event message receiving groups registers preset event registration information in the event management platform, the event message generated based on the preset event registration information is received by one of the event message receiving ends of the event message receiving group, and when the event message receiving end that receives the event message fails to process the event message, the event message is received by another of the event message receiving ends of the event message receiving group.
In some embodiments of the present invention, when a plurality of event message receiving groups register the same preset event registration information in the event management platform, the event message generated based on the preset event registration information is consumed by the plurality of event message receiving groups synchronously or asynchronously.
In some embodiments of the present invention, when the event message fails to be processed at the event message receiver, the event message receiver processes the event message with limited or unlimited retries.
According to another aspect of the present invention, there is also provided an event message asynchronous notification apparatus, including:
the monitoring and analyzing module is used for monitoring the logs of the database and analyzing the logs to acquire the updating information of the database, and the database is updated based on the execution of the business operation;
the generating module is used for generating an event message based on the preset event registration information and the acquired updating information of the database; and
and the sending module is used for sending the event message to an event message queue, wherein the event message in the event message queue is used for an event message receiving end to consume the event message from the event message queue based on the preset event registration information.
According to still another aspect of the present invention, there is also provided an electronic apparatus, including: a processor; a storage medium having stored thereon a computer program which, when executed by the processor, performs the steps as described above.
According to yet another aspect of the present invention, there is also provided a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps as described above.
Compared with the prior art, the invention has the advantages that:
when the database is updated based on the execution of the business operation, the present invention obtains update information of the database through parsing of the log based on the log of the database, and generates an event message to be transmitted to an event message receiving end via an event message queue by presetting event registration information. Therefore, the system executing the business operation only needs to pay attention to the business operation, and does not need to generate and send the event message to the event message receiving end by the system executing the business operation. On one hand, the consistency problem existing in the prior art that the event message is sent after the system executing the business operation updates the database is avoided; on the other hand, the service code for updating the database and the code for sending the event message are isolated, so that the decoupling of the service code and the event push code is realized.
Drawings
The above and other features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
Fig. 1 illustrates a flowchart of an event message asynchronous notification method according to an embodiment of the present invention.
Fig. 2 is a diagram illustrating an event message asynchronous notification system in accordance with a specific embodiment of the present invention.
Fig. 3 illustrates a block diagram of an event message asynchronous notification apparatus according to an embodiment of the present invention.
Fig. 4 schematically illustrates a computer-readable storage medium in an exemplary embodiment of the invention.
Fig. 5 schematically illustrates an electronic device in an exemplary embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the steps. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 illustrates a flowchart of an event message asynchronous notification method according to an embodiment of the present invention. The asynchronous notification method of the event message comprises the following steps:
step S110: monitoring a log of a database, analyzing the log to obtain update information of the database, and updating the database based on the execution of business operation;
step S120: generating an event message based on preset event registration information and the acquired update information of the database; and
step S130: and sending the event message to an event message queue, wherein the event message in the event message queue is used for an event message receiving end to consume the event message from the event message queue based on the preset event registration information.
In the event message asynchronous notification method provided by the invention, when the database is updated based on the execution of the business operation, the invention obtains the update information of the database through the analysis of the log based on the log of the database, and generates the event message to be sent to the event message receiving end through the event message queue by presetting the event registration information. Therefore, the system executing the business operation only needs to pay attention to the business operation, and does not need to generate and send the event message to the event message receiving end by the system executing the business operation. On one hand, the consistency problem existing in the prior art that the event message is sent after the system executing the business operation updates the database is avoided; on the other hand, the service code for updating the database and the code for sending the event message are isolated, so that the decoupling of the service code and the event push code is realized.
In various embodiments of the present invention, the monitored database is MySQL (relational database management system), and the log of the database may be binlog of MySQL. The binlog is a file in binary format, and is used for recording SQL statement information of updating the database by a user, for example, SQL statements for changing the database table and the content are all recorded in the binlog, so that the invention can analyze the binlog to obtain the update information of the database.
In various embodiments of the present invention, the event message receiver may implement consumption and processing of the event message through an SDK (software development kit). For example, an event message receiver may consume an event message from a message queue via an SDK and then process it via a callback function. A callback function is a function called by a function pointer. If a pointer (address) of a function is passed as a parameter to another function, when the pointer is used to call the function it points to, it is called a callback function. The invention adopts SDK to contain an abstract class, and the event message receiving end can send the abstract class to process after receiving the event message.
In some embodiments of the present invention, an event management platform is employed. And the event management platform is used for the event message receiving end to register the event on the event management platform. The event message receiving end inputs preset event registration information when registering an event on the event management platform. The preset event registration information at least comprises a table name, a field and configuration information of the field. Thus, in the step S120, converting the acquired update information of the database into the event message based on the preset event registration information may be implemented as follows: and based on the preset event registration information, generating an event message associated with the event message receiving end when the acquired updating information of the database hits the table name, the field and the configuration information of the field in the preset event registration information. In particular, configuration information for a field may include one or more of a value of the field, a change in a value of the field, an addition of the field, a deletion of the field, and other operations of the field. For example, it may monitor a certain table name, and when the value of the status field changes to 1, generate an event message associated with the event message receiving end; the method comprises the steps that under a certain table name, when the value of a status field is increased by 2, an event message related to an event message receiving end is generated; monitoring a certain table name, and generating an event message associated with the event message receiving end when a status field is deleted; the event message associated with the event message receiving end can be generated when the status field is added under a certain table name. The foregoing is merely an illustration of some implementations of the invention and is not intended to be limiting thereof.
In some implementations of the invention, the same event message may be consumed and processed simultaneously by multiple event message receivers. For example, when a plurality of event message receivers register the same preset event registration information in the event management platform, the event message generated based on the preset event registration information may be consumed and processed by the plurality of event message receivers synchronously. The present invention is not limited thereto, and when a plurality of event message receiving terminals register the same preset event registration information on the event management platform, the event message generated based on the preset event registration information may also be asynchronously consumed and processed by the plurality of event message receiving terminals.
In other implementations of the invention, the plurality of event message receivers may be divided into a plurality of event message receiver groups. Each event message reception group may include a plurality of event message reception ends arranged in sequence (e.g., a set order or an order set according to the execution of a specific service). Therefore, when the event message receiving group registers the preset event registration information in the event management platform, the event message generated based on the preset event registration information is received by one event message receiving end of the event message receiving group, and when the event message receiving end receiving the event message fails to process the event message, the next event message receiving end of the event message receiving group receives the event message. Thus, a mechanism for executing retry transfer after failure of event message processing is realized. This approach reduces the number of retries and retry time consumed by the same event message receiver repeatedly executing a failed event message.
In some implementations of the aforementioned embodiment, when a plurality of event message receiving groups register the same preset event registration information in the event management platform, the event message generated based on the preset event registration information is consumed synchronously or asynchronously by the plurality of event message receiving groups. In other words, the event message receivers of the event message receiving groups may consume and process the event message synchronously or asynchronously.
In other implementations of the invention, when the event message fails to be processed at the event message receiver, the event message receiver retries the processing of the event message a limited or unlimited number of times, thereby reducing hardware costs of failover.
One specific implementation of the present invention is described below with reference to fig. 2, and fig. 2 is a schematic diagram of an event message asynchronous notification system according to a specific embodiment of the present invention. Illustrated in fig. 2 are an event management platform 210, a plurality of databases 220, a log parsing platform 230, and a plurality of event message receivers 240. The event message receiver 240 may register an event with the event management platform 210. The event management platform 210 may transmit preset event registration information, which is input when the event message receiving terminal 240 registers an event, to the log parsing module 231 of the log parsing platform 230. The log parsing module 231 receives and parses logs of the plurality of databases 220 to obtain update information of the databases 220. The log parsing module 231 generates an event message according to the matching of the obtained update information of the database 220 and the preset event registration information, and sends the event message to the event message queue 232. The plurality of event messages in the event message queue 232 are consumed by the event message consuming threads 241 of the plurality of event message receiving ends 240 and processed by the event message processing threads 242. The log parsing module 231 may also send the generated event message to a full-text search engine for subsequent querying and tracing.
The above are merely one or more specific implementations provided by the present invention, and each of the specific implementations may be implemented alone or in combination, and the present invention is not limited thereto.
According to still another aspect of the present invention, there is also provided an event message asynchronous notification apparatus, and fig. 3 shows a block diagram of the event message asynchronous notification apparatus according to an embodiment of the present invention. The event message asynchronous notification apparatus 300 includes a listening parsing module 310, a generating module 320, and a transmitting module 330.
The monitoring and analyzing module 310 is configured to monitor a log of a database, and analyze the log to obtain update information of the database, where the database is updated based on execution of a service operation;
the generating module 320 is configured to generate an event message based on the preset event registration information and the acquired update information of the database; and
the sending module 330 is configured to send the event message to an event message queue, where the event message in the event message queue is used for an event message receiving end to consume the event message from the event message queue based on the preset event registration information.
In the event message asynchronous notification apparatus provided by the present invention, when a database is updated based on the execution of a business operation, the present invention obtains update information of the database through the parsing of a log based on the log of the database, and generates an event message to be transmitted to an event message receiving end via an event message queue by presetting event registration information. Therefore, the system executing the business operation only needs to pay attention to the business operation, and does not need to generate and send the event message to the event message receiving end by the system executing the business operation. On one hand, the consistency problem existing in the prior art that the event message is sent after the system executing the business operation updates the database is avoided; on the other hand, the service code of the updated database and the event message sending code are separated, and the decoupling of the service code and the event pushing code is realized.
Fig. 3 is a schematic diagram of the event message asynchronous notification apparatus 300 provided by the present invention, and the splitting, merging and adding of modules are within the protection scope of the present invention without departing from the concept of the present invention. The asynchronous event message notification apparatus 300 provided by the present invention can be implemented by software, hardware, firmware, plug-in and any combination thereof, which is not limited by the present invention.
In an exemplary embodiment of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored, which when executed by, for example, a processor, can implement the event message asynchronous notification method and the steps of the event message asynchronous notification method described in any of the above embodiments. In some possible embodiments, the various aspects of the present invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the present invention described in the event message asynchronous notification method and event message asynchronous notification method sections above in this description, when said program product is run on the terminal device.
Referring to fig. 4, a program product 700 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the tenant computing device, partly on the tenant device, as a stand-alone software package, partly on the tenant computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing devices may be connected to the tenant computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In an exemplary embodiment of the invention, there is also provided an electronic device that may include a processor and a memory for storing executable instructions of the processor. Wherein the processor is configured to execute the executable instructions to perform the event message asynchronous notification method and the steps of the event message asynchronous notification method in any of the above embodiments.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to this embodiment of the invention is described below with reference to fig. 5. The electronic device 500 shown in fig. 5 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the electronic device 500 is embodied in the form of a general purpose computing device. The components of the electronic device 500 may include, but are not limited to: at least one processing unit 510, at least one memory unit 520, a bus 530 that couples various system components including the memory unit 520 and the processing unit 510, a display unit 540, and the like.
Wherein the storage unit stores program code, which can be executed by the processing unit 510, to cause the processing unit 510 to execute the steps according to various exemplary embodiments of the present invention described in the event message asynchronous notification method and the event message asynchronous notification method section described above in this specification. For example, the processing unit 510 may perform the steps as shown in fig. 1.
The memory unit 520 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)5201 and/or a cache memory unit 5202, and may further include a read only memory unit (ROM) 5203.
The memory unit 520 may also include a program/utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 530 may be one or more of any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 500 may also communicate with one or more external devices 600 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a tenant to interact with the electronic device 500, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 550. Also, the electronic device 500 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 560. The network adapter 560 may communicate with other modules of the electronic device 500 via the bus 530. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above-mentioned event message asynchronous notification method and the event message asynchronous notification method according to the embodiment of the present invention.
Compared with the prior art, the invention has the advantages that:
when the database is updated based on the execution of the business operation, the present invention obtains update information of the database through parsing of the log based on the log of the database, and generates an event message to be transmitted to an event message receiving end via an event message queue by presetting event registration information. Therefore, the system executing the business operation only needs to pay attention to the business operation, and does not need to generate and send the event message to the event message receiving end by the system executing the business operation. On one hand, the consistency problem existing in the prior art that the event message is sent after the system executing the business operation updates the database is avoided; on the other hand, the service code for updating the database and the code for sending the event message are isolated, so that the decoupling of the service code and the event push code is realized.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.

Claims (8)

1. An event message asynchronous notification method, comprising:
monitoring a log of a database, analyzing the log to acquire update information of the database, and updating the database based on the execution of business operation;
generating an event message based on preset event registration information and the acquired updating information of the database; and
sending the event message to an event message queue, wherein the event message queue is used for an event message receiving end to consume the event message from the event message queue based on the preset event registration information,
wherein,
the preset event registration information is registered on an event management platform by the event message receiving terminals, a plurality of event message receiving terminals are divided into a plurality of event message receiving groups, when an event message receiving group registers the preset event registration information in the event management platform, the event message generated based on the preset event registration information is received by one of the event message receiving terminals of the event message receiving group, and when the event message receiving terminal receiving the event message fails to process the event message, the event message is received by another event message receiving end of the event message receiving group, when a plurality of event message receiving groups register the same preset event registration information in the event management platform, the event message generated based on the preset event registration information is consumed synchronously or asynchronously by the plurality of event message reception groups.
2. The event message asynchronous notification method as claimed in claim 1, wherein said preset event registration information comprises at least a table name, a field, and configuration information of the field.
3. The event message asynchronous notification method according to claim 2, wherein said converting the acquired update information of the database into the event message based on the preset event registration information comprises:
and based on the preset event registration information, generating an event message associated with the event message receiving end when the acquired updating information of the database hits the table name, the field and the configuration information of the field in the preset event registration information.
4. The asynchronous event message notification method as claimed in claim 2, wherein when a plurality of event message receivers register the same preset event registration information in the event management platform, the event messages generated based on the preset event registration information are consumed synchronously or asynchronously by the plurality of event message receivers.
5. The asynchronous notification method for event messages according to any of claims 1 to 4, wherein said event message receiver processes the event message with limited or unlimited retries when said event message receiver fails to process the event message.
6. An event message asynchronous notification apparatus, comprising:
the monitoring and analyzing module is used for monitoring the logs of the database and analyzing the logs to acquire the updating information of the database, and the database is updated based on the execution of the business operation;
the generating module is used for generating an event message based on the preset event registration information and the acquired updating information of the database; and
a sending module, configured to send the event message to an event message queue, where the event message in the event message queue is used for an event message receiving end to consume the event message from the event message queue based on the preset event registration information,
wherein,
the preset event registration information is registered on an event management platform by the event message receiving terminals, a plurality of event message receiving terminals are divided into a plurality of event message receiving groups, when an event message receiving group registers the preset event registration information in the event management platform, the event message generated based on the preset event registration information is received by one of the event message receiving terminals of the event message receiving group, and when the event message receiving terminal receiving the event message fails to process the event message, the event message is received by another event message receiving end of the event message receiving group, when a plurality of event message receiving groups register the same preset event registration information in the event management platform, the event message generated based on the preset event registration information is consumed synchronously or asynchronously by the plurality of event message reception groups.
7. An electronic device, characterized in that the electronic device comprises:
a processor;
memory on which is stored a computer program which, when executed by the processor, performs the event message asynchronous notification method of any of claims 1 to 5.
8. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when executed by a processor, performs the event message asynchronous notification method according to any of claims 1 to 5.
CN201911211516.XA 2019-11-29 2019-11-29 Asynchronous notification method and device of event message, electronic equipment and storage medium Active CN110968438B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911211516.XA CN110968438B (en) 2019-11-29 2019-11-29 Asynchronous notification method and device of event message, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911211516.XA CN110968438B (en) 2019-11-29 2019-11-29 Asynchronous notification method and device of event message, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110968438A CN110968438A (en) 2020-04-07
CN110968438B true CN110968438B (en) 2022-09-02

Family

ID=70032520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911211516.XA Active CN110968438B (en) 2019-11-29 2019-11-29 Asynchronous notification method and device of event message, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110968438B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552581B (en) * 2020-05-07 2023-04-28 网易(杭州)网络有限公司 Event delivery method, device, system and electronic equipment
CN111694857B (en) * 2020-06-12 2023-11-07 北京百度网讯科技有限公司 Method, device, electronic equipment and computer readable medium for storing resource data
CN111949497B (en) * 2020-06-23 2024-04-12 贝壳技术有限公司 Message queue system and message processing method based on same
CN111949654A (en) * 2020-07-20 2020-11-17 上海淇馥信息技术有限公司 User label-based quick query method and system and electronic equipment
CN111897521B (en) * 2020-08-03 2023-06-23 水羊化妆品制造有限公司 Task processing method and related device based on micro-service architecture
CN112364109B (en) * 2020-11-13 2024-02-27 卫宁健康科技集团股份有限公司 Event business association method, system, device, electronic equipment and storage medium
CN112671827B (en) * 2020-11-25 2023-03-07 紫光云技术有限公司 Distributed transaction final consistency method
CN112612804B (en) * 2020-12-22 2023-03-31 新华三大数据技术有限公司 Service management parameter updating method and device
CN113553206B (en) * 2021-09-22 2021-12-21 北京德风新征程科技有限公司 Data event execution method and device, electronic equipment and computer readable medium
CN114449037A (en) * 2021-12-29 2022-05-06 航天信息股份有限公司 Asynchronous communication push system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070276914A1 (en) * 2006-05-10 2007-11-29 Oracle International Corporation Method of using a plurality of subscriber types in managing a message queue of a database management system
CN103034699A (en) * 2011-12-06 2013-04-10 微软公司 Notification of providing document repository event for external system
CN104932932A (en) * 2014-03-20 2015-09-23 腾讯科技(深圳)有限公司 Asynchronous business processing method, device and system
CN105528378A (en) * 2014-10-22 2016-04-27 阿里巴巴集团控股有限公司 Service message sending method and device
CN110019498A (en) * 2017-08-14 2019-07-16 北京京东尚科信息技术有限公司 Log synchronous method and device, storage medium, electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070276914A1 (en) * 2006-05-10 2007-11-29 Oracle International Corporation Method of using a plurality of subscriber types in managing a message queue of a database management system
CN103034699A (en) * 2011-12-06 2013-04-10 微软公司 Notification of providing document repository event for external system
CN104932932A (en) * 2014-03-20 2015-09-23 腾讯科技(深圳)有限公司 Asynchronous business processing method, device and system
CN105528378A (en) * 2014-10-22 2016-04-27 阿里巴巴集团控股有限公司 Service message sending method and device
CN110019498A (en) * 2017-08-14 2019-07-16 北京京东尚科信息技术有限公司 Log synchronous method and device, storage medium, electronic equipment

Also Published As

Publication number Publication date
CN110968438A (en) 2020-04-07

Similar Documents

Publication Publication Date Title
CN110968438B (en) Asynchronous notification method and device of event message, electronic equipment and storage medium
US8392385B2 (en) Flexible event data content management for relevant event and alert analysis within a distributed processing system
CN108776696B (en) Node configuration method and device, storage medium and electronic equipment
CN108874558B (en) Message subscription method of distributed transaction, electronic device and readable storage medium
CN110795503A (en) Multi-cluster data synchronization method and related device of distributed storage system
CN110019498B (en) Log synchronization method and device, storage medium and electronic equipment
CN111309550A (en) Data acquisition method, system, equipment and storage medium of application program
USRE47593E1 (en) Reliability estimator for ad hoc applications
CN111371898B (en) Message monitoring method, device, equipment and storage medium
CN110532322B (en) Operation and maintenance interaction method, system, computer readable storage medium and equipment
CN111240940A (en) Real-time service monitoring method and device, electronic equipment and storage medium
CN109445841B (en) Interface document management method, device, server and storage medium
CN110990081A (en) Microservice registration and discovery method and device, storage medium and electronic equipment
WO2014065115A1 (en) Rule distribution server, as well as event processing system, method, and program
CN110851471A (en) Distributed log data processing method, device and system
CN111694645B (en) Task processing method and related device in distributed task scheduling system
CN109873861B (en) Cross-block chain node interaction method and device, storage medium and electronic equipment
CN109325002B (en) Text file processing method, device and system, electronic equipment and storage medium
CN113656502B (en) Data synchronization method, system, electronic device and storage medium
CN113297516B (en) Client interaction interface generation method and device and electronic equipment
CN114371888A (en) Method and device for hot updating of log collection plug-in, electronic equipment and readable medium
CN111752916B (en) Data acquisition method and device, computer readable storage medium and electronic equipment
CN109739724B (en) Data monitoring method, system, electronic device and storage medium
US8380729B2 (en) Systems and methods for first data capture through generic message monitoring
CN108182241B (en) Data interaction optimization method and device, server 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
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200407

Assignee: Nanjing Manyun Cold Chain Technology Co.,Ltd.

Assignor: JIANGSU MANYUN SOFTWARE TECHNOLOGY Co.,Ltd.

Contract record no.: X2023980038397

Denomination of invention: Asynchronous notification method, device, electronic device, and storage medium for event messages

Granted publication date: 20220902

License type: Common License

Record date: 20230724

EE01 Entry into force of recordation of patent licensing contract