Message enqueue method, device, electronic device and computer-readable medium

By determining the sending priority based on the number of messages in the message set before the message is enqueued, and dynamically adjusting the dequeuing order of messages is solved, the problem of failure to effectively consider the message priority in the prior art is solved, and the efficiency of message is improved.

CN112256458BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011242591.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-09
Publication Date
2025-02-21
Estimated Expiration
2040-11-09

AI Technical Summary

Technical Problem

The existing message enqueuing method fails to effectively consider the priority of the message, resulting in messages that should be sent first cannot be dequeued in time, thereby reducing the efficiency of message issuance.

Method used

Before the message is enqueued, the sending priority is determined by the number of messages in the message set, so that the message can dynamically adjust the dequeuing order according to the sending priority when dequeuing.

Benefits of technology

By dynamically adjusting the order of messages dequeuing, messages with higher priority can be sent in a timely manner, and the efficiency of message is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112256458B_ABST
    Figure CN112256458B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a message enqueuing method, device, electronic device and computer-readable medium. A specific implementation of the method includes: verifying a message sending request; in response to determining that the message sending request has passed the verification, determining the sending priority of the message set corresponding to the message sending request; adding the message set to the message queue of the corresponding message sending channel, wherein the messages in the message queue are dequeued according to the sending priority. This implementation solves the problem that less consideration is given to the priority of the message, which may cause the message that should be sent first to fail to be dequeued in time after the message is enqueued.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a message enqueueing method, device, electronic device, and computer-readable medium. Background Art

[0002] Message enqueuing is a technology that adds messages produced by producers to message queues. Message enqueuing technology achieves decoupling between different modules by adding messages to message queues. The relevant message enqueuing method usually adds messages to the message queue in the order in which they are generated, and when dequeuing messages, the messages that enter the message queue first are dequeued according to the order in which they are enqueued.

[0003] However, when the above method is used to enqueue messages, the following technical problems often occur:

[0004] First, the priority of messages is rarely considered, which may cause messages that should be sent first to fail to be dequeued in time after they are queued.

[0005] Second, the priority of messages cannot be adjusted dynamically to ensure that high-priority messages are sent first, which leads to low efficiency in sending messages. Summary of the invention

[0006] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0007] Some embodiments of the present disclosure propose a message enqueueing method, an apparatus, an electronic device, and a computer-readable medium to solve one or more of the technical problems mentioned in the above background technology section.

[0008] In a first aspect, some embodiments of the present disclosure provide a method for enqueuing a message, the method comprising: verifying a message sending request. In response to determining that the message sending request has passed the verification, determining a sending priority of a message set corresponding to the message sending request. Adding the message set to a message queue of the corresponding message sending channel, wherein the messages in the message queue are dequeued according to the sending priority.

[0009] In a second aspect, some embodiments of the present disclosure provide a message enqueuing device, the device comprising: a verification unit, configured to verify a message sending request. A determination unit, configured to, in response to determining that the message sending request has passed verification, determine the sending priority of a message set corresponding to the message sending request. The message enqueuing unit, configured to add the message set to a message queue of the corresponding message sending channel, wherein the messages in the message queue are dequeued according to the sending priority.

[0010] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0011] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0012] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: by enqueuing messages through the message enqueuing methods of some embodiments of the present disclosure, the message sending efficiency is improved. Specifically, the inventors found that the reason for the low efficiency of message sending is that the priority of the message is less considered, and thus, after the message is enqueued, the message that should be sent first may not be dequeued in time. Based on this, the message enqueuing methods of some embodiments of the present disclosure determine the sending priority by the number of messages in the message set before the message is enqueued, so that the dequeuing order of the message can be dynamically adjusted according to the sending priority when the message is dequeued. Because the message can be dequeued according to the sending priority, the message with a higher sending priority can be sent first. Thereby, the message with a higher sending priority can be sent in time. Thereby, the message sending efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0014] Figure 1 is a schematic diagram of an application scenario of a message enqueueing method according to some embodiments of the present disclosure;

[0015] Figure 2 is a flowchart of some embodiments of the message enqueue method according to the present disclosure;

