Message consumption method and device, electronic equipment and storage medium

By determining to-do messages in the first-level message queue and classifying and configuring them according to producers and consumers, the problem of poor collection and distribution of to-do messages in multi-service systems is solved, efficient message distribution and consumption is achieved, and the system's concurrency processing capabilities and efficiency are improved.

CN119996365APending Publication Date: 2025-05-13CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202311511786.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The collection and distribution of to-do messages generated by multi-service systems in the prior art is poor.

Method used

By determining to-do messages in the primary message queue and classifying and configuring them according to producers and consumers, if there is no target producer in the secondary message queue, the target producers and consumers will be configured in the secondary message queue to achieve efficient distribution and consumption of messages.

Benefits of technology

It improves the efficiency of collecting and distributing to-do messages generated by multi-service systems, realizes business isolation and synchronization of message processing results, and reduces the burden on first-level message queues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996365A_ABST
    Figure CN119996365A_ABST
Patent Text Reader

Abstract

The invention provides a message consumption method and device, electronic equipment and a storage medium. The method comprises the following steps: determining messages to be handled in a first-level message queue; according to the first producer in the first-level message queue, classifying the to-be-handled messages, and determining to-be-handled link messages in the to-be-handled messages; according to the first producer in the first-level message queue, classifying the to-be-handled messages, and determining to-be-handled link messages in the to-be-handled messages; determining a target producer of the link message to be handled according to the first consumer in the first-level message queue; if the target producer does not exist in the secondary message queue, configuring the target producer and the target consumer in the secondary message queue; and the first consumer in the first-level message queue sends the link message to be handled to the second-level message queue, so that the target producer and the target consumer in the second-level message queue perform message consumption on the link message to be handled. According to the method provided by the invention, the collection and distribution efficiency of the to-do messages generated by the multi-service system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of message consumption, and in particular to a message consumption method, device, electronic device and storage medium. Background Art

[0002] Message consumption refers to the process of consumers receiving messages from business systems and processing them. Message consumption is carried out in a group mode. A consumer group can contain multiple consumers, and each consumer group can subscribe to multiple topics.

[0003] At present, the existing technology mainly uses message queues to achieve unified collection and distribution of pending messages generated by multiple business systems. There are two message consumption modes: cluster consumption and broadcast consumption. In the cluster consumption mode, a consumer cluster jointly consumes multiple queues of a topic. In the broadcast consumption mode, the business system sends messages to each consumer in the consumer group for consumption.

[0004] However, the existing message consumption method has the problem of poor collection and distribution effect of pending messages generated by multiple business systems. Summary of the invention

[0005] The present application provides a message consumption method, device, electronic device and storage medium to solve the problem of poor collection and distribution effect of to-do messages generated by a multi-business system.

[0006] In a first aspect, the present application provides a message consumption method, comprising:

[0007] Determine the pending messages in the primary message queue;

[0008] According to the first producer in the first-level message queue, the to-do messages are classified and the to-do link messages in the to-do messages are determined;

[0009] Determine the target producer of the pending link message based on the first consumer in the primary message queue;

[0010] If the target producer does not exist in the second producer in the secondary message queue, the target producer and the target consumer corresponding to the target producer are configured in the secondary message queue, wherein each second producer is independent of each other;

[0011] The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target producer and target consumer in the secondary message queue consume the to-be-done link message.

[0012] In the embodiment of the present application, after determining the pending messages in the primary message queue, the method further includes:

[0013] According to the first producer in the first-level message queue, the pending messages are classified and the notification information messages in the pending messages are determined;

[0014] The notification information message in the to-do message is sent to the first consumer, so that the first consumer consumes the notification information message.

[0015] In an embodiment of the present application, determining the target producer of the to-do link message according to the first consumer in the primary message queue includes:

[0016] The first consumer in the first-level message queue consumes the to-do link message and determines the message content of the to-do link message;

[0017] Determine the message type of the to-do link message according to the message content of the to-do link message. The message types of the to-do link message include message consumption system type, enterprise OA type, third-party office software type, mobile phone text message type, voice type, and email system type.

[0018] According to the type of the to-do link message, determine the target producer of the to-do link message.

