Multi-type message processing method and device, equipment and medium

By determining the corresponding message middleware according to the message type in the message management device, and transmitting messages and processing methods, the problem of insufficient flexibility of message middleware in the prior art is solved, and efficient and flexible message interaction and middleware expansion are achieved.

CN119718720APending Publication Date: 2025-03-28CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411784540.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, the receiving client of the message middleware cannot freely switch other message middleware, resulting in low flexibility in information interaction and the inability to extend new message middleware.

Method used

The message management device receives the pending message, determines the corresponding message middleware according to the message type, and transmits the message and processing methods to the message middleware, so as to forward messages of different message types to different message middleware.

Benefits of technology

It improves the flexibility of message interaction and the efficiency of message processing between different systems, and increases the scalability of message middleware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718720A_ABST
    Figure CN119718720A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a multi-type message processing method and device, equipment and a medium, which are used for improving the flexibility of message interaction between different systems. The method comprises the following steps: receiving a to-be-processed message by message management equipment; wherein the to-be-processed message comprises event type information and message type information. And the message management equipment determines the event type of the to-be-processed message, and determines a message processing mode corresponding to the to-be-processed message according to a preset corresponding relationship between the event type and the message processing mode. And the message management device determines the message type of the to-be-processed message, and determines the message middleware corresponding to the to-be-processed message according to the corresponding relationship between the preset message type and the message middleware. And the message management equipment sends the to-be-processed message and the message processing mode to the message middleware. Wherein the message middleware is used for processing the to-be-processed message according to the message processing mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment and medium for processing multiple types of messages. Background Art

[0002] With the continuous development of computer technology, more and more enterprises, institutions, government agencies and other institutions are processing user business through business systems. In order to enable business systems to handle more types of business, there are usually multiple subsystems developed based on different technical solutions in large business systems. Among them, different subsystems can realize information exchange through messages.

[0003] In the prior art, a specific message middleware receiving client is usually deployed to enable different subsystems to interact through the message middleware. However, this method can only interact according to the set message middleware, and cannot freely switch to other message middleware, resulting in low flexibility in information interaction, which needs to be improved. Summary of the invention

[0004] Embodiments of the present application provide a method, apparatus, device, and medium for processing multiple types of messages, which are used to improve the flexibility of message interaction between different systems.

[0005] In the first aspect, the present application provides a method for processing multiple types of messages, which is applied to a message management device, the message management device is connected to multiple business systems, and the message management device is used to forward pending messages to multiple business systems. The method includes: the message management device receives the pending message. Among them, the pending message includes event type information and message type information. The message management device determines the event type of the pending message, and determines the message processing method corresponding to the pending message according to the preset correspondence between the event type and the message processing method. And, the message management device determines the message type of the pending message, and determines the message middleware corresponding to the pending message according to the preset correspondence between the message type and the message middleware. The message management device transmits the pending message and the message processing method to the message middleware. Among them, the message middleware is used to process the pending message according to the message processing method.

[0006] By adopting this method, after receiving a message to be processed, the message management device can determine the message middleware corresponding to the message to be processed according to the message type of the message to be processed, and transmit the message to be processed to the corresponding message middleware, which processes the message, thereby forwarding messages of different message types to different message middlewares, thereby improving the flexibility of message interaction. At the same time, the message management device can determine the message processing method corresponding to the message to be processed according to the event type of the message to be processed, and send the message processing method to the message middleware corresponding to the message to be processed, so that the message middleware processes the message to be processed according to the message processing method, thereby improving the efficiency of message processing.

[0007] In a possible embodiment, the event type includes a system startup type and a system destruction type.

[0008] In a possible embodiment, when the event type is a system startup type, the message processing method includes starting a consumer thread corresponding to the message middleware, and the consumer thread is used to receive and process messages in the consumer middleware. When the event type is a system destruction type, the message processing method includes closing the consumer thread corresponding to the message middleware.

[0009] In a possible embodiment, the opening of the consumer threads corresponding to the message middleware includes opening the consumer threads one by one based on the priorities of the consumer threads. The closing of the consumer threads corresponding to the message middleware includes closing the consumer threads one by one based on the priorities of the consumer threads.

[0010] In a possible embodiment, the message middleware is preset according to business requirements, and the message middleware includes Kafka message middleware and MQ message middleware.