[0016] Figure 3 A flow chart for determining an interface response state in a message enqueue method according to some embodiments of the present disclosure is shown;

[0017] Figure 4 are flowcharts of other embodiments of the message enqueueing method according to the present disclosure;

[0018] Figure 5 is a schematic diagram of the structure of some embodiments of the message enqueueing device according to the present disclosure;

[0019] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0021] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0022] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0023] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0024] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0025] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0026] Figure 1 It is a schematic diagram of an application scenario of the message enqueueing method according to some embodiments of the present disclosure.

[0027] exist Figure 1In the application scenario, first, the computing device 101 can verify the message sending request 102. Then, in response to determining that the message sending request 102 has passed the verification, the computing device 101 can determine the sending priority 104 of the message set 103 corresponding to the message sending request 102. Finally, the computing device 101 can add the message set 103 to the message queue 105 of the corresponding message sending channel, wherein the messages in the message queue 105 are dequeued according to the sending priority 104.

[0028] It should be noted that the computing device 101 can be hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or it can be implemented as a single server or a single terminal device. When the computing device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software and software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0029] It should be understood that Figure 1 The number of computing devices in the embodiment is only illustrative. Any number of computing devices may be provided according to implementation requirements.

[0030] Continue to refer Figure 2 , shows a process 200 of some embodiments of the message enqueue method according to the present disclosure. The message enqueue method comprises the following steps:

[0031] Step 201, verifying the message sending request.