[0019] In the embodiment of the present application, after determining the target producer of the to-do link message according to the first consumer in the primary message queue, the method further includes:

[0020] If there is a target producer in the secondary message queue, determine the target second producer and the target second consumer corresponding to the target second producer in the second producer in the secondary message queue;

[0021] The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target second producer and the target second consumer in the secondary message queue consume the to-be-done link message.

[0022] In an embodiment of the present application, the first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target second producer and the target second consumer in the secondary message queue consume the to-be-done link message, including:

[0023] The first consumer in the primary message queue sends the to-do link message to the target second producer in the secondary message queue;

[0024] The target second producer in the secondary message queue sends the to-be-done link message to the target second consumer;

[0025] The target second consumer determines the second target terminal service according to the to-do link message;

[0026] According to the second target terminal service, the to-do link message is consumed.

[0027] In an embodiment of the present application, the first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target producer and the target consumer in the secondary message queue consume the to-be-done link message, including:

[0028] The first consumer in the primary message queue sends the pending link message to the target producer in the secondary message queue;

[0029] The target producer in the secondary message queue sends the pending link message to the target consumer;

[0030] The target consumer determines the first target terminal service according to the to-do link message;

[0031] According to the first target terminal service, the to-do link message is consumed.

[0032] In an embodiment of the present application, after the first consumer in the primary message queue sends the to-do link message to the secondary message queue so that the target producer and the target consumer in the secondary message queue consume the to-do link message, the process further includes:

[0033] Determine the message consumption status of the to-do link message;

[0034] If the message consumption status of the to-do link message indicates that the to-do link message has been processed, the secondary message queue sends message feedback information to the primary message queue;

[0035] The first-level message queue processes pending messages based on message feedback information.

[0036] In the embodiment of the present application, when there are more than two to-do link messages, the following is also included:

[0037] According to the first consumer in the primary message queue, determine the target producer corresponding to each to-do link message;

[0038] According to the target producer corresponding to each to-do link message, determine the target second producer, target second consumer, configured target producer and configured target consumer in the secondary message queue;

[0039] The first consumer in the primary message queue pushes different to-do link messages to the secondary message queue, so that the target second producer, the target second consumer, the configured target producer and the configured target consumer consume each to-do link message.

[0040] In a second aspect, the present application provides a message consumption device, comprising:

[0041] A first determination module, used to determine pending messages in the primary message queue;

[0042] A second determination module is used to classify the to-do messages according to the first producer in the primary message queue, and determine the to-do link messages in the to-do messages;

[0043] A third determination module is used to determine the target producer of the to-be-done link message according to the first consumer in the primary message queue;

[0044] A configuration module, configured to configure the target producer and the target consumer corresponding to the target producer in the secondary message queue if the target producer does not exist in the second producer in the secondary message queue, wherein each second producer is independent of each other;

[0045] The sending module is used for the first consumer in the primary message queue to send the to-be-done link message to the secondary message queue, so that the target producer and target consumer in the secondary message queue consume the to-be-done link message.

[0046] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0047] Memory stores computer-executable instructions;

[0048] The processor executes the computer execution instructions stored in the memory to implement the data reporting and display method of the embodiment of the present application.

[0049] In a fourth aspect, a computer-readable storage medium stores computer execution instructions, which are used to implement the message consumption method of an embodiment of the present application when executed by a processor.

[0050] The message consumption method, device, electronic device and storage medium provided by the present application determine the to-do messages in the primary message queue; classify the to-do messages according to the first producer in the primary message queue to determine the to-do link messages in the to-do messages; determine the target producer of the to-do link messages according to the first consumer in the primary message queue; if the target producer does not exist in the second producer in the secondary message queue, configure the target producer and the target consumer corresponding to the target producer in the secondary message queue, wherein each second producer is independent of each other; the first consumer in the primary message queue sends the to-do link message to the secondary message queue, so that the target producer and the target consumer in the secondary message queue The means for consumers to consume to-do link messages enables the first-level message queue to concurrently and efficiently process notifications and to-do links, and then classify the messages and distribute them to the next-level message queue. Only messages are processed in the first-level message queue. In some high-concurrency situations, the burden is reduced and the usage efficiency is improved. In the secondary message queue, different types of messages are delivered to corresponding consumers for consumption. Each consumer can handle the business of multiple terminals including web, mobile and PC. At this time, consumers can only focus on their own business logic, realize business isolation, and at the same time ensure the synchronization of message processing results, so as to improve the collection and distribution efficiency of to-do messages generated by multiple business systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0052] Figure 1 A schematic diagram of a scenario of a message consumption method provided in an embodiment of the present application;

