Message monitor selection method and device, equipment and medium

By obtaining the metadata of database table change events and dynamically selecting message listeners, the problem of poor adaptability of fixed listeners is solved, and the reasonable allocation of listener resources and the improvement of event processing efficiency are achieved.

CN120705132APending Publication Date: 2025-09-26INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510817838.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-09-26

Smart Images

  • Figure CN120705132A_ABST
    Figure CN120705132A_ABST
Patent Text Reader

Abstract

The invention discloses a message monitor selection method and device, equipment and a medium. The method comprises the following steps: in response to a database table change event of a database, obtaining metadata of the database table change event; the metadata comprises at least one of the following items: an event name, a timestamp and an operation user; determining the event importance degree of the database table change event according to the metadata; determining an event type of the database table change event according to the event name; and determining a message monitor corresponding to the database table change event according to the event importance degree and the event type. According to the embodiment of the invention, the adaptability of the selected message monitor can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technology, and in particular to a message listener selection method, device, equipment and medium. Background Art

[0002] With the continuous development of database technology, when a change operation occurs in the database, the message listener will convert the change operation into a message object and send the message object to the message queue. Different message listeners have different monitoring strategies, so you need to choose the appropriate listener.

[0003] Currently, existing technologies usually select fixed message listeners to monitor database change operations.

[0004] However, the method of selecting a fixed listener has poor adaptability and is prone to overperformance or underperformance. Summary of the Invention

[0005] The present invention provides a message listener selection method, device, equipment and medium. The embodiments of the present invention can improve the adaptability of the selected message listener.

[0006] In a first aspect, an embodiment of the present invention provides a message listener selection method, the method comprising:

[0007] In response to a database table change event occurring in the database, metadata of the database table change event is obtained; the metadata includes at least one of the following: an event name, a timestamp, and an operating user;

[0008] Determine the importance of database table change events based on metadata;

[0009] Determine the event type of the database table change event based on the event name;

[0010] Determine the message listener corresponding to the database table change event based on the event importance and event type.

[0011] In a second aspect, an embodiment of the present invention further provides a message listener selection device, the device comprising:

[0012] A metadata acquisition module is used to obtain metadata of a database table change event in response to a database table change event; the metadata includes at least one of the following: an event name, a timestamp, and an operating user;

[0013] An importance determination module, used to determine the importance of a database table change event based on metadata;

[0014] An event type determination module is used to determine the event type of a database table change event based on the event name;

[0015] The message listener determination module is used to determine the message listener corresponding to the database table change event based on the event importance and event type.

[0016] In a third aspect, an embodiment of the present invention further provides a message listener selection device, the message listener selection device comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the message listener selection method according to any embodiment of the present invention.

[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the message listener selection method of any embodiment of the present invention when executed.

[0021] The technical solution of the embodiment of the present invention can achieve timely perception of database changes and information collection by responding to and obtaining metadata when a change event occurs in a database table, and can achieve reasonable division of event processing priorities by judging the importance of events based on metadata. By determining the event type according to the event name, it can achieve classified management of database events, and by selecting a message listener based on the importance of events and the event type, it can achieve dynamic adaptation and reasonable allocation of listener resources, thereby improving the pertinence and efficiency of event processing, and solving the technical problem that the method of selecting a fixed listener has poor adaptability and is prone to overperformance or insufficient performance. The embodiment of the present invention can improve the adaptability of the selected message listener.

[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1A flowchart of a message listener selection method provided by an embodiment of the present invention;

[0025] Figure 2 A flowchart of a message listener selection method provided by an embodiment of the present invention;

[0026] Figure 3 A schematic structural diagram of a message listener selection device provided by an embodiment of the present invention;

[0027] Figure 4 A structural diagram of a message listener selection device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] In the technical solution of the embodiment of the present invention, the acquisition, storage and application of metadata of database table change events involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0031] Figure 1 This is a flow chart of a message listener selection method provided by an embodiment of the present invention. This embodiment of the present invention is applicable to the case of selecting a suitable message listener in a message queue. This method can be performed by a message listener selection device, which can be implemented in the form of hardware and / or software.

