CN108810832B - Short message issuing method and device and computer readable storage medium - Google Patents

Short message issuing method and device and computer readable storage medium Download PDF

Info

Publication number
CN108810832B
CN108810832B CN201810360436.XA CN201810360436A CN108810832B CN 108810832 B CN108810832 B CN 108810832B CN 201810360436 A CN201810360436 A CN 201810360436A CN 108810832 B CN108810832 B CN 108810832B
Authority
CN
China
Prior art keywords
current node
message
message packet
short message
receiving module
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
CN201810360436.XA
Other languages
Chinese (zh)
Other versions
CN108810832A (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.)
Guangzhou Xuanwu Wireless Technology Co Ltd
Original Assignee
Guangzhou Xuanwu Wireless Technology 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 Guangzhou Xuanwu Wireless Technology Co Ltd filed Critical Guangzhou Xuanwu Wireless Technology Co Ltd
Priority to CN201810360436.XA priority Critical patent/CN108810832B/en
Publication of CN108810832A publication Critical patent/CN108810832A/en
Application granted granted Critical
Publication of CN108810832B publication Critical patent/CN108810832B/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]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0283Price estimation or determination
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/24Accounting or billing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The invention discloses a short message issuing method, a device and a computer readable storage medium, wherein the short message issuing method comprises the steps that a receiving module charges a message packet sent by a client; when the distributed cache system is effective, the receiving module respectively sends the message packet to a message queue of a current node of the receiving module and the distributed cache system for caching, and sends response information to the client; the current node deducts the fee from the fund account corresponding to the message packet in the message queue and generates fee deduction information; the current node respectively sends the message packets in the message queue and the fee deduction information corresponding to the message packets to a local database and a memory DB of a central service module for storage; the distributed caching system removes the message packet corresponding to the current node. The method is based on distributed cache, realizes asynchronous response of short message sending, greatly improves response time and realizes high availability of short message sending processing.

Description

