Message push method, device, equipment and storage medium

By dynamically adjusting the management of the activation status of the processing object and destination in the message grouping, combining cache queues and priority processing, the timeliness and accessibility problems in massive message push are solved, and efficient message push effect is achieved.

CN115499500BActive Publication Date: 2025-08-22BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210963820.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-11
Publication Date
2025-08-22
Estimated Expiration
2042-08-11

AI Technical Summary

Technical Problem

How to ensure that messages reach the destination in a timely manner in massive messages push, especially when there are many messages and the destination is not activated, improve the timeliness and accessibility of message push.

Method used

By updating the processing objects of message packets from the preset first processing objects to a larger number of second processing objects, and pushing messages when the destination is in an activated state, combining cache queues and priority processing, ensuring timely messages are promptly pushed, and delayed messages are pushed according to the set delay time, reasonably dispatching consumers and activation destinations.

Benefits of technology

It improves the timeliness and accessibility of message push, avoids message accumulation, ensures priority processing of high-priority messages and delays on-time push of messages, and improves the message push effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115499500B_ABST
    Figure CN115499500B_ABST
Patent Text Reader

Abstract

The present disclosure provides a message push method, apparatus, device and storage medium, which relate to the field of artificial intelligence technology, and specifically to technical fields such as big data and network communications. The message push method includes: obtaining the number of messages in a current message group among multiple message groups; in response to the number of messages in the current message group being greater than a preset value, updating the processing object of the current message group from a preset first processing object to a second processing object; wherein the number of the second processing objects is greater than the number of the first processing objects; in response to the destination end corresponding to the message in the current message group being in an activated state, using the second processing object to push the message in the current message group to the destination end. The present disclosure can improve the message push effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as big data and network communications, and in particular to a message push method, apparatus, device, and storage medium. Background Art

[0002] With the development of information technology, the number of messages generated by business parties is increasing.

[0003] In response to the demand for pushing massive messages, how to ensure that the messages reach the destination in a timely manner is an urgent problem that needs to be solved. Summary of the Invention

[0004] The present disclosure provides a message push method, apparatus, device, and storage medium.

[0005] According to one aspect of the present disclosure, a message push method is provided, including: obtaining the number of messages in a current message group among multiple message groups; in response to the number of messages in the current message group being greater than a preset value, updating the processing object of the current message group from a preset first processing object to a second processing object; wherein the number of the second processing objects is greater than the number of the first processing objects; in response to the destination end corresponding to the messages in the current message group being in an activated state, using the second processing object to push the messages in the current message group to the destination end.

[0006] According to another aspect of the present disclosure, a message pushing device is provided, including: an acquisition module for acquiring the number of messages in a current message group among multiple message groups; a scheduling module for updating the processing object of the current message group from a preset first processing object to a second processing object in response to the number of messages in the current message group being greater than a preset value; wherein the number of the second processing objects is greater than the number of the first processing objects; and a pushing module for pushing the messages in the current message group to the destination end using the second processing object in response to the destination end corresponding to the messages in the current message group being in an activated state.

[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any one of the methods described in any one of the above aspects.

[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to any one of the above aspects.

[0009] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of the above aspects.

[0010] According to the technical solution disclosed in the present invention, the message push effect can be improved.

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

[0012] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0013] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0014] Figure 2 is a schematic diagram of an application scenario corresponding to an embodiment of the present disclosure;

[0015] Figure 3 is an overall architecture diagram corresponding to the embodiment of the present disclosure;

[0016] Figure 4 is a timing diagram corresponding to an embodiment of the present disclosure;

[0017] Figure 5 is a schematic diagram according to a second embodiment of the present disclosure;

[0018] Figure 6 is a schematic diagram of activating a robot in an embodiment of the present disclosure;

[0019] Figure 7 is a schematic diagram according to a third embodiment of the present disclosure;

[0020] Figure 8 Schematic diagram of an electronic device used to implement the message push method of an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0022] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure. This embodiment provides a message push method, the method comprising:

[0023] 101. Obtain the number of messages in a current message group among multiple message groups.

[0024] 102. In response to the number of messages in the current message group being greater than a preset value, update the processing object of the current message group from a preset first processing object to a second processing object; wherein the number of the second processing objects is greater than the number of the first processing objects.

[0025] 103. In response to a destination end corresponding to the message in the current message group being in an activated state, use the second processing object to push the message in the current message group to the destination end.

[0026] The messages to be pushed can be divided into multiple message groups, which can be grouped in a predetermined manner. Each message group can include one or more messages. For example, the messages can be grouped based on priority, and accordingly, different message groups have different priorities.

[0027] Multiple message groups may be processed sequentially in groups, and the group currently being processed may be referred to as the current message group.

[0028] The processing order can be preset, for example, the processing can be performed according to priority. For example, if the multiple message groups include a first message group and a second message group, and the first message group has a higher priority than the second message group, the first message group will be processed first and then the second message group.

[0029] The message processing object refers to the resource that pushes the message. For example, in the subscription-consumption mode, the processing object refers to the consumer, which can be a thread.

[0030] Each message group may have a preset initial processing object. For the current message group, the preset initial processing object may be referred to as a first processing object, and the updated processing object may be referred to as a second processing object.

[0031] For example, for the current message group, the first processing object includes a first thread, which is preset. If the number of messages in the current message group is greater than a preset value, the second processing object can be updated to include the first thread and the second thread.

[0032] The destination of the message can be of various types, for example, it can be a robot or a program, such as an application (APP), a mini-program, a public account, etc.

[0033] In order to improve the reachability, you can first determine whether the destination is in an active state, and then push the message to the destination when the destination is in an active state, so as to avoid the problem of being unreachable when the destination is in an inactive state.

[0034] In this embodiment, in response to the number of messages in the current message group being greater than a preset value, the processing object of the message is updated from the preset first processing object to the second processing object; wherein, the number of the second processing objects is greater than the number of the first processing objects; this realizes that when the number of messages in the message group is large, the number of processing objects is increased, so that more processing objects can push messages, thereby avoiding message accumulation and improving the timeliness of message push; in response to the destination end corresponding to the message being in an activated state, the second processing object is used to push the message to the destination end; since the message push is performed when the destination end is in an activated state, the reachability of the message push can be improved. Therefore, this embodiment can improve the timeliness and reachability of message push and improve the effect of message push.

[0035] In order to better understand the embodiments of the present disclosure, the application scenarios of the embodiments of the present disclosure are described.

[0036] Figure 2 The push system may include a push end and a destination end, such as Figure 2 As shown, the push end is represented by the cloud 201, and the destination end can be one or more. Figure 2 The destination terminals are denoted by 202a to 202d. The cloud 201 pushes the message to each destination terminal 202a to 202d.

[0037] The types of the destination end can be various, for example, they can include robots (such as 202c-202d) and programs, and the programs can be deployed on user terminals, such as mobile phones (such as 202a-202b).

[0038] See further Figure 3 ,Business parties can generate messages according to their own needs.,For example, the messages can be medication reminder messages, ,medical appointment reminder messages, etc., as well as advertising messages, ,article messages, etc.

[0039] When generating a message, the business party can set the priority for each message, such as Figure 3 As shown, the priority can be represented by priority 1 to N, where N is a positive integer. Priority 1 can represent the highest priority.

[0040] After a business party generates a message, it can push the message to a message centralization center. For example, an application program interface (API) can be preset and the message can be pushed to the message centralization center through the API. The message centralization center can be implemented using a message queue (MQ).

[0041] The producer can monitor the message centralization center in real time. After monitoring the messages stored in the message centralization center, the producer can pull the messages from the message centralization center.

[0042] After the producer pulls the message, it can pre-process it. The pre-processing includes, for example, identifying the message type and performing different processing based on the message type.

[0043] Message types include: delayed messages and instant messages. Instant messages refer to messages that need to be pushed in a timely manner. That is, assuming that the message is obtained at the current time t, it will be pushed at the current time t; delayed messages refer to messages that do not need to be pushed in a timely manner. Assuming that the current time is t1, delayed messages refer to messages pushed at t2, which is later than t1. The specific t2 can be determined based on the information carried in the message. For example, a delayed message can carry similar information to be pushed 1 hour later.

[0044] Different processing based on message type includes: for instant messages, pushing the instant messages to the consumption queue; for delayed messages, storing the delayed messages in the first cache queue, and pushing the delayed messages from the first cache queue to the second cache queue after the expiration time is reached; the producer monitors the second cache queue in real time, and after storing the messages in the second cache queue, pulls the messages in the second cache queue and pushes them to the consumption queue.