[0032] See also Figure 1 The message listener selection method shown includes:

[0033] S101. In response to a database table change event occurring in a database, metadata of the database table change event is acquired; the metadata includes at least one of the following: an event name, a timestamp, and an operating user.

[0034] Among them, a database table change event may refer to an operation event that causes a change in the data content or structure of a data table in the database. When adding, deleting, or modifying data in a data table in the database through SQL (Structured Query Language) commands, the database will generate a corresponding change event and record the database table change event in the database's transaction log or binary log. For example, inserting a new order record into the "Order Table" in the database is an insert-type database table change event; or modifying the email field of a user in the "User Table" in the database is an update-type database table change event; or deleting the email field of a user in the "User Table" in the database is a delete-type database table change event.

[0035] Metadata refers to data that describes the characteristics of a database table change event. Metadata does not include the actual business data involved in a database table change event, but rather describes the external attributes of the event. Metadata can include data such as the event name, timestamp, and the user who performed the operation.

[0036] The event name can be a semantically defined name for a database table modification operation, indicating the business or operation involved. Event names are typically generated by the business system when generating or monitoring database operations, or they can be automatically named based on the operation table. Event names are used to quickly identify the meaning of an event and are crucial for determining its type and importance.

[0037] A timestamp can refer to the precise time when a database table change event occurred. Timestamps are typically expressed in the format of "year-month-day hour:minute:second" or a Unix timestamp, for example, "2025-06-06 12:30:21" or the Unix timestamp "1738889421." Timestamps are used to identify the time when a database table change event occurred.

[0038] The operating user can be the user identity that performs the database table modification operation. The operating user can be the actual account name for logging into the database or an intermediate service proxy identity.

[0039] S102: Determine the event importance of the database table change event based on the metadata.

[0040] The event importance may refer to the importance of the database table change event in the business process. The event importance is used to indicate whether the database table change event has significant significance in terms of system operation, business logic or data security.

[0041] Specifically, we can establish rules for judging the importance of events (such as based on event name keywords, operating user roles and time periods, etc.), assign weights to each field in the metadata and perform weighted calculations to comprehensively derive the importance of events.

[0042] S103: Determine the event type of the database table change event according to the event name.

[0043] The event type refers to the basic operation category to which a database table change event belongs. The event type reflects the type of operation performed on a database record and can include insert events, delete events, and update events. The event type of a database table change event can be determined by extracting keywords from the event name and matching them with rules.

[0044] S104: Determine the message listener corresponding to the database table change event based on the event importance and event type.

[0045] The message listener refers to a listening module deployed in the messaging middleware system. It receives, parses, and processes message objects converted from database change events. After database change events are converted into message objects and sent to the message queue, the listener continuously monitors the message queue and triggers subsequent processing based on the event content. Based on the event type and importance, the listener dynamically selects an execution strategy (such as a resident listener or an on-demand listener) to enable real-time message consumption and response processing.

[0046] It can be seen that in the embodiments of the present application, by responding to and obtaining metadata when a change event occurs in a database table, timely perception of database changes and information collection can be achieved. By judging the importance of events based on metadata, a reasonable division of event processing priorities can be achieved. By determining the event type based on the event name, classified management of database events can be achieved. By selecting a message listener based on the importance of events and the event type, dynamic adaptation and reasonable allocation of listener resources can be achieved, thereby improving the pertinence and efficiency of event processing, and solving the technical problem that the method of selecting a fixed listener has poor adaptability and is prone to overperformance or insufficient performance. The embodiments of the present invention can improve the adaptability of the selected message listener.

[0047] In an optional embodiment, Figure 2A flowchart of a message listener selection method provided in an embodiment of the present invention refines "determining the message listener corresponding to the database table change event based on the event importance and event type" into "obtaining the number of triggering times of the event type of the database table change event within a preset time window, and calculating the triggering frequency of the event type; when the event importance is greater than or equal to the important event threshold, and the triggering frequency is greater than or equal to the frequency threshold, selecting a resident type message listener; when the event importance is less than the important event threshold, or the triggering frequency is less than the frequency threshold, selecting an on-demand call type message listener" to improve the operation of message listener selection.

[0048] It should be noted that for parts not described in detail in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.

[0049] See also Figure 2 The message listener selection method shown includes:

[0050] S201. In response to a database table change event occurring in a database, metadata of the database table change event is acquired; the metadata includes at least one of the following: an event name, a timestamp, and an operating user.

[0051] S202: Determine the event importance of the database table change event based on the metadata.

[0052] S203: Determine the event type of the database table change event according to the event name.

[0053] S204: Obtain the number of times the event type of the database table change event is triggered within a preset time window, and calculate the trigger frequency of the event type.

[0054] The preset time window can refer to a set time range for counting triggering behaviors of database table change events. The preset time window can be a fixed value or a dynamically adjusted interval, such as 5 minutes, 1 hour, or 24 hours. Within the set time interval, triggering behaviors of a specific event type are counted to reflect the activity level of that specific event type.

[0055] The trigger count refers to the total number of times a certain type of event occurs within a preset time window. Trigger counts can be calculated by monitoring database logs or event queues. Each time an event of the corresponding type is detected, a trigger counter increments by one. For example, if 120 delete-type events are detected within a preset time window of 24 seconds, the trigger count for the delete-type event is 120.

[0056] The trigger frequency refers to the average number of times a certain type of event is triggered per unit time. This frequency is used to reflect the activity of such events, thereby determining whether an event is high-frequency and deciding whether to enable a high-performance and continuous monitoring strategy.

[0057] S205: When the importance of the event is greater than or equal to the important event threshold, and the trigger frequency is greater than or equal to the frequency threshold, a resident type message listener is selected.

[0058] The significant event threshold may be the threshold that distinguishes database table change events as "significant" or "not significant." The significant event threshold is used to determine the business importance of a database table change event and to determine whether the event is significant.

[0059] The frequency threshold can refer to a threshold that classifies event trigger frequencies as "high frequency" or "low frequency." For example, if the frequency threshold is set to 20 times / hour and a certain type of event occurs 25 times / hour, the event type is considered a high frequency event.

[0060] A resident message listener is a message listener that always listens. Deployed on a server or container, a resident message listener is always listening and is suitable for handling high-frequency and important events, ensuring that critical events are not missed or delayed.

[0061] S206: When the event importance is less than the important event threshold, or the trigger frequency is less than the frequency threshold, select an on-demand call type message listener.

[0062] On-demand message listeners are temporary listeners that are activated dynamically when an event arrives. They are typically deployed on serverless or container platforms. They are suitable for handling low-frequency or non-critical events.

[0063] It can be seen that in this embodiment, by counting the number of triggers of the same event type within a preset time window and calculating the trigger frequency, the activity level of the event type within a specific time period can be obtained; by adopting an on-demand call type message listener in scenarios where the event importance is low or the event triggering frequency is low, unnecessary resource occupation can be avoided and flexible allocation of computing resources and cost control can be achieved.

[0064] In some embodiments, determining the event type of the database table change event according to the event name includes:

[0065] Match the event name with each regular expression in the regular expression matching rule set to obtain a matching result; the regular expression matching rule set includes at least one regular expression and the event type corresponding to the regular expression;

[0066] Based on the matching results, the event type of the database table change event is determined.

[0067] Among them, the regular expression matching rule set can refer to a set of pattern rules for matching database event names, and each rule includes a regular expression and a predefined event type corresponding to the expression. Utilizing the pattern matching capability of regular expressions, the event name can be matched one by one with the rules in the set to find matching items that conform to a specific grammatical structure, thereby identifying the event type represented by the event name. For example, the regular expression matching rule set includes the following rules: Rule 1 is "^insert_.*", corresponding to the insert event type; Rule 2 is "^delete_.*", corresponding to the delete event type; Rule 3 is "^update_.*", corresponding to the update event type; when the event name is "insert_user_info, it can be identified as an insert event according to Rule 1.

