Processing method for million-level batch issuing of short messages with same content based on Web page
By designing a million-level batch distribution processing method for the same content SMS based on Web pages on the SMS batch sending platform, multiple problems in the existing platform when issuing a million-level number set are solved, zero-code visual operation, intelligent shard upload and adaptive fault tolerance are realized, and the usability and stability of the platform are improved.
Patent Information
- Application Number
- CN202510183222.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-06
AI Technical Summary
When existing SMS batch sending platforms face the problems of human-computer interaction defects at the interface layer, massive data processing bottlenecks, insufficient compatibility of number file import formats, limitations on number file transfer performance, and lack of service assurance mechanisms.
By designing a million-level batch distribution processing method for the same content SMS based on Web pages, zero-code visualization operations are realized, multi-modal file analysis is supported, intelligent shard upload and adaptive retry strategies are adopted to build a dynamic fault tolerance system.
It has enabled non-technical personnel to directly complete the orchestration and issuance of million-level SMS tasks through web pages, breaking through the scale performance bottleneck of traditional platforms, enhancing system compatibility, optimizing transmission processing efficiency, and building a dynamic fault tolerance system to ensure system stability and delivery rate.
Smart Images

Figure CN120111448A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to communication technology, and more specifically, to a method for processing batch distribution of millions of short messages with the same content based on Web pages. Background Art
[0002] In the field of modern commercial communications, SMS batch sending has become an important technical means for corporate customers to reach their users, especially in large-scale information delivery scenarios such as marketing promotion and notifications. Although the current mainstream SMS platforms have basic batch sending capabilities, the existing solutions still have some limitations for sending to ultra-large-scale number sets of millions, mainly manifested in:
[0003] 1. The interface layer has defects in human-computer interaction, lacks a zero-code visual operation interface, and the existing API calls have technical entry barriers, so non-technical personnel cannot complete the operation independently;
[0004] 2. Bottleneck for processing massive data. Users can send SMS through the page with a limit of one number. The limit does not support sending to millions of numbers at a time. If the limit exceeds the limit, the numbers must be split and submitted multiple times.
[0005] 3. The number file import format is not compatible enough, only supporting limited file formats (such as TXT), and not compatible with common file formats (CSV / XLSX / XLS);
[0006] 4. Performance limitation of number file transmission. When importing number files from a page, multi-threaded segmented upload of files is not implemented, resulting in a linear decrease in transmission efficiency with the file size.
[0007] 5. Lack of service guarantee mechanism, such as large-scale number delivery when submitting pages, lack of adaptive traffic control strategy (QoS), no dynamic rate limiting capability, and failure to build a resilient fault-tolerant architecture, including reliability guarantee mechanisms such as intelligent retry and exception isolation. Summary of the invention
[0008] The technical problem to be solved by the present invention is to provide a method for batch sending of millions of SMS with the same content based on a Web page in view of the shortcomings of the prior art. The sending numbers are imported through the Web page to realize zero-coding visualization processing and reliable SMS sending of a set of millions of numbers.
[0009] The present invention discloses a method for processing batch sending of millions of SMS messages with the same content based on a Web page. The method includes uploading a file of millions of numbers through a Web page, performing a duplicate check analysis on the file of millions of numbers, and parsing the file of millions of numbers if the duplicate check analysis passes. After the file of millions of numbers is parsed, SMS messages with the same content are sent to the corresponding numbers in the file of millions of numbers according to the set sending rules.
[0010] Preferably, the duplicate checking analysis is specifically:
[0011] If the upload progress of the million-level number file read from the server cache is 100% when the million-level number file is uploaded, the address of the million-level number file is returned to the front end, and the million-level number file is parsed;
[0012] If the million-level number file is not found in the server cache, check whether there are identical files in the current month and the previous month in the upload folder; if identical files are found, return the address of the file found in the upload folder to the front end, and then parse the file found in the upload folder; if the identical file is not found, return the not found mark character to the front end, and then re-execute the operation of uploading the million-level number file.
[0013] Preferably, the file of millions of numbers is uploaded by uploading in pieces.
[0014] Preferably, before re-executing the operation of uploading the million-level number file, check whether the current to-be-uploaded segment of the million-level number file has been uploaded;
[0015] If the current segment to be uploaded has been uploaded, determine whether the data size of the current segment to be uploaded is equal to the segment that has been uploaded; if the sizes of the two are equal, skip the current segment to be uploaded; if the sizes of the two are not equal, upload the current segment to be uploaded;
[0016] If the current segment to be uploaded has not been uploaded, then the current segment to be uploaded is uploaded.
[0017] Preferably, the method for parsing the million-level number file is specifically:
[0018] After the million-level number file is uploaded, request the back-end file parsing interface;
[0019] According to the information of the million-level number file, query and determine whether there is a parsing file for the million-level number file; if it exists, obtain the parsing file corresponding to the million-level number file and return it; if it does not exist, the file parsing interface reads the million-level number file according to the file address, removes duplicate numbers and numbers that do not conform to the format in the million-level number file, and then formats the million-level number file.
[0020] Preferably, the formatting method is:
[0021] The number of numbers to be written into the new text file is set, and the number information in the million-level number file is written into the new text file.
[0022] Preferably, the specific steps of sending the SMS with the same content are:
[0023] Step 1: After filling in the SMS signature and content on the web page, click the send button, and the front end requests the SMS sending interface of the back end;
[0024] Step 2: When the back end receives the front end request, it extracts the address of the new text file and reads the new text file;
[0025] Step 3: assemble each line of numbers in the new text file into a sending task, and then put the sending task into the SMS sending task queue;
[0026] Step 4: Send the SMS signature and content according to the sending rules.
[0027] Preferably, the issuing rule is specifically:
[0028] When the backend is enabled, the SMS sending rate is initialized and a thread pool of a fixed size is created;
[0029] When the sending task is put into the SMS sending task queue, the sending rate of the database is queried, and if found, the SMS sending rate is updated to the sending rate of the database;
[0030] The Count value is set and initialized, and the current timestamp is obtained as the initial timestamp; when the Count value is greater than zero, the Count value is reduced by one each time the thread of the thread pool is called; when the Count value is less than or equal to zero, the current timestamp is obtained as the actual timestamp; it is determined whether the difference between the actual timestamp and the initial timestamp is less than a preset threshold value, if so, the difference is used as the sleep time to control the sleep of the thread pool thread, and after the sleep time ends, the currently effective sending rate is set to the Count value, and the thread call is continued.
[0031] Preferably, when the sending task calls the SMS sending interface, if no response is received from the SMS sending interface, it is determined that the request has failed and needs to be resent, and the private attribute of each sending task is reduced by one, and then the sending task is put into the SMS sending task queue again; if the private attribute of the sending task is less than zero, retrying is stopped and an exception file is generated.
[0032] Preferably, when a user queries the task progress, the backend extracts the ID, total amount and actual sending amount of the sending task from the database, calculates the task progress based on the total amount and actual sending amount, and displays the task progress on a Web page.
[0033] Beneficial Effects
[0034] The advantages of the present invention are:
[0035] 1. Eliminate technical operation barriers: Break through the traditional API development dependence, build a full-link visual Web interaction mechanism, and enable non-technical personnel to directly complete the task scheduling and delivery of millions of SMS messages through the page.
[0036] 2. Break through the scale performance bottleneck: Use the intelligent sharding processing engine to support the second-level parsing and highly reliable storage of a single file of millions of numbers, breaking the rigid limit of 100,000 numbers at a time on traditional platforms.
[0037] 3. Enhance system compatibility: Design a multimodal file parser that covers automatic recognition and standardized conversion of mainstream formats such as XLSX / XLS / CSV / TXT to solve the problem of single format support on existing platforms.
[0038] 4. Optimize transmission processing efficiency: Accelerate the front-end file upload by segmentation based on Webuploader technology.
[0039] 5. Build a dynamic fault-tolerant system: Innovatively introduce traffic perception modules and adaptive retry strategies, dynamically adjust the delivery rate by real-time monitoring of channel load, and ensure that system stability and delivery rate meet the standards under million-level tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flow chart of a method for processing the batch sending of millions of short messages with the same content based on a Web page of the present invention;
[0041] Figure 2 This is a schematic diagram of the process of uploading a file of million-level numbers according to the present invention;
[0042] Figure 3 A schematic diagram of the million-level number file parsing process of the present invention;
[0043] Figure 4 A schematic diagram of the process of sending one million short messages of the present invention;
[0044] Figure 5 It is a schematic diagram of the process of displaying the progress of sending one million short messages according to the present invention. DETAILED DESCRIPTION
[0045] The present invention will be further described below in conjunction with the embodiments, but it does not constitute any limitation to the present invention. Any limited number of modifications made by anyone within the scope of the claims of the present invention are still within the scope of the claims of the present invention.
[0046] See also Figure 1The present invention provides a method for batch sending of millions of SMS with the same content based on a Web page. The method mainly involves uploading a file of millions of numbers through a Web page, and performing a duplicate check analysis on the file of millions of numbers. If the duplicate check analysis passes, the file of millions of numbers is parsed. After the file of millions of numbers is parsed, SMS with the same content is sent to the corresponding numbers in the file of millions of numbers according to the set sending rules. Users can complete operations such as file upload number import, SMS content editing, and sending task triggering through a Web page without writing code or calling an API, thus realizing zero-code full-process visual operation and solving the defects of human-computer interaction. The method of the present invention is mainly implemented through the following four steps.
[0047] Step 1: Figure 2 As shown, the file with millions of numbers is uploaded.
[0048] Step 1: After the user enters the web page sent by SMS, initialize Webuploader and set Webuploader to enable multi-slice upload. In particular, if an error occurs in automatic multi-slice upload, three retries are allowed. Three concurrent threads are set for uploading multi-slices. Repeated uploads are allowed. When uploading the current multi-slice, the next multi-slice is pre-processed. The file receiving server address is set. The total file size cannot exceed 250M. File upload with CSV / TXT / XLSX / XLS suffix is supported. The multi-slice strategy is adopted here, that is, uploading with three concurrent threads and pre-processing the next multi-slice when uploading the current multi-slice, thereby reducing waiting time and improving file transfer performance.
[0049] Step 2: The user clicks to download the import template, which supports CSV / TXT / XLSX / XLS, covers common scenarios, and has strong compatibility. Among them, CSV / XLSX / XLS files have one number per line, and TXT mobile phone numbers need to be separated by commas. Then write the numbers into the template file according to the format and click the batch import button.
[0050] Step 3: Upload the file with millions of numbers. For the uploaded file, you need to check whether the file has been uploaded before. The key is mainly composed of the file's MD5 value, file name, and system flag characters. Then, you can search the system based on the key to confirm whether the file has been uploaded.
[0051] When uploading, read the upload progress of the file with millions of numbers from the server cache. If it is 100%, return the address of the file to the front end, and then parse the file. If no file consistent with the file is found in the cache, check whether there is the same file in the upload folder in the current month and the previous month. If found, return the address of the found file to the front end, and then parse the file. If not found, return to the front end that the mark character was not found, and re-execute the upload.
[0052] For the file with millions of numbers that is re-uploaded, it will check whether the segment has been uploaded before uploading. It will check whether the segment file exists based on the file name, the file's MD5 value, the system flag character, and the size of the segment. If it exists, the uploading of the segment will be skipped. If the segment exists but the size of the segment is not equal to the size of the uploaded segment, it is considered incomplete. If the segment does not exist or is incomplete, it will be re-uploaded. After the upload is completed, the segments will be read and merged. After the merge, the address of the merged new file on the server will be returned to the front end.
[0053] The integrity of the fragments is verified based on the MD5 value of the file and the fragment size, which avoids repeated transmission and improves the transmission efficiency. The unique key is generated through the MD5 value of the file + the file name + the system flag, and the historical files (this month and last month) are reused. If the file already exists (cached or historical directory), the address is directly reused, which effectively reduces redundant uploads.
[0054] Step 2: Figure 3 As shown, the file analysis of millions of numbers.
[0055] The first step is that after the upload of the file with millions of numbers is completed, the front end obtains the merged file and requests the file parsing interface of the back end on the server.
[0056] Step 2: According to the information of the million-level number file, query and determine whether there is a parsing file of the million-level number file. If it exists, the parsing file of the million-level number file is returned; if it does not exist, the file parsing interface reads the million-level number file according to the file address, removes duplicate numbers and numbers that do not conform to the format, and formats the million-level number file. In this embodiment, the million-level number file is rewritten into a new text file with 100 numbers as a line.
[0057] The uploaded files are uniformly converted into standard text files with 100 numbers per line. At the same time, format differences are shielded, and duplicate numbers and numbers in illegal formats, such as numbers that are not 11 digits, are automatically removed, thus achieving standardized processing of large files.
[0058] Step 3: Figure 4 As shown, millions of text messages were sent.
[0059] The first step is to import a file of millions of numbers on the web page and parse it, fill in the information to be sent, such as the SMS signature and SMS content, and then click the Send button. When the basic verification on the front end is completed, the SMS sending interface on the back end will be requested.
[0060] When the backend is started, it first reads the initial value of the SMS sending rate (the number of SMS sending interface requests per second) from the database, and creates a fixed-size thread pool with twice the number of CPU cores and a daemon thread.
[0061] In the second step, when the back-end sending interface receives the request from the front-end, it will get the address of the newly generated text file and read the new text file at the same time.
[0062] Step 3: Assemble every 100 numbers into a sending task, divide the millions of numbers into several tasks and put them into the list, and then put them into the SMS sending task queue one by one. When putting them into the queue, you need to query the sending rate in the database. If the query is found, the sending rate will be updated, but the Count value corresponding to the effective rate will not be changed.
[0063] Step 4: cyclically take out the sending tasks to be sent from the SMS sending task queue and execute asynchronous submission and sending. In this process, the present invention sets a speed limit process.
[0064] Specifically, when executing the sending task for the first time, the Count value needs to be set and initialized, and the current timestamp is obtained as the initial timestamp. If the Count value is greater than 0, the SMS task call interface is directly taken out to send the SMS. The active thread in the thread pool will subtract 1 from the Count value each time it is called. For example, when the Count value is equal to 5, when the Count value is reduced to less than or equal to 0, the current timestamp and the timestamp when the Count is set will be subtracted. If the difference between the two is less than 1s, the thread will sleep for the value of the subtraction of the two timestamps. After the sleep time is over, the Count value will be set to the value of the sending rate, and the new timestamp will be set as the initial timestamp, and then the call will continue. In summary, the SMS delivery with a speed limit of 500 numbers per second is achieved.
[0065] When sending SMS messages, accurate speed limit is achieved through Count value and timestamp, and the running Count is not affected when the sending rate is dynamically updated, ensuring smooth transition of speed limit.
[0066] Step 5: Handle failed resending of SMS tasks.
[0067] When a SMS task calls the SMS sending interface, if the interface response is not received due to an abnormal scenario, the request is considered to have failed and needs to be resent. Each sending task is essentially a class object. The private attribute of the class object has a retry count, which is 5 times by default. If the sending is determined to be failed, this attribute will be reduced by 1 and put into the sending queue again. If the process is repeated 5 times and still fails, the retry will stop and an exception file will be generated.
[0068] Each task object has a built-in retry count. After a failure, it is reduced by 1 and re-queued until the retries are exhausted and the failed task generates an exception file. It supports manual intervention, elastic fault tolerance, and reduces exceptions.
[0069] Step 4: Figure 5 As shown, the progress of sending millions of text messages is displayed.
[0070] When the user clicks Send on the Web page to create a task of millions of SMS messages, there is a need to query the execution progress of the task. When the millions of numbers are divided into several tasks and put into the list and then put into the SMS sending task queue one by one, an ID of the sending task and related information will be generated and written into the submitted task table of the database. Each record in the table has two attributes: total amount and actual sending amount. When it is put into the SMS sending task queue, the ID of the sending task and the total number of numbers in the table will be inserted. When the thread calls the interface to send the task, the actual number of numbers submitted will be updated. For example, if the original value is 120100, and 100 numbers are submitted this time, the actual sending amount is 120100+100=120200. After the user clicks the Send button on the SMS sending page, it will jump to the task progress query page. The page refreshes every 5 seconds to read the latest record value from the database. The task progress is displayed as (actual submission amount / total submission amount)*100%.
[0071] The above is only a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the structure of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent.
Claims
1. A method for sending millions of short messages with the same content in batches based on Web pages, characterized in that: A file of million-level numbers is uploaded through a web page, and a duplicate check analysis is performed on the file of million-level numbers. If the duplicate check analysis passes, the file of million-level numbers is parsed. After the file of million-level numbers is parsed, SMS with the same content is sent to the corresponding numbers in the file of million-level numbers according to the set sending rules.
2. According to claim 1, a method for processing batch delivery of millions of short messages with the same content based on Web pages is characterized in that: The duplicate checking analysis is specifically as follows: If the upload progress of the million-level number file read from the server cache is 100% when the million-level number file is uploaded, the address of the million-level number file is returned to the front end, and the million-level number file is parsed; If the million-level number file is not found in the server cache, then check whether there is an identical file in the current month and the previous month in the upload folder; If the same file is found, the address of the file found in the upload folder is returned to the front end, and then the file found in the upload folder is parsed; If the same file is not found, a not found mark character is returned to the front end, and then the operation of uploading the million-level number file is re-executed.
3. A method for processing batch delivery of millions of short messages with the same content based on Web pages according to claim 2, characterized in that: The file of millions of numbers is uploaded by uploading in pieces.
4. A method for processing batch delivery of millions of short messages with the same content based on Web pages according to claim 3, characterized in that: Before re-executing the operation of uploading the million-level number file, checking whether the current to-be-uploaded segment of the million-level number file has been uploaded; If the current segment to be uploaded has been uploaded, determining whether the data size of the current segment to be uploaded is equal to the segment that has been uploaded; If the two sizes are equal, skip the current segment to be uploaded; If the sizes of the two are not equal, then upload the current segment to be uploaded; If the current segment to be uploaded has not been uploaded, then the current segment to be uploaded is uploaded.
5. A method for processing batch delivery of millions of short messages with the same content based on Web pages according to claim 1 or 2, characterized in that: The specific method for parsing the million-level number file is: After the million-level number file is uploaded, request the back-end file parsing interface; Query and determine whether there is a parsing file of the million-level number file according to the information of the million-level number file; If it exists, obtain the parsed file corresponding to the million-level number file and return it; If it does not exist, the file parsing interface reads the million-level number file according to the file address, removes duplicate numbers and numbers that do not conform to the format in the million-level number file, and then formats the million-level number file.
6. A method for processing batch delivery of millions of short messages with the same content based on Web pages according to claim 5, characterized in that: The formatting method is: The number of numbers to be written into the new text file is set, and the number information in the million-level number file is written into the new text file.
7. A method for processing batch delivery of millions of short messages with the same content based on Web pages according to claim 6, characterized in that: The specific steps of sending the SMS with the same content are as follows: Step 1: After filling in the SMS signature and content on the web page, click the send button, and the front end requests the SMS sending interface of the back end; Step 2: When the back end receives the front end request, it extracts the address of the new text file and reads the new text file; Step 3: assemble each line of numbers in the new text file into a sending task, and then put the sending task into the SMS sending task queue; Step 4: Send the SMS signature and content according to the sending rules.
8. A method for processing batch delivery of millions of short messages with the same content based on Web pages according to claim 7, characterized in that: The specific issuing rules are as follows: When the backend is enabled, the SMS sending rate is initialized and a thread pool of a fixed size is created; When the sending task is put into the SMS sending task queue, the sending rate of the database is queried, and if found, the SMS sending rate is updated to the sending rate of the database; Set the Count value and initialize it, and get the current timestamp as the initial timestamp; When the Count value is greater than zero, the Count value is reduced by one each time a thread in the thread pool is called; When the Count value is less than or equal to zero, obtain the current timestamp as the actual timestamp; Determine whether the difference between the actual timestamp and the initial timestamp is less than a preset threshold. If so, use the difference as the sleep time to control the thread pool thread sleep. After the sleep time ends, set the currently effective sending rate to the Count value and continue to execute the thread call.
9. A method for processing batch delivery of millions of short messages with the same content based on Web pages according to claim 7 or 8, characterized in that: When the sending task calls the SMS sending interface, if no response is received from the SMS sending interface, it is determined that the request has failed and needs to be resent, and the private attribute of each sending task is reduced by one, and then the sending task is put into the SMS sending task queue again; if the private attribute of the sending task is less than zero, retrying is stopped and an exception file is generated.
10. The method for sending millions of short messages with the same content in batches based on a Web page according to claim 1, characterized in that: When a user queries the task progress, the backend extracts the ID, total amount and actual sending amount of the sending task from the database, calculates the task progress based on the total amount and actual sending amount, and displays the task progress on the Web page.