Nothing Special   »   [go: up one dir, main page]

CN107396331A - Short message sending method and device based on priority queue - Google Patents

Short message sending method and device based on priority queue Download PDF

Info

Publication number
CN107396331A
CN107396331A CN201710852442.2A CN201710852442A CN107396331A CN 107396331 A CN107396331 A CN 107396331A CN 201710852442 A CN201710852442 A CN 201710852442A CN 107396331 A CN107396331 A CN 107396331A
Authority
CN
China
Prior art keywords
short message
priority
sent
short
query
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.)
Pending
Application number
CN201710852442.2A
Other languages
Chinese (zh)
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.)
Mashang Consumer Finance Co Ltd
Original Assignee
Mashang Consumer Finance 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 Mashang Consumer Finance Co Ltd filed Critical Mashang Consumer Finance Co Ltd
Priority to CN201710852442.2A priority Critical patent/CN107396331A/en
Publication of CN107396331A publication Critical patent/CN107396331A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • H04W4/14Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/10Flow control between communication endpoints
    • H04W28/14Flow control between communication endpoints using intermediate storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a short message sending method and a device based on a priority queue, wherein the method comprises the following steps: determining the priority corresponding to the delivery timeliness requirement of the short message to be sent according to the principle that the higher the delivery timeliness requirement is, the higher the priority is, and adding the priority into the corresponding short message to be sent; the method comprises the steps that short messages to be sent are placed into a pre-established priority queue to indicate the priority queue to arrange all the short messages contained in the priority queue according to the principle that the higher the corresponding priority is, the shorter the short messages contained in the priority queue are sent first; and sending the short messages contained in the priority queue to a short message multiplexing channel in sequence according to the sequence obtained by arrangement. According to the technical scheme disclosed by the application, the short messages with high requirements for time effectiveness are added with high priority, and the short messages with high priority are preferentially sent to the target user through the short message multiplexing channel.

Description