[0068] The matching result may refer to the result of comparing the event name with each regular expression in the regular expression matching rule set. The matching result is used to identify whether the event name matches a rule in the regular expression matching rule set and the rule item to which it belongs.

[0069] It can be seen that in this embodiment, by using regular expressions for matching, the diversity of event names can be flexibly coped with, and pattern recognition of event names can be achieved; by determining the event type based on the matching results, the event classification process can be automatically completed.

[0070] In some embodiments, a database table change event occurs in a database, further comprising:

[0071] Get the database log file;

[0072] Extract the header fields of each log event in the log file according to the log file to obtain the header fields of each log event;

[0073] Match the header fields with the database table change event comparison library to detect whether a database table change event has occurred in the database.

[0074] A log file is a text or binary data file that records various events and operation information that occur during database operations. Every time a database executes a transaction, it writes the relevant operation events (such as inserts, updates, and deletes) and their accompanying information to the log file.

[0075] The header field may refer to the beginning of each log event in the log file, and includes a meta-information field for describing the basic attributes of the log event.

[0076] The database table change event comparison library can refer to a collection of header fields storing all event types related to "database table structure changes." The extracted log event header fields are compared with the information in the database table change event comparison library. If a match is found, the log event is determined to be a "database table change event." This comparison process can be implemented through string matching, pattern matching, or a rule engine.

[0077] It can be seen that in this embodiment, by extracting the header field of the log event, the basic attributes of the log event can be quickly identified, thereby improving the processing efficiency of event analysis and reducing the parsing overhead of the entire log content.

[0078] In some embodiments, the database table change event includes at least one of the following: an insert event, a delete event, and an update event.

[0079] It can be seen that in this embodiment, by dividing database table change events into insert events, delete events, and update events, accurate distinction of database operation types can be achieved.

[0080] In some embodiments, determining the event importance of the database table change event based on metadata includes:

[0081] The metadata is input into the pre-trained event type detection model to obtain the event importance of the database table change event.

[0082] The event type detection model may be used to input metadata and output the event importance of the database table change event. In a specific example, the event type detection model extracts features from the metadata, encodes the extracted features, and obtains the event importance of the database table change event.

[0083] It can be seen that in this embodiment, by using the pre-trained event type detection model to analyze the metadata, automatic intelligent judgment of the importance of the event can be achieved.

[0084] In some embodiments, the event type detection model is trained by:

[0085] Get the actual message listener corresponding to the database table change event;

[0086] Obtain historical metadata of historical change events of a database table; the historical metadata includes at least one of the following: event name; event size, timestamp, and event user;

[0087] Input historical metadata into the event type detection model to obtain the predicted event importance of database table change events;

[0088] According to the event name, determine the historical event type of the database history table change event;

[0089] Determine the prediction message listener corresponding to the database table change event based on the importance of the prediction event and the type of historical event;

[0090] Based on the difference between the actual message listeners and the predicted message listeners, adjust the parameters of the event type detection model.

[0091] The actual message listener may refer to the message listener actually used for database table change events. The actual message listener is used to compare with the predicted message listener, and the parameters of the event type detection model can be adjusted based on the difference between the two.

[0092] It can be seen that in this embodiment, by obtaining the message listener used in the actual deployment, real feedback data can be provided for model training. Through the model's predicted output of historical data, the reasoning path during training can be constructed, thereby providing a basis for subsequent error feedback. By adjusting the difference between the actual message listener and the predicted message listener, the parameters of the event type detection model can be adjusted.

[0093] Figure 3 A schematic diagram of the structure of a message listener selection device provided by an embodiment of the present invention. The embodiment of the present invention is applicable to the case of selecting a suitable message listener in a message queue. The device can execute a message listener selection method and can be implemented in the form of hardware and / or software.

