CN112395103B - Method and device for sending delay message and storage medium - Google Patents

Method and device for sending delay message and storage medium Download PDF

Info

Publication number
CN112395103B
CN112395103B CN202011205008.3A CN202011205008A CN112395103B CN 112395103 B CN112395103 B CN 112395103B CN 202011205008 A CN202011205008 A CN 202011205008A CN 112395103 B CN112395103 B CN 112395103B
Authority
CN
China
Prior art keywords
target
delay
messages
message
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011205008.3A
Other languages
Chinese (zh)
Other versions
CN112395103A (en
Inventor
黄智伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin May 8th Home Freight Service Co ltd
Original Assignee
Tianjin May 8th Home Freight Service Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin May 8th Home Freight Service Co ltd filed Critical Tianjin May 8th Home Freight Service Co ltd
Priority to CN202011205008.3A priority Critical patent/CN112395103B/en
Publication of CN112395103A publication Critical patent/CN112395103A/en
Application granted granted Critical
Publication of CN112395103B publication Critical patent/CN112395103B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The embodiment of the application provides a method and a device for sending a delay message and a storage medium. In the embodiment of the application, when the target theme with the expected sending time matched with the current time is monitored, the number of delay messages sent by the target theme at a time is managed and controlled. Thus, when there are a plurality of target topics, there is a probability that the plurality of target topics will send out the delay message whose expected sending time is due. Even if the target subject with the message accumulation exists in the plurality of target subjects, the normal sending of the delayed messages of other target subjects is not influenced, and the influence of the subject with the message accumulation on the message throughput of other subjects is avoided as much as possible. Meanwhile, the target subject with the message pile can continuously send the delay message, and the number of the delay messages sent at a time is limited. Therefore, the technical problem that the message throughput of other subjects is influenced by the subject of message accumulation in the prior art can be well solved.

Description

Method and device for sending delay message and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for sending a delay message, and a storage medium.
Background
Based on message middleware technology, messages generated by producers can be consumed by consumers. Taking the message middleware implemented as a message queue as an example, the message delivery modes of the message queue generally include a Point To Point (PTP) mode and a Publish/Subscribe (Pub/Sub) mode. The PTP mode is characterized by one producer corresponding to one consumer. The Pub/Sub model is characterized in that after a producer generates a message and sends the message, the message can be received by a plurality of consumers.
After a producer sends a message to a message queue, the message is not expected to be consumed immediately, but is waited for a specified time before it can be consumed by a consumer, and such a message is generally referred to as a delayed message. Each message has a Topic (Topic), and a Topic may have 1 or more messages sent by the producer. Currently, the transmission of each delayed message is performed according to the expected transmission time of the delayed message. However, if there are many delayed messages in a certain topic, even if a pile-up phenomenon occurs, according to the above-mentioned transmission method of the delayed messages, it is likely that the delayed messages in other topics cannot be sent out as expected, which affects the message throughput of other topics.
Disclosure of Invention
Aspects of the present application provide a method, an apparatus, and a storage medium for sending a delayed message, so as to avoid as much as possible an influence of a topic of message accumulation on message throughput of other topics.
The embodiment of the application provides a method for sending a delay message, which comprises the following steps:
monitoring expected delivery times of delayed messages in a plurality of topics;
if the target theme with the expected sending time matched with the current time is monitored, target delay messages with the number not larger than the preset message number are respectively selected from the candidate delay messages in the target theme;
sequentially sending target delay messages in the target topics according to the sequence of the target topics; wherein the candidate delayed message is a delayed message whose expected transmission time matches the current time.
An embodiment of the present application further provides a device for sending a delay message, including: a memory and a processor;
the memory for storing a computer program;
the processor, coupled with the memory, to execute the computer program to:
monitoring expected delivery times of delayed messages in a plurality of topics;
if the target theme with the expected sending time matched with the current time is monitored, target delay messages with the number not larger than the preset message number are respectively selected from the candidate delay messages in the target theme;
sequentially sending target delay messages in the target topics according to the sequence of the target topics; wherein the candidate delayed message is a delayed message whose expected transmission time matches the current time.
Embodiments of the present application further provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps in the above-mentioned delayed message sending method.
The method, the device and the storage medium for sending the delay messages, provided by the embodiment of the application, manage and control the number of the delay messages sent by the target theme at a time when the target theme with the expected sending time matched with the current time is monitored. Thus, when there are a plurality of target topics, there is a probability that the plurality of target topics will send out the delay message whose expected sending time is due. Even if the target subject with the message accumulation exists in the plurality of target subjects, the normal sending of the delayed messages of other target subjects is not influenced, and the influence of the subject with the message accumulation on the message throughput of other subjects is avoided as much as possible. Meanwhile, the target subject with the message pile can continuously send the delay message, and the number of the delay messages sent at a time is limited. Therefore, the technical problem that the message throughput of other subjects is influenced by the subject of message accumulation caused by the mode that the delayed message in one subject is sent and then the delayed messages of other subjects are sent in the prior art can be well solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart illustrating a method for sending a delay message according to an exemplary embodiment of the present application;
fig. 2 is a schematic structural diagram of a delay message sending apparatus according to an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for sending a delayed message according to an exemplary embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step 101, monitoring expected sending time of delayed messages in a plurality of topics.
And 102, if the target subject with the expected sending time matched with the current time is monitored, respectively selecting target delay messages with the number not more than the preset message number from the candidate delay messages in the target subject.
103, sequentially sending target delay messages in the target topics according to the sequence of the target topics; wherein the candidate delayed message is a delayed message whose expected transmission time matches the current time.
In practical applications, there may be delayed messages with different expected sending times in each topic. The delay time of the delay messages with the same expected sending time can be the same or different; the delay time of the delayed message may be the same or different for different expected transmission times. Ideally, the delayed message should be sent to the consumer side when the expected sending time arrives. The expected transmission time of each delayed message is obtained by adding the production time of the delayed message produced by the producer to the delay time of the delayed message.
Generally, the producer will specify the delay time for each delay message, either directly or indirectly, as it is produced. For example, the producer may configure delay levels for delaying messages, with different delay levels corresponding to different delay times. For example, there are 18 configurable delay levels, 1s, 5s, 10s, 30s, 1m, 2m, 3m, 4m, 5m, 6m, 7m, 8m, 9m, 10m, 20m, 30m, 1h and 2h, s corresponds to time units of seconds, m corresponds to time units of minutes, h corresponds to time units of hours, and d corresponds to time units of days.
The subject matter of the message may vary in different application scenarios. For example, for e-commerce systems, the topic of its messages can be divided into: transaction messages, logistics messages, customer service messages, and the like. Different themes may have delay messages with the same expected sending time, and when the number of themes is large, if the number of themes is not regulated, when a theme has message accumulation, delay messages of other themes are also affected, and cannot be sent out as expected, so that message throughput of other themes is affected.
In this embodiment, the expected sending time of the delayed messages in each topic is monitored in real time, and for each topic, if it is monitored that the delayed message with the expected sending time being earlier than or equal to the current time is not sent to the consumer, the topic is a target topic with the expected sending time matching with the current time. When the target theme is monitored, the number of delay messages for sending the theme each time is managed and controlled.
In practical applications, the number of target topics may be one or more. Obviously, when the number of the target topics is multiple, each target topic has the same probability of sending the delay message, so that even if the target topic with message accumulation exists, the normal sending of the delay messages of other target topics is not influenced, and meanwhile, the target topic with message accumulation also continuously sends the delay messages, and only the number of the delay messages sent at a time is limited.
In this embodiment, for each target topic, only target delayed messages of the topic, which are not greater than the preset number of messages, are sent at a time, and the target delayed messages are selected from candidate delayed messages belonging to the target topic, of which the expected sending time matches with the current time. The preset message quantity is set according to a large amount of test data, and can be understood as the maximum allowable message quantity to be sent. That is, each target topic may transmit a preset number of target delay messages at most at a single time.
For example, the target topics are target topic 1, target topic 2, and target topic 3, and at the current time of 08:00:01, there are 500 candidate delay messages in target topic 1, 50 candidate delay messages in target topic 2, and 80 candidate delay messages in target topic 3. Among them, 450 of the 500 candidate delay messages in the target subject 1 have the expected transmission time earlier than 08:00:01, and 50 have the expected transmission time of 08:00: 01. The number of the preset messages is 100, at this time, 100 delay messages with the same item are selected from the delay messages with the same item of the target subject 1 to be sent, 50 delay messages with the same item of the target subject 2 are sent as target delay messages, and 80 delay messages with the same item of the target subject 3 are sent as target delay messages. Obviously, the occurrence of the piled-up target subject 1 does not affect the transmission of the delay messages of the target subjects 2, 3. In addition, the current time is updated to 08:00:02, the target subject 1 is still the target subject matching 08:00:02, and the delayed message of the target subject 1 is continuously sent at 08:00: 02.
In an alternative embodiment, when the number of the target topics is multiple, the target delay messages in the target topics may be sequentially sent according to the order of the priorities among the target topics from high to low. The higher the priority, the earlier the target delayed messages in the target topic are arranged to be sent, thereby ensuring that delayed messages of the target topic with higher priority are sent out as early as possible. Wherein, the priority between the target topics is made according to the actual situation. Along with the topics of the e-commerce system, priorities can be set according to the importance of each topic, for example, the priority is in the order from high to low: transaction messages, logistics messages, customer service messages.
The method for sending the delay message provided by this embodiment manages and controls the number of delay messages sent by a single time of the target topic when monitoring the target topic of which the expected sending time is matched with the current time. Thus, when there are a plurality of target topics, there is a probability that the plurality of target topics will send out the delayed message with the expected sending time expired. Even if the target subject with the message accumulation exists in the plurality of target subjects, the normal sending of the delayed messages of other target subjects is not influenced, and the influence of the subject with the message accumulation on the message throughput of other subjects is avoided as much as possible. Meanwhile, the target subject with the message pile can continuously send the delay messages, and the number of the delay messages sent at a time is limited. Therefore, the technical problem that the message throughput of other subjects is influenced by the subjects of message accumulation caused by the mode that the delayed message in one subject is sent and then the delayed messages of other subjects are sent in the prior art can be well solved.
On the basis of the above embodiment, when monitoring the expected sending time of the delayed message in the plurality of topics, the expected sending time of the delayed message in the plurality of topics may be compared with the current time; and acquiring a theme with the expected sending time which is the same as or earlier than the current time as a target theme.
In this embodiment, a topic having an expected sending time that is the same as or earlier than the current time is used as a target topic having an expected sending time matching with the current time, so that even if there is a topic having a pile of messages, delayed messages of the topic can be continuously sent out without terminating the sending of delayed messages of the topic.
On the basis of the foregoing embodiment, respectively selecting target delayed messages, the number of which is not greater than the preset number of messages, from the candidate delayed messages in the target topic may include: if the number of the candidate delay messages in the target subject is not larger than the preset message number, all the candidate delay messages are used as target delay messages; and if the number of the candidate delay messages in the target subject is larger than the preset message number, selecting the target delay messages of which the number is not larger than the preset message number according to the expected sending time of the candidate delay messages.
In practical applications, the number of candidate delayed messages in the target topic may not be greater than the preset number of messages, and may also be greater than the preset number of messages. And if the candidate delay messages of the target topic are not more than the preset message number, all the candidate delay messages of the target topic are used as target delay messages. If the candidate delay messages of the target subject are larger than the preset message quantity, part of the candidate delay messages of the target subject are used as target delay messages.
When the candidate delayed messages of the target subject are larger than the preset message number, the target delayed messages of which the expected sending time is earliest and not larger than the preset message number can be selected from the candidate delayed messages in the order from early to late, and the target delayed messages of which the expected sending time is latest and not larger than the preset message number can also be selected.
Further, the selection operation of the target delay message may be performed in combination with the expected transmission time and the delay level of the candidate delay message. Specifically, according to the sequence of the expected sending time of the candidate delay messages from early to late, target delay messages are sequentially selected from the candidate delay messages corresponding to each expected sending time until the preset message number is reached; and for the finally selected expected sending time, if the number of the candidate delay messages corresponding to the expected sending time is greater than the number of the target delay messages to be selected, selecting the target delay messages from the candidate delay messages according to the sequence of the delay grades of the candidate delay messages from low to high.
In this embodiment, the length of the delay time can reflect the tolerance of the system to the delayed message being sent. The lower the delay level, the shorter the delay time, the earlier the corresponding delay message needs to be sent out, and the tolerance of the system to the delay message is low, i.e. the system cannot tolerate the corresponding delay message being sent out in a delayed manner. The higher the delay level is, the longer the delay time is, the less the corresponding delay message needs to be sent out as early as possible, and the tolerance of the system to the delay message is higher, i.e. the more the system can tolerate the corresponding delay message being sent out in a delayed manner. Therefore, when selecting the target delay message, the target delay message which needs to be sent out as early as possible can be selected preferentially according to the delay level.
Along the above example, when the current time is 08:00:01, there are 110 candidate delay messages in a certain target topic, and the number of the preset messages is 100. Among the 50 pieces of delay messages, the expected transmission time is earlier than 08:00:01, the expected transmission time of 60 pieces of delay messages is 08:00:01, 10 pieces of delay messages with the delay time of 1 second corresponding to the delay level 1, 30 pieces of delay messages with the delay time of 5 seconds corresponding to the delay level 2, and 20 pieces of delay messages with the delay time of 5 seconds corresponding to the delay level 3 are selected from the 60 candidate delay messages.
When selecting 100 item delay messages, first, 50 candidate delay messages whose expected transmission time is earlier than 08:00:01 are selected as target delay messages; next, 50 pieces (including 10 pieces corresponding to delay level 1, 30 pieces corresponding to delay level 2, and 10 pieces corresponding to delay level 3) with the lowest delay level are selected from 60 pieces of the expected transmission time 08:00:01 as the target delay message, and 100 pieces of the target delay message are made up.
It should be noted that the execution subjects of the steps of the methods provided in the above embodiments may be the same device, or different devices may be used as the execution subjects of the methods. For example, the execution subject of steps 101 to 103 may be device a; for another example, the execution subject of steps 101 and 102 may be device a, and the execution subject of step 103 may be device B; and so on.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 101, 102, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
Fig. 2 is a schematic structural diagram of a delay message sending apparatus according to an exemplary embodiment of the present application. As shown in fig. 2, the apparatus includes: the method comprises the following steps: a memory 11 and a processor 12.
The memory 11 is used for storing a computer program and may be configured to store other various data to support operations on the processor. Examples of such data include instructions for any application or method operating on the processor, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 11 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 12, coupled to the memory 11, for executing the computer program in the memory 11 for:
monitoring expected sending times of delayed messages in a plurality of topics;
if the target theme with the expected sending time matched with the current time is monitored, target delay messages with the number not larger than the preset message number are respectively selected from the candidate delay messages in the target theme;
sequentially sending target delay messages in the target topics according to the sequence of the target topics; wherein the candidate delayed message is a delayed message whose expected transmission time matches the current time.
Further, the processor 12, when selecting the target theme, is specifically configured to:
comparing expected sending times of delayed messages in a plurality of topics with a current time;
and obtaining a theme with the expected sending time which is the same as or earlier than the current time as a target theme.
Further, when selecting the target delay message, the processor 12 is specifically configured to: if the number of the candidate delay messages in the target subject is not larger than the preset message number, all the candidate delay messages are used as target delay messages; and if the number of the candidate delay messages in the target subject is greater than the preset message number, selecting the target delay messages of which the number is not greater than the preset message number according to the expected sending time of the candidate delay messages.
Further, when selecting a target delayed message that is not greater than the preset number of messages according to the expected sending time of the candidate delayed message, the processor 12 is specifically configured to:
and selecting target delay messages of which the number is not more than the preset number of messages from the candidate delay messages in the sequence from early to late according to the expected sending time of the candidate delay messages.
Further, when the processor 12 selects the target delay message not greater than the preset number of messages from the candidate delay messages in the order from early to late according to the expected sending time of the candidate delay messages, the processor is specifically configured to:
sequentially selecting target delay messages from the candidate delay messages corresponding to each expected sending time according to the sequence of the expected sending time of the candidate delay messages from early to late until the number of the preset messages is reached;
and for the finally selected expected sending time, if the number of the candidate delay messages corresponding to the expected sending time is greater than the number of the target delay messages to be selected, selecting the target delay messages from the candidate delay messages according to the sequence of the delay levels of the candidate delay messages from high to low.
Further, when the processor 12 sends the target delay message in the target topic, it is specifically configured to:
and sequentially sending the target delay messages in the target topics from high to low according to the priority among the target topics.
The apparatus shown in fig. 2 can perform the method of the above embodiment, and reference may be made to the related description of the above embodiment for a part of the embodiment that is not described in detail. The implementation process and technical effect of the technical solution refer to the description in the above embodiments, and are not described herein again.
Further, as shown in fig. 2, the apparatus further includes: communication components 13, display 14, power components 15, audio components 16, and the like. Only some of the components are schematically shown in fig. 2, and it is not meant that the processor includes only the components shown in fig. 2. In addition, the components shown by the dashed boxes in fig. 2 are optional components, not necessary components, and the specific implementation of the delay message sending apparatus may be determined. If the delayed message sending apparatus is implemented as a terminal device such as a notebook computer, a tablet, a mobile phone, etc., the delayed message sending apparatus may include components shown by a dashed box in fig. 2; if the delayed message sending apparatus is implemented as a server device such as a conventional server, a cloud server or a server array, the components shown by the dashed boxes in fig. 2 are not included.
Accordingly, the present application further provides a computer readable storage medium storing a computer program, where the computer program is capable of implementing the steps that can be executed by a processor in the foregoing method embodiments when executed.
The communication component of fig. 2 described above is configured to facilitate communication between the device in which the communication component is located and other devices in a wired or wireless manner. The device where the communication component is located can access a wireless network based on a communication standard, such as a WiFi, a 2G, 3G, 4G/LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
The display of fig. 2 described above includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
The power supply assembly of fig. 2 described above provides power to the various components of the device in which the power supply assembly is located. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device in which the power component is located.
The audio components of fig. 2 described above may be configured to output and/or input audio signals. For example, the audio component includes a Microphone (MIC) configured to receive an external audio signal when the device in which the audio component is located is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in a memory or transmitted via a communication component. In some embodiments, the audio assembly further comprises a speaker for outputting audio signals.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (6)

1. A method for transmitting a delayed message, comprising:
monitoring expected delivery times of delayed messages in a plurality of topics;
if the target theme with the expected sending time matched with the current time is monitored, target delay messages with the number not larger than the preset message number are respectively selected from the candidate delay messages in the target theme;
sequentially sending target delay messages in the target topics according to the sequence of the target topics; wherein the candidate delay message is a delay message whose expected sending time matches the current time;
wherein, respectively selecting target delay messages with the number not more than the preset message number from the candidate delay messages in the target subject comprises: if the number of the candidate delay messages in the target subject is not larger than the preset message number, all the candidate delay messages are used as target delay messages; if the number of the candidate delay messages in the target subject is larger than the preset message number, sequentially selecting target delay messages from the candidate delay messages corresponding to each expected sending time according to the sequence of the expected sending time of the candidate delay messages from early to late until the preset message number is reached; and for the finally selected expected sending time, if the number of the candidate delay messages corresponding to the expected sending time is larger than the number of the target delay messages to be selected, selecting the target delay messages from the candidate delay messages according to the sequence of the delay levels of the candidate delay messages from high to low, wherein different delay levels correspond to different delay times, and the higher the delay level is, the longer the corresponding delay time is.
2. The method of claim 1, further comprising:
comparing expected transmission times of delayed messages in the plurality of topics to a current time;
and obtaining a theme with the expected sending time which is the same as or earlier than the current time as a target theme.
3. The method according to any one of claims 1 to 2, wherein the step of sequentially sending the target delay messages in the target topic according to the sequence between the target topics comprises:
and sequentially sending the target delay messages in the target topics according to the sequence of the priorities among the target topics from high to low.
4. A delayed message transmission apparatus, comprising: a memory and a processor;
the memory for storing a computer program;
the processor, coupled with the memory, to execute the computer program to:
monitoring expected sending times of delayed messages in a plurality of topics;
if the target theme with the expected sending time matched with the current time is monitored, target delay messages with the number not larger than the preset message number are respectively selected from the candidate delay messages in the target theme;
sequentially sending target delay messages in the target topics according to the sequence of the target topics; wherein the candidate delay message is a delay message whose expected sending time matches the current time;
wherein, when selecting the target delay message, the processor is specifically configured to: if the number of the candidate delay messages in the target subject is not larger than the preset message number, all the candidate delay messages are used as target delay messages; if the number of the candidate delay messages in the target subject is larger than the preset message number, sequentially selecting target delay messages from the candidate delay messages corresponding to each expected sending time according to the sequence of the expected sending time of the candidate delay messages from early to late until the preset message number is reached; and for the finally selected expected sending time, if the number of the candidate delay messages corresponding to the expected sending time is larger than the number of the target delay messages to be selected, selecting the target delay messages from the candidate delay messages according to the sequence of the delay levels of the candidate delay messages from high to low, wherein different delay levels correspond to different delay times, and the higher the delay level is, the longer the corresponding delay time is.
5. The apparatus of claim 4, wherein the processor, when selecting the target topic, is specifically configured to:
comparing expected transmission times of delayed messages in the plurality of topics to a current time;
and obtaining a theme with the expected sending time which is the same as or earlier than the current time as a target theme.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 3.
CN202011205008.3A 2020-11-02 2020-11-02 Method and device for sending delay message and storage medium Active CN112395103B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011205008.3A CN112395103B (en) 2020-11-02 2020-11-02 Method and device for sending delay message and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011205008.3A CN112395103B (en) 2020-11-02 2020-11-02 Method and device for sending delay message and storage medium

Publications (2)

Publication Number Publication Date
CN112395103A CN112395103A (en) 2021-02-23
CN112395103B true CN112395103B (en) 2022-09-13

Family

ID=74597733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011205008.3A Active CN112395103B (en) 2020-11-02 2020-11-02 Method and device for sending delay message and storage medium

Country Status (1)

Country Link
CN (1) CN112395103B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259195B (en) * 2021-05-10 2022-07-05 中国人民解放军63660部队 Message middleware performance test method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9674131B1 (en) * 2015-12-04 2017-06-06 International Business Machines Corporation Message delivery system
CN107197015A (en) * 2017-05-23 2017-09-22 阿里巴巴集团控股有限公司 A kind of message treatment method and device based on Message Queuing system
CN107509119A (en) * 2017-07-11 2017-12-22 北京潘达互娱科技有限公司 A kind of monitoring alarm method and device
CN107888499A (en) * 2017-11-17 2018-04-06 北京邮电大学 A kind of distribution subscription system and message forwarding method based on SDN
US10313257B1 (en) * 2014-06-12 2019-06-04 Tripwire, Inc. Agent message delivery fairness

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8489674B2 (en) * 2010-03-11 2013-07-16 Yahoo! Inc. Distributed publish/subscribe system
US9032012B2 (en) * 2011-06-27 2015-05-12 International Business Machines Corporation Configurable pacing for messaging systems
US9270527B2 (en) * 2013-08-05 2016-02-23 The Trustees Of The University Of Pennsylvania Methods, systems, and computer readable media for enabling real-time guarantees in publish-subscribe middleware using dynamically reconfigurable networks
US9503548B2 (en) * 2013-10-28 2016-11-22 International Business Machines Corporation Subscriber based priority of messages in a publisher-subscriber domain
WO2017177455A1 (en) * 2016-04-15 2017-10-19 华为技术有限公司 Message presentation method, device, and system
CN109560976B (en) * 2017-09-25 2021-06-08 北京国双科技有限公司 Message delay monitoring method and device
US10678614B2 (en) * 2017-11-30 2020-06-09 Oracle International Corporation Messages with delayed delivery in an in-database sharded queue

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10313257B1 (en) * 2014-06-12 2019-06-04 Tripwire, Inc. Agent message delivery fairness
US9674131B1 (en) * 2015-12-04 2017-06-06 International Business Machines Corporation Message delivery system
CN107197015A (en) * 2017-05-23 2017-09-22 阿里巴巴集团控股有限公司 A kind of message treatment method and device based on Message Queuing system
CN107509119A (en) * 2017-07-11 2017-12-22 北京潘达互娱科技有限公司 A kind of monitoring alarm method and device
CN107888499A (en) * 2017-11-17 2018-04-06 北京邮电大学 A kind of distribution subscription system and message forwarding method based on SDN

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于Tair/Redis的延迟队列系统的设计与实现";刘子晨;《中国优秀博硕学位论文全文数据库(硕士)信息科技辑》;20180415;第三章到第五章 *

Also Published As

Publication number Publication date
CN112395103A (en) 2021-02-23

Similar Documents

Publication Publication Date Title
KR101723203B1 (en) Apparatus and method for delivery control of application data to a mobile device in a communication network
US11327736B2 (en) Update method, system, end node and electronic device
CN111953648A (en) Data processing method and device based on block chain prediction machine and electronic equipment
CN111782470A (en) Distributed container log data processing method and device
CN104253872A (en) Synchronous information updating method, system and terminal
CN112395103B (en) Method and device for sending delay message and storage medium
CN113301075B (en) Flow control method, distributed system, device and storage medium
CN110875947A (en) Data processing method and edge node equipment
CN106921733B (en) Cluster notification pushing method and device and electronic equipment
CN112419040A (en) Credit anti-fraud identification method, credit anti-fraud identification device and storage medium
CN115914375A (en) Disaster tolerance processing method and device for distributed message platform
CN114385647B (en) Alliance link-out block method, alliance link-out block device, electronic equipment and medium
CN113301076B (en) Flow control method, distributed system, device and storage medium
CN113268272B (en) Application delivery method, device and system based on private cloud
CN111459653B (en) Cluster scheduling method, device and system and electronic equipment
CN113918436A (en) Log processing method and device
CN111104575B (en) Data grabbing method and device and electronic equipment
CN112149964A (en) Resource allocation method and device
CN115086234B (en) Message processing method, system, equipment and storage medium
CN112905358A (en) Software distribution method, device and system of distributed system
CN113051103B (en) Data processing method and device and electronic equipment
CN115086234A (en) Message processing method and system, device and storage medium
CN116962496A (en) Search service framework, search service request processing method, service isolation method and equipment
CN113342501A (en) System fault processing method and device
CN113490018A (en) Advertisement playing method, playing end, management end and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant