SMS control method and device
By obtaining the actual sending delay of a single text message and using the PID algorithm to adjust the sending speed of batch text messages, the problem of low single text message sending efficiency caused by batch text message processing in traditional platforms is solved, and more efficient text message sending is achieved.
Patent Information
- Application Number
- CN202211131199.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-16
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-09-16
AI Technical Summary
In traditional messaging service platforms, batch text message processing will squeeze the sending performance of a single text message, resulting in low sending efficiency and high delay of a single text message, which cannot meet the timeliness requirements of users.
By obtaining the actual sending delay of a single text message, the sending speed of batch text messages is adjusted so that it is inversely related to the actual sending delay. The specific method includes determining the control volume and using the proportional integral derivative (PID) algorithm to adjust the speed of batch text messages being stored in the message queue.
It improves the efficiency of sending a single text message and reduces the performance requirements of batch text messages on the messaging service platform, thereby improving the efficiency and timeliness of sending a single text message.
Smart Images

Figure CN115314846B
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a text message control method and device. Background Art
[0002] With the development of the Internet and the penetration of Internet applications into people's daily lives, more and more scenarios require the use of mobile phone text messages, for example, receiving verification codes via mobile phone text messages. In this context, users have higher requirements for the timeliness of text message interactions. In one example, "text messages" can also be called "short messages."
[0003] In traditional messaging service platforms, when batches of SMS files need to be processed, the sending performance of a single SMS will be squeezed, resulting in lower sending efficiency of a single SMS, or higher sending delay of a single SMS, resulting in users being unable to receive SMS in a timely manner.
[0004] Therefore, a solution is urgently needed to solve the above-mentioned technical problems. Summary of the invention
[0005] How to improve the sending efficiency of a single text message, and provide a text message control method and device.
[0006] In a first aspect, an embodiment of the present application provides a method for controlling text messages, the method comprising:
[0007] Get the actual sending delay of a single SMS;
[0008] The sending speed of the batch of SMS messages is adjusted according to the actual sending delay of the single SMS message, wherein the sending speed is inversely correlated with the actual sending delay.
[0009] Optionally, adjusting the sending speed of batch SMS messages according to the actual sending delay of the single SMS message includes:
[0010] Determining a control amount according to an actual sending delay of the single SMS, wherein the control amount is used to determine a sending speed of the batch SMS;
[0011] The sending speed of the batch SMS is adjusted according to the control amount.
[0012] Optionally, determining the control amount according to the actual sending delay of the single short message includes:
[0013] The control amount is determined according to a difference between an actual sending delay of the single short message and a standard sending delay of the single short message.
[0014] Optionally, determining the control amount according to a difference between an actual sending delay of the single text message and a standard sending delay of the single text message includes:
[0015] The control amount is determined according to the difference and the proportional-integral-differential (PID) algorithm.
[0016] Optionally, adjusting the sending speed of batch SMS according to the control amount includes:
[0017] The speed of storing the batch of short messages in the message queue is adjusted according to the control amount, wherein the speed of storing the batch of short messages in the message queue is inversely correlated with the actual sending delay.
[0018] In a second aspect, an embodiment of the present application provides a short message control device, the device comprising:
[0019] An acquisition unit, used to acquire the actual sending delay of a single SMS;
[0020] An adjusting unit is used to adjust the sending speed of batch SMS according to the actual sending delay of the single SMS, wherein the sending speed is inversely correlated with the actual sending delay.
[0021] Optionally, the adjustment unit is used to:
[0022] Determining a control amount according to an actual sending delay of the single SMS, wherein the control amount is used to determine a sending speed of the batch SMS;
[0023] The sending speed of the batch SMS is adjusted according to the control amount.
[0024] Optionally, determining the control amount according to the actual sending delay of the single short message includes:
[0025] The control amount is determined according to a difference between an actual sending delay of the single short message and a standard sending delay of the single short message.
[0026] Optionally, determining the control amount according to a difference between an actual sending delay of the single text message and a standard sending delay of the single text message includes:
[0027] The control amount is determined according to the difference and the proportional-integral-differential (PID) algorithm.
[0028] Optionally, adjusting the sending speed of batch SMS according to the control amount includes:
[0029] The speed of storing the batch of short messages in the message queue is adjusted according to the control amount, wherein the speed of storing the batch of short messages in the message queue is inversely correlated with the actual sending delay.
[0030] Compared with the prior art, the embodiments of the present application have the following advantages:
[0031] An embodiment of the present application provides a text message control method. In one example, the method can be applied to a message service platform. The method includes: obtaining the actual sending delay of a single text message, and adjusting the sending speed of batch text messages according to the actual sending delay of the single text message, wherein the sending speed of the batch text messages is inversely correlated with the actual sending delay. In other words, the smaller the actual sending delay of a single text message, the higher the sending speed of the batch text messages, and the larger the actual sending delay of a single text message, the lower the sending speed of the batch text messages. In one example, when the actual sending delay of a single text message is large, the sending speed of the batch text messages can be adjusted to be lower, thereby reducing the performance requirement for sending batch text messages, and accordingly, the message service platform can have more performance to send a single text message, thereby improving the sending efficiency of a single text message. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A flowchart of a text message control method provided in an embodiment of the present application;
[0034] Figure 2 A principle block diagram of a simulated PID control system provided in an embodiment of the present application;
[0035] Figure 3 A schematic diagram of the structure of a text message control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] Various non-limiting implementations of the present application are described in detail below in conjunction with the accompanying drawings.
[0038] Exemplary Methods
[0039] See also Figure 1, which is a flow chart of a method for controlling short messages provided in an embodiment of the present application. In this embodiment, the method can be applied to a message service platform.
[0040] In an example, the method may include the following steps: S101 - S102 .
[0041] S101: Obtaining the actual sending delay of a single SMS.
[0042] In one example, the actual sending delay of a single SMS message may be collected periodically. In one example, for any collection time, the actual sending delay of a single SMS message that has not been successfully sent at the current time may be collected. As an example, the average sending delay of multiple single SMS messages that have not been successfully sent at the current time may be determined as the actual sending delay of a single SMS message corresponding to the current collection time.
[0043] S102: adjusting a sending speed of batch SMS messages according to an actual sending delay of the single SMS message, wherein the sending speed is inversely correlated with the actual sending delay.
[0044] After determining the actual sending delay of the single SMS, in order to ensure the sending efficiency of the single SMS, the sending speed of the batch SMS can be adjusted according to the actual sending delay of the single SMS. When adjusting the sending speed of the batch SMS, the sending speed of the batch SMS is inversely correlated with the actual sending delay of the single SMS. In other words, the smaller the actual sending delay of the single SMS, the higher the sending speed of the batch SMS, and the larger the actual sending delay of the single SMS, the lower the sending speed of the batch SMS.
[0045] It is not difficult to understand that when the sending speed of batch SMS is low, the performance requirement for sending batch SMS is also low. When the sending speed of batch SMS is high, the performance requirement for sending batch SMS is also high. However, the performance of the message service platform is limited. The higher the performance occupied by sending batch SMS, the lower the performance available for sending a single SMS. Correspondingly, the lower the performance occupied by sending batch SMS, the higher the performance available for sending a single SMS.
[0046] In one implementation of the embodiment of the present application, when the actual sending delay of a single SMS is large, the sending speed of the batch SMS can be adjusted to a lower level, thereby reducing the performance requirement for sending batch SMS. Correspondingly, the message service platform can have more performance to send a single SMS, thereby improving the sending efficiency of a single SMS.
[0047] In one example, when S102 is implemented specifically, for example, a functional relationship between an actual sending delay and a sending speed of batch text messages can be established, wherein the actual sending delay is an independent variable, and the sending speed of the batch text messages is a dependent variable. Then, the sending speed of the batch text messages is determined based on the actual sending delay of the single text message and the functional relationship.
[0048] In yet another example, when S102 is specifically implemented, for example, it may include the following steps A1-A2.
[0049] Step A1: determining a control amount according to the actual sending delay of the single SMS, wherein the control amount is used to determine the sending speed of the batch SMS.
[0050] Regarding the control amount, it should be noted that the control amount can be an absolute value of the sending speed or an adjusted value of the sending speed, and the embodiment of the present application does not make any specific limitation.
[0051] In an example, the control amount may be determined according to the actual sending delay and the corresponding relationship between the actual sending delay and the control amount.
[0052] In yet another example, the control amount may be determined according to a difference between an actual sending delay of the single text message and a standard sending delay of the single text message.
[0053] In one example, the standard sending delay of a single SMS message may be, for example, a preset threshold value, which is not specifically limited in the embodiment of the present application, and may be, for example, 1.5s. In another example, the standard sending delay of a single SMS message may be a preset threshold interval, which is not specifically limited in the embodiment of the present application, and may be, for example, 1s to 2s.
[0054] In one example, in a specific implementation, the control amount is determined according to the difference. For example, the control amount can be determined according to the difference and the corresponding relationship between the difference and the control amount.
[0055] In yet another example, in a specific implementation, the control amount is determined according to the difference value and a proportional integral differential (PID) algorithm to determine the control amount.
[0056] Regarding the PID algorithm, please refer to the relevant description part below, which will not be described in detail here.
[0057] Step A2: adjusting the sending speed of batch SMS according to the control amount.
[0058] After determining the control amount, the sending speed of the batch text messages may be adjusted according to the control amount. In one example, if the control amount is an absolute value of the sending speed, the sending speed of the batch text messages may be adjusted to the absolute value. In another example, if the control amount is an adjustment value of the sending speed, the sending speed of the batch text messages may be determined according to the current value of the sending speed and the adjustment value. For example, the adjusted sending speed of the batch text messages may be obtained by subtracting the adjustment value from the current value.
[0059] In one example, considering that for batch SMS, batch SMS are often stored in a message queue, and SMS are read from the message queue for sending. The SMS service platform has a high processing efficiency for the queue, so the speed of storing the batch SMS in the message queue can be considered as the sending speed of the batch SMS. For this case, when step A2 is specifically implemented, for example, the speed of storing the batch SMS in the message queue can be adjusted according to the control amount. It is not difficult to understand that the speed of storing the batch SMS in the message queue is inversely correlated with the actual sending delay.
[0060] For this case, in one example, the control amount may be an absolute speed of storing the batch of text messages in the message queue by adjusting the control amount. Accordingly, in a specific implementation of "adjusting the speed of storing the batch of text messages in the message queue according to the control amount", the speed of storing the batch of text messages in the message queue may be adjusted to the absolute speed. In another example, the control amount may be a speed change amount of adjusting the batch of text messages in the message queue by adjusting the control amount. Accordingly, in a specific implementation of "adjusting the speed of storing the batch of text messages in the message queue according to the control amount", the speed of storing the batch of text messages in the message queue may be determined based on the current speed of storing the batch of text messages in the message queue and the speed change amount, and the speed of storing the batch of text messages in the message queue may be further adjusted to the determined speed. For example, the speed change amount is subtracted from the current speed to obtain the adjusted speed of storing the batch of text messages in the message queue.
[0061] The embodiment of the present application does not specifically limit the specific implementation method of adjusting the speed of storing the batch of short messages in the message queue. In one example, the speed of storing the batch of short messages in the message queue can be adjusted by adjusting the sleep time in the cycle. In this case, the control amount can be, for example, the absolute value or adjustment value of the sleep time in the cycle.
[0062] Next, we will briefly introduce the PID algorithm mentioned above.
[0063] The PID algorithm is a control algorithm that combines proportional, integral and differential control into one.
[0064] The principle block diagram of the conventional analog PID control system is as follows Figure 2 As shown. Figure 2 middle:
[0065] r(t) is the given value, y(t) is the actual output value of the system, and the given value and the actual output value constitute the control deviation e(t) = r(t) - y(t). e(t) is the input of PID control, and u(t) is the output of the PID controller and the input of the controlled object. Therefore, the control law of the simulated PID controller is shown in formula (1):
[0066]
[0067] Among them, K p is the proportional coefficient of the controller; T i is the integration time, also called the integration coefficient; T d is the differential time, also called the differential coefficient.
[0068] P-proportional part:
[0069] The role of the proportional link is to respond to the deviation instantly. Once the deviation occurs, the controller immediately produces a control action to change the control amount in the direction of reducing the deviation. The strength of the control action depends on the proportional coefficient. The larger the proportional coefficient, the stronger the control action, the faster the transition process, and the smaller the static deviation of the control process; but if it is too large, it is easy to produce oscillation and destroy the stability of the system. Therefore, the proportional coefficient must be selected appropriately to reduce the transition time and achieve the effect of small static deviation and stable control.
[0070] I-Integral part:
[0071] The regulation of the integral link will eliminate the static deviation, but it will also reduce the response speed of the system and increase the overshoot of the system. The larger the integral coefficient, the weaker the cumulative effect of the integral, which prevents the system from excessive oscillation during transition; increasing the integral coefficient will slow down the elimination process of the static deviation, but it can reduce the overshoot and improve the stability of the system.
[0072] D-Differential part:
[0073] In addition to eliminating static deviations, actual control systems also require speeding up the adjustment process. At the moment when the deviation occurs or changes, not only should the deviation be responded to immediately, but appropriate adjustments should also be made in advance according to the deviation change trend. Therefore, the role of the differential link is to prevent the change of the deviation, and it controls according to the deviation change trend (speed of change). The faster the deviation changes, the greater the output of the differential controller, and it can be corrected before the deviation value becomes larger. It helps to reduce overshoot, overcome oscillation, and make the system stable.
[0074] The original calculation formula of the PID algorithm is shown in the following formula (2):
[0075]
[0076] In formula (2):
[0077] K p is the proportional gain;
[0078] K i is the integral gain;
[0079] K d is the differential gain;
[0080] u(t) is the output quantity (i.e., the control quantity, for example, it can be the sleep time in the batch SMS file reading loop);
[0081] e(t) is the input quantity (i.e. the aforementioned difference).
[0082] By discretizing the above formula, we can get formula (3), which is the discrete formula of the incremental PID algorithm used in practice:
[0083] Δu(k)=K p (e(k)-e(k-1))+K i e(k)+K d (e(k)-2e(k-1)+e(k-2)) Formula (3)
[0084] In formula (3):
[0085] Δu(k) is the change of control quantity;
[0086] e(k) is the aforementioned difference at the current sampling moment;
[0087] e(k-1) is the aforementioned difference at the previous sampling moment;
[0088] e(k-2) is the aforementioned difference between the two sampling moments before the current sampling moment.
[0089] Exemplary Devices
[0090] Based on the method provided in the above embodiment, the embodiment of the present application further provides a device, which is described below in conjunction with the accompanying drawings.
[0091] See also Figure 3 , which is a schematic diagram of the structure of a short message control device provided in an embodiment of the present application. The device 300 may specifically include: an acquisition unit 301 and an adjustment unit 302.
[0092] An acquisition unit 301 is used to acquire an actual sending delay of a single SMS message;
[0093] The adjusting unit 302 is configured to adjust the sending speed of the batch of SMS messages according to the actual sending delay of the single SMS message, wherein the sending speed is inversely correlated with the actual sending delay.
[0094] Optionally, the adjusting unit 302 is configured to:
[0095] Determining a control amount according to an actual sending delay of the single SMS, wherein the control amount is used to determine a sending speed of the batch SMS;
[0096] The sending speed of the batch SMS is adjusted according to the control amount.
[0097] Optionally, determining the control amount according to the actual sending delay of the single short message includes:
[0098] The control amount is determined according to a difference between an actual sending delay of the single short message and a standard sending delay of the single short message.
[0099] Optionally, determining the control amount according to a difference between an actual sending delay of the single text message and a standard sending delay of the single text message includes:
[0100] The control amount is determined according to the difference and the proportional-integral-differential (PID) algorithm.
[0101] Optionally, adjusting the sending speed of batch SMS according to the control amount includes:
[0102] The speed of storing the batch of short messages in the message queue is adjusted according to the control amount, wherein the speed of storing the batch of short messages in the message queue is inversely correlated with the actual sending delay.
[0103] Since the device 300 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 300 is based on the same concept as the above method embodiment. Therefore, for the specific implementation of each unit of the device 300, reference can be made to the description part of the above method embodiment, which will not be repeated here.
[0104] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0105] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0106] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for controlling short messages, characterized in that: The method comprises: Obtaining an actual sending delay of a single SMS, where the actual sending delay of the single SMS is the actual sending delay of a single SMS that has not been successfully sent at the current moment, or the average sending delay of multiple SMS that have not been successfully sent at the current moment; adjusting the sending speed of the batch of SMS messages according to the actual sending delay of the single SMS message, wherein the sending speed is inversely correlated with the actual sending delay; The adjusting the sending speed of batch SMS according to the actual sending delay of the single SMS includes: determining a control amount according to the actual sending delay of the single SMS, the control amount being used to determine the sending speed of the batch SMS; and adjusting the sending speed of the batch SMS according to the control amount.
2. The method according to claim 1, characterized in that: The determining the control amount according to the actual sending delay of the single short message includes: The control amount is determined according to a difference between an actual sending delay of the single short message and a standard sending delay of the single short message.
3. The method according to claim 2, characterized in that The determining the control amount according to the difference between the actual sending delay of the single short message and the standard sending delay of the single short message includes: The control amount is determined according to the difference and the proportional-integral-differential (PID) algorithm.
4. The method according to claim 1, characterized in that: The adjusting the sending speed of batch SMS according to the control amount includes: The speed of storing the batch of short messages in the message queue is adjusted according to the control amount, wherein the speed of storing the batch of short messages in the message queue is inversely correlated with the actual sending delay.
5. A short message control device, characterized in that: The device comprises: An acquisition unit, used to acquire an actual sending delay of a single SMS, where the actual sending delay of the single SMS is the actual sending delay of a single SMS that has not been successfully sent at the current moment, or the average sending delay of multiple SMS that have not been successfully sent at the current moment; An adjustment unit is used to adjust the sending speed of batch text messages according to the actual sending delay of the single text message, wherein the sending speed is inversely correlated with the actual sending delay. The adjusting the sending speed of batch text messages according to the actual sending delay of the single text message comprises: determining a control amount according to the actual sending delay of the single text message, the control amount being used to determine the sending speed of the batch text messages; and adjusting the sending speed of the batch text messages according to the control amount.
6. The device according to claim 5, characterized in that The determining the control amount according to the actual sending delay of the single short message includes: The control amount is determined according to a difference between an actual sending delay of the single short message and a standard sending delay of the single short message.
7. The device according to claim 6, characterized in that The determining the control amount according to the difference between the actual sending delay of the single short message and the standard sending delay of the single short message includes: The control amount is determined according to the difference and the proportional-integral-differential (PID) algorithm.
8. The device according to claim 5, characterized in that The adjusting the sending speed of batch SMS according to the control amount includes: The speed of storing the batch of short messages in the message queue is adjusted according to the control amount, wherein the speed of storing the batch of short messages in the message queue is inversely correlated with the actual sending delay.