[0053] Figure 2 A flow chart of a message consumption method provided in an embodiment of the present application;

[0054] Figure 3 A flowchart of another message consumption method provided in an embodiment of the present application;

[0055] Figure 4 A schematic diagram of the structure of a message consumption device provided in an embodiment of the present application;

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

[0057] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0058] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0059] In the prior art, when consuming messages, it is generally done in batches. After receiving the message, the consumer puts the message into a buffer. When the number of messages in the buffer reaches a certain level, the message is processed in batches. However, by consuming messages in this way, it is impossible to achieve concurrent and efficient processing of business messages, nor can it achieve the effect of business isolation.

[0060] The embodiment of the present application can process high concurrency based on the first-level message queue. Therefore, in order to reduce the burden of the first-level message queue, the first-level message queue is set to only process the message type, and then each category of producers is set through the second-level message queue for processing. Thus, the scalability of the system is improved through the design of multi-level message queues, and the message processing speed is improved.

[0061] Embodiments of the present application provide a message consumption method, device, electronic device, and storage medium.

[0062] Figure 1 A scenario diagram of a message consumption method provided in an embodiment of the present application. Figure 1As shown, the execution subject of the message consumption method can be a server. The server can be a mobile phone, tablet, computer and other devices. This embodiment does not impose any special restrictions on the implementation method of the execution subject, as long as the execution subject can determine the to-do messages in the primary message queue; classify the to-do messages according to the first producer in the primary message queue, and determine the to-do link messages in the to-do messages; determine the target producer of the to-do link messages according to the first consumer in the primary message queue; if there is no target producer in the second producer in the secondary message queue, configure the target producer and the target consumer corresponding to the target producer in the secondary message queue, wherein each second producer is independent of each other; the first consumer in the primary message queue sends the to-do link message to the secondary message queue, so that the target producer and target consumer in the secondary message queue can consume the to-do link message.

[0063] Message consumption refers to the process of consumers receiving messages from business systems and processing them. Message consumption can be carried out in a group mode. A consumer group can contain multiple consumers, and each consumer group can subscribe to multiple topics.

[0064] Figure 2 The flowchart of the message consumption method provided in the embodiment of the present application is shown in FIG. The execution subject of the present method can be a server or other servers, and this embodiment is not particularly limited here. Figure 2 As shown, the method may include:

[0065] S201, determining pending messages in the primary message queue.

[0066] Among them, the message queue can refer to a basic data structure for storing messages waiting to be processed. In a multi-business system, the message queue can be used to implement functions such as asynchronous communication and decoupling. Among them, in the embodiment of the present application, the first-level message queue does not process specific business logic in consumption, avoiding slow or even disordered message status synchronization due to overly complex logic.

[0067] A pending message may refer to a message that needs to be processed but has not yet been processed. The pending message may be stored in a first message queue, waiting for processing and consumption by a consumer. In an embodiment of the present application, the pending message may be a message generated by a business system.

[0068] In the embodiment of the present application, after determining the pending messages in the primary message queue, the method may further include:

[0069] According to the first producer in the first-level message queue, the pending messages are classified and the notification information messages in the pending messages are determined;

[0070] The notification information message in the to-do message is sent to the first consumer, so that the first consumer consumes the notification information message.

[0071] The first producer may refer to a program in the primary message queue that creates and sends messages to other queues, and the first consumer may refer to a program that obtains and processes messages from the primary message queue.

[0072] Notification information messages may refer to relevant information generated by an application or manually set, which needs to remind the user. It may include pending tasks, events or reminders, which are used to remind the user to handle or pay attention to related content in a timely manner. The form of notification information messages may include text messages, push notifications, etc.

[0073] According to the first producer in the primary message queue, the method for classifying the to-do messages may include first determining the producer of each to-do message, and then classifying the to-do messages according to business requirements and classification standards. For example, the to-do messages may be classified according to the producer's name, department, message type, and other attributes. In the embodiment of the present application, the classification of to-do messages may include notification information messages and to-do connection messages.

[0074] S202. Classify the to-do messages according to the first producer in the primary message queue, and determine the to-do link messages in the to-do messages.

[0075] Among them, the to-do link message may refer to a message containing a link or URL (Uniform Resource Identifier) ​​address to be processed. These links may point to related web pages, documents, applications or other resources, which can help users quickly find the required information or resources, thereby improving work efficiency and task completion speed.

[0076] S203. Determine the target producer of the to-be-done link message according to the first consumer in the primary message queue.

[0077] Among them, according to the first consumer in the primary message queue, the method for determining the target producer of the to-do link message may include checking the message identifier in the to-do link message, checking the message metadata in the to-do link message, querying the database, etc.

[0078] The target producer can refer to the producer that meets the needs of the to-do link message type.

[0079] Among them, in the embodiment of the present application, according to the first consumer in the primary message queue, the method for determining the target producer of the to-do link message may include:

[0080] The first consumer in the first-level message queue consumes the to-do link message and determines the message content of the to-do link message;

[0081] Determine the message type of the to-do link message according to the message content of the to-do link message. The message types of the to-do link message include message consumption system type, enterprise OA type, third-party office software type, mobile phone text message type, voice type, and email system type.

[0082] According to the type of the to-do link message, determine the target producer of the to-do link message.

[0083] Among them, the first consumer in the first-level message queue consumes the to-do link message, and the method for determining the message content of the to-do link message may include first receiving the to-do link message, then parsing the message to extract data such as the link or URL address, and determining the message content based on the data.

[0084] The method for determining the message type of a to-do link message based on the message content of the to-do link message may include judging the type of the message based on the characteristics and context of the message content. For example, if the message contains data or operation instructions related to a specific business, it may belong to the enterprise OA type or the third-party office software type; the type of the message may be judged based on the identification of the message format. Different types of messages usually have specific formats and structures. For example, mobile phone text message type messages usually contain text message numbers and short information content, and mail system type messages have the format and characteristics of mails, such as recipients, subjects, and text.

[0085] In the embodiment of the present application, after determining the target producer of the to-do link message according to the first consumer in the primary message queue, the method may further include:

[0086] If there is a target producer in the secondary message queue, determine the target second producer and the target second consumer corresponding to the target second producer in the second producer in the secondary message queue;

[0087] The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target second producer and the target second consumer in the secondary message queue consume the to-be-done link message.

[0088] The secondary message queue may refer to a message queue that delivers different types of messages received in the first message queue to corresponding consumers for consumption.

[0089] The target second producer may refer to a producer in the secondary message queue that meets the requirements of the to-be-linked message type.

[0090] The method for the first consumer in the primary message queue to send the to-do link message to the secondary message queue may include the first consumer sending the to-do link message to the secondary message queue using an appropriate protocol and format, such as the Advanced Message Queuing Protocol, the Simple Text Messaging Protocol, or the Machine-to-Machine Transfer Protocol.

[0091] Among them, in the embodiment of the present application, the method in which the first consumer in the primary message queue sends the to-do link message to the secondary message queue so that the target second producer and the target second consumer in the secondary message queue consume the to-do link message may include:

[0092] The first consumer in the primary message queue sends the to-do link message to the target second producer in the secondary message queue;

[0093] The target second producer in the secondary message queue sends the to-be-done link message to the target second consumer;

[0094] The target second consumer determines the second target terminal service according to the to-do link message;

[0095] According to the second target terminal service, the to-do link message is consumed.

[0096] Among them, the method for the target second consumer to determine the second target terminal service based on the to-do link message may include the target second consumer parsing the to-do link message and extracting information related to the second target terminal service. Among them, in an embodiment of the present application, the terminal service may include services of multiple terminals such as web, mobile and PC.

[0097] According to the second target terminal service, the method for consuming the to-do link message may include a user receiving the to-do link message through the second target terminal service, and then consuming the to-do link message on the second target terminal service, for example, pushing the to-do link message on the web side, and the user clicking on the to-do link message to complete the consumption.

[0098] S204: If the target producer does not exist in the second producer in the secondary message queue, the target producer and the target consumer corresponding to the target producer are configured in the secondary message queue, wherein each second producer is independent of each other.

[0099] Among them, the method of configuring the target producer and the target consumer corresponding to the target producer in the secondary message queue may include finding the corresponding code in the code library through the type of to-do link message, automatically configuring the target producer, or manually configuring using a specific configuration file or parameters.

[0100] The independence of each second producer means that no matter whether a second producer is added or deleted, other second producers will not affect each other. For example, when a new channel or terminal needs to receive messages, you only need to add a group of producers and consumers in the secondary message queue, which will not affect the existing logic. Subsequent maintenance and upgrades are also more convenient, ensuring the security and stability of the overall solution.

[0101] S205: The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target producer and target consumer in the secondary message queue consume the to-be-done link message.

[0102] Among them, in the embodiment of the present application, the method in which the first consumer in the primary message queue sends the to-be-done link message to the secondary message queue so that the target producer and the target consumer in the secondary message queue consume the to-be-done link message may include:

[0103] The first consumer in the primary message queue sends the pending link message to the target producer in the secondary message queue;

[0104] The target producer in the secondary message queue sends the pending link message to the target consumer;

[0105] The target consumer determines the first target terminal service according to the to-do link message;

[0106] According to the first target terminal service, the to-do link message is consumed.

[0107] Among them, the method for the target producer in the secondary message queue to send the to-do link message to the target consumer may include using the sending function of the message queue service, using middleware or proxy forwarding, and other methods.

[0108] In the embodiment of the present application, after the first consumer in the primary message queue sends the to-do link message to the secondary message queue so that the target producer and the target consumer in the secondary message queue consume the to-do link message, the method may further include:

[0109] Determine the message consumption status of the to-do link message;

[0110] If the message consumption status of the to-do link message indicates that the to-do link message has been processed, the secondary message queue sends message feedback information to the primary message queue;

[0111] The first-level message queue processes pending messages based on message feedback information.

[0112] Among them, the method for determining the message consumption status of the to-do link message may include reading the status in the message queue, or checking the consumption queue service through a third-party tool, etc., wherein, in an embodiment of the present application, the message consumption status may include processed and unprocessed.

[0113] The method for processing to-do messages by the first-level message queue according to the message feedback information may include deleting the processed to-do link messages by the first-level message queue to reduce memory usage.

[0114] In this embodiment of the present application, when there are more than two to-do link messages, the method may further include:

[0115] According to the first consumer in the primary message queue, determine the target producer corresponding to each to-do link message;

[0116] According to the target producer corresponding to each to-do link message, determine the target second producer, target second consumer, configured target producer and configured target consumer in the secondary message queue;

[0117] The first consumer in the primary message queue pushes different to-do link messages to the secondary message queue, so that the target second producer, the target second consumer, the configured target producer and the configured target consumer consume each to-do link message.

[0118] Among them, the method for determining the target second producer, target second consumer, configured target producer and configured target consumer in the secondary message queue according to the target producers corresponding to each to-do link message may include: when some of the target producers corresponding to each to-do link message exist in the second producer in the secondary message queue, and some do not exist in the second producer in the secondary message queue, configuring the target producer and the target consumer corresponding to the target producer in the secondary message queue, and determining the target second producer and target second consumer in the secondary message queue; when all the target producers corresponding to each to-do link message exist in the second producer in the secondary message queue, determining the target second producer and target second consumer in the secondary message queue; when all the target producers corresponding to each to-do link message do not exist in the second producer in the secondary message queue, configuring the target producer and the target consumer corresponding to the target producer in the secondary message queue.

[0119] The message consumption method provided in the embodiment of the present application can first efficiently process notifications and to-do links through the first-level message queue concurrently, and then classify the messages and distribute them to the next-level message queue. In the second-level message queue, different types of messages are respectively delivered to corresponding consumers for consumption. Each consumer can handle services of multiple terminals including web, mobile and PC. At this time, consumers can only focus on their own business logic, realize business isolation, and at the same time ensure the synchronization of message processing results, thereby achieving the effect of improving the collection and distribution efficiency of to-do messages generated by multiple business systems.