[0011] In the second aspect, the present application provides a device for processing multiple types of messages, which is applied to a message management device, which is connected to multiple business systems, and the message management device is used to forward pending messages to multiple business systems. The device includes: the device includes: a communication module, which is used to receive pending messages, and the pending messages include event type information and message type information. A processing module is used to determine the event type of the pending message, and determine the message processing method corresponding to the pending message according to the correspondence between the preset event type and the message processing method. And, the processing module is also used to determine the message type of the pending message, and determine the message middleware corresponding to the pending message according to the correspondence between the preset message type and the message middleware. The communication module is also used to send the pending message and the message processing method to the message middleware, and the message middleware is used to process the pending message according to the message processing method.

[0012] In a possible embodiment, the event type includes a system startup type and a system destruction type.

[0013] In a possible embodiment, when the event type is a system startup type, the message processing method includes starting a consumer thread corresponding to the message middleware, and the consumer thread is used to receive and process messages in the consumer middleware. When the event type is a system destruction type, the message processing method includes closing the consumer thread corresponding to the message middleware.

[0014] In a possible embodiment, starting the consumer thread corresponding to the message middleware includes starting the consumer threads one by one based on the priorities of the consumer threads.

[0015] Closing the consumer threads corresponding to the message middleware includes closing the consumer threads one by one based on the priorities of the consumer threads.

[0016] In a possible embodiment, the message middleware is preset according to business requirements, and the message middleware includes Kafka message middleware and MQ message middleware.

[0017] In a third aspect, the present application provides an electronic device, including:

[0018] A memory for storing program instructions;

[0019] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.

[0020] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.

[0021] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.

[0022] The technical effects brought about by the second to fifth aspects and any one of their designs can refer to the technical effects brought about by the corresponding designs in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A schematic diagram of the structure of a multi-type message processing system provided in an embodiment of the present application;

[0024] Figure 2A flowchart of a method for processing multiple types of messages provided in an embodiment of the present application;

[0025] Figure 3 A flowchart of another method for processing multiple types of messages provided in an embodiment of the present application;

[0026] Figure 4 A schematic diagram of the structure of a device for processing multiple types of messages provided in an embodiment of the present application;

[0027] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0029] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0030] In the technical solution of this application, the collection, dissemination, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0031] Before introducing the method for processing multiple types of messages provided in the embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.

[0032] In order to enable the business system to handle more types of business, there are usually multiple subsystems developed based on different technical solutions in a large business system. Different subsystems in a large business system can exchange information through messages.

[0033] In the prior art, a specific message middleware receiving client is usually deployed to enable different subsystems to interact through the message middleware. This method can interact according to the set message middleware. For example, the producer forwards the produced message to the corresponding message queue according to the rules, and then the consumer simply pulls and consumes it.

[0034] However, when faced with various complex businesses and complex service call relationships, this method cannot freely switch to other message middleware, resulting in low flexibility in information interaction and inability to expand new message middleware, which needs to be improved.

[0035] In order to solve the above-mentioned defects, the embodiments of the present application provide a method, apparatus, device and medium for processing multiple types of messages, which are used to improve the flexibility of message interaction between different systems and increase the scalability of message middleware.

[0036] Figure 1 A schematic diagram of the structure of a multi-type message processing system provided in an embodiment of the present application. Figure 1 As shown, in the embodiment of the present application, the message management device is connected to multiple message middlewares, and the message management device is also connected to multiple message producers. Among them, the message management device is used to forward pending messages to multiple message middlewares. The message producer is used to produce pending messages. The message middleware is used to process pending messages. For example, the message middleware can process pending messages and forward the processed messages to the corresponding business system.

[0037] In the present application, the method adopted includes: a message management device receives a message to be processed. The message to be processed includes event type information and message type information. The message management device determines the event type of the message to be processed, and determines the message processing method corresponding to the message to be processed based on the correspondence between the preset event type and the message processing method. In addition, the message management device determines the message type of the message to be processed, and determines the message middleware corresponding to the message to be processed based on the correspondence between the preset message type and the message middleware. The message management device transmits the message to be processed and the message processing method to the message middleware. The message middleware is used to process the message to be processed according to the message processing method.

[0038] By adopting this method, after receiving a message to be processed, the message management device can determine the message middleware corresponding to the message to be processed according to the message type of the message to be processed, and transmit the message to be processed to the corresponding message middleware, which processes the message, thereby forwarding messages of different message types to different message middlewares, thereby improving the flexibility of message interaction. At the same time, the message management device can determine the message processing method corresponding to the message to be processed according to the event type of the message to be processed, and send the message processing method to the message middleware corresponding to the message to be processed, so that the message middleware processes the message to be processed according to the message processing method, thereby improving the efficiency of message processing.

[0039] In addition, the subject used to execute the method described in the present application may be a server, or may be a processing device in a computer system used to execute the method described in the present application, such as a processor or a processing module, etc., which is not specifically limited in the present application.