[0045] Among them, such as Figure 3 As shown, the first cache queue can be called a delay queue, and the second cache queue can be called a blocking queue, both of which can be implemented using Redis cache. The consumer queue can be implemented using MQ.

[0046] From the time the business side generates a message to the time the message is stored in the consumer queue, the message sequence diagram can be as follows: Figure 4 As shown. Figure 4As shown, the messages generated by the business party are pushed to the message concentration center, the producer pulls the messages from the message concentration center and performs message preprocessing (identifying whether the messages are timely messages or delayed messages). After message preprocessing, the delayed messages are pushed to the delayed queue, and are pushed to the blocking queue after expiration. The delayed messages are pulled from the blocking queue and pushed to the consumer queue; and the timely messages are pushed to the consumer queue.

[0047] Each message (including timely messages and delayed messages) can carry priority information. The consumer queue can group messages based on their priority information and divide messages of the same priority into the same message group. Assuming that there are N priorities in the message, then Figure 3 As shown, the consumer queue can be divided into N message groups, each message group corresponds to a different priority.

[0048] The dispatcher, i.e. Figure 3 Consumer queue monitoring and consumer task scheduling can schedule consumers to consume messages in the consumer queue.

[0049] At the initial stage, the consumer can set the corresponding initial consumer for each message group. For example, at the initial stage, each message group can be configured to correspond to a consumer. For example, the message group of priority 1 is consumed by consumer 1, the message group of priority 2 is consumed by consumer 2, and the message group of priority N is consumed by consumer N.

[0050] For the current message group, that is, the currently scheduled message group, if the number of messages in the group is greater than the preset value, more consumers can be scheduled.

[0051] Based on the different priorities of the consumer groups, different ways of adding consumers can be adopted. Specifically, for message groups other than the lowest priority, consumers corresponding to message groups with lower priority can be scheduled, and for message groups with the lowest priority, new message groups can be created.

[0052] For example, for a message group of priority 1, its initial consumer is consumer 1. If the number of messages in the message group of priority 1 is greater than a preset value, the consumer corresponding to the message group of priority 1 can be updated from consumer 1 to consumer 1 and consumer 2.

[0053] For a message group with priority N, its initial consumer is consumer N. If the number of messages in the message group with priority N exceeds a preset value, the corresponding consumer can be updated from consumer N to consumer N and consumer N+1, where consumer N+1 is a newly created consumer. Additionally, if the number of messages in the message group with priority N does not exceed a preset value, consumer N+1 can be deleted.

[0054] After the dispatcher dispatches the consumer, it can use the consumer to consume the message. Consumer consumption means that the consumer pulls the message from the consumption queue and pushes it to the destination.

[0055] Consumers can push messages to various types of destinations, such as Figure 3 As shown, the destination includes a robot (represented by Xiaodu) and an APP as an example. In addition, consumers can also store messages in the message center of the database.

[0056] In combination with the above application scenarios, the embodiments of the present disclosure also provide a message pushing method.

[0057] Figure 5 2 is a schematic diagram according to a second embodiment of the present disclosure. This embodiment provides a message push method, the method comprising:

[0058] 501. The producer determines the message type of the message generated by the business party.

[0059] The business side can generate messages as needed, such as various reminder messages, advertising messages, article messages, etc.

[0060] Business parties can push generated messages to a message centralization center through the API.

[0061] The producer can monitor the message center and pull messages from the message center after monitoring them.

[0062] Message types can include immediate messages or delayed messages.

[0063] Instant messages refer to messages that need to be pushed in a timely manner. That is, assuming that the message is obtained at the current time t, it will be pushed at the current time t; delayed messages refer to messages that do not need to be pushed in a timely manner. Assuming that the current time is t1, delayed messages refer to messages pushed at t2, which is later than t1. The specific t2 can be determined based on the information carried in the message. For example, a delayed message can carry similar information to be pushed 1 hour later.

[0064] Messages generated by the business side can carry conditional information. A correspondence between the conditional information and the message type is preset within the producer, allowing the message to be parsed to obtain the conditional information carried within the message. The message type is determined based on the obtained conditional information and the preset correspondence between the conditional information and the message type. This can be implemented using a reflection mechanism to determine the message type based on the conditional information carried within the message and the preset correspondence.

[0065] Specifically, the conditional information is, for example, message type identification information, such as 1 for a timely message and 0 for a delayed message. The producer can obtain the corresponding message type by parsing the message type identification information carried in the message.