[0032] In some embodiments, the execution body of the message enqueue method (such as Figure 1 The computing device 101 shown in the figure can verify the message sending request. Among them, the message sending request may include but is not limited to at least one of the following: message content, mobile phone number group, message content template identifier. The message content template identifier may be a unique identifier of the message content template used by the message content. The message content may meet a variety of target application scenarios. For example, the message content may be promotional information in a promotional application scenario. For another example, the message content may be login verification code information or registration verification code information in a security verification application scenario. The target application scenario may be any scenario. For example, the target application scenario may be a password reset scenario. For another example, the target application scenario may be a personal information binding scenario. The mobile phone number group may include at least one mobile phone number. The mobile phone number may be the mobile phone number corresponding to the receiving terminal to which the message content is to be sent.

[0033] In practice, the execution entity can verify the message sending request in a variety of ways. As an example, the message content and the mobile phone number group included in the message sending request can be verified respectively. It can be understood that a message content template can be set in advance, and the message content can be verified by comparing the message content with the message content template. All mobile phone numbers stored in the database can be marked in advance, so that the mobile phone number group can be verified by the mark of each mobile phone number in the mobile phone number group. For another example, the message content template identifier of each message content template can be stored in the database in advance. The message sending request can be verified by determining whether the message content template identifier included in the message sending request is stored in the database.

[0034] As an example, the above message content template may be "

****

****

[0035] Step 202: In response to determining that the message sending request passes verification, determine the sending priority of the message set corresponding to the message sending request.

[0036] In some embodiments, in response to determining that the message sending request has been verified, the execution subject may determine the sending priority of the message set corresponding to the message sending request. As an example, the message sending request being verified may mean that the message content matches the message content template and / or the tags of each mobile phone number in the mobile phone number group do not include a preset tag and / or the message content template identifier is stored in the database. The preset tag may be "1", which is used to indicate that the mobile phone number is a blacklisted mobile phone number. The sending priority may be used to determine the priority of the messages in the message set when they are dequeued from the message queue. The messages in the message set may be generated by the message content and the mobile phone number group included in the message sending request. In practice, as an example, a priority may be set in advance for each message content template and stored in a database. Then, the priority of the message content template represented by the message content template identifier may be obtained in the database and determined as the sending priority. In practice, as an example, the messages in the message set may be composed of the message content and the mobile phone number in the message sending request. The mobile phone number is used to identify the receiving terminal that receives the message content. The sending priority can be determined by the number of mobile phone numbers included in the mobile phone number group. In practice, as an example, a number interval can be pre-defined so that each number interval corresponds to a sending priority, and the sending priority is determined by determining the number interval in which the number of mobile phone numbers included in the mobile phone number group is located. For another example, the number of mobile phone numbers included in the mobile phone number group can be used as the sending priority.

[0037] Step 203: Add the message set to the message queue of the corresponding message sending channel.

[0038] In some embodiments, the execution subject may add the message set to the message queue of the corresponding message delivery channel. The message delivery channel may be a message delivery channel randomly assigned by the execution subject to the message set. The messages in the message queue are dequeued according to the sending priority. In practice, as an example, the message queue may be a message queue that supports priority. For example, RabbitMQ (Rabbit Message Queue). Another example is ActiveMq (Active Message Queue). The message delivery channel may correspond to a gateway interface of a communication service provider (for example, an operator) in a fixed manner. The message delivery channel may send the received message to the gateway interface after receiving the message dequeued from the message queue. The gateway interface may send the message content in the received message to the receiving terminal corresponding to the mobile phone number in the message. For another example, the message delivery channel may send the message content in the received message directly to the receiving terminal corresponding to the mobile phone number in the message through its own delivery interface.

[0039] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: by enqueuing messages through the message enqueuing methods of some embodiments of the present disclosure, the message sending efficiency is improved. Specifically, the inventors found that the reason for the low efficiency of message sending is that the priority of the message is less considered, and thus, after the message is enqueued, the message that should be sent first may not be dequeued in time. Based on this, the message enqueuing methods of some embodiments of the present disclosure determine the sending priority by the number of messages in the message set before the message is enqueued, so that the dequeuing order of the message can be dynamically adjusted according to the sending priority when the message is dequeued. Because the message can be dequeued according to the sending priority, the message with a higher sending priority can be sent first. Thereby, the message with a higher sending priority can be sent in time. Thereby, the message sending efficiency is improved.

[0040] Further references Figure 3 , which shows a process 300 of another embodiment of a message enqueue method. The process 300 of the message enqueue method includes the following steps:

[0041] Step 301, verify the message sending request.

[0042] In some embodiments, the execution body of the message enqueue method (such as Figure 1The computing device 101 shown in the figure can verify the above-mentioned message sending request. Among them, the above-mentioned message sending request may include but is not limited to at least one of the following: message content, mobile phone number group, account information corresponding to the above-mentioned message sending request. The above-mentioned account information may include but is not limited to at least one of the following: account name, password, IP address (Internet Protocol Address). The above-mentioned IP address may be the IP address of the account corresponding to the account information when it last logged in. The above-mentioned account name and password can be used to log in to the message service platform. The above-mentioned message service platform can provide a message sending function for the account corresponding to the above-mentioned account information. The account corresponding to the above-mentioned account information can be assigned a fixed message sending channel when registering. Then the message set corresponding to the above-mentioned message sending request can be added to the message queue of the above-mentioned message sending channel.

[0043] In some embodiments, the execution subject verifies the message sending request, which may include but is not limited to at least one of the following verification steps:

[0044] The first step is to determine whether the message content includes at least one blocked word in a preset blocked word group, wherein the preset blocked word may be a word that is prohibited from appearing in the message content.

[0045] As an example, the preset blocked phrase group may be [loan, rebate, promotion]. The message content may be "Verification code: 667154, valid for 10 minutes. If it is not operated by me, please ignore it." It can be determined that the message content "Verification code: 667154, valid for 10 minutes. If it is not operated by me, please ignore it." does not include the blocked words in the preset blocked phrase group. The message content may be "Dear, you have been given a loan amount. Click here to view http: / / **.******.com". The message content "Dear, you have been given a loan amount. Click here to view http: / / **.******.com" includes the blocked word "loan" in the preset blocked phrase group.

[0046] The second step is to remove the mobile phone numbers that meet the first preset condition from the mobile phone number group to obtain the target mobile phone number group. The first preset condition is set based on the preset mobile phone number group. The preset mobile phone number group is pre-stored in the memory cache database. The first preset condition may be that the mobile phone number is a mobile phone number in the preset mobile phone number group. The mobile phone numbers included in the preset mobile phone number group may be mobile phone numbers on which the account corresponding to the mobile phone number has performed illegal operations. The illegal operation may be a brushing operation.

[0047] The third step is to determine whether the account information satisfies a second preset condition, wherein the second preset condition may be that the account name and password included in the account information match and the IP address included in the account information is a legal IP address.

[0048] The fourth step is to determine whether the message sending request submission frequency corresponding to the account information meets the third preset condition. The third preset condition may be that the message sending request submission frequency is less than the preset message sending request submission frequency.

[0049] As an example, the preset message sending request submission frequency may be 1 time / minute. "1 time / minute" may mean that within 1 minute from the time when the execution subject receives the message sending request, the total number of times the account corresponding to the account information submits the message sending request is less than 1 time. If the message sending request submission frequency is not less than the preset message sending request submission frequency, the message sending request may not be responded to. At the same time, a prompt message indicating that the submission frequency exceeds the limit may be sent to the account corresponding to the message sending request.

[0050] Step 302, in response to determining that the message sending request has passed verification, determining the sending priority of the message set according to the number of messages in the message set and the account priority corresponding to the message sending request.

[0051] In some embodiments, the execution subject may determine the sending priority of the message set according to the number of messages in the message set and the account priority corresponding to the message sending request in response to determining that the number of target mobile phone numbers in the target mobile phone number group is not zero, the message content does not include any blocked word in the preset blocked word group, the account information satisfies the second preset condition, and the frequency of submitting the message sending request satisfies the third preset condition. The account priority may be the account priority assigned to the account corresponding to the message sending request when it is registered. The account priority may be represented by a number, and the smaller the number, the higher the account priority.

[0052] As an example, the account priorities can be represented by 1, 2, and 3. 1 can be used to represent the account priority of an administrator account. 2 can be used to represent the account priority of a first-level ordinary user account. 3 can be used to represent the account priority of a second-level ordinary user account. The first-level ordinary user account can be an account with a business need for sending verification codes. The second-level ordinary user account can be an account with a business need for sending batch promotion information. The fewer the number of messages in the message set, the more important the messages in the message set. The sending priority can be represented by the product of the account priority and the number of messages in the message set. The smaller the product value, the higher the level of the sending priority.

[0053] The above steps, as an inventive point of an embodiment of the present disclosure, solve the second technical problem mentioned in the background technology, "the priority of the message cannot be adjusted dynamically to ensure that the high-priority message is sent first, which leads to low message sending efficiency". The factors that lead to low message sending efficiency are often as follows: the existing message enqueue method cannot accurately determine the sending priority according to the message sending request before the message is enqueued. If the above factors are solved, the effect of improving the message sending efficiency can be achieved. In order to achieve this effect, the present disclosure introduces the account priority of the account corresponding to the message sending request, and comprehensively considers the number of messages in the message set, and determines the sending priority in real time and dynamically before the message is enqueued. The determined sending priority is not only related to the number of messages, but also to the account priority, which improves the accuracy of the determined sending priority. Therefore, the importance of messages can be distinguished by the sending priority, and messages with higher importance are preferentially dequeued according to the sending priority when the message is dequeued. In turn, the message sending efficiency is improved.

[0054] Step 303: Add the message set to the message queue of the corresponding message delivery channel.

[0055] In some embodiments, the specific implementation of step 303 and the technical effects brought about can be referred to Figure 2 The corresponding step 203 in the embodiments will not be described in detail here.

[0056] Step 304: in response to receiving the message dequeue information of the message queue, obtaining the interface response status of the corresponding gateway interface from the message delivery channel.

[0057] In some embodiments, the execution subject may obtain the interface response status of the corresponding gateway interface from the message delivery channel in response to receiving the message dequeue information of the message queue. The interface response status may be used to indicate whether the message is delivered successfully. The message delivery channel may be fixedly corresponding to the gateway interface of a communication service provider (e.g., an operator).

[0058] As an example, the above interface response status can be represented by 0 and 1. 1 can represent the above interface response status as a message sending success status. 0 can represent the above interface response status as a message sending failure status.

[0059] Step 305: Add the interface response status and the identifier corresponding to the message dequeue information to the interface response queue, so as to update the status of the message corresponding to the message dequeue information.

[0060] In some embodiments, the execution subject may add the interface response status and the identifier corresponding to the message dequeue information to the interface response queue, so as to update the status of the message corresponding to the message dequeue information. The identifier may be a unique identifier of the message dequeue information.

[0061] The above-mentioned embodiments of the present disclosure have the following beneficial effects: First, the sending priority is determined in real time and dynamically before the message is queued by the account priority of the account corresponding to the message sending request and the number of messages in the message set. The determined sending priority is not only related to the number of messages, but also to the account priority, which improves the accuracy of the determined sending priority. Therefore, the importance of messages can be distinguished by the sending priority, and messages with higher importance are preferentially dequeued according to the sending priority when the messages are dequeued. Thus, the message sending efficiency is improved. Then, the message set is added to the message queue of the corresponding message sending channel. Thus, the message sets corresponding to different message sending requests are added to the message queue corresponding to the corresponding message sending channel, so that the message sets corresponding to different message sending requests can be added to different message queues, and the messages are shunted through multiple message queues and the messages are dequeued synchronously, thereby improving the message sending capability. Finally, the interface response status and the identifier corresponding to the message dequeue information are added to the specified interface response queue, so as to obtain the interface response information from the interface response queue, and update the interface response status corresponding to the message in an asynchronous manner. Therefore, when sending a message, the time for the outbound interface to respond to the status update can be saved, further improving the efficiency of sending the message.

[0062] Further references Figure 4 , showing a process 400 for determining an interface response state in a message enqueueing method according to some embodiments of the present disclosure. The process 400 for determining an interface response state comprises the following steps:

[0063] Step 401: perform grouping processing on the received messages to generate a target message group.

[0064] In some embodiments, the execution subject of determining the interface response state may perform grouping processing on the received messages to generate a target message group. The target message group may include at least one message. The execution subject may be various software, a computing device 101, or a server.

[0065] As an example, a preset number can be used as the grouping number. After receiving the preset number of messages, each message in the preset number of messages is first added as a grouping message to the grouping message group, and then the grouping message group is used as the target message group. For another example, a preset waiting time can be used as the grouping time. First, each message received within the preset waiting time is added as a grouping message to the grouping message group, and then the grouping message group is used as the target message group.

[0066] In some optional implementations of some embodiments, the execution subject performs grouping processing on the received messages to generate a target message group, which may include the following steps:

[0067] The first step is to add the received message as a package message to the package message group.

[0068] As an example, each time a message is received, the message can be added to the group message group as a group message. Thus, the problem of waste of network resources and low sending efficiency caused by sending a message to the gateway interface corresponding to the message sending channel each time a message is received can be improved. The above-mentioned message sending channel can be fixedly corresponding to the gateway interface of a communication service provider (for example, an operator).

[0069] In the second step, in response to determining that the number of packaged messages in the packaged message group is equal to the preset number and the time difference between the current time and the earliest time of adding the packaged message in the packaged message group is less than the preset waiting time, the packaged message group is determined as the target message group. The preset number of packaged messages is used to limit the maximum number of packaged messages that can be included in the packaged message group. The preset waiting time is used to limit the maximum waiting time of the packaged message group.

[0070] As an example, the preset number may be 1000. The preset waiting time may be 1 second. When the number of grouped messages in the grouped message group is 1000 and the time difference is 0.89 seconds, the grouped message group may be determined as the target message group. At this time, the number of target messages included in the target message group is 1000. Thus, the target message group may be sent to the gateway interface corresponding to the message sending channel in the shortest possible time, thereby improving the sending efficiency.

[0071] In a third step, in response to determining that the number of packaged messages in the packaged message group is less than the preset number and the time difference between the current time and the earliest joining time of the packaged messages in the packaged message group is equal to the preset waiting time, the packaged message group is determined as the target message group.

[0072] As an example, the preset number of packaged messages may be 1000. The preset waiting time may be 1 second. When the number of packaged messages in the packaged message group is 1295 and the time difference is 1 second, the packaged message group may be determined as the target message group. At this time, the number of target messages included in the target message group is 1295. Thus, the number of packaged messages in the packaged message group may be increased as much as possible within the preset time, thereby improving the package efficiency.

[0073] Step 402: Send the target message group to the gateway interface corresponding to the message sending channel.

[0074] In some embodiments, the execution subject may send the target message group to the gateway interface corresponding to the message sending channel via a wired connection or a wireless connection. It should be noted that the wireless connection may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultrawideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0075] Step 403: Determine the interface response status of the gateway interface.

[0076] In some embodiments, the execution entity may determine the interface response status of the gateway interface.

[0077] As an example, the interface response status can be obtained by accessing the above-mentioned gateway interface. For another example, the interface response status can be determined by receiving the interface response status sent by the above-mentioned gateway interface. Thus, it is convenient to update the message sending status according to the above-mentioned interface response status.

[0078] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a message enqueue device, and these device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0079] like Figure 5 As shown, the message enqueueing device 500 of some embodiments includes: a verification unit 501, a determination unit 502 and a message enqueueing unit 503. The verification unit 501 is configured to verify the message sending request. The determination unit 502 is configured to determine the sending priority of the message set corresponding to the message sending request in response to determining that the message sending request has passed the verification. The message enqueueing unit 503 is configured to add the message set to the message queue of the corresponding message sending channel, wherein the messages in the message queue are dequeued according to the sending priority.

[0080] In an optional implementation of some embodiments, the message sending request includes at least one of the following: message content, a mobile phone number group, and account information corresponding to the message sending request.

[0081] In an optional implementation of some embodiments, the verification unit 501 may perform at least one of the following verification steps: determining whether the message content includes at least one blocked word in a preset blocked word group. Eliminating the mobile phone numbers that meet the first preset condition in the mobile phone number group to obtain a target mobile phone number group. The first preset condition is set based on the preset mobile phone number group. Determining whether the account information meets the second preset condition. Determining whether the message sending request submission frequency corresponding to the account information meets the third preset condition.

[0082] In an optional implementation of some embodiments, the above-mentioned preset mobile phone number group is pre-stored in a memory cache database.

[0083] In an optional implementation of some embodiments, the determination unit 502 may be further configured to: in response to determining that the message sending request has passed verification, determine the sending priority of the message set according to the number of messages in the message set and the account priority corresponding to the message sending request.

[0084] In an optional implementation of some embodiments, the device 500 may further include: an acquisition unit (not shown in the figure) and an enqueue unit (not shown in the figure). The acquisition unit may be configured to, in response to receiving the message dequeue information of the message queue, acquire the interface response status of the corresponding gateway interface from the message delivery channel. The enqueue unit may be configured to add the interface response status and the identifier corresponding to the message dequeue information to the interface response queue, so as to update the status of the message corresponding to the message dequeue information.