[0040] Figure 2 A flowchart of a method for processing multiple types of messages provided by an embodiment of the present invention. Taking a message management device as an example, the process may include the following steps:

[0041] S201, a message management device receives a message to be processed, wherein the message to be processed includes event type information and message type information.

[0042] In one or more embodiments, the message management device may receive a to-be-processed message from a message producer, and correspondingly, the message producer sends the to-be-processed message to the message management device.

[0043] Optionally, the message producer may be a terminal device. That is, the message to be processed may be generated by the terminal device and sent to the message management device. Alternatively, the message producer may be one or more business systems among multiple business systems connected to the message management device. That is, when transmitting messages between multiple business systems, the message to be processed may be forwarded to the message manager, and the message manager forwards the message to be processed to the target business system.

[0044] In one or more embodiments, the message to be processed may include information indicating the event type of the message, and may also include information indicating the message type of the message. For example, the header of the message to be processed may carry identification information of the event type and / or the message type. Accordingly, after receiving the message to be processed, the message management device may obtain the identification information of the event type and / or the message type of the message to be processed through the header of the message to be processed.

[0045] Optionally, the message types of the to-be-processed messages generated by the same type of message producers may be the same. Different types of message producers may be connected to the message management device through different interfaces. Accordingly, the message management device may determine the message type of the to-be-processed message based on the interface for receiving the to-be-processed message.

[0046] S202: The message management device determines a message processing method corresponding to the message to be processed according to a preset correspondence between an event type and a message processing method.

[0047] In one or more embodiments, the message management device may determine the event type of the message to be processed based on the event type information included in the message to be processed. For example, the message management device pre-stores the association relationship between the event type information and the event type, and the message management device may determine the event type corresponding to the message to be processed based on the association relationship between the event type information and the event type. Alternatively, the event type information may directly indicate the event type of the message to be processed. Accordingly, the message management device may determine the event type of the message to be processed based on the event type information of the message to be processed.

[0048] In one or more embodiments, the correspondence between event types and message processing methods may be pre-set according to business requirements.

[0049] Optionally, the event type may include a system startup type and a system destruction type.

[0050] When the event type is a system startup type, the message processing method includes starting a consumer thread corresponding to the message middleware, wherein the consumer thread is used to receive and process messages in the consumer middleware.

[0051] When the event type is the system destruction type, the message processing method includes closing the consumer thread corresponding to the message middleware.

[0052] S203: The message management device determines the message middleware corresponding to the message to be processed according to the preset correspondence between the message type and the message middleware.

[0053] In one or more embodiments, the message management device may determine the message type of the message to be processed according to the message type information included in the message to be processed.

[0054] Exemplarily, the message management device pre-stores the association relationship between the message type information and the message type, and the message management device can determine the message type corresponding to the to-be-processed message based on the association relationship between the message type information and the message type.

[0055] For example, the message type information may refer to the identifier of the message type. Table 1 is a correspondence table between a message type and a message type identifier provided in an embodiment of the present application. As shown in Table 1, different message type identifiers correspond to different message types. The message management device may determine the corresponding message type according to the identifier of the message type by looking up a table.

[0056] Identifier of the message type Message Type Message Middleware 01 Message Type 1 Message Middleware 1 02 Message Type 2 Message Middleware 2 03 Message Type 3 Message Middleware 3 04 Message Type 4 Message Middleware 4 05 Message Type 5 Message Middleware 5

[0057] Table 1

[0058] In one or more embodiments, the message middleware may be pre-set according to business requirements. The message middleware includes Kafka message middleware and MQ message middleware. Different message types correspond to different message middleware.

[0059] Exemplarily, the message management device may determine the corresponding message middleware according to the message type of the message to be processed based on the correspondence between the preset message type and the message middleware.

[0060] For example, still taking Table 1 as an example, the message management device can determine the corresponding message middleware according to the message type by looking up the table.

[0061] In one or more embodiments, when the correspondence between the message type and the message middleware does not include the target message type, the correspondence between the message type and the message middleware can be added to the correspondence between the message type and the message middleware according to business requirements. Alternatively, the correspondence between the message type and the message middleware can be modified according to business requirements, so that the modified correspondence between the message type and the message middleware meets the business requirements.

[0062] It is understandable that the correspondence between message types and message middleware is increased and / or modified according to business requirements, so that the correspondence is extensible and the rationality of the correspondence is ensured.

[0063] S204: The message management device sends the message to be processed and the message processing method to the message middleware.