[0066] In this embodiment, by parsing the message to obtain condition information and determining the message type based on a preset correspondence, the message type can be determined simply and accurately, and then appropriate processing can be performed based on the message type.

[0067] 502. In response to the message type being an instant message, the producer pushes the instant message to a message queue.

[0068] 503. The producer, in response to the message type being a delayed message, pushes the delayed message to the first cache queue, and when the expiration time carried in the delayed message is reached, pushes the delayed message from the first cache queue to the second cache queue; in response to the delayed message being stored in the second cache queue, pulls the delayed message from the second cache queue and pushes the delayed message to the message queue.

[0069] Among them, the message queue is, for example, Figure 3 or Figure 4 The consumer queue of the instant message pushes the instant message to the message queue, so that the instant message can be pushed to the destination in time.

[0070] For delayed messages, they can be stored in the first cache queue and stored in the second cache queue after expiration. The first cache queue is, for example, Figure 3 or Figure 4 The delay queue of the second cache queue is, for example, Figure 3 or Figure 4 The blocking queue.

[0071] By pushing the delayed message to the first cache queue, the delayed message can be cached. The expiration time carried in the delayed message can be a delay interval, such as pushing after 1 hour, or a delayed push time point, such as 10 o'clock (assuming it is currently 9 o'clock).

[0072] When the above expiration time is reached, the first cache queue can push the delayed message to the second cache queue.

[0073] The producer can monitor the second cache queue and pull the stored message when a message is stored in the second cache queue.

[0074] Therefore, when the expiration time carried in the delayed message, that is, the delay time, is reached, the producer can pull the delayed message and push the pulled delayed message to the message queue.

[0075] In this embodiment, instant messages are pushed to a message queue, ensuring timely delivery of instant messages. Delayed messages are pushed to a first cache queue, and when their expiration time is reached, they are pushed from the first cache queue to a second cache queue. Delayed messages are then retrieved from the second cache queue and pushed to the message queue, ensuring that they are delivered when their corresponding delay time is reached. This ensures that both instant and delayed messages are delivered appropriately. Furthermore, by employing two cache queues, delayed message delivery can be implemented.

[0076] 504. The message queue divides the message into multiple message groups based on the priority information carried in the message.

[0077] When the business party generates a message, it not only carries message type identification information but also priority information in the message.

[0078] After the producer pushes messages (both immediate and delayed) to the message queue, the message queue can group them based on the priority information carried in the messages. For example, messages of the same priority level can be grouped together.

[0079] like Figure 3 As shown, assuming that messages are divided into N priorities, there are N message groups, and each message group corresponds to a priority.

[0080] 505. The dispatcher obtains the number of messages in the current message group among the multiple message groups.

[0081] The current message group is a message group currently being processed among the multiple message groups.

[0082] The scheduler may process each message group in order from high to low priority.

[0083] For example, assuming that priority 1 represents the highest priority, the message group corresponding to priority 1 is processed first, then the message group corresponding to priority 2 is processed, and so on.

[0084] For the current message group, the number of messages in the current message group may be obtained, for example, M messages, where M is a positive integer.

[0085] 506. The dispatcher, in response to the number of messages in the current message group being greater than a preset value, updates the processing object of the current message group from a preset first processing object to a second processing object; wherein the number of the second processing objects is greater than the number of the first processing objects.

[0086] Each message group can preset an initial processing object, taking the processing object as an example, for example, Figure 3As shown, the number of initial consumers that matches the number of message groups can be preset, and each message group corresponds to one initial consumer. The consumer can be specifically a thread.

[0087] For the current message grouping, assuming the preset value is M0, when M>M0, more consumers can be scheduled.

[0088] On the other hand, if M is not greater than M0, the consumer can be kept as the initial consumer.

[0089] Based on the priority of the current message group, more consumers can be scheduled in different ways.

[0090] Specifically, it may include: if the current message group is not the message group with the lowest priority, obtaining the processing object of the target message group, and using the first processing object and the processing object of the target message group as the second processing object; wherein the priority of the target message group is lower than the priority of the current message group; or, if the current message group is the message group with the lowest priority, creating a new processing object, and using the first processing object and the new processing object as the second processing object.

[0091] For example, the current message group is the message group corresponding to priority 1, and its initial consumer is consumer 1. When more consumers need to be scheduled, its consumers can be updated to consumer 1 and consumer 2. Consumer 2 is the initial consumer of the message group corresponding to priority 2.