[0085] In an optional implementation of some embodiments, the interface response state is determined by the following steps: performing packet processing on the received message to generate a target message group, sending the target message group to a gateway interface corresponding to the message sending channel, and determining the interface response state of the gateway interface.

[0086] In an optional implementation of some embodiments, performing a package processing on the received message to generate a target message group includes: adding the received message as a package message to the package message group. In response to determining that the number of package messages in the package message group is equal to a preset number and the time difference between the current time and the earliest adding time of the package message in the package message group is less than a preset waiting time, the package message group is determined as the target message group.

[0087] In an optional implementation of some embodiments, the received messages are grouped to generate a target message group, including: in response to determining that the number of grouped messages in the grouped message group is less than the preset number and the time difference between the current time and the earliest joining time of the grouped messages in the grouped message group is equal to the preset waiting time, determining the grouped message group as the target message group.

[0088] In some embodiments, the efficiency of message sending is improved. Specifically, the inventors found that the reason for the low efficiency of message sending is that the priority of the message is less considered, and thus, after the message is queued, the message that should be sent first may not be dequeued in time. Based on this, the message enqueuing method of some embodiments of the present disclosure determines the sending priority by the number of messages in the message set before the message is queued, so that the dequeuing order of the message can be dynamically adjusted according to the sending priority when the message is dequeued. Because the message can be dequeued according to the sending priority, the message with a higher sending priority can be sent first. As a result, the message with a higher sending priority can be sent in time. Thereby improving the efficiency of message sending.