A kind of note transmission method and device based on priority query
Technical field
The present invention relates to data communication technology field, is sent out more specifically to a kind of short message based on priority query Delivery method and device.
Background technology
With the rise of the Internet, applications, the industry short message only used originally by Xian Xia enterprises is also increasingly interconnected net enterprise Industry is received so that the application amount of industry short message increases constantly.
At present, industry short message can be divided into different classifications, and the requirement of the industry short message of every kind of classification to being sent to timeliness is each Differ, such as:Identifying code class short message, member notify class short message, enterprise marketing class short message to drop the requirement for being sent to timeliness successively Low, enterprise can send industry short message for the special channel of the industry short message application of every kind of classification.But based on cost, The consideration of short message channel utilization rate, the short message channel on existing market are mostly to support unification of three nets (support to movement, join simultaneously Logical, three big Chinese Telecommunication Operator of telecommunications sends the ability of short message), support the short message multiplexing canal of different classes of industry short message Road, i.e., all industry short messages can be sent to targeted customer by the channel.But because enterprise is sending industry short message When be transmitted in sequence, when to being sent to behind timeliness requires that high industry short message comes, and largely to sending When requiring that low industry short message comes above up to timeliness, it may appear that require that high industry short message can not be sent in time to being sent to timeliness And the situation of validity is lost, certain loss now can be then caused to enterprise and user.
In summary, existing industry short message sending method presence may cause the industry short message for requiring high to being sent to timeliness The problem of can not being sent in time.
The content of the invention
In view of this, it is an object of the invention to provide a kind of note transmission method and device based on priority query, with Solving existing industry short message sending method presence may cause to require that high industry short message can not be sent in time to being sent to timeliness The problem of.
To achieve these goals, the present invention provides following technical scheme:
A kind of note transmission method based on priority query, including:
Determine to require with the timeliness that is sent to of short message to be sent according to the timeliness requirement more higher principle of high priority is sent to Corresponding priority, and by short message to be sent corresponding to priority addition;
The short message to be sent is put into the priority query being pre-created, to indicate priority query's base The priority of the whole short messages included in the priority query is according to the corresponding more high more first principle pair sent of priority The whole short messages included in the priority query are arranged;
The short message included in the priority query is sent to short message successively according to the order of arrangement gained and is multiplexed channel.
Preferably, determine and when being sent to of short message to be sent according to being sent to the timeliness requirement more higher principle of high priority Effect require corresponding to priority, and by the priority add corresponding in short message to be sent, including:
It will require in the identical same subregion that pre-establish of short message deposit to be sent being sent to timeliness, according to being sent to The timeliness requirement short message that more the higher principle of high priority determines with each subregion includes to be sent to timeliness requirement corresponding preferentially Level, and the priority determined is added to each short of corresponding subregion using thread corresponding with each subregion respectively In letter.
Preferably, the short message to be sent is put into the priority query being pre-created, including:
The thread corresponding with the subregion belonging to each short message to be sent is utilized respectively to put the short message Enter into the priority query.
Preferably, the short message to be sent is put into the priority query being pre-created, including:
Be more than the short message to be sent of pre-set level for the priority-level of addition, then directly will be described to be sent short Letter is put into the priority query;It is less than or equal to the to be sent short of the pre-set level for the priority-level of addition Letter, then judge whether the idle degree of the priority query is more than preset value, if so, being then put into the short message to be sent In the priority query, if it is not, then returning to the idle degree for performing and judging the priority query after predetermined time period The step of whether being more than preset value.
Preferably, the short message included in the priority query is sent to short message successively according to the order of arrangement gained and answered With channel, including:
Using each thread in the thread pool corresponding with the priority query being pre-created according to the priority team The short message is read in putting in order for the short message included in row from the priority query successively, and using in the thread pool The short message sending read to short message is multiplexed channel by each thread.
Preferably, the short message sending read to short message is multiplexed channel using each thread in the thread pool, Including:
Whether the correspondence short message for judging to read respectively using each thread in the thread pool meets to preset Transmission condition, if satisfied, then using the thread by message template ID corresponding to the correspondence read the short message and described Variable part in short message sends to short message and is multiplexed channel, to indicate that the short message is multiplexed the short message pair that channel will receive Variable part in the message template ID answered and the short message is combined into complete short message.
A kind of short message sending device based on priority query, including:
Priority block is added, is used for:According to be sent to the timeliness requirement more higher principle of high priority determine with it is to be sent Short message be sent to priority corresponding to timeliness requirement, and by the priority add corresponding to short message to be sent;
Module is put into, is used for:The short message to be sent is put into the priority query being pre-created, to indicate State priority of the priority query based on the whole short messages included in the priority query and get over Gao Yuexian according to corresponding priority The principle sent is arranged the whole short messages included in the priority query;
Sending module, for by the short message included in the priority query according to arrangement gained order send successively to Short message is multiplexed channel.
Preferably, the addition priority block includes:
Priority unit is added, is used for:It will require what identical short message deposit to be sent pre-established to being sent to timeliness In same subregion, according to being sent to sending for the timeliness requirement short message that more the higher principle of high priority determines to include with each subregion Up to priority corresponding to timeliness requirement, and the priority determined is added using thread corresponding with each subregion respectively Enter into each short message of corresponding subregion.
Preferably, the module that is put into includes:
Unit is put into, is used for:It is utilized respectively corresponding described with the subregion belonging to each short message to be sent The short message is put into the priority query by thread.
Preferably, the module that is put into includes:
Judging unit, it is used for:It is more than the short message to be sent of pre-set level for the priority-level of addition, then directly will The short message to be sent is put into the priority query;It is less than or equal to the default level for the priority-level of addition Other short message to be sent, then judge whether the idle degree of the priority query is more than preset value, if so, then will be described pending The short message sent is put into the priority query, if it is not, then after predetermined time period return perform judge it is described preferentially The step of whether idle degree of level queue is more than preset value.A kind of short message sending side based on priority query provided by the invention Method and device, wherein this method include:According to be sent to the timeliness requirement more higher principle of high priority determine with it is to be sent short Letter is sent to priority corresponding to timeliness requirement, and by short message to be sent corresponding to priority addition;Will be to be sent Short message is put into the priority query being pre-created, to indicate that priority query is short based on the whole included in priority query The priority of letter is carried out according to the corresponding more high more first principle sent of priority to the whole short messages included in priority query Arrangement;The short message included in priority query is sent to short message successively according to the order of arrangement gained and is multiplexed channel.The application Disclosed above-mentioned technical proposal, determine to send with short message to be sent according to the timeliness requirement more higher principle of high priority is sent to It is added to up to priority corresponding to timeliness, and by the priority of determination in short message to be sent, that is, is sent to timeliness and requires high to treat The priority of the short message of transmission is high, and then, short message to be sent is put into the priority query being pre-created, excellent to indicate First level queue is ranked up according to the more high more first principle sent of priority for whole short messages in priority query, so excellent The short message can be sent of first level high (be sent to timeliness and require high) is because being arranged in before priority query and preferential quilt Send to short message and be multiplexed channel, and then sent in time to targeted customer, so as to be effectively prevented from because will be to being sent to timeliness Occur it is required that high short message is arranged in the situation for occurring being sent in time behind queue, that is, it is short to solve existing industry Letter sending method presence may cause to require the problem of high industry short message can not be sent in time to being sent to timeliness.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of flow chart of the note transmission method based on priority query provided in an embodiment of the present invention;
Fig. 2 is a kind of structural representation of the short message sending device based on priority query provided in an embodiment of the present invention;
Fig. 3 is a kind of a kind of specific implementation of note transmission method based on priority query provided in an embodiment of the present invention The flow chart of example;
Fig. 4 is a kind of concrete application field of the note transmission method provided in an embodiment of the present invention based on priority query Scape.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made Embodiment, belong to the scope of protection of the invention.
Referring to Fig. 1, it illustrates a kind of note transmission method based on priority query provided in an embodiment of the present invention Flow chart, can include:
S11:Determine to be sent to timeliness with short message to be sent according to the timeliness requirement more higher principle of high priority is sent to Corresponding priority, and by short message to be sent corresponding to priority addition.
It should be noted that in embodiments of the present invention, the executive agent of above-mentioned technical proposal can be this corresponding hair A kind of short message sending device based on priority query that bright embodiment provides.
In view of enterprise when sending short message, requirement of all kinds of short messages to being sent to timeliness is different, in order that obtaining subsequently Require that high short message can be sent to targeted customer in time to being sent to timeliness, then can get over high priority according to timeliness requirement is sent to Higher principle determines to be sent to the corresponding priority of timeliness with short message to be sent, that is, is sent to high to be sent of timeliness requirement Priority that short message is determined is high, and it is low to be sent to the priority that timeliness requires that low short message to be sent is determined, then will The priority determined is added in short message to be sent corresponding with priority.For example, the short message transmitted by enterprise can at present To be divided into following three class:Identifying code class short message, member notify class short message, enterprise marketing class short message, and this three classes short message is to being sent to The requirement of timeliness reduces successively, then requires that the more higher principle of high priority can determine that this three class is treated according to the above-mentioned timeliness that is sent to The priority of the short message of transmission is reduced successively, and the priority of determination is corresponded to respectively and is added in this three classes short message.Consider Under special circumstances, it is possible that needing the short message promptly sent, then special urgent class short message, and this kind of short message can be set Requirement highest to being sent to timeliness, the corresponding priority for determining and adding is also highest.
S12:Short message to be sent is put into the priority query being pre-created, to indicate that it is excellent that priority query is based on The priority of the whole short messages included in first level queue is according to the corresponding more high more first principle sent of priority to priority team The whole short messages included in row are arranged.
Because the essence of short message sending is an asynchronous process, even if enterprise sends short message, channel in a synchronous manner Business receives the process of short message also still asynchronous process, therefore short message to be sent can be formed a priority query by enterprise (referred to as queue) and then send in the short message multiplexing channel provided to distributor.
According to be sent to timeliness requirement more the higher principle of high priority determine short message to be sent priority and will After corresponding priority is added in short message to be sent, short message to be sent can be put into the queue being pre-created, And by priority of the queue based on the whole short messages included in queue according to the more high more first principle sent of priority to queue In the whole short messages included arranged, its detailed process can be:
If existing short message to be sent in queue, the priority for the short message to be sent being newly put into newly is put with being located at The priority of the short message to be sent before short message to be sent entered is compared, if the short message to be sent being newly put into is excellent First level is higher than the priority of the short message to be sent before the short message to be sent being newly put into, then is got over according to corresponding priority The principle that Gao Yuexian is sent, by the short message to be sent being newly put into and pending before the short message to be sent being newly put into The short message transposition sent, then, return and perform the priority for the short message to be sent being newly put into being treated positioned at what is be newly put into The step of priority of short message to be sent before the short message of transmission is compared, until the short message to be sent being newly put into Priority is not higher than the priority of the short message to be sent before the short message to be sent that is newly put into, or what is be newly put into treat Untill there is no short message to be sent before the short message of transmission.Finally, the whole short messages included in queue are then higher according to priority The more first principle arrangement sent, i.e. the high short message to be sent of priority is arranged in before queue, and priority is low treats The short message of transmission is arranged in behind queue, in this manner it is possible to which so that the high short message of priority is preferentially sent.Certainly, queue There are many kinds in the way of the more high more first principle sent of priority is arranged short message, these concrete modes are at this Within the protection domain of invention.
S13:The short message included in priority query is sent to short message successively according to the order of arrangement gained and is multiplexed channel.
After the whole short messages included in queue are ranked up by queue according to the more high more first principle sent of priority, Short message sending to short message can be multiplexed channel according to the order of arrangement gained, so ensure that priority height (i.e. to sending Require high up to timeliness) short message channel transmission in time preferentially can be multiplexed to target by short message because being arranged in queue before User, the loss to caused by enterprise and user can be reduced to a certain extent, and will require different to being sent to timeliness All kinds of short messages are multiplexed channel transmission by a short message can improve the reusability of short message channel, at the same time, it is contemplated that channel Business is charged in SMS receiving expense according to section, i.e. the quantity of enterprise's transmission short message is more, converts into every The expense of short message is lower, and therefore, enterprise is multiplexed channel transmission short message by a short message to send short message with relative reduction Expense.
Above-mentioned technical proposal disclosed in the present application, determined according to the timeliness requirement more higher principle of high priority is sent to treating The short message of transmission is sent to priority corresponding to timeliness, and the priority of determination is added in short message to be sent, that is, is sent to Timeliness requires that the high priority for obtaining short message to be sent is high, then, short message to be sent is put into the priority team being pre-created In row, to indicate that priority query enters according to the more high more first principle sent of priority as whole short messages in priority query Row sequence, the short message can be sent of such priority high (be sent to timeliness and require high) is because being arranged in priority query Above and be in time sent to short message multiplexing channel, and then sent in time to targeted customer, so as to be effectively prevented from because It will require that high short message is arranged in the situation for occurring being sent in time behind queue and occurred to being sent to timeliness, that is, solve Existing industry short message sending method presence may cause to require that what high industry short message can not be sent in time asks to being sent to timeliness Topic.
A kind of note transmission method based on priority query provided in an embodiment of the present invention, got over according to timeliness requirement is sent to The higher principle determination of high priority is sent to the corresponding priority of timeliness requirement with short message to be sent, and the priority is added In short message to be sent corresponding to entering, it can include:
It will require in the identical same subregion that be pre-created of short message deposit to be sent being sent to timeliness, according to being sent to The timeliness requirement short message that more the higher principle of high priority determines with each subregion includes to be sent to timeliness requirement corresponding preferentially Level, and the priority determined is added to each short message for corresponding to subregion using thread corresponding with each subregion respectively In.
To occupy each thread in certain internal memory, the thread pool corresponding with priority query in itself based on priority query The short message multiplexing channel provided the disposal ability of short message in priority query, distributor in itself to disposal ability of short message etc. because The consideration of element, therefore, the length of limit priority queue is N, and N value is less than staff based on examining above-mentioned factor The preset value considered and set.Therefore, corresponding short message largely can not be overstock in queue, for the consideration of this respect, then Short message can be put into the subregion pre-established, that is, allow short message to exist as far as possible in subregion, rather than overstock in queue.
At the same time, can be with for the ease of adding priority and for the ease of being managed to short message for all kinds of short messages It will require that being sent to timeliness identical short message to be sent is stored in a subregion, and can then proceed in and be sent to timeliness and require higher The higher principle of priority determines to be sent to the corresponding priority of timeliness, afterwards, Ke Yifen with the short message that includes in each subregion Do not utilize the thread corresponding with each subregion to read the short message included in each subregion, and the priority determined is added to In the corresponding short message read, the priority determined is added to corresponding subregion by thread corresponding to this each subregion simultaneously Mode in each short message can be accelerated to add the speed of priority for corresponding short message, improve corresponding efficiency.
A kind of note transmission method based on priority query provided in an embodiment of the present invention, short message to be sent is put into Into the priority query being pre-created, can include:
It is utilized respectively thread corresponding with each affiliated subregion of short message to be sent and the short message is put into priority query In.
When needing the short message to be sent for adding corresponding priority being put into priority query, can be utilized respectively Corresponding short message is put into priority query by the thread corresponding with the subregion belonging to short message to be sent, corresponding to each subregion Thread works simultaneously can shorten the whole time for sending short message process, improve the efficiency of short message sending.
A kind of note transmission method based on priority query provided in an embodiment of the present invention, short message to be sent is put into Into the priority query being pre-created, can include:
It is more than the short message to be sent of pre-set level for the priority-level of addition, then directly puts short message to be sent Enter in priority query;It is less than or equal to the short message to be sent of pre-set level for the priority-level of addition, then judges excellent Whether the idle degree of first level queue is more than preset value, if so, then short message to be sent is put into priority query, if it is not, Then returned after predetermined time period and the step of whether idle degree for judging priority query is more than preset value performed.
When short message to be sent is put into priority query, it is more than for priority-level previously according to actual need The short message to be sent of the priority-level to be set (i.e. pre-set level), it is contemplated that the priority level of these short messages to be sent Relatively high not in all short messages, i.e., the requirement to being sent to timeliness is relatively high, then can be directly to be sent by these Short message be put into priority query;And be less than or equal to the short message to be sent of pre-set level for priority-level, then Show these short messages to be sent priority-level compare it is relatively low, when further demonstrating that these short messages to be sent to being sent to The requirement of effect is not so high relatively, and in view of the length of queue, then can first judge that the idle degree in priority query is It is no to be more than previously according to the numerical value (i.e. preset value) for being actually needed setting, if being more than, show that now queue can accommodate these The short message of priority-level, then these short messages can be put into priority query, if being not more than, show that now queue is not The short message of these priority-levels can be accommodated, still, is located at because queue is originally added while new short message is added Short message before queue is sent into short message multiplexing channel simultaneously, i.e. the idle degree of queue is changing always, then is passing through Cross after predetermined time period, the idle degree of queue may meet to require, can now return to execution and judge in priority query Idle degree whether be more than previously according to numerical value (i.e. the preset value) for being actually needed setting the step of, afterwards the step of with above-mentioned phase Together, repeat no more here.
It should be noted that the idle degree (%) of above-mentioned mentioned priority query=[already present short in 1- queues The total length of length/queue of letter] × 100%, and for priority-level is less than or equal to the short message of pre-set level, Preset value corresponding to the short message of different priorities rank simultaneously differs, and preset value corresponding to the high short message of priority-level will The short message low less than priority-level, i.e., when the short message in queue is more, pay the utmost attention to the high short message of priority-level It is put into queue, and when the short message in queue is fewer, the high short message of priority-level and the low short message of priority-level It can be placed in queue.This mode for being put into short message can be so that queue be unlikely to occur excessively crowded and mixed Random situation, while preferentially the high short message of priority can also be put into when inner queue short message is more in queue, i.e., The transmission to being sent to the high short message of timeliness requirement is not influenceed as far as possible.
A kind of note transmission method based on priority query provided in an embodiment of the present invention, will be included in priority query Short message according to arrangement gained order send successively to short message be multiplexed channel, can include:
Using each thread in the thread pool corresponding with priority query being pre-created according to being included in priority query Short message the short message reading from priority query successively that puts in order, and utilize the short message that each thread will be read in thread pool Send to short message and be multiplexed channel.
When by the short message sending included in queue to short message multiplexing channel, be pre-created and priority team can be utilized Each thread in thread pool corresponding to row is read from queue successively according to putting in order for the short message included in priority query Short message, then each thread respectively by the short message sending each read to short message be multiplexed channel, wherein, the number of thread pool thread Mesh can be configured based on parameters such as the configuration of equipment in itself, CPU core number, internal memories, empirically can according to CPU core number × 2 obtain the number of threads in thread pool, and certainly, the calculating of the number of threads in thread does not limit to and this, these calculations Within protection scope of the present invention.This mode for being read simultaneously using multithreading and sending short message can be accelerated to send short The speed of letter, improve efficiency.
A kind of note transmission method based on priority query provided in an embodiment of the present invention, utilizes each line in thread pool The short message sending read to short message is multiplexed channel by journey, can be included:
Whether the corresponding short message for judging to read respectively using each thread in thread pool meets default transmission condition, if full Foot, then sent message template ID corresponding to the corresponding short message read and the variable part in short message to short message using thread Channel is multiplexed, to indicate short message multiplexing channel by message template ID corresponding to the short message received and the variable part in short message It is combined into complete short message.
When the short message sending read to short message is multiplexed channel by each thread in using thread pool, thread each first needs Whether the corresponding short message that judge to read respectively meets default transmission condition, and whether such as corresponding short message exceedes the term of validity, corresponding Short message in predetermined time period whether repeat send etc., if meet transmission condition (correspond to short message and be not above the term of validity, In predetermined time period without repeat send etc.), then using thread by message template ID corresponding to the corresponding short message read with And the variable part in short message sends to short message and is multiplexed channel, wherein, message template is that distributor is based on that short message is institutionalized examines Consider, and be respectively the template set per class short message, and for the ease of unified management, a corresponding message template ID per class short message, And message template is made up of fixed part and variable part (being replaced with variable), thread only need to will be short corresponding to the short message read Variable part in letter template ID and short message sends to short message and is multiplexed channel, and by channel by the message template received and Variable part in short message is combined, and is formed the short message of a completion, is then forwarded to operator, and by operator send to Targeted customer.This mode for sending short message can ensure that transmission to the short message of targeted customer is effective short message, and keep away as far as possible The situation for exempting from same short message being repeatedly sent to targeted customer is sent, and reduces the puzzlement brought to targeted customer, while can subtract It is few that unnecessary short message sending expense is brought to enterprise.
The embodiment of the present invention additionally provides a kind of short message sending device based on priority query, as shown in Fig. 2 can wrap Include:
Priority block 11 is added, is used for:According to be sent to the timeliness requirement more higher principle of high priority determine with it is pending The short message sent is sent to priority corresponding to timeliness requirement, and by the priority add corresponding to short message to be sent;
Module 12 is put into, is used for:The short message to be sent is put into the priority query being pre-created, with instruction Priority of the priority query based on the whole short messages included in the priority query gets over Gao Yue according to corresponding priority The principle first sent is arranged the whole short messages included in the priority query;
Sending module 13, is used for:The short message included in the priority query is sent out successively according to the order of arrangement gained Deliver to short message multiplexing channel.
A kind of short message sending device based on priority query provided in an embodiment of the present invention, adding priority block can be with Including:
Priority unit is added, is used for:It will require what identical short message deposit to be sent pre-established to being sent to timeliness In same subregion, according to being sent to sending for the timeliness requirement short message that more the higher principle of high priority determines to include with each subregion Up to priority corresponding to timeliness requirement, and the priority determined is added using thread corresponding with each subregion respectively Enter into each short message of corresponding subregion.
A kind of short message sending device based on priority query provided in an embodiment of the present invention, being put into module can include:
Unit is put into, is used for:It is utilized respectively corresponding described with the subregion belonging to each short message to be sent The short message is put into the priority query by thread.
A kind of short message sending device based on priority query provided in an embodiment of the present invention, being put into module can include:
Judging unit, it is used for:It is more than the short message to be sent of pre-set level for the priority-level of addition, then directly will The short message to be sent is put into the priority query;It is less than or equal to the default level for the priority-level of addition Other short message to be sent, then judge whether the idle degree of the priority query is more than preset value, if so, then will be described pending The short message sent is put into the priority query, if it is not, then after predetermined time period return perform judge it is described preferentially The step of whether idle degree of level queue is more than preset value.
A kind of short message sending device based on priority query provided in an embodiment of the present invention, sending module can include:
Transmitting element, it is used for:Using each thread in the thread pool corresponding with the priority query being pre-created by The short message is read from the priority query successively according to putting in order for the short message included in the priority query, and profit The short message sending read to short message is multiplexed channel with each thread in the thread pool.
A kind of short message sending device based on priority query provided in an embodiment of the present invention, transmitting element can include:
Transmission sub-unit, it is used for:Judged respectively described in the correspondence that reads using each thread in the thread pool Whether short message meets default transmission condition, if satisfied, then will be short corresponding to the correspondence read the short message using the thread Believe that the variable part in template ID and the short message is sent to short message and be multiplexed channel, to indicate that the short message multiplexing channel will connect Message template ID corresponding to the short message received and the variable part in the short message are combined into complete short message.
As a specific embodiment, technical scheme can be illustrated, first, by short message to be sent It is divided into special urgent class, identifying code class, reminder announced class, marketing class, and this four classes short message reduces successively to the requirement for being sent to timeliness, Then corresponding priority orders are from high to low, referring to Fig. 3, it illustrates provided in an embodiment of the present invention a kind of based on preferential A kind of specific embodiment of the note transmission method of level queue, respectively by special urgent class, identifying code class, reminder announced class, marketing Class deposit corresponding to H subregions, A subregions, B subregions, C subregions, be then utilized respectively TH threads corresponding to each subregion, TA threads, TB threads, TC threads consume the short message in corresponding subregion, that is, read the short message in respective partition, and the addition of the short message to read is excellent First level, the short message object with priority attribute is become, after priority corresponding to short message addition corresponding to H subregions, Because the priority-level of this kind of short message is more than pre-set level, then this kind of short message after addition priority is directly inserted into queue In;For short message corresponding to A subregions, B subregions, C subregions difference, because the priority-level of this three classes short message is less than or equal in advance If rank, then need to judge whether the idle degree of queue is more than preset value, from high to low, it is corresponding for the priority of this three classes short message Preset value be followed successively by 30%, 50%, 80%, can be seen that when the idle degree of queue is smaller, i.e., from corresponding preset value When internal short message is more, preferentially the short message in the high A subregions of priority is added in queue;When the idle degree of queue is bigger When, i.e., when internal short message is fewer, the short message in A subregions, B subregions, C subregions can be added in queue, at the same time, with For the corresponding each thread of queue according to the short message included in the consumption queue that puts in order of queue, can avoid will to being sent to timeliness High short message is sought because requiring that low short message causes to send in time to mesh short message is multiplexed the overstocking of channel to being sent to timeliness The situation for marking user occurs.
Technical scheme can apply to many business scenarios, such as the checking of APP user's registrations, cell-phone number, Promotional advertisement prompting etc. that mobile telephone registration turn up service, short message of making loans are reminded, refund collection short message is reminded, new product is reached the standard grade, is having Short message in above-mentioned scene can be carried out taxonomic revision by body when using, obtain special urgent class, identifying code class, reminder announced class, Market the class short message of class four, and the priority orders of four class short messages is from high to low, can be to the present invention with reference to concrete application scene Technical scheme be described further, referring to Fig. 4, it illustrates short message hair of the embodiment of the present invention based on priority query A kind of concrete application scene of delivery method:Wherein (by a distribution of Apache Software Foundation exploitation, divided using kafka The message system project of increasing income of area, more duplicates) be used as message-oriented middleware, to realize to the subregions of all kinds of short messages, also will on State four class short messages to be stored in respectively in different subregions, consider that reminder announced class, the quantity for class short message of marketing are huge in specific application Greatly, be likely to appear in the situation that part of short message in this two classes short message differs to being sent to timeliness requirement, thus can be this two Short message in class short message sets high priority and low priority respectively, and is correspondingly arranged two subregions, if use usually This two classes short message can be respectively put into a corresponding subregion without particular/special requirement, when there are special circumstances, then will be high The short message (or short message by low priority) of priority is called in another subregion, so as to play quick insertion Effect into priority query.In this concrete application scene, a Redis (high performance, band persistence energy is also utilized The memory database project of the key-value structures of power, there is provided abundant data structure) as caching middleware, to realize Speed limit management etc. as defined in transmission frequency limitation, transmission counting statistics, each short message multiplexing channel when sending short message to short message Function.Also, when enterprise is short message sending to corresponding subregion, then the calculator for corresponding subregion adds 1, when line corresponding to subregion When journey consumes a short message in subregion, then the calculator for corresponding subregion subtracts 1, so can be in order to short message in monitored partition Number, follow-up process may be referred to it is above-mentioned to technical solution of the present invention elaborate part and mentioned specific implementation Example part, will not be repeated here, wherein, after thread corresponding to subregion judges that queue free time degree meets corresponding condition, then will The short message object (being packaged into the short message object with priority attribute) of Comparable interfaces is realized in corresponding short message encapsulation, if Thread corresponding to subregion judges that the idle degree of queue is unsatisfactory for corresponding conditionses, then thread progress dormancy, the circulation then judged again, Untill the idle degree of queue meets condition;If subsequently judging that short message is effective, send to short message and be multiplexed channel, if judging It is invalid to go out short message, then log and abandons short message.
The explanation of relevant portion please in a kind of short message sending device based on priority query provided in an embodiment of the present invention The detailed description of corresponding part in a kind of note transmission method based on priority query provided referring to the embodiment of the present invention, It will not be repeated here.Realized in other above-mentioned technical proposal provided in an embodiment of the present invention with corresponding to technical scheme in the prior art The part of principle is simultaneously unspecified, in order to avoid excessively repeat.
The foregoing description of the disclosed embodiments, those skilled in the art are enable to realize or using the present invention.To this A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and generic principles defined herein can Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited The embodiments shown herein is formed on, and is to fit to consistent with principles disclosed herein and features of novelty most wide Scope.