[0092] In this embodiment, for message groups that are not of the lowest priority, the initial processing objects of other message groups with lower priorities can be scheduled. Since message groups are processed according to priority, when processing the current message group, the initial processing objects of message groups with lower priorities are in an idle state. Therefore, idle resources can be reasonably utilized for message processing to avoid message accumulation. For the message group with the lowest priority, more resources can be used for message processing by creating new processing objects to avoid message accumulation.

[0093] 507. Consumer, confirm that the destination is in an activated state.

[0094] The destination can be of various types, such as robots, programs, etc. Programs can include APPs, mini-programs, official accounts, etc.

[0095] Different methods can be used to determine whether different types of destinations are in an active state.

[0096] Specifically, it may include: if the destination end is a robot, performing command interaction with the robot to determine that the robot is in an activated state; or, if the destination end is a program, maintaining a long link with the program to determine that the program is in an activated state.

[0097] In this embodiment, different methods may be used to determine whether the destination terminal is in an activated state based on different types of the destination terminal, thereby achieving reasonable activation or keep-alive of the destination terminal.

[0098] Furthermore, for robots, you can execute:

[0099] sending an echo command to the robot and receiving status information sent by the robot based on the echo command; if the status information is not an activation state, sending an activation command to the robot to activate the robot; or,

[0100] An activation instruction is sent to the robot to activate the robot.

[0101] Among them, for robots, the echo-pull-push or pull-push method can be used to determine whether the robot is in an active state.

[0102] Take the echo-pull-push method as an example, Figure 6 As shown, the consumer can send an echo command to the robot. In response to the echo command, the robot will feedback status information to the message sender. The status information is used to indicate whether the robot is in an active state. If the robot is in an active state, the message can be pushed to the robot in the subsequent process. If the robot is not in an active state, the consumer can send an activation command to the robot. In response to the activation command, the robot starts to activate itself and feedbacks the activation status to the consumer through feedback information. After the consumer confirms that the robot is in an active state, the message can be pushed to the robot in the subsequent process.

[0103] In this embodiment, multiple methods can be used to determine whether the robot is in an activated state to ensure the reachability of subsequent message push.

[0104] 508. In response to the destination end corresponding to the message in the current message group being in an activated state, the consumer uses the second processing object to push the message in the current message group to the destination end.

[0105] In this embodiment, for the business party, the business party only needs to push the message to the message centralization center, and the specific message processing process is executed by the producer, that is, the message processing logic is shielded from the business party, and the business party can focus on business development and improve business development efficiency. In the usual solution, the business party needs to consider how to put the message into the message queue. For the producer, different processing can be performed based on the message category to ensure the timely push of timely messages and the push of delayed messages according to the set delay time; by adopting a cache queue, the message delayed push function can be realized, and the usual message queue processes the messages placed therein in a timely manner. By processing messages based on priority, it can be ensured that high-priority messages are processed first; by dispatching more consumers for processing when the number of messages is large, message accumulation can be avoided and the timeliness of message processing can be improved; by ensuring that messages are pushed when the destination is in an activated state, the reachability of the message can be improved.

[0106] Figure 7 3 is a schematic diagram according to the third embodiment of the present disclosure. This embodiment provides a message pushing device, and the device 700 includes: an acquisition module 701, a scheduling module 702 and a pushing module 703.

[0107] The acquisition module 701 is used to obtain the number of messages in the current message group among multiple message groups; the scheduling module 702 is used to update the processing object of the current message group from a preset first processing object to a second processing object in response to the number of messages in the current message group being greater than a preset value; wherein the number of the second processing objects is greater than the number of the first processing objects; the push module 703 is used to push the messages in the current message group to the destination end using the second processing object in response to the destination end corresponding to the messages in the current message group being in an activated state.

[0108] In this embodiment, in response to the number of messages in the current message group being greater than a preset value, the processing object of the message is updated from the preset first processing object to the second processing object; wherein, the number of the second processing objects is greater than the number of the first processing objects; this realizes that when the number of messages in the message group is large, the number of processing objects is increased, so that more processing objects can push messages, thereby avoiding message accumulation and improving the timeliness of message push; in response to the destination end corresponding to the message being in an activated state, the second processing object is used to push the message to the destination end; since the message push is performed when the destination end is in an activated state, the reachability of the message push can be improved. Therefore, this embodiment can improve the timeliness and reachability of message push and improve the effect of message push.