Short message issuing method and device and computer readable storage medium
Technical Field
The invention relates to the technical field of short message issuing, in particular to a short message issuing method, a short message issuing device and a computer readable storage medium.
Background
At present, the existing downlink message processing flow is to perform message charging and fee deduction first and then perform DB persistence processing, but strict transaction consistency of message charging and fee deduction is caused, on one hand, message charging serialization processing consumes a long time, on the other hand, DB lock contention is frequent easily caused, and persistence consuming a long time, so that response time of a message is delayed, and a network IO thread utilization rate is low.
Disclosure of Invention
The invention aims to provide a short message issuing method, a short message issuing device and a computer readable storage medium, which realize the asynchronous response of short message issuing through distributed cache, greatly improve the response time and realize the high availability of short message issuing processing.
In order to solve the above technical problem, an embodiment of the present invention provides a short message issuing method, including:
the receiving module charges the message packet sent by the client;
when the distributed cache system is effective, the receiving module respectively sends the message packet to a message queue of a current node of the receiving module and the distributed cache system for caching, and sends response information to the client;
the current node deducts the fee from the fund account corresponding to the message packet in the message queue and generates fee deduction information;
the current node respectively sends the message packets in the message queue and the fee deduction information corresponding to the message packets to a local database and a memory DB of a central service module for storage;
the distributed cache system removes the message packet corresponding to the current node.
Preferably, the receiving module charges a message packet sent by a client, and specifically includes:
according to a preset black and white list and sensitive words, a service processing unit of the receiving module filters the short messages sent by the client, obtains the message packet and sends the message packet to a charging processing unit of the receiving module;
and the charging processing unit carries out frame charging on the message packet.
Preferably, the short message issuing method further includes:
detecting whether the current node is down according to registration information sent by the current node to the distributed cache system according to a set time interval;
when the current node is down, detecting whether a message packet corresponding to the current node exists in the distributed cache system;
when the distributed cache system has the message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, other nodes of the receiving module pull the message packet corresponding to the current node from the distributed cache system and deduct the fee.
Preferably, when the distributed cache system has a message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, the other nodes of the receiving module pull the message packet corresponding to the current node from the distributed cache system and deduct the fee, specifically including:
when the distributed cache system has a message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, other nodes of the receiving module determine a takeover node for taking over the message packet corresponding to the current node through a contention distributed lock;
and the takeover node pulls the message packet corresponding to the current node from the distributed cache system, and deducts the fee of the fund account corresponding to the message packet.
Preferably, the short message issuing method includes:
the distributed cache system comprises a main cache server and a plurality of secondary cache servers which are connected in a chain structure;
when the main cache server is down, the takeover node pulls the message packet corresponding to the current node from the slave cache server under the main cache server.
Preferably, the short message issuing method further includes:
judging whether the accumulation amount of the current cache queue of the current node is larger than a second threshold value;
and when the accumulation amount of the cache queue of the current node is larger than the second threshold, adjusting the response time of the current node according to the accumulation amount of the current cache queue of the current node, the second threshold and a preset delay factor.
Preferably, when the accumulation amount of the buffer queue of the current node is greater than the second threshold, adjusting the response time of the current node according to the accumulation amount of the current buffer queue of the current node, the second threshold and a preset delay factor specifically includes:
when the accumulation amount of the cache queue of the current node is larger than the second threshold, calculating the delayed submission response time of the current node according to a formula t ═ a-b × n, and adjusting the current submission response time of the current node to be the delayed submission response time;
wherein t is the delayed submission response time, a is the accumulation amount of the current buffer queue, b is the second threshold, and n is the preset delay factor.
Preferably, the short message issuing method further includes:
when the distributed cache system fails, the receiving module sends the message packet to a message queue of the current node, and the current node sends response information to the client when sending the message packet in the message queue and the fee deduction information corresponding to the message packet to the local database and the memory DB of the central service module respectively.
The embodiment of the invention also provides a short message issuing device, which comprises a processor, a memory and a computer program which is stored in the memory and configured to be executed by the processor, wherein the processor realizes the short message issuing method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, which comprises a stored computer program, wherein when the computer program runs, the device where the computer readable storage medium is located is controlled to execute the short message issuing method.
Compared with the prior art, the short message issuing method provided by the embodiment of the invention has the beneficial effects that: the method comprises the steps that a receiving module charges a message packet sent by a client; when the distributed cache system is effective, the receiving module respectively sends the message packet to a message queue of a current node of the receiving module and the distributed cache system for caching, and sends response information to the client; the current node deducts the fee from the fund account corresponding to the message packet in the message queue and generates fee deduction information; the current node respectively sends the message packets in the message queue and the fee deduction information corresponding to the message packets to a local database and a memory DB of a central service module for storage; the distributed cache system removes the message packet corresponding to the current node. The method is based on distributed cache, realizes asynchronous response of short message sending, greatly improves response time and realizes high availability of short message sending processing. The embodiment of the invention also provides a short message issuing device and a computer readable storage medium.
Drawings
Fig. 1 is a flowchart of a short message issuing method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a short message issuing device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Please refer to fig. 1, which is a flowchart illustrating a method for issuing a short message according to an embodiment of the present invention; the short message issuing method comprises the following steps:
s100: the receiving module charges the message packet sent by the client;
s200: when the distributed cache system is effective, the receiving module respectively sends the message packet to a message queue of a current node of the receiving module and the distributed cache system for caching, and sends response information to the client;
s300: the current node deducts the fee from the fund account corresponding to the message packet in the message queue and generates fee deduction information;
s400: the current node respectively sends the message packets in the message queue and the fee deduction information corresponding to the message packets to a local database and a memory DB of a central service module for storage;
s500: the distributed cache system removes the message packet corresponding to the current node.
In this embodiment, the receiving module adopts a cache mode combining a local message queue and a distributed cache, so that the node of the receiving module performs asynchronous deduction and DB persistence on the received message packets, on one hand, when the local message queue is lost due to the downtime of the current node, other nodes can pull the message packets corresponding to the local message queue from the distributed cache system, thereby realizing data cache recovery; on the other hand, the response processing is carried out while the message packet is cached, so that the asynchronous response of the short message sending is realized, the response time is greatly improved, and the high availability of the short message sending processing is realized.
In an alternative embodiment, S100: the receiving module charges a message packet sent by a client, and specifically comprises the following steps:
according to a preset black and white list and sensitive words, a service processing unit of the receiving module filters the short messages sent by the client, obtains the message packet and sends the message packet to a charging processing unit of the receiving module;
and the charging processing unit carries out frame charging on the message packet.
In this embodiment, the service processing unit filters the short message sent by the client according to a preset black and white list and the sensitive word to obtain an effective short message and form the message packet, so that the charging processing unit can be prevented from charging an invalid short message, and the accuracy of short message charging is improved.
In an optional embodiment, the short message sending method further includes:
detecting whether the current node is down according to registration information sent by the current node to the distributed cache system according to a set time interval;
when the current node is down, detecting whether a message packet corresponding to the current node exists in the distributed cache system;
when the distributed cache system has the message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, other nodes of the receiving module pull the message packet corresponding to the current node from the distributed cache system and deduct the fee.
In this embodiment, all nodes of the receiving module send registration information to the distributed cache system according to the set time interval; detecting whether the registration information sent by the current node exists in the distributed cache system or not at a set heartbeat detection time interval; if yes, determining that the current node is online; and if not, determining that the current node is down.
And carrying out heartbeat detection on the current node periodically, and when the current node is down, taking over the unprocessed message packets of the current node from the distributed cache system by other nodes and carrying out subsequent fee deduction DB persistence processing on the unprocessed message packets so as to realize data recovery when the node is down.
In an optional embodiment, when the distributed cache system has a message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, the other nodes of the receiving module pull the message packet corresponding to the current node from the distributed cache system and deduct the fee, specifically including:
when the distributed cache system has a message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, other nodes of the receiving module determine a takeover node for taking over the message packet corresponding to the current node through a contention distributed lock;
and the takeover node pulls the message packet corresponding to the current node from the distributed cache system, and deducts the fee of the fund account corresponding to the message packet.
In this embodiment, the other nodes determine to take over the unprocessed message packet of the current node cached in the distributed cache system by contending for the distributed lock generated based on the distributed cache system and the LUA script, so that the plurality of other nodes can be prevented from simultaneously taking over the unprocessed message packet of the current node cached in the distributed cache system, repeated recovery of data is effectively prevented, and correctness of data recovery is ensured. Wherein the first threshold is a processing duration of the current node for processing the message packet.
In an optional embodiment, the short message issuing method includes:
the distributed cache system comprises a main cache server and a plurality of secondary cache servers which are connected in a chain structure;
when the main cache server is down, the takeover node pulls the message packet corresponding to the current node from the slave cache server under the main cache server.
In this embodiment, the distributed cache system is subjected to disaster recovery deployment, and a main cache server and two secondary cache servers are adopted, where the main cache server and the two secondary cache servers are linked in a chain structure, that is, the secondary cache server C belongs to the secondary cache server B, and the secondary cache server B belongs to the main cache server a, and at this time, when the main cache server a is down, other nodes pull the message packet of the current node from the secondary cache server B, so as to implement data recovery; when the cache server B is down, other nodes pull the message packet of the current node from the cache server C to realize data recovery; disaster tolerance deployment is carried out on the distributed cache system, so that disaster tolerance of the distributed cache system in the same machine room and across machine rooms can be realized; the slave chain structure is adopted, so that the pressure of data replication on the nodes can be reduced; in addition, by combining the high availability scheme of the distributed cache system, the failover of the fault distributed cache node instance can be realized.
In an optional embodiment, the short message sending method further includes:
judging whether the accumulation amount of the current cache queue of the current node is larger than a second threshold value;
and when the accumulation amount of the cache queue of the current node is larger than the second threshold, adjusting the response time of the current node according to the accumulation amount of the current cache queue of the current node, the second threshold and a preset delay factor.
In this embodiment, the second threshold is a accumulation waterline set by the current node. For example: assuming that the accumulation waterline set by the current node is 10000, and the delay factor is 10; the current cache queue accumulation amount of the current node reaches 20000, at the moment, the current cache queue accumulation amount of the current node is higher than the accumulation water line, the information amount of the message packet received by the current node is indicated to be too large, and the response time is dynamically adjusted according to the current cache queue accumulation amount of the current node, the second threshold and the preset delay factor, so that the limitation on submitted flow is achieved, the automatic speed limitation when the node flow is too large is realized, and the current node load is avoided to be too large.
In an optional embodiment, when the accumulation amount of the buffer queue of the current node is greater than the second threshold, adjusting the response time of the current node according to the accumulation amount of the current buffer queue of the current node, the second threshold, and a preset delay factor specifically includes:
when the accumulation amount of the cache queue of the current node is larger than the second threshold, calculating the delayed submission response time of the current node according to a formula t ═ a-b × (n), and adjusting the current submission response time of the current node to be the delayed submission response time;
wherein t is the delayed submission response time, a is the accumulation amount of the current buffer queue, b is the second threshold, and n is the preset delay factor.
In an optional embodiment, the short message sending method further includes:
when the distributed cache system fails, the receiving module sends the message packet to a message queue of the current node, and the current node sends response information to the client when sending the message packet in the message queue and the fee deduction information corresponding to the message packet to the local database and a memory DB of the central service module.
In this embodiment, when the distributed cache system fails to work due to various other emergency situations, for example: the machine room where the distributed cache system is located is damaged due to some irresistible natural disasters, typhoons, floods, earthquakes and the like; a network main optical cable used in a machine room is damaged; the distributed cache component causes the unavailability of service due to self defects; the receiving module carries out automatic dimension reduction processing, namely, the asynchronous dimension reduction of the short message is changed into synchronous fee deduction processing of the short message, namely, the message packet received by the receiving module is not subjected to distributed caching, and response processing is carried out after the fee deduction processing is carried out on the message packet, so that the usability of normal service of a short message platform is ensured.
Please refer to fig. 2, which is a schematic diagram of a short message issuing device according to an embodiment of the present invention; the short message issuing device comprises: the system comprises a receiving module 1, a central service module 2 and a distributed cache system 3;
the receiving module 1 is used for charging the message packet sent by the client;
when the distributed cache system 3 is valid, the receiving module 1 is configured to send the message packet to a message queue of a current node of the receiving module 1 and the distributed cache system 3 for caching, and send response information to the client;
the current node is used for deducting the fund account corresponding to the message packet in the message queue and generating deduction information;
the current node is configured to send the message packets in the message queue and the fee deduction information corresponding to the message packets to the local database 11 and the memory DB21 of the central service module 2 for storage;
the distributed cache system 3 is used for removing the message packet corresponding to the current node.
In this embodiment, the receiving module adopts a cache mode combining a local message queue and a distributed cache, so that the node of the receiving module performs asynchronous deduction and DB persistence on the received message packets, on one hand, when the local message queue is lost due to the downtime of the current node, other nodes can pull the message packets corresponding to the local message queue from the distributed cache system, thereby realizing data cache recovery; on the other hand, the response processing is carried out while the message packet is cached, so that the asynchronous response of the short message sending is realized, the response time is greatly improved, and the high availability of the short message sending processing is realized.
In an optional embodiment, the receiving module 1 includes a service processing unit 12, a charging processing unit 13;
according to a preset black and white list and sensitive words, the service processing unit 12 of the receiving module 1 is configured to filter the short message sent by the client, obtain the message packet, and send the message packet to the charging processing unit 13 of the receiving module 1;
the charging processing unit 13 is configured to perform frame charging on the message packet.
In this embodiment, the service processing unit filters the short message sent by the client according to a preset black and white list and the sensitive word to obtain an effective short message and form the message packet, so that the charging processing unit can be prevented from charging an invalid short message, and the accuracy of short message charging is improved.
In an optional embodiment, the short message sending apparatus further includes a node downtime detection module:
the node downtime detection module is used for detecting whether the current node is down according to registration information sent to the distributed cache system by the current node according to a set time interval;
the node downtime detection module is further configured to detect whether a message packet corresponding to the current node exists in the distributed cache system when the current node is down;
when the distributed cache system has the message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, the other nodes of the receiving module are used for pulling the message packet corresponding to the current node from the distributed cache system and deducting the fee.
In this embodiment, all nodes of the receiving module send registration information to the distributed cache system according to the set time interval; detecting whether the registration information sent by the current node exists in the distributed cache system or not at a set heartbeat detection time interval; if yes, determining that the current node is online; and if not, determining that the current node is down.
And carrying out heartbeat detection on the current node periodically, and when the current node is down, taking over the unprocessed message packet of the current node from the distributed cache system by other nodes and carrying out subsequent withholding DB persistence processing by other nodes so as to realize data recovery when the node is down.
In an optional embodiment, when the distributed cache system has a message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, the other nodes of the receiving module are configured to determine, by contending for the distributed lock, a takeover node that takes over the message packet corresponding to the current node;
and the takeover node is used for pulling the message packet corresponding to the current node from the distributed cache system and deducting the fund account corresponding to the message packet.
In this embodiment, the other nodes determine to take over the unprocessed message packet of the current node cached in the distributed cache system by contending for the distributed lock generated based on the distributed cache system and the LUA script, so that the plurality of other nodes can be prevented from simultaneously taking over the unprocessed message packet of the current node cached in the distributed cache system, repeated recovery of data is effectively prevented, and correctness of data recovery is ensured. Wherein the first threshold is a processing duration of the current node for processing the message packet.
In an alternative embodiment, the distributed caching system comprises a primary caching server and a plurality of secondary caching servers connected in a chained structure;
when the main cache server is down, the takeover node is used for pulling the message packet corresponding to the current node from the slave cache server under the main cache server.
In this embodiment, the distributed cache system is subjected to disaster recovery deployment, and a main cache server and two secondary cache servers are adopted, where the main cache server and the two secondary cache servers are linked in a chain structure, that is, the secondary cache server C belongs to the secondary cache server B, and the secondary cache server B belongs to the main cache server a, and at this time, when the main cache server a is down, other nodes pull the message packet of the current node from the secondary cache server B, so as to implement data recovery; when the cache server B is down, other nodes pull the message packet of the current node from the cache server C to realize data recovery; disaster tolerance deployment is carried out on the distributed cache system, so that disaster tolerance of the distributed cache system in the same machine room and across machine rooms can be realized; the slave chain structure is adopted, so that the pressure of data replication on the nodes can be reduced; in addition, by combining the high availability scheme of the distributed cache system, the failover of the fault distributed cache node instance can be realized.
In an optional embodiment, the short message sending device further includes a traffic detection unit and a traffic adjustment unit;
the flow detection unit is used for judging whether the accumulation amount of the current cache queue of the current node is larger than a second threshold value;
and the flow regulating unit is used for regulating the response time of the current node according to the current cache queue accumulation amount of the current node, the second threshold and a preset delay factor when the cache queue accumulation amount of the current node is greater than the second threshold.
In this embodiment, the second threshold is a accumulation waterline set by the current node. For example: assuming that the accumulation waterline set by the current node is 10000, and the delay factor is 10; the current cache queue accumulation amount of the current node reaches 20000, at the moment, the current cache queue accumulation amount of the current node is higher than the accumulation water line, the information amount of the message packet received by the current node is indicated to be too large, and the response time is dynamically adjusted according to the current cache queue accumulation amount of the current node, the second threshold and the preset delay factor, so that the limitation on submitted flow is achieved, the automatic speed limitation when the node flow is too large is realized, and the current node load is avoided to be too large.
In an optional embodiment, the traffic detection unit is configured to, when the accumulation amount of the cache queue of the current node is greater than the second threshold, calculate a delayed commit response time of the current node according to a formula t ═ a-b × (n), and adjust the current commit response time of the current node to the delayed commit response time;
wherein t is the delayed submission response time, a is the accumulation amount of the current buffer queue, b is the second threshold, and n is the preset delay factor.
In an optional embodiment, when the distributed cache system fails, the receiving module is configured to send the message packet to a message queue of the current node, and the current node is configured to send response information to the client when sending the message packet in the message queue and the charging information corresponding to the message packet to the local database and the memory DB of the central service module.
In this embodiment, when the distributed cache system fails to work due to various other emergency situations, for example: the machine room where the distributed cache system is located is damaged due to some irresistible natural disasters, typhoons, floods, earthquakes and the like; a network main optical cable used in a machine room is damaged; the distributed cache component causes the unavailability of service due to self defects; the receiving module carries out automatic dimension reduction processing, namely, the asynchronous dimension reduction of the short message is changed into synchronous fee deduction processing of the short message, namely, the message packet received by the receiving module is not subjected to distributed caching, and response processing is carried out after the fee deduction processing is carried out on the message packet, so that the usability of normal service of a short message platform is ensured.
The embodiment of the invention also provides a short message issuing device, which comprises a processor, a memory and a computer program which is stored in the memory and configured to be executed by the processor, wherein the processor realizes the short message issuing method when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used for describing the execution process of the computer program in the short message sending device. For example, the computer program may be divided into functional modules in the short message sending device shown in fig. 2.
The short message issuing device can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The short message issuing device can include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the schematic diagram is merely an example of the short message issuing apparatus, and does not constitute a limitation on the short message issuing apparatus, and may include more or less components than those shown in the drawings, or combine some components, or different components, for example, the short message issuing apparatus may further include an input/output device, a network access device, a bus, and the like.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general processor can be a microprocessor or the processor can be any conventional processor, and the processor is a control center of the short message issuing device and is connected with each part of the whole short message issuing device by various interfaces and circuits.
The memory can be used for storing the computer program and/or the module, and the processor realizes various functions of the short message issuing device by running or executing the computer program and/or the module stored in the memory and calling the data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
If the module/unit integrated with the short message issuing device is realized in the form of a software functional unit and is sold or used as an independent product, the module/unit can be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The embodiment of the invention also provides a computer readable storage medium, which comprises a stored computer program, wherein when the computer program runs, the device where the computer readable storage medium is located is controlled to execute the short message issuing method.
Compared with the prior art, the short message issuing method provided by the embodiment of the invention has the beneficial effects that: the method comprises the steps that a receiving module charges a message packet sent by a client; when the distributed cache system is effective, the receiving module respectively sends the message packet to a message queue of a current node of the receiving module and the distributed cache system for caching, and sends response information to the client; the current node deducts the fee from the fund account corresponding to the message packet in the message queue and generates fee deduction information; the current node respectively sends the message packets in the message queue and the fee deduction information corresponding to the message packets to a local database and a memory DB of a central service module for storage; the distributed cache system removes the message packet corresponding to the current node. The method is based on distributed cache, realizes asynchronous response of short message sending, greatly improves response time and realizes high availability of short message sending processing. The embodiment of the invention also provides a short message issuing device and a computer readable storage medium.
The foregoing is a preferred embodiment of the present invention, and it should be noted that it would be apparent to those skilled in the art that various modifications and enhancements can be made without departing from the principles of the invention, and such modifications and enhancements are also considered to be within the scope of the invention.