Claims (10)

  1. A kind of 1. note transmission method based on priority query, it is characterised in that including:
    According to be sent to the timeliness requirement more higher principle of high priority determine with short message to be sent to be sent to timeliness requirement corresponding Priority, and by the priority add corresponding in short message to be sent;
    The short message to be sent is put into the priority query being pre-created, to indicate that the priority query is based on institute The priority of the whole short messages included in priority query is stated according to the corresponding more high more first principle sent of priority to described The whole short messages included in priority query are arranged;
    The short message included in the priority query is sent to short message successively according to the order of arrangement gained and is multiplexed channel.
  2. 2. according to the method for claim 1, it is characterised in that require the more higher principle of high priority according to timeliness is sent to It is determined that be sent to the corresponding priority of timeliness requirement with short message to be sent, and by the priority add corresponding to it is to be sent short In letter, including:
    It will require in the identical same subregion that pre-establish of short message deposit to be sent being sent to timeliness, according to being sent to timeliness It is required that the short message that more the higher principle of high priority determines with each subregion includes is sent to the corresponding priority of timeliness requirement, and The priority determined is added in each short message of corresponding subregion using thread corresponding with each subregion respectively.
  3. 3. according to the method for claim 2, it is characterised in that the short message to be sent is put into be pre-created it is excellent In first level queue, including:
    The thread corresponding with the subregion belonging to each short message to be sent is utilized respectively to be put into the short message In the priority query.
  4. 4. according to the method for claim 1, it is characterised in that the short message to be sent is put into be pre-created it is excellent In first level queue, including:
    It is more than the short message to be sent of pre-set level for the priority-level of addition, then directly puts the short message to be sent Enter in the priority query;It is less than or equal to the short message to be sent of the pre-set level for the priority-level of addition, Then judge whether the idle degree of the priority query is more than preset value, if so, the short message to be sent then is put into institute State in priority query, if it is not, execution is then returned after predetermined time period judges that the idle degree of the priority query is No the step of being more than preset value.
  5. 5. according to the method for claim 1, it is characterised in that by the short message included in the priority query according to arrangement The order of gained sends to short message and is multiplexed channel successively, including:
    Using each thread in the thread pool corresponding with the priority query being pre-created according in the priority query Comprising putting in order for short message the short message is read from the priority query successively, and utilize each line in the thread pool The short message sending read to short message is multiplexed channel by journey.
  6. 6. according to the method for claim 5, it is characterised in that the institute that will be read using each thread in the thread pool State short message sending to short message and be multiplexed channel, including:
    Whether the correspondence short message for judging to read respectively using each thread in the thread pool meets default transmission Condition, if satisfied, then using the thread by message template ID and the short message corresponding to the correspondence read the short message In variable part send to short message and be multiplexed channel, to indicate that the short message is multiplexed channel by corresponding to the short message received Variable part in message template ID and the short message is combined into complete short message.
  7. A kind of 7. short message sending device based on priority query, it is characterised in that including:
    Priority block is added, is used for:According to be sent to the timeliness requirement more higher principle of high priority determine with it is to be sent short Letter is sent to priority corresponding to timeliness requirement, and by the priority add corresponding to short message to be sent;
    Module is put into, is used for:The short message to be sent is put into the priority query being pre-created, it is described excellent to indicate Priority of the first level queue based on the whole short messages included in the priority query more first is sent out according to corresponding priority is more high The principle sent is arranged the whole short messages included in the priority query;
    Sending module, it is used for:The short message included in the priority query is sent to short successively according to the order of arrangement gained Letter multiplexing channel.
  8. 8. device according to claim 7, it is characterised in that the addition priority block includes:
    Priority unit is added, is used for:By to be sent to timeliness require identical it is to be sent short message deposit pre-establish it is same In individual subregion, when being sent to of short message included with each subregion is determined according to the timeliness requirement more higher principle of high priority is sent to Priority corresponding to effect requirement, and be added to the priority determined using thread corresponding with each subregion respectively In each short message of corresponding subregion.
  9. 9. device according to claim 8, it is characterised in that the module that is put into includes:
    Unit is put into, is used for:It is utilized respectively the thread corresponding with the subregion belonging to each short message to be sent The short message is put into the priority query.
  10. 10. device according to claim 7, it is characterised in that the module that is put into includes:Judging unit, it is used for:For The priority-level of addition is more than the short message to be sent of pre-set level, then is directly put into the short message to be sent described excellent In first level queue;It is less than or equal to the short message to be sent of the pre-set level for the priority-level of addition, then judges institute Whether the idle degree for stating priority query is more than preset value, if so, the short message to be sent then is put into the priority In queue, perform whether the idle degree for judging the priority query is more than in advance if it is not, then being returned after predetermined time period If the step of value.