[0109] In some embodiments, each message group in the plurality of message groups has a different priority;

[0110] The scheduling module 702 is further used to: if the current message group is not the message group with the lowest priority, obtain the processing object of the target message group, and use the first processing object and the processing object of the target message group as the second processing object; wherein the priority of the target message group is lower than the priority of the current message group; or, if the current message group is the message group with the lowest priority, create a new processing object, and use the first processing object and the new processing object as the second processing object.

[0111] In this embodiment, for message groups that are not of the lowest priority, the initial processing objects of other message groups with lower priorities can be scheduled. Since message groups are processed according to priority, when processing the current message group, the initial processing objects of message groups with lower priorities are in an idle state. Therefore, idle resources can be reasonably utilized for message processing to avoid message accumulation. For the message group with the lowest priority, more resources can be used for message processing by creating new processing objects to avoid message accumulation.

[0112] In some embodiments, the device 700 further includes: a detection module for, if the destination end is a robot, interacting with the robot through instructions to determine that the robot is in an activated state; or, if the destination end is a program, maintaining a long link with the program to determine that the program is in an activated state.

[0113] In this embodiment, different methods may be used to determine whether the destination terminal is in an activated state based on different types of the destination terminal, thereby achieving reasonable activation or keep-alive of the destination terminal.

[0114] In some embodiments, the detection module is further configured to: for the robot, perform:

[0115] Send an echo command to the robot and receive status information sent by the robot based on the echo command; if the status information is not an activation state, send an activation command to the robot to activate the robot; or, send an activation command to the robot to activate the robot.

[0116] In this embodiment, multiple methods can be used to determine whether the robot is in an activated state to ensure the reachability of subsequent message push.

[0117] In some embodiments, the multiple message groups are located in a message queue; the device 700 also includes: a determination module for determining the message type of the message generated by the business party; a first processing module for pushing the instant message to the message queue in response to the message type being an instant message; or, a second processing module for pushing the delayed message to the first cache queue in response to the message type being a delayed message, and when the expiration time carried in the delayed message is reached, the delayed message is pushed from the first cache queue to the second cache queue; in response to the delayed message being stored in the second cache queue, the delayed message is pulled from the second cache queue and pushed to the message queue.

[0118] In this embodiment, instant messages are pushed to a message queue, ensuring timely delivery of instant messages. Delayed messages are pushed to a first cache queue, and when their expiration time is reached, they are pushed from the first cache queue to a second cache queue. Delayed messages are then retrieved from the second cache queue and pushed to the message queue, ensuring that they are delivered when their corresponding delay time is reached. This ensures that both instant and delayed messages are delivered appropriately. Furthermore, by employing two cache queues, delayed message delivery can be implemented.

[0119] In some embodiments, the determination module is further used to: parse the message to obtain conditional information carried in the message; and determine the message type of the message based on the obtained conditional information and the correspondence between the preset conditional information and the message type.

[0120] In this embodiment, by parsing the message to obtain condition information and determining the message type based on a preset correspondence, the message type can be determined simply and accurately, and then appropriate processing can be performed based on the message type.

[0121] It can be understood that in the embodiments of the present disclosure, the same or similar contents in different embodiments can be referenced to each other.

[0122] It can be understood that the terms “first”, “second”, etc. in the embodiments of the present disclosure are only used for distinction and do not indicate the degree of importance, time sequence, etc.

[0123] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0124] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0125] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device 800 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0126] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0127] Multiple components in the electronic device 800 are connected to the I / O interface 805, including an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0128] The computing unit 801 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the message push method. For example, in some embodiments, the message push method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the message push method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the message push method in any other appropriate manner (e.g., by means of firmware).

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

[0130] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable message push device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0131] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

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

[0133] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0134] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.

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