Claims (10)

1. A short message issuing method is characterized by comprising the following steps:
the receiving module charges the message packet sent by the client;
when the distributed cache system is effective, the receiving module respectively sends the message packet to a message queue of a current node of the receiving module and the distributed cache system for caching, and sends response information to the client;
the current node deducts the fee from the fund account corresponding to the message packet in the message queue and generates fee deduction information;
the current node respectively sends the message packets in the message queue and the fee deduction information corresponding to the message packets to a local database and a memory of a central service module for storage;
the distributed cache system removes the message packet corresponding to the current node.
2. The short message sending method of claim 1, wherein the receiving module charges a message packet sent by a client, and specifically comprises:
according to a preset black and white list and sensitive words, a service processing unit of the receiving module filters the short messages sent by the client, obtains the message packet and sends the message packet to a charging processing unit of the receiving module;
and the charging processing unit carries out frame charging on the message packet.
3. The short message delivery method as claimed in claim 1, wherein the short message delivery method further comprises:
detecting whether the current node is down according to registration information sent by the current node to the distributed cache system according to a set time interval;
when the current node is down, detecting whether a message packet corresponding to the current node exists in the distributed cache system;
when the distributed cache system has the message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, other nodes of the receiving module pull the message packet corresponding to the current node from the distributed cache system and deduct the fee.
4. The short message delivery method according to claim 3, wherein when the distributed cache system has a message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, the other nodes of the receiving module pull the message packet corresponding to the current node from the distributed cache system and deduct the fee, specifically comprising:
when the distributed cache system has a message packet corresponding to the current node and the cache time of the message packet corresponding to the current node is greater than a first threshold, other nodes of the receiving module determine a takeover node for taking over the message packet corresponding to the current node through a contention distributed lock;
and the takeover node pulls the message packet corresponding to the current node from the distributed cache system and deducts the fund account corresponding to the message packet.
5. The short message delivery method as claimed in claim 4, wherein the short message delivery method comprises:
the distributed cache system comprises a main cache server and a plurality of secondary cache servers which are connected in a chain structure;
when the main cache server is down, the takeover node pulls the message packet corresponding to the current node from the slave cache server under the main cache server.
6. The short message delivery method as claimed in claim 1, wherein the short message delivery method further comprises:
judging whether the accumulation amount of the current cache queue of the current node is larger than a second threshold value;
and when the accumulation amount of the cache queue of the current node is larger than the second threshold, adjusting the response time of the current node according to the accumulation amount of the current cache queue of the current node, the second threshold and a preset delay factor.
7. The short message delivery method according to claim 6, wherein when the accumulation amount of the buffer queue of the current node is greater than the second threshold, the adjusting the response time of the current node according to the accumulation amount of the current buffer queue of the current node, the second threshold and a preset delay factor specifically comprises:
when the accumulation amount of the cache queue of the current node is larger than the second threshold, calculating the delayed submission response time of the current node according to a formula t ═ a-b × n, and adjusting the current submission response time of the current node to be the delayed submission response time;
wherein t is the delayed submission response time, a is the accumulation amount of the current buffer queue, b is the second threshold, and n is the preset delay factor.
8. The short message delivery method as claimed in claim 1, wherein the short message delivery method further comprises:
when the distributed cache system fails, the receiving module sends the message packet to a message queue of the current node, and the current node sends response information to the client when sending the message packet in the message queue and deduction information corresponding to the message packet to the local database and the memory of the central service module.
9. A short message delivery apparatus, comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the short message delivery method according to any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, comprising a stored computer program, wherein when the computer program runs, the computer-readable storage medium controls a device to execute the short message delivery method according to any one of claims 1 to 8.
CN201810360436.XA 2018-04-20 2018-04-20 Short message issuing method and device and computer readable storage medium Active CN108810832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810360436.XA CN108810832B (en) 2018-04-20 2018-04-20 Short message issuing method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810360436.XA CN108810832B (en) 2018-04-20 2018-04-20 Short message issuing method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108810832A CN108810832A (en) 2018-11-13
CN108810832B true CN108810832B (en) 2020-08-18

