WO2016150051A1 - 用于消息队列下发消息的方法和消息下发装置 - Google Patents
用于消息队列下发消息的方法和消息下发装置 Download PDFInfo
- Publication number
- WO2016150051A1 WO2016150051A1 PCT/CN2015/084809 CN2015084809W WO2016150051A1 WO 2016150051 A1 WO2016150051 A1 WO 2016150051A1 CN 2015084809 W CN2015084809 W CN 2015084809W WO 2016150051 A1 WO2016150051 A1 WO 2016150051A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- message
- priority
- queue
- message queue
- sent
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/21—Monitoring or handling of messages
- H04L51/226—Delivery according to priorities
Definitions
- the present application relates to the field of computer network communication, and in particular, to a method for sending a message in a message queue and a message delivery device.
- a message queue is a container that holds messages during the transmission of a message.
- the message queue manager acts as a middleman when relaying messages from the source to the destination.
- the main purpose of message queues is to provide routing and guarantee the delivery of messages. If the message fails to be sent, the message queue retains the message until it can be successfully delivered.
- the traditional message queue is issued according to the "first in, first out” queue customization method. Later, the queue and the stack are mutually converted. This realizes that the message can be "first in, first out” or “behind” according to the actual situation.
- the first-out method is issued, but these methods cannot solve the commercial requirement of the real-time priority of the message sent by the queue. People finally think of the characteristics of the dependency database, store the queue in the data table, then process the delivery sequence through the sort command, and send the message in order. However, there is a defect in this method. When the delivery channel is blocked and the sequence in the data table cannot be listed, the newly entered message cannot be given priority. Only the queue that was blocked before is sent out, and then the delivery can be continued. This will result in delays in the delivery time.
- a method for sending a message by a message queue includes: receiving a request for the message to enter the message queue, and acquiring parameters of the message Determining, according to parameter information of the message, a priority of the message, inserting the message into the message queue according to a priority of the message; and ordering each message in the message queue in a priority order Issued.
- the method can optimize the time of message dequeue, ensure that key services can be processed quickly, avoid long-term delay of light weighted messages, reduce system application risk, and improve user real-time interactive experience.
- the message queue is stored in a buffer area and receives a message entry request through an application programming interface.
- an application programming interface is used to receive a request for a message into the column, and the interface can be connected to other applications, and the method of writing to a database or a medium is widely used. And using this interface does not require access to the source code, or understand the details of the internal working mechanism, which makes the operation simple and fast.
- the current weight and the time coefficient of the message determine the current priority of the message, reinsert the message queue according to the current priority of the message, and deliver the messages in the message queue in the current priority order.
- the priority of the message is determined by a combination of the weight of the message and the time coefficient of the message. Among them, through the different weights of the message and the time coefficient, the priority of a variety of messages can be formed, and the selection order of the message is more extensive and scientific.
- the priority of the message is determined by the product of the weight of the message and the time coefficient of the message.
- the weight of the message is determined by the product of the weight of the message and the time coefficient of the message.
- different degrees of importance are attached to different parameters for different situations.
- This application can use other arithmetic methods such as powers or functions.
- Those skilled in the art can modify the parameters of the above formula or make other modifications or operations on the relationship between the parameters.
- the time coefficient of each message in the message queue is updated after each message is sent.
- the update of the time coefficient ensures that the message priority increases with time, ensuring that the message is promptly dequeued.
- the priority of each message in the message queue is updated after each message is sent. Among them, the update of the message priority meets the needs of business changes.
- the message is encapsulated and converted into an identifiable push entity, and the push entity is submitted to an operation gateway, and the push entity is delivered by the operation gateway.
- the sending, by the sending, the message in the message queue in the order of priority further comprises: storing the status information of the sent message into a message state library.
- the message queues in the buffer area are monitored by a thread, and the messages are sent according to the priority of each message in the message queue.
- a message delivery device including: a priority determining unit, receiving a request for the message to enter the message queue, acquiring parameter information of the message, and determining, according to parameter information of the message, The message is prioritized, and the message is inserted into the message queue according to the priority of the message; the message delivery unit sends the messages in the message queue in the priority order.
- the priority determining unit may include: a priority updating unit, when the message in the message queue fails to be sent, determining a current priority of the message according to the obtained current weight and time coefficient of the message
- the message queue is re-inserted according to the current priority of the message, and/or the message encapsulating unit, and the message is encapsulated and converted into an identifiable push entity, and submitted to the operation gateway for delivery by the operation gateway.
- the push entity may include: a priority updating unit, when the message in the message queue fails to be sent, determining a current priority of the message according to the obtained current weight and time coefficient of the message.
- Priority row The order is comprehensively determined by, for example, message weight, push time, and the like.
- the message When the message enters the queue, it receives the weight declaration and then inserts it into a reasonable queue position according to the stacking time.
- the above priority is updated as the time coefficient of each message is updated after each message is sent. Therefore, the time for message dequeue can be optimized, the critical service can be processed quickly, the long-term delay of the lighter weight message is avoided, the system application risk is reduced, and the real-time interactive experience of the user is improved.
- FIG. 1 is a schematic flowchart of a message sent by a message queue according to an embodiment of the present application
- FIG. 2 is a structural block diagram of a message delivery apparatus according to an embodiment of the present application.
- FIG. 1 is a schematic flow chart of a message queue sending message according to an embodiment of the present application. As shown, the method of this embodiment includes a process of a forward process and a process of a self-loop process. Specifically include:
- Process 1 receiving a request for the message to enter the message queue, obtaining parameter information of the message, determining a priority of the message according to parameter information of the message, and inserting the message according to a priority of the message Go to the message queue.
- the process includes:
- Step S101 Receive a message enqueue request.
- an API Application Programming Interface
- the API is some predefined function, the purpose is to provide the ability of applications and developers to access a set of routines based on a certain software or hardware. It eliminates the need for applications and developers to access source code or understand the details of internal workings.
- the API receives the incoming request passed by the application unit.
- An example of the function definition of the receiving application unit is exemplarily given below:
- the message entry can also use the conventional method of writing to the database or media, and then use a separate program to traverse the delivery of the incoming message.
- the above message is reconciled when the request is enqueued, and the request queue provides a message entity, which includes the recipient of the message, the delivered content, and an optional weight value.
- the message queue receives a request for a message to enter the message queue.
- the weights are allocated by the application project unit, and the distribution conditions are also designed by the application project unit according to the business. Low weight messages can be made by using time coefficients There is also a higher priority than high-weight messages, avoiding low-weight blocking.
- Step S102 acquiring the weight of the message, the current time coefficient of the message (the time of the message in the queue), and comprehensively determining the priority of the message by using the weight of the message and the time coefficient of the message.
- the way is for example:
- Priority of the message weight of the message * current time coefficient of the message.
- the above formula schematically reflects the priority of the message, and the calculation is relatively simple, so that it is easy to intuitively reflect and select a higher priority.
- different degrees of importance are attached to different parameters for different situations.
- the present application may also employ other arithmetic methods such as powers or functions. It is to be understood by those skilled in the art that the parameters of the formulas in the present application may be modified, or other modifications or operations may be made to the relationship between the parameters, which are within the scope of the present application.
- Step S103 Insert the above message into the message queue buffer according to the order of the priority of the priority of entering the queue (in order of high and low), and form a message queue of the message to be delivered. For example, the higher the priority, the earlier the message is inserted into the cache.
- Process 2 The messages in the message queue are delivered in priority order.
- the process includes:
- Step S201 In the above step S104, the message continuously enters the queue to form a message queue of the message to be delivered.
- Step S202 A thread is used to listen to the message queue buffer area. When there is a message to be delivered in the message queue buffer area, the message is sent in the order of priority of the message, and the set of the sent message is obtained. number).
- Step S203 When the message enters, the message entity is encapsulated, and the encapsulation process is a combination of the constraint condition of the message entity to the third-party operator (such as the receiving element name of each operator, the service identification code, the device identification code, etc.) and Encapsulation of its own business generality (such as the business event identification code contained in the message body: offline, notification, presentation, etc.), the purpose is to convert it into a push entity recognizable by the application software for message push.
- the message push adopts the aurora push (JPush) mode.
- the Aurora Push is a free third-party messaging service open to the average developer.
- the above push entity is submitted to the Aurora Operation Gateway for push service.
- Step S204 The receiving Aurora operation gateway returns the result provided by the service of the operator.
- Step S205 According to the result returned by the aurora operation gateway, it is determined whether the message is delivered successfully, and the feedback result is recorded in the database for reference whether the transmission succeeds or fails.
- Step S206 When a message in the message queue fails to be sent, the current priority of the message is determined according to the obtained current parameter information of the message, and the message queue is reinserted according to the current priority of the message.
- Steps S201 to S206 are repeated, and the messages in the message queue are delivered in the current priority order.
- the time coefficient of each message in the message queue is updated after each message is sent.
- the priority of each message in the message queue is updated after each message is sent. The message is sent to the message queue buffer to be delivered, and the message is sent in the above manner until the message sent in the message queue is 0.
- FIG. 2 is a schematic block diagram showing the structure of a message delivery apparatus according to an embodiment of the present application.
- the message delivery device 1 includes a priority determination unit 11 and a message delivery unit 12, wherein the priority determination unit 11 includes a priority update unit 111 and a message encapsulation unit 112.
- the priority determining unit 11 is configured to receive a request for the message to enter the message queue, obtain parameter information of the message, determine a priority of the message according to parameter information of the message, and according to the The priority of the message inserts the message into the message queue; the priority update unit 111 is configured to determine the message according to the current weight and time coefficient of the obtained message when the message in the message queue fails to be sent. The current priority, the message is reinserted into the message queue according to the current priority of the message.
- the message encapsulating unit 112 encapsulates and converts the message into an identifiable push entity.
- the message delivery unit 12 is configured to submit the messages in the message queue that are converted into the push entity to the operation gateway in the order of priority, and then send the message to the operation gateway.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
Abstract
Description
Claims (10)
- 用于消息队列下发消息的方法,包括:(1)接收所述消息进入所述消息队列的请求,获取所述消息的参数信息,根据所述消息的参数信息确定所述消息的优先级,根据所述消息的优先级将所述消息插入到所述消息队列中;(2)将所述消息队列中的各个消息按所述优先级顺序地下发。
- 根据权利要求1所述的方法,其中,所述步骤(1)中的消息队列保存在缓存区,通过应用程序编程接口接收所述消息入列的请求。
- 根据权利要求1所述的方法,其中,所述步骤(2)中,当下发所述消息队列中的消息失败时,根据获取的该消息当前的权重和时间系数,确定该消息当前的优先级,将该消息按当前的优先级重新插入所述消息队列,将所述消息队列中的各个消息按当前的优先级顺序进行下发。
- 根据权利要求3所述的方法,其中,所述消息的优先级是通过所述消息的权重和所述消息的时间系数的乘积确定的。
- 根据权利要求4所述的方法,其中,所述消息队列中的各个消息的时间系数在每次消息下发后进行更新。
- 根据权利要求5所述的方法,其中,所述消息队列中的各个消息的优先级在每次消息的下发后进行更新。
- 根据权利要求1所述的方法,其中,所述步骤(2)包括:将所述消息进行封装、转换成可识别的推送实体,将所述推送实体提交到运营网关,由所述运营网关下发所述推送实体。
- 根据权利要求1所述的方法,其中,所述步骤(2)还包括,将所述下发消息的状态信息存入消息状态库;和/或通过线程监听缓存区内的所述消息队列,根据所述消息队列中所述各个消息的优先级下发所述各个消息。
- 消息下发装置,包括:优先级确定单元(11),接收所述消息进入所述消息队列的请求,获取所述消息的参数信息,根据所述消息的参数信息确定所述消息的优先级,根据所述消息的优先级将所述消息插入到所述消息队列中;消息下发单元(12),将所述消息队列中的各个消息按所述优先级顺序地下发。
- 根据权利要求9所述的消息下发装置,其中所述优先级确定单元(11)包括:优先级更新单元(111),当下发所述消息队列中的消息失败时,根据获取的该消息当前的权重和时间系数,确定该消息当前的优先级,按该消息当前的优先级重新插入所述消息队列,和/或消息封装单元(112),将所述消息进行封装、转换成可识别的推送实体,提交到运营网关,以由所述运营网关下发所述推送实体。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510130179.7A CN104753769A (zh) | 2015-03-24 | 2015-03-24 | 用于消息队列下发消息的方法和消息下发装置 |
CN201510130179.7 | 2015-03-24 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016150051A1 true WO2016150051A1 (zh) | 2016-09-29 |
Family
ID=53592911
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/084809 WO2016150051A1 (zh) | 2015-03-24 | 2015-07-22 | 用于消息队列下发消息的方法和消息下发装置 |
Country Status (3)
Country | Link |
---|---|
US (1) | US20160285812A1 (zh) |
CN (1) | CN104753769A (zh) |
WO (1) | WO2016150051A1 (zh) |
Families Citing this family (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104753769A (zh) * | 2015-03-24 | 2015-07-01 | 新余兴邦信息产业有限公司 | 用于消息队列下发消息的方法和消息下发装置 |
CN105068864B (zh) * | 2015-07-24 | 2020-02-07 | 北京京东尚科信息技术有限公司 | 处理异步消息队列的方法及系统 |
CN106470169A (zh) * | 2015-08-19 | 2017-03-01 | 阿里巴巴集团控股有限公司 | 一种业务请求调整方法及设备 |
US9319365B1 (en) * | 2015-10-09 | 2016-04-19 | Machine Zone, Inc. | Systems and methods for storing and transferring message data |
CN107784025A (zh) * | 2016-08-31 | 2018-03-09 | 北京国双科技有限公司 | 一种数据更新方法及装置 |
CN107786623B (zh) * | 2016-09-20 | 2021-03-30 | 平安科技(深圳)有限公司 | 消息异步处理方法和装置 |
CN106453141B (zh) * | 2016-10-12 | 2019-11-15 | 中国联合网络通信集团有限公司 | 全局队列调整方法、业务流队列调整方法和网络系统 |
CN106776401B (zh) * | 2016-11-23 | 2019-11-15 | 东软集团股份有限公司 | 消息传输方法和装置 |
US10250440B2 (en) * | 2016-11-29 | 2019-04-02 | International Business Machines Corporation | Managing a generation and delivery of digital identity documents |
CN108156192A (zh) * | 2016-12-02 | 2018-06-12 | 联芯科技有限公司 | 安卓ril消息处理系统及方法 |
CN107426025A (zh) * | 2017-07-28 | 2017-12-01 | 江西山水光电科技股份有限公司 | 一种增强网管北向消息响应度的调度方法 |
CN107741884B (zh) * | 2017-10-09 | 2020-10-27 | 武汉斗鱼网络科技有限公司 | 一种分层状态机实现消息推送的方法和装置 |
CN107734062B (zh) * | 2017-11-15 | 2020-02-07 | 维沃移动通信有限公司 | 消息推送方法及装置 |
CN110609758A (zh) * | 2019-08-30 | 2019-12-24 | 恒大智慧科技有限公司 | 基于队列的设备运行方法、计算机设备及可读存储介质 |
CN111158934B (zh) * | 2019-12-31 | 2023-05-02 | 中国银行股份有限公司 | 基于缓冲队列接收数据实现不同级别延迟拼接方法和装置 |
CN111897825A (zh) * | 2020-06-01 | 2020-11-06 | 中国人民财产保险股份有限公司 | 分布式事务处理方法和装置 |
CN113434301A (zh) * | 2021-07-19 | 2021-09-24 | 深圳市链融科技股份有限公司 | 信息推送方法、装置、计算机设备及存储介质 |
CN114553946B (zh) * | 2022-01-29 | 2024-01-19 | 北京金堤科技有限公司 | 一种对消息进行处理的方法及装置 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1878131A (zh) * | 2005-06-10 | 2006-12-13 | 华为技术有限公司 | 进行流量控制的方法和系统 |
CN101034996A (zh) * | 2006-03-09 | 2007-09-12 | 腾讯科技(深圳)有限公司 | 即时消息推送方法及其系统 |
CN101582786A (zh) * | 2009-06-17 | 2009-11-18 | 中兴通讯股份有限公司 | 一种及时消息及时处理的方法及装置 |
CN101778101A (zh) * | 2009-12-31 | 2010-07-14 | 卓望数码技术(深圳)有限公司 | 一种消息传送方法和消息传送系统 |
CN104753769A (zh) * | 2015-03-24 | 2015-07-01 | 新余兴邦信息产业有限公司 | 用于消息队列下发消息的方法和消息下发装置 |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6115365A (en) * | 1998-07-30 | 2000-09-05 | Motorola, Inc. | Method and apparatus for queuing and transmitting messages |
US7058082B1 (en) * | 2000-09-06 | 2006-06-06 | Cisco Technology, Inc. | Communicating messages in a multiple communication protocol network |
US6856599B1 (en) * | 2000-09-13 | 2005-02-15 | Harris Corporation | System and method of reducing retransmission of messages in a TCP/IP environment |
US8234338B1 (en) * | 2001-04-20 | 2012-07-31 | Microsoft Corporation | System and method for reliable message delivery |
US7895273B1 (en) * | 2003-01-23 | 2011-02-22 | Sprint Spectrum L.P. | System and method for sorting instant messages |
CN1635781A (zh) * | 2003-12-29 | 2005-07-06 | 北京中视联数字系统有限公司 | 一种数字电视接收机中间件消息统一处理方法 |
CN100370845C (zh) * | 2004-12-22 | 2008-02-20 | 华为技术有限公司 | 在宽带码分多址系统中对小区广播服务消息调度的方法 |
KR100726042B1 (ko) * | 2006-03-16 | 2007-06-08 | 포스데이타 주식회사 | 휴대 인터넷 서비스의 큐오에스 제공 방법 및 시스템 |
CN101453716B (zh) * | 2008-11-04 | 2010-06-09 | 中国移动通信集团福建有限公司 | 基于短信应用网关的短信下发调度系统 |
CN102487494B (zh) * | 2009-10-26 | 2015-05-13 | 中国电信股份有限公司 | 短信流量控制方法和系统 |
CN101778055B (zh) * | 2009-12-31 | 2013-03-13 | 卓望数码技术(深圳)有限公司 | 一种消息处理方法和网络实体 |
CA2762739C (en) * | 2010-12-29 | 2021-01-12 | Bce Inc. | Method and system for transmitting a network-initiated message to a mobile device |
CN103139732A (zh) * | 2011-11-24 | 2013-06-05 | 方正国际软件有限公司 | 一种改进的短信发送方法及系统 |
CN103516585B (zh) * | 2012-06-29 | 2017-04-26 | 北京奇虎科技有限公司 | 一种实现消息优先级分发的方法及系统 |
CN103458384B (zh) * | 2013-09-27 | 2017-02-01 | 武钢集团昆明钢铁股份有限公司 | 一种企业短信息发送系统及方法 |
CN103888619B (zh) * | 2014-04-16 | 2016-03-23 | 青岛海信电子设备股份有限公司 | 一种消息处理方法及其系统 |
CN103986653B (zh) * | 2014-05-29 | 2017-03-22 | 苏州大学 | 一种网络节点及数据传输方法和系统 |
-
2015
- 2015-03-24 CN CN201510130179.7A patent/CN104753769A/zh active Pending
- 2015-07-22 WO PCT/CN2015/084809 patent/WO2016150051A1/zh active Application Filing
-
2016
- 2016-01-28 US US15/008,806 patent/US20160285812A1/en not_active Abandoned
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1878131A (zh) * | 2005-06-10 | 2006-12-13 | 华为技术有限公司 | 进行流量控制的方法和系统 |
CN101034996A (zh) * | 2006-03-09 | 2007-09-12 | 腾讯科技(深圳)有限公司 | 即时消息推送方法及其系统 |
CN101582786A (zh) * | 2009-06-17 | 2009-11-18 | 中兴通讯股份有限公司 | 一种及时消息及时处理的方法及装置 |
CN101778101A (zh) * | 2009-12-31 | 2010-07-14 | 卓望数码技术(深圳)有限公司 | 一种消息传送方法和消息传送系统 |
CN104753769A (zh) * | 2015-03-24 | 2015-07-01 | 新余兴邦信息产业有限公司 | 用于消息队列下发消息的方法和消息下发装置 |
Also Published As
Publication number | Publication date |
---|---|
CN104753769A (zh) | 2015-07-01 |
US20160285812A1 (en) | 2016-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2016150051A1 (zh) | 用于消息队列下发消息的方法和消息下发装置 | |
US10178063B2 (en) | System and method for serving a message client | |
US8949348B2 (en) | Controlling message delivery in publish/subscribe messaging | |
US9141447B2 (en) | Conditional deferred queuing | |
US10541957B2 (en) | Using e-mail message characteristics for prioritization | |
US8949258B2 (en) | Techniques to manage file conversions | |
US20150081839A1 (en) | Fast sequential message store | |
US8271683B2 (en) | Content push service | |
US20130066674A1 (en) | Marketplace for timely event data distribution | |
US20140344327A1 (en) | Content interchange bus | |
US20110307948A1 (en) | Extending a customer relationship management eventing framework to a cloud computing environment in a secure manner | |
US9513833B2 (en) | Asynchronous processing of mapping information | |
AU2013347966A1 (en) | System and method for serving a message client | |
WO2015096692A1 (zh) | 数据接收流量控制方法及其系统、计算机存储介质 | |
KR101795333B1 (ko) | 클라우드 프로세스 관리 | |
US9589007B2 (en) | Method for issuing multipart receipts in connection to extensive database operations | |
US20190109806A1 (en) | Secure electronic message conveyance | |
US10558716B2 (en) | Adaptive content-based publish/subscribe messaging | |
JP2009514051A (ja) | 添付ファイルを含む電子メッセージをユーザ側で処理する方法および装置 | |
RU2463709C2 (ru) | Транспортная агностическая служба передачи сообщений с режимом извлечения | |
US10341176B2 (en) | System and method for network provisioning | |
US20140122620A1 (en) | Attachment handling during email delivery | |
US9137189B2 (en) | Providing distributed dynamic routing using a logical broker | |
US11070494B2 (en) | Managing email content in an activity stream | |
US9143472B2 (en) | Updating an e-mail recipient list |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15885985 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 15885985 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23.02.2018) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 15885985 Country of ref document: EP Kind code of ref document: A1 |