[0089] Reference below Figure 6 , which shows an electronic device (such as Figure 1 A schematic diagram of the structure of the computing device 101)600 is shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0090] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0091] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0092] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0093] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0094] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0095] The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist independently without being assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: verifies the message sending request. In response to determining that the above-mentioned message sending request has passed the verification, determine the sending priority of the message set corresponding to the above-mentioned message sending request. Add the above-mentioned message set to the message queue of the corresponding message sending channel, wherein the messages in the above-mentioned message queue are dequeued according to the above-mentioned sending priority.

[0096] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0097] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0098] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including a verification unit, a determination unit, and a message enqueue unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the verification unit may also be described as a "unit for verifying a message sending request".

[0099] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0100] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A message enqueue method, comprising: Verify the message sending request; In response to determining that the message sending request passes verification, determining a sending priority of the message set according to the number of messages in the message set corresponding to the message sending request and the account priority corresponding to the message sending request; Adding the message set to the message queue of the corresponding message sending channel, wherein the messages in the message queue are dequeued according to the sending priority; In response to receiving the message dequeue information of the message queue, the interface response status of the corresponding gateway interface is obtained from the message sending channel; the interface response status and the identifier corresponding to the message dequeue information are added to the interface response queue, so as to update the status of the message corresponding to the message dequeue information.