Family

ID=64093730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810360436.XA Active CN108810832B (en) 2018-04-20 2018-04-20 Short message issuing method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108810832B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669791A (en) * 2018-12-22 2019-04-23 网宿科技股份有限公司 Exchange method, server and computer readable storage medium
CN110753316B (en) * 2019-09-26 2022-04-26 贝壳技术有限公司 Information sending method and device, computer readable storage medium and electronic equipment
CN113794998B (en) * 2021-08-20 2022-07-15 上海德吾信息科技有限公司 Information sending method and device based on distributed lock and storage medium
CN117295118A (en) * 2023-10-08 2023-12-26 广州市玄武无线科技股份有限公司 Method for buffering short message data and controlling flow with strong stability

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724314A (en) * 2012-06-20 2012-10-10 深圳市远行科技有限公司 Memcached client side based on metadata management
WO2013075513A1 (en) * 2011-11-21 2013-05-30 中兴通讯股份有限公司 Short message buffering method and system
CN104216659A (en) * 2013-05-30 2014-12-17 中兴通讯股份有限公司 Off-line message storage method and servers
CN106412861A (en) * 2016-09-28 2017-02-15 海南港澳资讯产业股份有限公司 Short message distribution method and system
CN107707662A (en) * 2017-10-16 2018-02-16 大唐网络有限公司 A kind of distributed caching method based on node, device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013075513A1 (en) * 2011-11-21 2013-05-30 中兴通讯股份有限公司 Short message buffering method and system
CN102724314A (en) * 2012-06-20 2012-10-10 深圳市远行科技有限公司 Memcached client side based on metadata management
CN104216659A (en) * 2013-05-30 2014-12-17 中兴通讯股份有限公司 Off-line message storage method and servers
CN106412861A (en) * 2016-09-28 2017-02-15 海南港澳资讯产业股份有限公司 Short message distribution method and system
CN107707662A (en) * 2017-10-16 2018-02-16 大唐网络有限公司 A kind of distributed caching method based on node, device and storage medium