[0136] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A message push method, comprising: Get the number of messages in the current message group among multiple message groups; In response to the number of messages in the current message group being greater than a preset value, updating the processing object of the current message group from a preset first processing object to a second processing object; wherein the number of the second processing objects is greater than the number of the first processing objects; In response to a destination end corresponding to the message in the current message group being in an activated state, using the second processing object to push the message in the current message group to the destination end; Each message group in the plurality of message groups has a different priority; The updating of the processing object of the current message group from the preset first processing object to the second processing object includes: If the current message group is not the message group with the lowest priority, obtaining a processing object of a target message group, and using the first processing object and a preset processing object of the target message group as the second processing object; wherein the priority of the target message group is lower than the priority of the current message group; Wherein, the first processing object and the second processing object are both consumers for consuming the message; The message is generated by the business party and pushed to the message centralization center, and is obtained by the producer from the message centralization center and pushed to the message queue; The production side is specifically used for: Determine the message type of the message generated by the business party; In response to the message type being an instant message, pushing the instant message into the message queue; or, In response to the message type being a delayed message, the delayed message is pushed to a first cache queue, and when the expiration time carried in the delayed message is reached, the delayed message is pushed from the first cache queue to a second cache queue; in response to the delayed message being stored in the second cache queue, the delayed message is pulled from the second cache queue and pushed to the message queue.

2. The method according to claim 1, wherein The updating of the processing object of the current message group from the preset first processing object to the second processing object further includes: If the current message group is the message group with the lowest priority, a new processing object is created, and the first processing object and the new processing object are used as the second processing object.

3. The method according to claim 1, wherein, in response to the destination end corresponding to the message in the current message group being in an activated state, before using the second processing object to push the message in the current message group to the destination end, the method further comprises: If the destination end is a robot, perform command interaction with the robot to determine that the robot is in an activated state; or, If the destination end is a program, a long link is maintained with the program to ensure that the program is in an activated state.

4. The method according to claim 3, wherein: If the destination end is a robot, performing command interaction with the robot to determine that the robot is in an activated state includes: For the robot, execute: sending an echo command to the robot and receiving status information sent by the robot based on the echo command; if the status information is not an activation state, sending an activation command to the robot to activate the robot; or, An activation instruction is sent to the robot to activate the robot.

5. The method according to claim 1, wherein The determining of the message type of the message generated by the business party includes: Parsing the message to obtain condition information carried in the message; The message type of the message is determined based on the obtained condition information and the corresponding relationship between the preset condition information and the message type.

6. A message push device, comprising: An acquisition module, used to acquire the number of messages in a current message group among multiple message groups; a scheduling module, configured to update a processing object of the current message group from a preset first processing object to a second processing object in response to the number of messages in the current message group being greater than a preset value; wherein the number of the second processing objects is greater than the number of the first processing objects; a push module, configured to, in response to a destination end corresponding to a message in the current message group being in an activated state, push the message in the current message group to the destination end using the second processing object; Each message group in the plurality of message groups has a different priority; The scheduling module is further configured to: If the current message group is not the message group with the lowest priority, obtaining the processing object of the target message group, and using the first processing object and the processing object of the target message group as the second processing object; wherein the priority of the target message group is lower than the priority of the current message group; Wherein, the first processing object and the second processing object are both consumers for consuming the message; The message is generated by the business party and pushed to the message centralization center, and is obtained by the producer from the message centralization center and pushed to the message queue; The device further comprises: A determination module, used to determine the message type of the message generated by the business party; A first processing module is configured to push the instant message to the message queue in response to the message type being an instant message; or The second processing module is used to push the delayed message to the first cache queue in response to the message type being a delayed message, and when the expiration time carried in the delayed message is reached, push the delayed message from the first cache queue to the second cache queue; in response to the delayed message being stored in the second cache queue, pull the delayed message from the second cache queue and push the delayed message to the message queue.

7. The device according to claim 6, wherein The scheduling module is further configured to: If the current message group is the message group with the lowest priority, a new processing object is created, and the first processing object and the new processing object are used as the second processing object.

8. The apparatus according to claim 6, further comprising: a detection module, configured to, if the destination end is a robot, interact with the robot through instructions to determine whether the robot is in an activated state; Alternatively, if the destination end is a program, a long link is maintained with the program to ensure that the program is in an activated state.

9. The device according to claim 8, wherein The detection module is further configured to: For the robot, execute: sending an echo command to the robot and receiving status information sent by the robot based on the echo command; if the status information is not an activation state, sending an activation command to the robot to activate the robot; or, An activation instruction is sent to the robot to activate the robot.

10. The device according to claim 6, wherein The determining module is further configured to: Parsing the message to obtain condition information carried in the message; The message type of the message is determined based on the obtained condition information and the corresponding relationship between the preset condition information and the message type.

11. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.

13. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Message processing method and system

    CN110719318A

  • Design method of data storage architecture and message transmission method and device

    CN113342544A

  • Message consumption optimization method and terminal

    CN114490026A