2. The method according to claim 1, wherein: The message sending request includes at least one of the following: message content, mobile phone number group, account information corresponding to the message sending request; and The verifying of the message sending request includes at least one of the following verification steps: Determining whether the message content includes at least one blocked word in a preset blocked word group; Eliminate the mobile phone numbers that meet the first preset condition in the mobile phone number group to obtain the target mobile phone number group, wherein the first preset condition is set based on the preset mobile phone number group; Determining whether the account information satisfies a second preset condition; Determine whether the message sending request submission frequency corresponding to the account information meets a third preset condition.

3. The method according to claim 2, wherein: The preset mobile phone number group is pre-stored in a memory cache database.

4. The method according to claim 1, wherein: The interface response status is determined by the following steps: Performing packet processing on the received messages to generate a target message group; Sending the target message group to the gateway interface corresponding to the message sending channel; An interface response status of the gateway interface is determined.

5. The method according to claim 4, wherein: The step of performing grouping processing on the received messages to generate a target message group includes: Adding the received message as a package message to a package message group; In response to determining that the number of grouped messages in the grouped message group is equal to a preset number and the time difference between the current time and the earliest joining time of the grouped messages in the grouped message group is less than a preset waiting time, the grouped message group is determined as a target message group.

6. The method according to claim 5, wherein: The step of performing grouping processing on the received messages to generate a target message group includes: In response to determining that the number of grouped messages in the grouped message group is less than the preset number and the time difference between the current time and the earliest joining time of the grouped messages in the grouped message group is equal to the preset waiting time, the grouped message group is determined as the target message group.

7. A message enqueue device, comprising: A verification unit, configured to verify the message sending request; a determining unit configured to, in response to determining that the message sending request passes verification, determine a sending priority of the message set according to the number of messages in the message set corresponding to the message sending request and the account priority corresponding to the message sending request; A message enqueue unit is configured to add the message set to a message queue of a corresponding message sending channel, wherein the messages in the message queue are dequeued according to the sending priority; The updating unit is configured to, in response to receiving the message dequeue information of the message queue, obtain the interface response status of the corresponding gateway interface from the message sending channel; add the interface response status and the identifier corresponding to the message dequeue information to the interface response queue, so as to update the status of the message corresponding to the message dequeue information.

8. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and device for issuing messages by message queue

    CN104753769A

  • Message queue processing method, device and equipment and storage medium

    CN109766200A