Also Published As

Publication number Publication date
CN108810832A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
CN108810832B (en) Short message issuing method and device and computer readable storage medium
WO2021077746A1 (en) Data recovery method, apparatus and device, and readable storage medium
WO2019232926A1 (en) Method and apparatus for data consistency checking and flow control, electronic device and storage medium
US20210176174A1 (en) Load balancing device and method for an edge computing network
US20180260256A1 (en) Fine-grain synchronization in data-parallel jobs for distributed machine learning
CN113765980A (en) Current limiting method, device, system, server and storage medium
WO2022142478A1 (en) Model calculation method and system
CN113656176B (en) Cloud equipment distribution method, device and system, electronic equipment, medium and product
CN115277577B (en) Data processing method, apparatus, computer device, and computer readable storage medium
TW202027003A (en) Method and system for accepting blockchain evidence storage transaction
CN111475108A (en) Distributed storage method, computer equipment and computer readable storage medium
CN115442373A (en) Data processing method, device, equipment and storage medium
CN110557432B (en) Cache pool balance optimization method, system, terminal and storage medium
CN111866101A (en) Access request processing method and device, storage medium and electronic equipment
WO2017114180A1 (en) Component logical threads quantity adjustment method and device
US20180262402A1 (en) Communication efficient sparse-reduce in distributed machine learning
CN112615795A (en) Flow control method and device, electronic equipment, storage medium and product
CN108509148B (en) I/O request processing method and device
CN108322542B (en) Data updating method, system, device and computer readable storage medium
CN115766720A (en) Data processing method and device, electronic equipment and storage medium
US20220206554A1 (en) Processor and power supply ripple reduction method
CN114205160A (en) Data processing method and device based on block chain and electronic equipment
CN110704382B (en) File deployment method, device, server and storage medium
US11481347B2 (en) Data transmission system and resource allocation method thereof
CN113162781B (en) Service recovery method, device, system and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 510000 room 23bd, No. 109, system West Road, Tianhe District, Guangzhou City, Guangdong Province

Patentee after: GUANGZHOU XUANWU WIRELESS TECHNOLOGY Co.,Ltd.

Address before: 32B, no.103b, TianLiHe Road, Guangzhou, 510000

Patentee before: GUANGZHOU XUANWU WIRELESS TECHNOLOGY Co.,Ltd.