[0094] See also Figure 3 The message listener selection device shown includes: a metadata acquisition module 301, an importance determination module 302, an event type determination module 303 and a message listener determination module 304, wherein:

[0095] The metadata acquisition module 301 is configured to acquire metadata of a database table change event in response to a database table change event occurring in the database; the metadata includes at least one of the following: an event name, a timestamp, and an operating user;

[0096] Importance determination module 302, configured to determine the event importance of the database table change event based on metadata;

[0097] An event type determination module 303 is used to determine the event type of the database table change event according to the event name;

[0098] The message listener determination module 304 is used to determine the message listener corresponding to the database table change event according to the event importance and event type.

[0099] The technical solution of the embodiment of the present invention can achieve timely perception of database changes and information collection by responding to and obtaining metadata when a change event occurs in a database table, and can achieve reasonable division of event processing priorities by judging the importance of events based on metadata. By determining the event type according to the event name, it can achieve classified management of database events, and by selecting a message listener based on the importance of events and the event type, it can achieve dynamic adaptation and reasonable allocation of listener resources, thereby improving the pertinence and efficiency of event processing, and solving the technical problem that the method of selecting a fixed listener has poor adaptability and is prone to overperformance or insufficient performance. The embodiment of the present invention can improve the adaptability of the selected message listener.

[0100] In some embodiments, in determining the message listener corresponding to the database table change event based on the event importance and event type, the message listener determination module 304 is specifically configured to:

[0101] Obtain the number of times the event type of the database table change event is triggered within the preset time window, and calculate the trigger frequency of the event type;

[0102] When the event importance is greater than or equal to the important event threshold, and the trigger frequency is greater than or equal to the frequency threshold, the resident type message listener is selected;

[0103] When the event severity is less than the critical event threshold, or the trigger frequency is less than the frequency threshold, select the on-demand call type message listener.

[0104] In some embodiments, in determining the event type of the database table change event according to the event name, the event type determination module 303 is specifically configured to:

[0105] Match the event name with each regular expression in the regular expression matching rule set to obtain a matching result; the regular expression matching rule set includes at least one regular expression and the event type corresponding to the regular expression;

[0106] Based on the matching results, the event type of the database table change event is determined.

[0107] In some embodiments, when a database table change event occurs in the database, the metadata acquisition module 301 is further specifically configured to:

[0108] Get the database log file;

[0109] Extract the header fields of each log event in the log file according to the log file to obtain the header fields of each log event;

[0110] Match the header fields with the database table change event comparison library to detect whether a database table change event has occurred in the database.

[0111] In some embodiments, the database table change event includes at least one of the following: an insert event, a delete event, and an update event.

[0112] In some embodiments, in determining the event importance of the database table change event based on metadata, the importance determination module 302 is specifically configured to:

[0113] The metadata is input into the pre-trained event type detection model to obtain the event importance of the database table change event.

[0114] In some embodiments, when the event type detection model is trained in the following manner, the importance determination module 302 is specifically configured to:

[0115] Get the actual message listener corresponding to the database table change event;

[0116] Obtain historical metadata of historical change events of a database table; the historical metadata includes at least one of the following: event name; event size, timestamp, and event user;

[0117] Input historical metadata into the event type detection model to obtain the predicted event importance of database table change events;

[0118] According to the event name, determine the historical event type of the database history table change event;

[0119] Determine the prediction message listener corresponding to the database table change event based on the importance of the prediction event and the type of historical event;

[0120] Based on the difference between the actual message listeners and the predicted message listeners, adjust the parameters of the event type detection model.

[0121] The message listener selection device provided in the embodiment of the present invention can execute the message listener selection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the message listener selection method.

[0122] Figure 4 A structural diagram of a message listener selection device provided by an embodiment of the present invention.