CN201710852442.2A 2017-09-19 2017-09-19 Short message sending method and device based on priority queue Pending CN107396331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710852442.2A CN107396331A (en) 2017-09-19 2017-09-19 Short message sending method and device based on priority queue

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710852442.2A CN107396331A (en) 2017-09-19 2017-09-19 Short message sending method and device based on priority queue

Publications (1)

Publication Number Publication Date
CN107396331A true CN107396331A (en) 2017-11-24

Family

ID=60350489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710852442.2A Pending CN107396331A (en) 2017-09-19 2017-09-19 Short message sending method and device based on priority queue

Country Status (1)

Country Link
CN (1) CN107396331A (en)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255607A (en) * 2018-01-08 2018-07-06 武汉斗鱼网络科技有限公司 Task processing method, device, electric terminal and readable storage medium storing program for executing
CN108933994A (en) * 2018-07-19 2018-12-04 平安科技(深圳)有限公司 Short message distribution processing method, device, computer equipment and storage medium
CN109547327A (en) * 2018-11-01 2019-03-29 苏州达家迎信息技术有限公司 A kind of method for sending information, device, storage medium and equipment
CN110337075A (en) * 2019-06-28 2019-10-15 北京奇才天下科技有限公司 A kind of short message sending method, device and electronic equipment based on APP type of service
CN110493734A (en) * 2019-07-22 2019-11-22 苏宁云计算有限公司 The channel selection method and device that short message is sent
CN110533897A (en) * 2019-08-22 2019-12-03 杭州电子科技大学 Socket-based coffee roasting communication method
CN110557728A (en) * 2018-06-01 2019-12-10 中国移动通信有限公司研究院 short message sending method, device and network equipment
CN110611891A (en) * 2019-08-29 2019-12-24 深圳市梦网科技发展有限公司 Short message sending method and device
CN110661668A (en) * 2019-09-29 2020-01-07 深圳前海微众银行股份有限公司 Message sending management method and device
CN111885516A (en) * 2020-07-09 2020-11-03 深圳市富之富信息技术有限公司 Multi-channel access short message configuration method and device, computer equipment and storage medium
CN111918225A (en) * 2020-09-15 2020-11-10 北京值得买科技股份有限公司 Method for sending short message based on multiple operators
CN112020024A (en) * 2020-07-24 2020-12-01 上海淇玥信息技术有限公司 Short message sending management method, system and electronic equipment
CN112346840A (en) * 2020-11-10 2021-02-09 广州小鹏汽车科技有限公司 Data processing method and device
CN112527436A (en) * 2020-12-14 2021-03-19 五八有限公司 Popup display method, popup display device, electronic equipment and computer readable medium
CN113873449A (en) * 2021-09-15 2021-12-31 北京仁科互动网络技术有限公司 Short message sending method, cloud service system, electronic device and storage medium
CN113905336A (en) * 2021-11-18 2022-01-07 中国平安财产保险股份有限公司 Text recognition-based short message sending method, device, equipment and storage medium
CN113918365A (en) * 2021-10-20 2022-01-11 中国联合网络通信集团有限公司 Data processing method, device and equipment based on short message
CN114205762A (en) * 2021-12-10 2022-03-18 中国农业银行股份有限公司 Short message flow control method, equipment and storage medium
CN116112880A (en) * 2022-11-09 2023-05-12 上海创蓝云智信息科技股份有限公司 MQ-based high concurrency short message sending method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094181A (en) * 2007-07-25 2007-12-26 华为技术有限公司 Dispatch device and method of enqueuing and dequeuing message
CN102364967A (en) * 2011-11-21 2012-02-29 携程计算机技术(上海)有限公司 Short message transmission method and system
CN103024699A (en) * 2011-09-22 2013-04-03 北京神州泰岳软件股份有限公司 Short message sending method and information resource station entity
CN103139732A (en) * 2011-11-24 2013-06-05 方正国际软件有限公司 Improved short message sending method and system
US20160113025A1 (en) * 2014-10-15 2016-04-21 At&T Intellectual Property I, Lp Machine to machine traffic management methods and systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094181A (en) * 2007-07-25 2007-12-26 华为技术有限公司 Dispatch device and method of enqueuing and dequeuing message
CN103024699A (en) * 2011-09-22 2013-04-03 北京神州泰岳软件股份有限公司 Short message sending method and information resource station entity
CN102364967A (en) * 2011-11-21 2012-02-29 携程计算机技术(上海)有限公司 Short message transmission method and system
CN103139732A (en) * 2011-11-24 2013-06-05 方正国际软件有限公司 Improved short message sending method and system
US20160113025A1 (en) * 2014-10-15 2016-04-21 At&T Intellectual Property I, Lp Machine to machine traffic management methods and systems

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255607A (en) * 2018-01-08 2018-07-06 武汉斗鱼网络科技有限公司 Task processing method, device, electric terminal and readable storage medium storing program for executing
CN110557728A (en) * 2018-06-01 2019-12-10 中国移动通信有限公司研究院 short message sending method, device and network equipment
CN108933994A (en) * 2018-07-19 2018-12-04 平安科技(深圳)有限公司 Short message distribution processing method, device, computer equipment and storage medium
CN108933994B (en) * 2018-07-19 2021-12-21 平安科技(深圳)有限公司 Short message distribution processing method and device, computer equipment and storage medium
CN109547327A (en) * 2018-11-01 2019-03-29 苏州达家迎信息技术有限公司 A kind of method for sending information, device, storage medium and equipment
CN109547327B (en) * 2018-11-01 2021-08-03 苏州达家迎信息技术有限公司 Information sending method, device, storage medium and equipment
CN110337075A (en) * 2019-06-28 2019-10-15 北京奇才天下科技有限公司 A kind of short message sending method, device and electronic equipment based on APP type of service
CN110493734A (en) * 2019-07-22 2019-11-22 苏宁云计算有限公司 The channel selection method and device that short message is sent
CN110533897A (en) * 2019-08-22 2019-12-03 杭州电子科技大学 Socket-based coffee roasting communication method
CN110611891A (en) * 2019-08-29 2019-12-24 深圳市梦网科技发展有限公司 Short message sending method and device
CN110611891B (en) * 2019-08-29 2022-05-20 深圳市梦网科技发展有限公司 Short message sending method and device
CN110661668A (en) * 2019-09-29 2020-01-07 深圳前海微众银行股份有限公司 Message sending management method and device
WO2021057500A1 (en) * 2019-09-29 2021-04-01 深圳前海微众银行股份有限公司 Message sending management method and device
CN110661668B (en) * 2019-09-29 2023-05-16 深圳前海微众银行股份有限公司 Message sending management method and device
CN111885516A (en) * 2020-07-09 2020-11-03 深圳市富之富信息技术有限公司 Multi-channel access short message configuration method and device, computer equipment and storage medium
CN112020024A (en) * 2020-07-24 2020-12-01 上海淇玥信息技术有限公司 Short message sending management method, system and electronic equipment
CN112020024B (en) * 2020-07-24 2024-01-30 上海淇玥信息技术有限公司 Short message sending management method, system and electronic equipment
CN111918225A (en) * 2020-09-15 2020-11-10 北京值得买科技股份有限公司 Method for sending short message based on multiple operators
CN112346840A (en) * 2020-11-10 2021-02-09 广州小鹏汽车科技有限公司 Data processing method and device
CN112527436A (en) * 2020-12-14 2021-03-19 五八有限公司 Popup display method, popup display device, electronic equipment and computer readable medium
CN113873449A (en) * 2021-09-15 2021-12-31 北京仁科互动网络技术有限公司 Short message sending method, cloud service system, electronic device and storage medium
CN113918365A (en) * 2021-10-20 2022-01-11 中国联合网络通信集团有限公司 Data processing method, device and equipment based on short message
CN113905336A (en) * 2021-11-18 2022-01-07 中国平安财产保险股份有限公司 Text recognition-based short message sending method, device, equipment and storage medium
CN114205762A (en) * 2021-12-10 2022-03-18 中国农业银行股份有限公司 Short message flow control method, equipment and storage medium
CN116112880A (en) * 2022-11-09 2023-05-12 上海创蓝云智信息科技股份有限公司 MQ-based high concurrency short message sending method and device
CN116112880B (en) * 2022-11-09 2023-09-08 上海创蓝云智信息科技股份有限公司 MQ-based high concurrency short message sending method and device