[0120] Figure 3 A flow chart of another message consumption method provided in an embodiment of the present application is as follows: Figure 3 As shown, the method includes:

[0121] S301, determining pending messages in the primary message queue.

[0122] Among them, the message queue can refer to a basic data structure used to store messages waiting to be processed. In a multi-business system, the message queue can be used to implement functions such as asynchronous communication and decoupling.

[0123] S302. Classify the to-do messages according to the first producer and the first consumer in the primary message queue, and determine the target producer of the to-do link message in the to-do messages.

[0124] The to-do link message may refer to a message containing a link or URL (Uniform Resource Identifier) ​​address to be processed, and the target producer may refer to a producer that meets the requirements of the to-do link message type.

[0125] S303: The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target producer and target consumer in the secondary message queue consume the to-be-done link message.

[0126] The target producer in the secondary message queue may refer to a producer existing in the secondary message queue itself, or may refer to a producer configured according to demand.

[0127] S304: Determine the message consumption status of the to-do link message.

[0128] Among them, the method of determining the message consumption status of the to-do link message may include reading the status in the message queue, or checking the consumption queue service through a third-party tool, etc.

[0129] S305: If the message consumption status of the to-do link message indicates that the to-do link message has not been processed, the secondary message queue sends message feedback information to the primary message queue.

[0130] The message feedback information may refer to information on the message consumption status of the to-do link message. In the embodiment of the present application, the message consumption status of the to-do link message may refer to information indicating that the message consumption status of the to-do link message is not processed.

[0131] S306. The first-level message queue processes the pending messages according to the message feedback information.

[0132] The method for processing the to-do message according to the message feedback information by the primary message queue may include repeatedly executing steps S301 to S304 until the message consumption status of the to-do link message indicates that the to-do link message has been processed.

[0133] Another message consumption method provided by an embodiment of the present application can first use a first-level message queue to concurrently and efficiently process notifications and to-do links, and then classify the messages and distribute them to the next-level message queue. In the secondary message queue, different types of messages are respectively handed over to corresponding consumers for consumption, and the message consumption status is fed back. If the processing is not successful, the message is repeated, thereby improving the processing success rate of pending messages in multi-business systems.

[0134] Figure 4 This is a schematic diagram of the structure of the message consumption device provided in the embodiment of the present application. Figure 4 As shown, the message consumption device 40 includes: a first determination module 401, a second determination module 402, a third determination module 403, a configuration module 404, and a sending module 405. Among them:

[0135] A first determining module 401 is used to determine pending messages in the primary message queue;

[0136] The second determination module 402 is used to classify the to-do messages according to the first producer in the primary message queue, and determine the to-do link messages in the to-do messages;

[0137] The third determination module 403 is used to determine the target producer of the to-be-done link message according to the first consumer in the primary message queue;

[0138] A configuration module 404 is used to configure the target producer and the target consumer corresponding to the target producer in the secondary message queue if the target producer does not exist in the second producer in the secondary message queue, wherein each second producer is independent of each other;

[0139] The sending module 405 is used for the first consumer in the primary message queue to send the to-be-done link message to the secondary message queue, so that the target producer and target consumer in the secondary message queue consume the to-be-done link message.

[0140] In the embodiment of the present application, the first determining module 401 may also be used to:

[0141] According to the first producer in the first-level message queue, the pending messages are classified and the notification information messages in the pending messages are determined;

[0142] The notification information message in the to-do message is sent to the first consumer, so that the first consumer consumes the notification information message.

[0143] In the embodiment of the present application, the third determining module 403 may also be used to:

[0144] The first consumer in the first-level message queue consumes the to-do link message and determines the message content of the to-do link message;

[0145] Determine the message type of the to-do link message according to the message content of the to-do link message. The message types of the to-do link message include message consumption system type, enterprise OA type, third-party office software type, mobile phone text message type, voice type, and email system type.

[0146] According to the type of the to-do link message, determine the target producer of the to-do link message.

[0147] In the embodiment of the present application, the third determining module 403 may also be used to:

[0148] If there is a target producer in the secondary message queue, determine the target second producer and the target second consumer corresponding to the target second producer in the second producer in the secondary message queue;

