CN108834086B - Method and device for sending short message, computer equipment and storage medium - Google Patents

Method and device for sending short message, computer equipment and storage medium Download PDF

Info

Publication number
CN108834086B
CN108834086B CN201810661258.4A CN201810661258A CN108834086B CN 108834086 B CN108834086 B CN 108834086B CN 201810661258 A CN201810661258 A CN 201810661258A CN 108834086 B CN108834086 B CN 108834086B
Authority
CN
China
Prior art keywords
short message
cache region
message data
fixed
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810661258.4A
Other languages
Chinese (zh)
Other versions
CN108834086A (en
Inventor
张文聪
汪灿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810661258.4A priority Critical patent/CN108834086B/en
Priority to PCT/CN2018/105202 priority patent/WO2020000663A1/en
Publication of CN108834086A publication Critical patent/CN108834086A/en
Application granted granted Critical
Publication of CN108834086B publication Critical patent/CN108834086B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Abstract

The invention relates to a method and a device for sending a short message, computer equipment and a storage medium. The method comprises the following steps: when the queue length of the short message data of the fixed cache region in the cache pool is detected to be larger than a threshold value, calling the cache space of the dynamic cache region in the cache pool to expand the fixed cache region to obtain an expanded cache region, wherein the fixed cache region corresponds to the short message gateways one by one, storing the received short message data in the expanded cache region, and sending the short message data in the expanded cache region to the short message gateway of the fixed cache region for short message sending. By adopting the method, the size of the maximum queue length of the fixed buffer area can be dynamically configured when a large quantity of short messages are sent, so that the condition that the short messages are failed to be sent due to the loss of short message data is prevented.

Description

Method and device for sending short message, computer equipment and storage medium
Technical Field
The present invention relates to the field of short message transmission technologies, and in particular, to a method and an apparatus for transmitting a short message, a computer device, and a storage medium.
Background
With the increase of the sending amount of short messages, a platform which can facilitate the sending of large-batch messages is urgently needed, and the message sending platform appearing in the market at present directly pushes the short messages to a short message gateway for sending the short messages after the short messages are taken out from a database through an application layer program when the problem of sending the large-batch messages is solved.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, a computer device and a storage medium for sending short messages, which can effectively prevent the short message sending failure during the mass short message sending.
A method for sending short messages, the method comprising:
when detecting that the queue length of the short message data of the fixed cache region in the cache pool is greater than a threshold value, calling the cache space of the dynamic cache region in the cache pool to expand the fixed cache region to obtain an expanded cache region; the cache pool comprises a plurality of fixed cache areas which correspond to the short message gateways one by one;
and storing the received short message data into the extended cache region, and sending the short message data in the extended cache region to the short message gateway of the fixed cache region for short message sending.
In one embodiment, the method further comprises the following steps: identifying a classification label of the short message data, wherein the classification label is used for identifying the attribute of the short message data; the attribute corresponds to a short message gateway; and storing the short message data into an extended cache region corresponding to the short message gateway according to the attribute of the short message data.
In one embodiment, the method further comprises the following steps: activating task processes with the same number according to the number of the attribute categories of the short message data, and storing the short message data into the short message gateway corresponding to the short message gateway through parallel processing of all the task processes; each task process processes short message data corresponding to one attribute.
In one embodiment, the state of the task process includes: the working state and the dormant state further comprise: and switching the states of the task processes with the same number from the dormant state to the working state according to the number of the attribute types.
In one embodiment, the method further comprises the following steps: when the queue length of the short message data is larger than a threshold value, determining that a dynamic cache region needs to be called; the threshold is proportional to the maximum queue length of the fixed buffer;
when the dynamic cache region is determined to be called, acquiring the write-in rate of the current short message data stored in the fixed cache region, and obtaining the size of a queue to be expanded according to the write-in rate; and calling the cache space of the dynamic cache region to expand the fixed cache region according to the size of the queue to be expanded.
In one embodiment, the method further comprises the following steps: and inquiring the area in the dynamic cache area in the state to be called, and calling the cache space of the area in the state to be called to expand the capacity of the fixed cache area according to the size of the queue to be expanded.
In one embodiment, the method further comprises the following steps: monitoring the short message sending speed of each short message gateway, and detecting whether the length of a short message data queue in a fixed cache region corresponding to the short message gateway reaches a preset queue length threshold value when the short message sending speed is determined to be abnormal due to network fluctuation; and if so, stopping storing the short message data into the fixed cache region corresponding to the short message gateway.
An apparatus for short message transmission, the apparatus comprising:
the expansion module is used for calling the cache space of the dynamic cache region in the cache pool to expand the fixed cache region to obtain an expanded cache region when the queue length of the short message data of the fixed cache region in the cache pool is larger than a threshold value; the fixed cache regions correspond to the short message gateways one to one;
and the sending module is used for storing the received short message data into the extended cache region, sending the short message data in the extended cache region to the short message gateway of the fixed cache region, and sending the short message.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
when detecting that the queue length of the short message data of the fixed cache region in the cache pool is greater than a threshold value, calling the cache space of the dynamic cache region in the cache pool to expand the fixed cache region to obtain an expanded cache region; the cache pool comprises a plurality of fixed cache areas which correspond to the short message gateways one by one;
and storing the received short message data into the extended cache region, and sending the short message data in the extended cache region to the short message gateway of the fixed cache region for short message sending.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
when detecting that the queue length of the short message data of the fixed cache region in the cache pool is greater than a threshold value, calling the cache space of the dynamic cache region in the cache pool to expand the fixed cache region to obtain an expanded cache region; the cache pool comprises a plurality of fixed cache areas which correspond to the short message gateways one by one;
and storing the received short message data into the extended cache region, and sending the short message data in the extended cache region to the short message gateway of the fixed cache region for short message sending.
According to the method, the device, the computer equipment and the storage medium for sending the short messages, the short message data are stored in the fixed cache region, the expansion of the fixed cache region is carried out by detecting the queue length of the short message data in the fixed cache region in the cache pool and calling the cache space of the dynamic cache region in the cache pool when the queue length of the short message data exceeds the threshold value, so that an expanded cache region is obtained, then the received short message data are stored in the expanded cache region, and the short message gateway corresponding to the fixed cache region also obtains the short message data from the expanded cache region for sending the short messages. According to the embodiment of the invention, the dynamic configuration of the fixed cache regions of the plurality of short message gateways can effectively prevent short message sending failure during mass short message sending.
Drawings
Fig. 1 is an application scenario diagram of a short message sending method in one embodiment;
FIG. 2 is a flow chart illustrating a method for sending short messages according to an embodiment;
FIG. 3 is a flow chart illustrating a step of storing short message data in a fixed buffer according to an embodiment;
FIG. 4 is a schematic flow chart of short message data processing according to an embodiment;
FIG. 5 is a flowchart illustrating a method for sending short messages according to another embodiment;
FIG. 6 is a block diagram of an apparatus for short message sending according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for sending the short message can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
The terminal 102 may be communicatively connected to the server 104 through a synchronous interface or an asynchronous interface.
In the embodiment of the present invention, the server 104 includes a database, the database is configured with a sending table, a pre-configured portal is accessed through the terminal 102, the portal may be a web page, short messages are edited in the portal, and then a synchronous interface or an asynchronous interface is called to send the short messages to the database of the server 104, further, the short message data is stored in the sending table, and then the short message gateway fetches data from the sending table.
In the embodiment of the invention, the server 104 configures a fixed cache region for each short message gateway, after the short message gateway fetches the number from the sending table, the short message data obtained by fetching the number are stored in the corresponding fixed cache region, and then the short message gateways send the short message data in the fixed cache regions in sequence, in addition, the server 104 is also configured with a dynamic cache region, and part of the dynamic cache region can be called to expand the capacity of the fixed cache region through the queue length of the short message data in the fixed cache region. In order to facilitate the implementation of the cache region, the fixed cache region and the dynamic cache region may be implemented by using a cache pool.
The dynamic cache region and the fixed cache region can be realized by a Redis database.
In an embodiment, as shown in fig. 2, a method for sending a short message is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
step 202, when detecting that the queue length of the short message data of the fixed cache region in the cache pool is greater than a threshold value, calling the cache space of the dynamic cache region in the cache pool to expand the fixed cache region, so as to obtain an expanded cache region.
In this step, the fixed cache regions correspond to the short message gateways one to one, that is, one short message gateway corresponds to one fixed cache region, the cache region at least includes one dynamic cache region and a plurality of fixed cache regions, and the size of the fixed cache region is measured by the queue length, for example, 10000 short messages can be stored in the fixed cache region at maximum, and then the maximum queue length of the fixed cache region is 10000. In addition, the threshold may be selected according to the maximum queue length of the buffer, and the threshold is set so that when the short message queue in the fixed buffer reaches a certain length, the short message queue is triggered to expand the capacity. It should be further noted that the cache space of the dynamic cache region represents a region of the dynamic cache region for storing data, and the cache space may be a part of the dynamic cache region or may be all of the dynamic cache region.
Specifically, the capacity expansion of the fixed cache region is realized by increasing the maximum queue length of the fixed cache region so as to enhance the data storage capacity of the fixed cache region.
In this step, the dynamic buffer area is linked with the fixed buffer through the buffer pool, so as to realize the dynamic configuration of the maximum queue length of the fixed buffer area.
And 204, storing the received short message data into the expanded cache region, and sending the short message data in the expanded cache region to the short message gateway of the fixed cache region for short message sending.
In this step, the extended cache region is relative to the fixed cache region, and the fixed cache region corresponds to a unique short message gateway, that is, before the fixed cache region is not expanded, short message data is obtained from the fixed cache region in the corresponding short message gateway, after the fixed cache region is expanded, the extended cache region actually needs to correspond to the short message gateway corresponding to the fixed cache region, then the short message data is stored through the extended cache region, and the short message data in the extended cache region is sent to the corresponding short message gateway for short message sending.
It is worth to be noted that each short message gateway works independently, so that the corresponding fixed cache regions are also independent, and dynamic capacity expansion of each fixed cache region is also independent. In addition, according to the first-in first-out principle of the buffer queue, the short messages are sequentially sent to the operator through the short message gateway.
In the method for sending the short message, the short message data is stored in the fixed cache region, the queue length of the short message data in the fixed cache region in the cache pool is detected, when the queue length of the short message data exceeds a threshold value, the cache space of the dynamic cache region in the cache pool is called to expand the fixed cache region to obtain an expanded cache region, then the received short message data is stored in the expanded cache region, and the short message gateway corresponding to the fixed cache region also obtains the short message data from the expanded cache region to send the short message. According to the embodiment of the invention, the dynamic configuration of the fixed cache regions of the plurality of short message gateways can effectively prevent short message sending failure during mass short message sending.
In the application scenario of fig. 1, a plurality of short message gateways may be configured in the server, generally speaking, the number of the short message gateways is determined according to a service scenario, and in addition, when dealing with large-batch data, a plurality of short message gateways may be configured for the same service scenario, and the service scenario may be divided into: marketing, trading, etc. Therefore, when the client edits the short message, different classification labels can be set for the short messages of different service scenes, and the server judges the short message gateway corresponding to the short message by identifying the classification labels.
In an embodiment, as shown in fig. 3, when receiving the short message data sent by the client, the server may perform the following processing:
step 302, storing the short message data in a sending table.
At step 304, the classification tags in the forwarding table are identified.
Step 306, storing the short message data into a corresponding fixed cache region according to the attribute of the short message data.
In the embodiment of the present invention, the classification tag is used to identify an attribute of the short message data, for example: the classification label is set for the short message of the identifying code class in the client, and the attribute of the short message data can be known to be the identifying code class in the server through identifying the classification label.
In addition, in the embodiment of the invention, each attribute of the short message data is configured with an exclusive short message gateway, namely, the short message data is stored in the corresponding fixed cache region through the attribute of the short message data. Because more than one short message gateway may be configured in each service scenario, for example, the verification code short message is configured with three short message gateways, when the server identifies that the short message is a verification code short message, the verification code short message can be allocated to a fixed cache region corresponding to one of the three short message gateways by setting an allocation rule.
In another embodiment, for the step S306, the short message data may be stored in the corresponding fixed buffer area from the sending table in a manner of task process access, a task may be generated or deleted in the server according to a task requirement, and when the short message data needs to be transferred from the database to the short message gateway, a task process may be generated, where the task process is used for access of the short message data. Specifically, the same number of task processes may be activated according to the number of types of the short message attributes, that is, the interface connecting the short message gateway and the database is activated by activating the task processes, and then the short message data is stored in the corresponding fixed buffer area by parallel processing of each task process.
In the embodiment of the invention, when the short message data with three attributes exist in the sending table of the database, the short messages can be specifically marketing short messages, transaction short messages and promotion short messages, so that the marketing short messages, the transaction short messages and the promotion short messages need to be sent to the corresponding short message gateways for sending in actual processing, the attributes of the marketing short messages, the transaction short messages and the promotion short messages are identified through the classification tags, and the task processes with the corresponding number can be activated. In addition, when large-batch short message data processing is carried out, each task process can be processed in parallel in a multithreading mode, and the short message sending efficiency is higher. The task processes processed in parallel cannot be influenced mutually, and errors are avoided when short message data are written in the fixed cache region.
In yet another embodiment, a task process may be configured to include two states, respectively: the method comprises a dormant state and a working state, wherein when a task process is in the working state, short message data is fetched from a sending table, consumed system resources are large, when the task process is in the dormant state, the system resources are hardly consumed, and when the task process with the same number is activated according to the number of attribute types of the short message data, the state of the task process with the same number can be switched from the dormant state to the working state according to the number of the attribute types. This means that the task process needs to be switched to the working state when it is needed, and needs only to be switched to the sleeping state when it is not needed. Therefore, through the processing of the embodiment, the consumption of the system resources of the server is rationalized, and the optimization of the whole system is facilitated.
In the embodiment of the present invention, the processing flow of the short message data may be as shown in fig. 4, the short message data with 6 attributes are stored in the sending table, and correspondingly, the short message data also includes 6 short message gateways and 6 fixed buffer partitions, in the sending table, the short message data with different attributes may be arranged in a disordered manner, when the task process fetches, the task process stores the short message data in the corresponding fixed buffer partition by identifying the classification tag of the short message data, for example, the short message 3, and the task process transfers the short message 3 from the sending table to the fixed buffer partition 3 by identifying the classification tag of the short message 3, and then the short message gateway 3 fetches and sends the fetched number.
In an embodiment, after the short message data is stored in the fixed cache region in the server, it needs to be determined whether the fixed cache region needs to be expanded, as shown in fig. 5, the specific steps are as follows:
s501, comparing the queue length of the short message data in the current fixed buffer area with a queue length threshold value.
Wherein the queue length threshold is proportional to the maximum queue length of the fixed buffer.
Further, 90% of the maximum queue length may be selected as the queue length threshold, e.g., 10000 for the maximum queue length, then 9000 for the queue length threshold. It should be noted that 90% is a reasonable value obtained by practical use, and the embodiment of the present invention is not limited thereto.
S502, judging whether the queue length of the short message data is larger than the queue length threshold, if so, jumping to the step S503, and if not, jumping to the step S505.
S503, obtaining the write-in rate of the current short message data stored in the fixed buffer area, and obtaining the size of the queue to be expanded according to the write-in rate.
In this step, by obtaining the write rate and the processing capability of the short message gateway, the increase rate of the queue length in the fixed buffer area can be obtained, and each increase rate can correspond to one size of the queue to be expanded in advance. Therefore, the size of the queue to be expanded can be correspondingly obtained according to the write-in rate.
S504, according to the size of the queue to be expanded, calling the cache space of the dynamic cache region to expand the fixed cache region.
And S505, ending.
In the embodiment of the invention, the capacity of the fixed cache region can be automatically expanded by dynamically configuring the relationship between the threshold value and the maximum queue length. It should be noted that the embodiment of the present invention is not limited to this method for configuring the threshold, and the same technical effect can also be achieved by setting the difference between the maximum queue length and the queue length threshold to be a constant value.
In a specific embodiment, the maximum queue length of the fixed buffer is 10000, 90% of the maximum queue length is set as a queue length threshold, the processing capacity of the short message gateway is 200 pieces/minute, the current queue length in the fixed buffer is 8000, and the write rate is maintained at 400 pieces/minute, it is conceivable that after 5 minutes, the queue length of the short message data in the fixed buffer will reach 9000, so that the dynamic buffer needs to be called, the increase speed is 200 pieces/minute, a large amount of historical data is analyzed according to daily experience or big data, and the short message data will be returned stably after 15 minutes, so the size of the queue to be expanded can be set to 3000, and 3000 queue lengths are called from the dynamic buffer. Through the above processing, the problem of data overflow can be solved, so that the loss of the short message data is prevented, and further, if the short message data is not returned to be stable after 15 minutes, but is continuously written in 400 pieces/minute, at this time, the maximum queue length is 13000, and the dynamically set queue length threshold is 11700, then when the queue length threshold is halved by 18, the queue length threshold is reached again, so that a partial area needs to be called again from the dynamic buffer area. Through the processing, the queue length threshold value can be dynamically configured, so that the overflow of the short message data is avoided.
In another embodiment, the working principle of the dynamic cache area is as follows: when the dynamic cache region is not called, the dynamic cache region is in a state to be called, and can receive a calling instruction in the state to be called, the dynamic cache region receives a region after calling and is in the calling state, and when the dynamic cache region needs to be called, the calling instruction is generated, so that the capacity expansion of the fixed cache region is realized.
In the embodiment of the invention, the expansion of the fixed cache region can be executed by inquiring the region in the dynamic cache region in the state to be called and then according to the size of the queue to be expanded. It should be noted that the dynamic cache region may be called by all the fixed cache regions, once a region in the dynamic cache region is called, the region will not be called by other fixed cache regions, but becomes a cache space for calling the fixed cache region, and under a certain condition, the fixed cache region returns a part of the called dynamic cache region, so that the calling region is in a state to be called again.
In addition, as an improved embodiment of the present invention, the short message sending speed of each short message gateway can be monitored by setting a corresponding monitoring subprogram in the server, where the short message sending speed is abnormal and may be caused by hardware or software failure of the short message gateway itself, and when such a failure occurs, corresponding operation and maintenance personnel can be notified to perform maintenance, but some failures are temporary, for example, network fluctuation will affect the short message sending speed of the short message gateway, and false images of large batches of data may occur, such as no processing, and for the server, the area of the dynamic cache area will be called to expand the fixed cache area. In essence, the network fluctuation is short, when the network fluctuation causes the abnormal short message sending speed, firstly, whether the short message data queue length in the fixed buffer zone corresponding to the short message gateway reaches the preset queue length threshold value is detected; if so, stopping storing the short message data into the fixed cache region corresponding to the short message gateway.
In the embodiment of the invention, when the length of the short message data queue in the fixed cache region reaches the queue length threshold value due to network fluctuation, the jam can be considered as temporary, and only the short message data is required to be stopped being stored into the fixed cache region.
It should be understood that although the various steps in the flowcharts of fig. 2, 3 and 5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 3 and 5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, an apparatus for sending a short message is provided, including: an expansion module 602 and a sending module 604, wherein:
an expansion module 602, configured to call a cache space of a dynamic cache region in the cache pool to expand the fixed cache region when detecting that a queue length of short message data in the fixed cache region in the cache pool is greater than a threshold value, so as to obtain an expanded cache region; the fixed cache regions correspond to the short message gateways one to one.
A sending module 604, configured to store the received short message data in the extended cache region, and send the short message data in the extended cache region to a short message gateway in the fixed cache region for sending a short message.
It should be noted that the expansion module and the sending module may be disposed in the server shown in fig. 1, functions of the modules may be implemented by a plurality of hardware modules and a computer program in a matching manner, and specifically, by cooperation of the modules, dynamic configuration of a maximum queue length of a fixed buffer may be implemented, so as to reduce a situation of short message data loss during processing of a large batch of short messages.
In an embodiment, the sending module 604 is further configured to identify a classification tag of the short message data, where the classification tag is used to identify an attribute of the short message data; the attribute corresponds to the short message gateway; and storing the short message data into an extended cache region corresponding to the short message gateway according to the attribute of the short message data.
In an embodiment, the sending module 604 is further configured to activate task processes with the same number according to the number of the attribute categories of the short message data, and store the short message data into the short message gateway corresponding to the short message gateway through parallel processing of each task process; each task process processes short message data corresponding to one attribute.
In an embodiment, the sending module 604 is further configured to switch the states of the same number of task processes from the sleep state to the working state according to the number of the attribute categories, where the states of the task processes include: an active state and a sleep state.
In an embodiment, the expansion module 602 is configured to determine that a dynamic cache region needs to be called when the queue length of the short message data is greater than a threshold; the threshold is proportional to the maximum queue length of the fixed buffer; when the dynamic cache region is determined to be called, acquiring the write-in rate of the current short message data stored in the fixed cache region, and obtaining the size of a queue to be expanded according to the write-in rate; and calling the cache space of the dynamic cache region to expand the fixed cache region according to the size of the queue to be expanded.
In an embodiment, the expansion module 504 is further configured to query a region in the dynamic cache region that is in a to-be-called state, and call a cache space of the region in the to-be-called state to expand the fixed cache region according to the size of the to-be-expanded queue.
In one embodiment, the method further comprises: the monitoring module is used for monitoring the short message sending speed of each short message gateway and detecting whether the short message data queue length in the fixed cache region corresponding to the short message gateway reaches a preset queue length threshold value or not when the short message sending speed is determined to be abnormal due to network fluctuation; and if so, stopping storing the short message data into the fixed cache region corresponding to the short message gateway.
For specific limitations of the device for sending short messages, reference may be made to the above limitations of the method for sending short messages, which are not described herein again. All modules in the device for sending the short message can be completely or partially realized through software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and a computer program in the nonvolatile storage medium, and in addition, the internal memory is also provided with a fixed cache region and a dynamic cache region, and on the other hand, the same effect can be realized by an external memory. A short message sending table is arranged in a database of the computer equipment and used for storing received short message data. The network interface of the computer equipment is used for being connected with an external terminal through a network or communicating with an interface on one hand, and is also used for being connected with a short message gateway and sending short message data to the short message gateway on the other hand. The computer program is executed by a processor to implement a method of short message transmission.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory storing a computer program and a processor implementing the steps of the above-described method embodiments when the processor executes the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the respective method embodiment as described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for sending short messages, the method comprising:
when detecting that the queue length of the short message data of the fixed cache region in the cache pool is greater than a threshold value, calling the cache space of the dynamic cache region in the cache pool to expand the fixed cache region to obtain an expanded cache region; the fixed cache regions correspond to the short message gateways one to one;
storing the received short message data into the extended cache region, and sending the short message data in the extended cache region to the short message gateway of the fixed cache region for short message sending;
monitoring the short message sending speed of each short message gateway, and detecting whether the length of a short message data queue in a fixed cache region corresponding to the short message gateway reaches a preset queue length threshold value when the short message sending speed is determined to be abnormal due to network fluctuation; and if so, stopping storing the short message data into the fixed cache region corresponding to the short message gateway.
2. The method of claim 1, wherein the step of storing the received short message data in the extended buffer comprises:
identifying a classification label of the short message data, wherein the classification label is used for identifying the attribute of the short message data; the attribute corresponds to a short message gateway;
and storing the short message data into an extended cache region corresponding to the short message gateway according to the attribute of the short message data.
3. The method of claim 2, wherein the storing the short message data in an extended buffer corresponding to the short message gateway according to the attribute of the short message data comprises:
activating task processes with the same number according to the number of the attribute categories of the short message data, and storing the short message data into the short message gateway corresponding to the short message gateway through parallel processing of all the task processes; each task process processes short message data corresponding to one attribute.
4. The method of claim 3, wherein the status of the task process comprises: a working state and a dormant state;
the step of activating the task processes with the same number according to the number of the attribute categories of the short message data comprises the following steps:
and switching the states of the task processes with the same number from the dormant state to the working state according to the number of the attribute categories.
5. The method of claim 1, wherein when detecting that the queue length of the short message data in the fixed buffer in the buffer pool is greater than a threshold, the method calls the buffer space of the dynamic buffer in the buffer pool to expand the fixed buffer, and includes:
when the queue length of the short message data is larger than a threshold value, determining that a dynamic cache region needs to be called; the threshold is proportional to the maximum queue length of the fixed buffer;
when the dynamic cache region is determined to be called, acquiring the write-in rate of the current short message data stored in the fixed cache region, and obtaining the size of a queue to be expanded according to the write-in rate; and calling the cache space of the dynamic cache region to expand the fixed cache region according to the size of the queue to be expanded.
6. The method of sending short messages according to claim 5, wherein the calling the buffer space of the dynamic buffer to expand the fixed buffer according to the size of the queue to be expanded includes:
and inquiring the area in the dynamic cache area in the state to be called, and calling the cache space of the area in the state to be called to expand the capacity of the fixed cache area according to the size of the queue to be expanded.
7. The method of claim 5, wherein obtaining a write rate at which current short message data is stored in the fixed buffer, and obtaining a size of a queue to be expanded according to the write rate comprises:
acquiring the size of the writing rate and the processing capacity of the short message gateway to obtain the increase rate of the queue length in the fixed cache region; each growth rate corresponds to the size of a queue to be expanded in advance;
and correspondingly obtaining the size of the queue to be expanded according to the write-in rate.
8. An apparatus for sending short messages, the apparatus comprising:
the expansion module is used for calling the cache space of the dynamic cache region in the cache pool to expand the fixed cache region to obtain an expanded cache region when the queue length of the short message data of the fixed cache region in the cache pool is larger than a threshold value; the fixed cache regions correspond to the short message gateways one to one;
the sending module is used for storing the received short message data into the extended cache region, sending the short message data in the extended cache region to the short message gateway of the fixed cache region and sending the short message;
the monitoring module is used for monitoring the short message sending speed of each short message gateway and detecting whether the short message data queue length in the fixed cache region corresponding to the short message gateway reaches a preset queue length threshold value or not when the short message sending speed is determined to be abnormal due to network fluctuation; and if so, stopping storing the short message data into the fixed cache region corresponding to the short message gateway.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method of sending a short message according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of short message transmission according to any one of claims 1 to 7.
CN201810661258.4A 2018-06-25 2018-06-25 Method and device for sending short message, computer equipment and storage medium Active CN108834086B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810661258.4A CN108834086B (en) 2018-06-25 2018-06-25 Method and device for sending short message, computer equipment and storage medium
PCT/CN2018/105202 WO2020000663A1 (en) 2018-06-25 2018-09-12 Short message sending method and apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810661258.4A CN108834086B (en) 2018-06-25 2018-06-25 Method and device for sending short message, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108834086A CN108834086A (en) 2018-11-16
CN108834086B true CN108834086B (en) 2021-05-11

Family

ID=64138284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810661258.4A Active CN108834086B (en) 2018-06-25 2018-06-25 Method and device for sending short message, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN108834086B (en)
WO (1) WO2020000663A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109474900B (en) * 2018-12-21 2021-10-29 上海瀚银信息技术有限公司 Short message service system and service method
CN111245743B (en) * 2020-01-09 2023-09-08 浙江吉利汽车研究院有限公司 Information processing method, storage medium, gateway and automobile
CN111371704B (en) * 2020-02-06 2024-03-15 视联动力信息技术股份有限公司 Data caching method and device, terminal equipment and storage medium
CN114401258A (en) * 2021-12-22 2022-04-26 杭州安恒信息技术股份有限公司 Short message sending method, device, electronic device and storage medium
CN115242745B (en) * 2022-07-19 2023-08-15 南京鼎山信息科技有限公司 Short message pushing system and method based on 5G communication network
CN115665674B (en) * 2022-11-11 2023-03-10 上海大汉三通通信股份有限公司 5G message processing method, device, equipment and storage medium
CN117041893B (en) * 2023-10-10 2024-01-12 江西掌中无限网络科技股份有限公司 Method and system for sending international short message by using cloud computing technology

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1461160A (en) * 2002-05-24 2003-12-10 Lg电子株式会社 Short information service information memory method for Global mobile communication system terminal
WO2004105405A3 (en) * 2003-05-16 2005-02-10 M Qube Inc Mobile messaging short code translation and routing system and method
CN101188544A (en) * 2007-12-04 2008-05-28 浙江大学 File transfer method for distributed file server based on buffer
CN101957800A (en) * 2010-06-12 2011-01-26 福建星网锐捷网络有限公司 Multichannel cache distribution method and device
CN103124400A (en) * 2011-11-21 2013-05-29 中兴通讯股份有限公司 Short message cache method and system
CN103150268A (en) * 2013-03-04 2013-06-12 浪潮电子信息产业股份有限公司 Block-level data capture method in CDP (Continuous Data Protection)
CN103906018A (en) * 2012-12-26 2014-07-02 中国移动通信集团福建有限公司 Method of sending short message and device
CN103914456A (en) * 2012-12-31 2014-07-09 北京中交兴路信息科技有限公司 Data storage method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7646741B2 (en) * 2003-10-23 2010-01-12 Alcatel-Lucent Usa Inc. Method for client-based multicast message transmission
CN101159913B (en) * 2007-11-12 2011-03-16 中兴通讯股份有限公司 Entity short message flow control system and method of exterior short message
CN102056108B (en) * 2010-12-09 2013-06-05 北京握奇数据系统有限公司 Short message cache method and device and telecommunication smart card
EP2897408B1 (en) * 2012-10-09 2017-07-26 Huawei Technologies Co., Ltd. Data pushing method and device
CN108200544B (en) * 2018-03-02 2021-12-28 北京中电普华信息技术有限公司 Short message issuing method and short message platform

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1461160A (en) * 2002-05-24 2003-12-10 Lg电子株式会社 Short information service information memory method for Global mobile communication system terminal
WO2004105405A3 (en) * 2003-05-16 2005-02-10 M Qube Inc Mobile messaging short code translation and routing system and method
CN101188544A (en) * 2007-12-04 2008-05-28 浙江大学 File transfer method for distributed file server based on buffer
CN101957800A (en) * 2010-06-12 2011-01-26 福建星网锐捷网络有限公司 Multichannel cache distribution method and device
CN103124400A (en) * 2011-11-21 2013-05-29 中兴通讯股份有限公司 Short message cache method and system
CN103906018A (en) * 2012-12-26 2014-07-02 中国移动通信集团福建有限公司 Method of sending short message and device
CN103914456A (en) * 2012-12-31 2014-07-09 北京中交兴路信息科技有限公司 Data storage method and system
CN103150268A (en) * 2013-03-04 2013-06-12 浪潮电子信息产业股份有限公司 Block-level data capture method in CDP (Continuous Data Protection)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高校短信平台的研究与实现;云洁;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130115;全文 *

Also Published As

Publication number Publication date
CN108834086A (en) 2018-11-16
WO2020000663A1 (en) 2020-01-02

Similar Documents

Publication Publication Date Title
CN108834086B (en) Method and device for sending short message, computer equipment and storage medium
CN109788053B (en) Data synchronization method and system
CN108933993B (en) Short message cache queue selection method and device, computer equipment and storage medium
CN110719318B (en) Message processing method and system
EP3562096B1 (en) Method and device for timeout monitoring
CN110708247B (en) Message routing method, message routing device, computer equipment and storage medium
CN110503385B (en) Service processing method, device, computer equipment and storage medium
CN108388478B (en) Log data processing method and system
CN110768873B (en) Distributed heartbeat detection method, system and device and computer equipment
CN108446172B (en) Data calling method and device, computer equipment and storage medium
CN108965383B (en) File synchronization method and device, computer equipment and storage medium
CN108845869B (en) Concurrent request control method, device, computer equipment and storage medium
CN110767291A (en) Medical image processing method, apparatus and storage medium
CN112491659A (en) Flow playback test method and device, computer equipment and storage medium
CN110674149B (en) Service data processing method and device, computer equipment and storage medium
CN110599080A (en) Service data distribution processing method and device, computer equipment and storage medium
CN108389124B (en) Data processing method, data processing device, computer equipment and storage medium
CN111159233B (en) Distributed caching method, system, computer equipment and storage medium
CN111382976B (en) Early warning data processing method and device, computer equipment and storage medium
CN109857344B (en) Heartbeat state judgment method and device based on shared memory and computer equipment
CN115509861A (en) Process monitoring method, system, computer device and storage medium
CN111258860B (en) Data alarm method, device, computer equipment and storage medium
CN115373886A (en) Service group container shutdown method, device, computer equipment and storage medium
CN113961611A (en) Log processing method, device, equipment and storage medium
CN114157582A (en) Switch port state monitoring method and device and network communication system

Legal Events

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