[0123] like Figure 4 As shown, the message listener selection device 400 includes at least one processor 401, and a memory connected to the at least one processor 401, such as a read-only memory (ROM) 402, a random access memory (RAM) 403, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 401 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 402 or the computer program loaded from the storage unit 408 into the random access memory (RAM) 403. In RAM403, various programs and data required for the operation of the message listener selection device 400 can also be stored. The processor 401, ROM402 and RAM403 are connected to each other via a bus 404. An input / output (I / O) interface 408 is also connected to the bus 404.

[0124] Multiple components in the message listener selection device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a magnetic disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the message listener selection device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0125] Processor 401 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. Processor 401 executes the various methods and processes described above, such as the message listener selection method.

[0126] In some embodiments, the message listener selection method can be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the message listener selection device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by processor 401, one or more steps of the message listener selection method described above can be performed. Alternatively, in other embodiments, processor 401 can be configured to perform the message listener selection method in any other appropriate manner (e.g., by means of firmware).

[0127] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0128] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0129] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0130] To provide interaction with a user, the systems and techniques described herein can be implemented on an operation detection device, the message listener selection device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the message listener selection device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0131] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, 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: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0132] A computing system may include clients and servers. The clients and servers are generally remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within a cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS (Virtual Private Server) services.

[0133] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0134] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A message listener selection method, characterized in that: The method comprises: In response to a database table change event occurring in the database, metadata of the database table change event is acquired; the metadata includes at least one of the following: an event name, a timestamp, and an operating user; Determining the event importance of the database table change event according to the metadata; Determining the event type of the database table change event according to the event name; A message listener corresponding to the database table change event is determined according to the event importance and the event type.

2. The method according to claim 1, characterized in that The determining, based on the event importance and the event type, a message listener corresponding to the database table change event includes: Obtaining the number of times the event type of the database table change event is triggered within a preset time window, and calculating the trigger frequency of the event type; When the importance of the event is greater than or equal to the important event threshold, and the trigger frequency is greater than or equal to the frequency threshold, selecting a resident type message listener; When the importance of the event is less than the important event threshold, or the trigger frequency is less than the frequency threshold, the on-demand call type message listener is selected.

3. The method according to claim 1, characterized in that Determining the event type of the database table change event according to the event name includes: Matching the event name with each regular expression in a regular expression matching rule set to obtain a matching result; the regular expression matching rule set includes at least one regular expression and an event type corresponding to the regular expression; The event type of the database table change event is determined according to the matching result.

4. The method according to claim 1, wherein The database table change event occurs in the database, and further includes: Get the database log file; Extracting the header field of each log event in the log file according to the log file to obtain the header field of each log event; The header field is matched with a database table change event comparison library to detect whether a database table change event occurs in the database.

5. The method according to claim 1, wherein The database table change event includes at least one of the following: an insert event, a delete event, and an update event.

6. The method according to claim 1, characterized in that Determining the event importance of the database table change event according to the metadata includes: The metadata is input into a pre-trained event type detection model to obtain the event importance of the database table change event.

7. The method according to claim 6, characterized in that The event type detection model is trained in the following way: Get the actual message listener corresponding to the database table change event; Obtain historical metadata of historical change events of a database table; the historical metadata includes at least one of the following: event name; event size, timestamp, and event user; Inputting the historical metadata into an event type detection model to obtain a predicted event importance of the database table change event; Determining the historical event type of the database history table change event according to the event name; Determining a prediction message listener corresponding to the database table change event according to the importance of the predicted event and the type of the historical event; According to the difference between the actual message listener and the predicted message listener, the parameters of the event type detection model are adjusted.

8. A message listener selection device, characterized in that: include: A metadata acquisition module, configured to acquire metadata of a database table change event in response to a database table change event occurring in the database; The metadata includes at least one of the following: event name, timestamp, and operation user; An importance determination module, configured to determine the importance of the database table change event based on the metadata; An event type determination module, configured to determine the event type of the database table change event according to the event name; The message listener determination module is used to determine the message listener corresponding to the database table change event according to the importance of the event and the event type.

9. A message listener selection device, characterized in that: The message listener selection device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the message listener selection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the message listener selection method according to any one of claims 1 to 7 when executed.