[0149] The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target second producer and the target second consumer in the secondary message queue consume the to-be-done link message.

[0150] In the embodiment of the present application, the third determining module 403 may also be used to:

[0151] The first consumer in the primary message queue sends the to-do link message to the target second producer in the secondary message queue;

[0152] The target second producer in the secondary message queue sends the to-be-done link message to the target second consumer;

[0153] The target second consumer determines the second target terminal service according to the to-do link message;

[0154] According to the second target terminal service, the to-do link message is consumed.

[0155] In the embodiment of the present application, the sending module 405 may also be used for:

[0156] The first consumer in the primary message queue sends the pending link message to the target producer in the secondary message queue;

[0157] The target producer in the secondary message queue sends the pending link message to the target consumer;

[0158] The target consumer determines the first target terminal service according to the to-do link message;

[0159] According to the first target terminal service, the to-do link message is consumed.

[0160] In the embodiment of the present application, the sending module 405 may also be used for:

[0161] Determine the message consumption status of the to-do link message;

[0162] If the message consumption status of the to-do link message indicates that the to-do link message has been processed, the secondary message queue sends message feedback information to the primary message queue;

[0163] The first-level message queue processes pending messages based on message feedback information.

[0164] In the embodiment of the present application, the sending module 405 may also be used for:

[0165] According to the first consumer in the primary message queue, determine the target producer corresponding to each to-do link message;

[0166] According to the target producer corresponding to each to-do link message, determine the target second producer, target second consumer, configured target producer and configured target consumer in the secondary message queue;

[0167] The first consumer in the primary message queue pushes different to-do link messages to the secondary message queue, so that the target second producer, the target second consumer, the configured target producer and the configured target consumer consume each to-do link message.

[0168] As can be seen from the above, the message consumption device of the embodiment of the present application consists of a first determination module 401, which is used to determine the to-do messages in the primary message queue; a second determination module 402, which is used to classify the to-do messages according to the first producer in the primary message queue, and determine the to-do link messages in the to-do messages; a third determination module 403, which is used to determine the target producer of the to-do link messages according to the first consumer in the primary message queue; a configuration module 404, which is used to configure the target producer and the target consumer corresponding to the target producer in the secondary message queue if there is no target producer among the second producers in the secondary message queue, wherein each second producer is independent of each other; a sending module 405, which is used for the first consumer in the primary message queue to send the to-do link message to the secondary message queue, so that the target producer and the target consumer in the secondary message queue consume the to-do link message. Therefore, the embodiment of the present application can first use the first-level message queue to concurrently and efficiently process notifications and to-do links, and then classify the messages and distribute them to the next-level message queue. In the secondary message queue, different types of messages are delivered to corresponding consumers for consumption. Each consumer can handle services of multiple terminals including web, mobile and PC. At this time, consumers can only focus on their own business logic, realize business isolation, and at the same time ensure the synchronization of message processing results, thereby achieving the effect of improving the collection and distribution efficiency of to-do messages generated by multiple business systems.

[0169] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 50 includes:

[0170] The electronic device 50 may include a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a communication component 503 and other components. The processor 501 , the memory 502 and the communication component 503 are connected via a bus 504 .

[0171] In a specific implementation process, at least one processor 501 executes the computer execution instructions stored in the memory 502, so that at least one processor 501 executes the above message consumption method.

[0172] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0173] In the above Figure 5In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0174] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0175] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0176] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which implement the steps in any of the above-mentioned message consumption methods when executed by a processor.

[0177] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0178] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0179] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple instructions are stored, and the instructions can be loaded by a processor to execute the steps in any message consumption method provided in the embodiment of the present application.

[0180] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0181] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program comprises computer instructions stored in a computer-readable storage medium.

[0182] Since the instructions stored in the storage medium can execute the steps in any message consumption method provided in the embodiments of the present application, the beneficial effects that can be achieved by any message consumption method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0183] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0184] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A message consumption method, characterized in that: The method comprises: Determine the pending messages in the primary message queue; Classifying the to-do messages according to the first producer in the primary message queue, and determining to-do link messages in the to-do messages; Determine the target producer of the to-do link message according to the first consumer in the primary message queue; If the target producer does not exist in the second producer in the secondary message queue, the target producer and the target consumer corresponding to the target producer are configured in the secondary message queue, wherein each of the second producers is independent of each other; The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target producer and the target consumer in the secondary message queue consume the to-be-done link message.