[0064] In one or more embodiments, after determining the message middleware corresponding to the to-be-processed message, the message management device may send the to-be-processed message and the message processing method to the message middleware. Correspondingly, the message middleware receives the to-be-processed message and the message processing method from the message management device. The message middleware may process the to-be-processed message based on the message processing method.

[0065] Exemplarily, when the message processing method is to start a consumer thread corresponding to the message middleware, the message middleware can start an independent consumer thread for each topic in the message middleware by calling the consumer factory. The consumer thread can receive the pending message corresponding to the message middleware and start a thread pool to process the pending message.

[0066] When the message processing method is to close the consumer thread corresponding to the message middleware, the message middleware can close the consumer threads and the thread pool of the consumer threads in the message middleware one by one by calling the consumer factory.

[0067] It can be understood that the message middleware can create or destroy message consumption threads for the message middleware according to the message processing method, thereby improving the efficiency and flexibility of the message middleware in processing messages.

[0068] In addition, after the message middleware processes the pending message, it can also send the processed message to the business system corresponding to the message middleware. Among them, the message middleware and the business system can be in a one-to-one correspondence, that is, different business systems correspond to different message middleware. Alternatively, the message middleware can correspond to multiple business systems of the same type.

[0069] The following is a detailed introduction to the method for processing multiple types of messages provided by the present application based on Example 1. In Example 1, a message management device includes a message receiving initiator and a message listener, event types include system shutdown and system startup, and message middleware includes Kafka message middleware and MQ message middleware.

[0070] The specific contents of Example 1 are as follows:

[0071] Figure 3 A flowchart of a method for processing multiple message types provided in an embodiment of the present application. The process may include the following steps:

[0072] S301, a message receiving initiator receives a message to be processed.

[0073] S302: The message receiving initiator determines the event type of the message to be processed according to the configured event type.

[0074] When the event type of the message to be processed is system startup, step S303 is executed; when the event type of the message to be processed is system shutdown, step S304 is executed.

[0075] S303: The message receiving initiator determines the message type of the system startup message according to the configured message type.

[0076] When the message type of the system startup message is Kafka type, execute step S305; when the message type of the system startup message is MQ type, execute step S306.

[0077] S304: The message receiving initiator determines the message type of the system shutdown message according to the configured message type.

[0078] When the message type of the system startup message is Kafka type, execute step S307; when the message type of the system startup message is MQ type, execute step S308.

[0079] S305, the Kafka message listener calls the Kafka consumer factory to open an independent consumer thread for each topic to process the pending messages.

[0080] The Kafka message listener calls the Kafka consumer factory to start an independent consumer thread for each topic. The consumer thread receives the pending messages and starts the thread pool to process the corresponding messages.

[0081] S306, the MQ message listener calls the MQ consumer factory to open an independent consumer thread for each topic to process the pending messages.

[0082] The MQ message listener calls the MQ consumer factory to start an independent consumer thread for each topic. The consumer thread receives the pending message and starts the thread pool to process the corresponding message.

[0083] S307, the Kafka message listener calls the Kafka consumer factory to close the consumer thread and thread pool.

[0084] Among them, the Kafka consumer factory closes the consumer thread and the corresponding thread pool.

[0085] S308, the MQ message listener calls the MQ consumer factory to close the consumer thread.

[0086] Based on the above content and the same concept, the present application provides a device for processing multiple types of messages. Figure 4 As shown, the device includes a communication module 401 and a processing module 402 .

[0087] The communication module 401 is used to receive a message to be processed, and the message to be processed includes event type information and message type information. The processing module 402 is used to determine the event type of the message to be processed, and determine the message processing method corresponding to the message to be processed according to the correspondence between the preset event type and the message processing method. And, the processing module 402 is also used to determine the message type of the message to be processed, and determine the message middleware corresponding to the message to be processed according to the correspondence between the preset message type and the message middleware. The communication module 401 is also used to send the message to be processed and the message processing method to the message middleware, and the message middleware is used to process the message to be processed according to the message processing method.

[0088] In a possible embodiment, the event type includes a system startup type and a system destruction type.

[0089] In a possible embodiment, when the event type is a system startup type, the message processing method includes starting a consumer thread corresponding to the message middleware, and the consumer thread is used to receive and process messages in the consumer middleware. When the event type is a system destruction type, the message processing method includes closing the consumer thread corresponding to the message middleware.

[0090] In a possible embodiment, starting the consumer thread corresponding to the message middleware includes starting the consumer threads one by one based on the priorities of the consumer threads.

[0091] Closing the consumer threads corresponding to the message middleware includes closing the consumer threads one by one based on the priorities of the consumer threads.