Similar Documents

Publication Publication Date Title
CN107396331A (en) Short message sending method and device based on priority queue
US9864595B2 (en) Software updating method, system, and device
CN1901695B (en) Short message management system using a vm application and a mobile communication terminal
CN111246483A (en) Resource selection method and device for auxiliary link communication
CN106155812A (en) Method, device, system and the electronic equipment of a kind of resource management to fictitious host computer
CN103581966A (en) Real-time monitoring optimizing configuration method for smart phone
CN108173698A (en) Network service management method, apparatus, server and storage medium
CN106973377B (en) The control method and control device and management equipment and terminal of data communication
CN104394193A (en) A sharing method and device for Cloud SIM cards
CN101594270A (en) A kind of WAP (wireless access point) and bandwidth allocation methods thereof
CN106161256A (en) A kind of processing method and processing device of Border Gateway Protocol (BGP) route
CN108681481A (en) The processing method and processing device of service request
CN107968881A (en) End-point device broadcast processing method and processing device, terminal device and storage medium
CN102387125A (en) Method and system for accessing microblog, and picture sending method and system of microblog website
CN109451076A (en) A kind of the merging treatment method, apparatus and electronic equipment of network request
CN106571933A (en) Service processing method and device
CN103428373A (en) Achieving method and device of user-defined package
CN108920274B (en) Performance optimization and device for image processing server side
CN103188764B (en) Connection control method, apparatus and system
CN116471277A (en) Computing power distribution method, computing power distribution device, server and computer readable storage medium
CN115767570A (en) AI model registration method and equipment for wireless communication system
CN109002381B (en) Process communication monitoring method, electronic device and computer readable storage medium
CN102196583B (en) A kind of distribution method of channel resource and base station
CN102158833A (en) Method for transmitting short message service (SMS) and SMS gateway
CN107567032A (en) Wireless transmission resources collocation method, device and communication equipment in wireless Mesh netword

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171124