2. The method according to claim 1, characterized in that After determining the pending messages in the primary message queue, the method further includes: Classifying the pending messages according to the first producer in the primary message queue, and determining the notification information message in the pending messages; The notification information message in the to-do message is sent to the first consumer, so that the first consumer consumes the notification information message.

3. The method according to claim 1, characterized in that The step of determining the target producer of the to-do link message according to the first consumer in the primary message queue includes: A first consumer in the first-level message queue consumes the to-do link message and determines the message content of the to-do link message; Determine the message type of the to-do link message according to the message content of the to-do link message, the message type of the to-do link message including message consumption system type, enterprise OA type, third-party office software type, mobile phone text message type, voice type and email system type; According to the type of the to-do link message, a target producer of the to-do link message is determined.

4. The method according to claim 1, characterized in that: After determining the target producer of the to-do link message according to the first consumer in the primary message queue, the method further includes: If the target producer exists in the secondary message queue, determining a target second producer and a target second consumer corresponding to the target second producer from the second producers in the secondary message queue; The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target second producer and the target second consumer in the secondary message queue consume the to-be-done link message.

5. The method according to claim 4, characterized in that The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target second producer and the target second consumer in the secondary message queue consume the to-be-done link message, including: The first consumer in the primary message queue sends the to-be-done link message to the target second producer in the secondary message queue; The target second producer in the secondary message queue sends the to-be-done link message to the target second consumer; The target second consumer determines a second target terminal service according to the to-be-done link message; The to-do link message is consumed according to the second target terminal service.

6. The method according to claim 1, characterized in that The first consumer in the primary message queue sends the to-be-done link message to the secondary message queue, so that the target producer and the target consumer in the secondary message queue consume the to-be-done link message, including: The first consumer in the primary message queue sends the to-be-done link message to the target producer in the secondary message queue; The target producer in the secondary message queue sends the to-be-done link message to the target consumer; The target consumer determines a first target terminal service according to the to-do link message; The to-do link message is consumed according to the first target terminal service.

7. The method according to claim 1, characterized in that After the first consumer in the primary message queue sends the to-be-done link message to the secondary message queue so that the target producer and the target consumer in the secondary message queue consume the to-be-done link message, the method further includes: Determine the message consumption status of the to-do link message; If the message consumption state of the to-do link message indicates that the to-do link message has been processed, the secondary message queue sends message feedback information to the primary message queue; The first-level message queue processes the pending messages according to the message feedback information.

8. The method according to claim 1, characterized in that When there are more than two to-do link messages, the method further includes: Determine, according to the first consumer in the primary message queue, a target producer corresponding to each of the to-do link messages; Determine the target second producer, the target second consumer, the configured target producer and the configured target consumer in the secondary message queue according to the target producer corresponding to each of the to-do link messages; The first consumer in the primary message queue pushes different to-do link messages to the secondary message queue, so that the target second producer, the target second consumer, the configured target producer and the configured target consumer consume each of the to-do link messages.

9. A message consumption device, characterized in that: include: A first determination module, used to determine pending messages in the primary message queue; A second determination module is used to classify the to-do messages according to the first producer in the primary message queue, and determine the to-do link messages in the to-do messages; A third determination module, used to determine the target producer of the to-be-done link message according to the first consumer in the primary message queue; A configuration module, configured to configure the target producer and a target consumer corresponding to the target producer in the secondary message queue if the target producer does not exist in the second producer in the secondary message queue, wherein each of the second producers is independent of each other; The sending module is used for the first consumer in the primary message queue to send the to-be-done link message to the secondary message queue, so that the target producer and the target consumer in the secondary message queue consume the to-be-done link message.

10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the message consumption method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Distributed crawler architecture based on Kafka and Quartz and implementation method thereof

    CN105677918A

  • Message queue configuration method and device, computer device and storage medium

    CN110032459A

  • Message processing method and device

    CN112084042A

  • Message queue-based message consumption method and device, computer equipment and a medium

    CN112667414A

  • Message queue cluster migration method and device

    CN114064328A