[0092] In a possible embodiment, the message middleware is preset according to business requirements, and the message middleware includes Kafka message middleware and MQ message middleware.

[0093] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown.

[0094] The electronic device in the embodiment of the present application may include a processor 501. The processor 501 is the control center of the device, and various interfaces and lines can be used to connect various parts of the device, by running or executing instructions stored in the memory 503 and calling data stored in the memory 503. Optionally, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 503 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0095] The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The method steps disclosed in the embodiments of the present application may be directly executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0096] In the embodiment of the present application, the memory 503 stores instructions that can be executed by at least one processor 501. The at least one processor 501 can be used to execute the method steps disclosed in the embodiment of the present application by executing the instructions stored in the memory 503.

[0097] The memory 503 is a non-volatile computer-readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 503 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 503 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 503 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0098] In the embodiment of the present application, the device may further include a communication interface 502 , through which the electronic device may transmit data.

[0099] Optional, can be Figure 5 The processor 501 (or the processor 501 and the communication interface 502) implements Figure 4 The processing module 402 and / or the communication module 401 shown, that is, the actions of the processing module 402 and / or the communication module 401 can be executed by the processor 501 (or the processor 501 and the communication interface 502).

[0100] Based on the same inventive concept, the embodiment of the present application also provides a computer-readable storage medium, which may store instructions. When the instructions are executed on a computer, the computer executes the operation steps provided in the above method embodiment. The computer-readable storage medium may be Figure 5 The memory 503 is shown.

[0101] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0102] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0103] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0105] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for processing multiple types of messages, characterized in that: Applied to a message management device, the message management device is connected to multiple message middlewares, and the message management device is used to forward pending messages to the multiple message middlewares. The method includes: receiving a message to be processed, wherein the message to be processed includes event type information and message type information; Determining the event type of the message to be processed, and determining the message processing method corresponding to the message to be processed according to a preset correspondence between the event type and the message processing method; and, Determine the message type of the message to be processed, and determine the message middleware corresponding to the message to be processed according to the correspondence between the preset message type and the message middleware; The message to be processed and the message processing method are sent to the message middleware, and the message middleware is used to process the message to be processed according to the message processing method.

2. The method according to claim 1, characterized in that The event types include a system startup type and a system destruction type.

3. The method according to claim 2, characterized in that When the event type is a system startup type, the message processing method includes starting a consumer thread corresponding to the message middleware, and the consumer thread is used to receive and process messages in the consumer middleware; When the event type is a system destruction type, the message processing method includes closing a consumer thread corresponding to the message middleware.

4. The method according to claim 3, characterized in that The opening of the consumer threads corresponding to the message middleware includes opening the consumer threads one by one based on the priorities of the consumer threads; The closing of the consumer threads corresponding to the message middleware includes closing the consumer threads one by one based on the priorities of the consumer threads.

5. The method according to any one of claims 1 to 4, characterized in that: The message middleware is pre-set according to business requirements, and the message middleware includes Kafka message middleware and MQ message middleware.

6. A device for processing multiple types of messages, characterized in that: Applied to a message management device, the message management device is connected to multiple message middlewares, and the message management device is used to forward pending messages to the multiple message middlewares. The device includes: A communication module, used for receiving a message to be processed, wherein the message to be processed includes event type information and message type information; a processing module, used to determine the event type of the message to be processed, and determine the message processing method corresponding to the message to be processed according to a preset correspondence between the event type and the message processing method; and The processing module is further used to determine the message type of the message to be processed, and determine the message middleware corresponding to the message to be processed according to the correspondence between the preset message type and the message middleware; The communication module is further used to send the message to be processed and the message processing method to the message middleware, and the message middleware is used to process the message to be processed according to the message processing method.

7. The device according to claim 6, characterized in that The event types include a system startup type and a system destruction type.

8. The device according to claim 7, characterized in that When the event type is a system startup type, the message processing method includes starting a consumer thread corresponding to the message middleware, and the consumer thread is used to receive and process messages in the consumer middleware; When the event type is a system destruction type, the message processing method includes closing a consumer thread corresponding to the message middleware.

9. The device according to claim 8, characterized in that The opening of the consumer threads corresponding to the message middleware includes opening the consumer threads one by one based on the priorities of the consumer threads; The closing of the consumer threads corresponding to the message middleware includes closing the consumer threads one by one based on the priorities of the consumer threads.

10. The device according to any one of claims 6 to 9, characterized in that: The message middleware is pre-set according to business requirements, and the message middleware includes Kafka message middleware and MQ message middleware.

11. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods of claims 1-5 according to the obtained program instructions.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 5.

13. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 5.