Text short message sending method based on AI

Through the AI-based text message sending method, historical messages are extracted and preset templates are generated using the AI ​​interface, and keywords are automatically replaced, which solves the problem of inefficient entry of artificial mass short messages and realizes fast and efficient SMS sending.

CN119835244APending Publication Date: 2025-04-15GUIYANG LONGMASTER INFORMATION & TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411884925.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Manual mass short messages are inefficient in entering message content. It is necessary to manually compile customized message templates and enter message content one by one, which is inefficient.

Method used

Using AI-based text message sending method, by defining message templates, using the AI ​​interface to extract historical messages and generate preset templates, automatically replace keywords in the templates, and generate and send SMS messages.

Benefits of technology

It improves the efficiency of sending short messages, reduces the steps of manual entry, and can quickly send customized messages in mass.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835244A_ABST
    Figure CN119835244A_ABST
Patent Text Reader

Abstract

The invention provides an AI-based text short message sending method, which comprises the following steps that: a message template is defined, and the message template comprises main body content and a replacement word string; obtaining a preset template according to a historical message and the replacement word string and executing a storage instruction, including executing a template extraction instruction through an AI interface according to the historical short message; the server responds to a short message sending request, and obtains the preset template as a first parameter according to a template number of a request parameter; executing a second replacement instruction according to the order number and the number source to obtain a second output message; executing a short message content generation instruction according to the second output message to obtain a hyperlink short message; the target user executes a short message content jump instruction according to the second hyperlink short message; and the server responds to the second hyperlink short message H5 page access request, executes the random code verification instruction and returns to the H5 page. The problem of low efficiency of inputting the message content by manual group sending of short messages is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of AI, and in particular relates to a text message sending method based on AI. Background Art

[0002] In industry SMS, it is often necessary to send customized messages to users. However, before sending a customized message, a customized message template needs to be manually compiled, and then the short message can be sent according to the customized template. If there is no predetermined template, the complete message content needs to be manually entered each time, which is inefficient. Summary of the invention

[0003] The purpose of this embodiment is to provide an AI-based text message sending method to solve the problem of low efficiency in manually entering message content when sending group short messages.

[0004] An AI-based text message sending method, comprising:

[0005] Define a message template, wherein the message template includes a main content and a replacement string;

[0006] Obtaining a preset template according to the historical message and the replacement string and executing a storage instruction, including executing a template extraction instruction through an AI interface according to the historical short message;

[0007] The server responds to the short message sending request, including the steps of:

[0008] Acquire the preset template as a first parameter according to the template number of the request parameter;

[0009] Execute a first replacement instruction according to the doctor, patient, address, time and the first parameter in the request parameters to obtain a first output message;

[0010] Generate an order number and number source according to the first output message;

[0011] Execute a second replacement instruction according to the order number and the number source to obtain a second output message;

[0012] Execute the short message content generation instruction according to the second output message to obtain a hyperlink short message;

[0013] Obtaining the target user's phone number and random verification code according to the hyperlink short message;

[0014] The hyperlink short message and the random verification code are connected and combined into a second hyperlink short message content to execute a short message gateway message sending request instruction;

[0015] The target user executes a short message content jump instruction according to the second hyperlink short message;

[0016] The server responds to the H5 page access request of the second hyperlink short message by executing the random code verification instruction and returning to the H5 page.

[0017] Preferably, the replacement string includes a string composed of keywords connected by special character strings at the front and back: the keywords include doctor, patient, address, number source, order, and time; the special characters include "<{" and "}>", where the string "<{" is placed in front of the keyword and the string "}>" is placed after the keyword.

[0018] Preferably, the template extraction instruction includes: initiating an AI question according to the AI ​​interface, the question content includes the historical short message + "Please use <{doctor}> to replace the doctor's name in the above content, use <{patient}> to replace the patient's name in the above content, use <{address}> to replace the address name in the above content, use <{time}> to replace the time in the above content, use <{order}> to replace the order number in the above content, and use <{number source}> to replace the number source content in the above content;".

[0019] Preferably, the storage instruction includes executing the preset template numbering and storing it in a database.

[0020] Preferably, the first replacement instruction includes using a regular expression to perform string replacement or direct string replacement, including using the doctor, patient, address, and time in the request parameters to replace "<{doctor}>", "<{patient}>", and "<{address}>" in the first string, respectively.

[0021] Preferably, the second replacement instruction includes using the order number and number source to replace "<{order}>" and "<{number source}>" in the first string respectively.

[0022] Preferably, the content generation instruction includes generating a hyperlink short message content according to the second output message.

[0023] Preferably, the SMS gateway message sending request instruction includes executing short message sending if the target user's telephone number is a valid number.

[0024] Preferably, the short message content jump instruction includes a target user clicking a hyperlink in the short message content to execute an H5 page access request of the second hyperlink short message.

[0025] Preferably, the random code verification instruction includes the random verification code in the verification request parameter if the random verification code is valid in the library table.

[0026] The present invention provides an AI-based text message sending method, which solves the problem of low efficiency in entering message content when manually sending group short messages.

[0027] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 : A method step diagram of a text message sending method based on AI provided in an embodiment of the present invention;

[0029] Figure 2 : A timing diagram of message template definition for the AI-based text message sending method provided in an embodiment of the present invention;

[0030] Figure 3 : A step diagram of the server responding to and jumping to the H5 page of the AI-based text message sending method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The technical solution in the embodiment of the present invention will be described below in conjunction with the accompanying drawings in the embodiment of the present invention. In this implementation, the AI ​​model is a prior art, and the AI ​​model backend server is accessed through the AI ​​interface.

[0032] This embodiment provides an AI-based text message sending method, including:

[0033] S001: Define a message template, the message template includes a main body content and a replacement string, wherein the replacement string includes a string composed of keywords connected by special strings at the front and back: the keywords include doctor, patient, address, number source, order, time; the special characters include "<{" and "}>", wherein the string "<{" is placed in front of the keyword, and the string "}>" is placed after the keyword; in specific implementation, the description of the message template definition is placed in the database to debug the accuracy of the replacement string when debugging AI question and answer. In the embodiment, the keywords surrounded by "<{" and "}>" are used as replacement strings. According to industry requirements, the keywords and main body content are defined through the background client. The embodiment uses an example based on the hospital field. The background client defines keywords and special characters through web page operations, such as doctor, patient, address, number source, order, time; see the message template definition timing diagram Figure 2 , proceed to step S002.

[0034] S002: Obtain a preset template according to the historical message and the replacement string and execute a storage instruction, including executing a template extraction instruction through an AI interface according to the historical short message, the instruction content including: the historical short message + "Please use <{doctor}> to replace the doctor's name in the above content, use <{patient}> to replace the patient's name in the above content, use <{address}> to replace the address name in the above content, use <{time}> to replace the time in the above content, use <{order}> to replace the order number in the above content, and use <{number source}> to replace the number source content in the above content;"; wherein the storage instruction includes executing the preset template number and storing it in a database; in specific implementation, construct a timer, and the timer obtains the historically sent short messages from the historical short messages; for example: "Health reminder: Zhang San, you have made an appointment with XXXX (Fifth Medical) Public Health Treatment Center Daying Road Campus-Infectious Disease Clinic (Daying Road)-Doctor Li Si-January 19th 15:12 (No. 37) number source, registration form number: W0029451, please make an appointment today at 14 :42 before the hospital for treatment." When initiating an AI request, the historical short message includes the following parameter content in the POST parameter of the request: "Health reminder: Zhang San, you have made an appointment with XXXX (Fifth Hospital) Public Health Treatment Center Daying Road Campus-Infectious Disease Clinic (Daying Road)-Doctor Li Si-January 19th 15:12 (No. 37), registration number: W0029451, please go to the hospital before 14:42 today. Please use <{doctor}> to replace the doctor's name in the above content, use <{patient}> to replace the patient's name in the above content, use <{address}> to replace the address name in the above content, use <{time}> to replace the time in the above content, use <{order}> to replace the order number in the above content, and use <{number source}> to replace the number source content in the above content. ", in specific implementation, the WEB callback of the AI ​​interface is used to realize the return of question data. Another way is to use a browser plug-in to open the AI ​​page, and initiate an access request for AI questions through the plug-in JS. In this embodiment, the content returned according to the AI ​​big model is as follows:

[0035] Here is the replaced text:

[0036] Health reminder: <{Patient}>, you have made an appointment at <{Address}>-Infectious Disease Clinic (Daying Road)-<{Doctor}>-<{Time}>-<{Appointment Source}>, registration number: <{Order}>, please arrive at the hospital for treatment before 14:42 today.

[0037] in:

[0038] <{Patient}>: Zhang San

[0039] <{Address}>: XXXX (Fifth Hospital) Public Health Treatment Center Daying Road Campus

[0040] <{Doctor}>: Li Si

[0041] <{Time}>: January 19, 15:12

[0042] <{Source}>: No. 37

[0043] <{Order}>: W0029451

[0044] This completes the string replacement as you requested, making the text more structured and general, convenient for further processing or displaying specific information.

[0045] In the embodiment, the content returned according to the AI ​​model interface is as follows:

[0046] Health reminder: <{patient}>, you have made an appointment for <{address}>-Infectious Disease Outpatient Clinic-{doctor}-<{time}>(<{number source}>), registration form number: <{order}>, please arrive at the hospital for treatment before 14:42 today.

[0047] During specific implementation, determine which AI interface to use to obtain the template content based on your business needs; after obtaining the template content in the timer task, you also need to perform the following steps:

[0048] A template number is generated according to the template content. The template number is used by the doctor client to determine the selected template content when sending a customized short message, and step S003 is performed.

[0049] S003: The server responds to the short message sending request, including the following steps:

[0050] S1: The preset template is obtained as the first parameter according to the template number of the request parameter; in the specific implementation, the doctor selects the short message template to be sent through the drop-down menu on the web page, and when clicking send, the server determines the selected preset short message according to the preset template. It is also possible not to select a template, and the doctor constructs the complete short message content. When the preset template number is not selected, the short message content sent is executed after sending the short message to the designated patient user and entering the historical message record table. The above-mentioned timer task learns the historical messages and generates a message template which is stored in the database.

[0051] S2: Execute a first replacement instruction according to the doctor, patient, address, time and the first parameter in the request parameter to obtain a first output message; wherein the first replacement instruction includes using a regular expression to perform string replacement, and the regular expression includes using the doctor, patient, address and time in the request parameter to replace "<{doctor}>", "<{patient}>", "<{address}>" in the first string respectively; the string replacement instruction of PHP is used in the specific implementation of this embodiment, and of course the same effect can be achieved by using the regular replacement instruction of other languages, and the specific code is as follows:

[0052] $pattern = ' / {(\w+)} / '; / / match the words in the curly brackets

[0053] $rep l acement = '<\$1>'; / / Replace with <word>

[0054] $subject = "Health Reminder: {Patient} You have made an appointment with {Address}";

[0055] $resu lt=preg_rep l ace($pattern,'<\$1>',$subject);

[0056] echo$resul lt; / / Output: Health reminder: <patient> You have made an appointment with <address>

[0057] You can also replace based on string mode. The specific sample code is as follows:

[0058] $search = ["<{patient}>","<{address}>","<{doctor}>","<{time}>","<{order}>","<{number source}>"];

[0059] $rep l ace=["Zhang San","XXXX Daying Road","Li Si","January 19, 15:12","W0029451","No. 37"];

[0060] $subject = "Health reminder: <{patient}> You have made an appointment for <{address}>-Infectious Disease Clinic-<{doctor}>-<{time}> (<{number source}>), registration number: <{order}>";

[0061] $resu lt=str_rep l ace($search,$rep l ace,$subject);

[0062] echo$resul lt; / / Output: Health reminder: Zhang San, you have made an appointment for XXXXXXX-Infectious Disease Clinic-Li Si-01-19 15:12 (No. 37), registration number: W0029451;

[0063] S3: Generate an order number and a number source according to the first output message; in specific implementation, the order number is implemented by a database auto-increment variable, and the number source is determined according to the patient queue user serial number;

[0064] S4: executing a second replacement instruction according to the order number and the number source to obtain a second output message, including: using the order number and the number source to replace "<{order}>" and "<{number source}>" in the first string respectively;

[0065] S5: Execute the short message content generation instruction according to the second output message to obtain a hyperlink short message, including generating a hyperlink short message and an H5 page long message according to the second output message; if the message to the end user needs to be displayed as a rich media message, in this embodiment, the H5 page long message is displayed by the browser in the mobile phone through the hyperlink short message when the user clicks the hyperlink in the short message, so that more content can be displayed due to the operator's limitation of 70 Chinese characters for short messages, such as pictures or videos that cannot be displayed in short messages, see Figure 3 This is a step diagram of how the server responds and jumps to the H5 page after the user clicks on a hyperlink short message.

[0066] S6: Obtain the target user's phone number and random verification code according to the hyperlink short message; the target phone number is obtained by the server from the patient database table that needs to be notified, and the server also generates a random code in the hyperlink short message address and places it in the address parameter to prevent non-notified users from entering and viewing the details through other means, so as to protect the privacy of the patient user.

[0067] S7: The hyperlink short message and the random verification code are connected and combined into the second hyperlink short message content to execute the SMS gateway message sending request, including, if the target user's phone number is a valid number, executing the short message sending; in this embodiment, after the SMS gateway server successfully verifies the target user's phone number when sending the short message, it is also necessary to verify whether the random code in the hyperlink address is consistent with the random code to be sent in the database. If they are consistent, the short message content will be sent. In specific implementation, when sending, the short message gateway establishes a short message sending buffer table and generates a one-to-one correspondence between the random code and the short message content.

[0068] S004: The target user executes the short message content jump instruction according to the second hyperlink short message, including executing the target link address through the terminal's built-in browser to execute the H5 page access request of the second hyperlink short message; in specific implementation, this step is the target user's smart terminal, such as the built-in browser in the mobile phone terminal, responding to the hyperlink click event in the mobile phone short message content to execute the process start instruction to open the browser, and the parameters are passed to the browser through the console parameter passing method to pass the link address in the second hyperlink short message content.

[0069] S005: The server responds to the H5 page access request of the second hyperlink short message, including the random verification code in the verification request parameter. If the random verification code is valid, the H5 page content is returned. In the specific implementation, the server responds to the H5 page access request and needs to verify the random code in the request parameter. If the random code exists in the above-mentioned short message sending buffer table and is determined to be a valid request, the H5 page content is executed and returned to the client.

[0070] The present invention provides an AI-based text message sending method, which solves the problem of low efficiency in entering message content when manually sending group short messages.

[0071] The above description is only an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A text message sending method based on AI, characterized in that: include: Define a message template, wherein the message template includes a main content and a replacement string; Obtaining a preset template according to the historical message and the replacement string and executing a storage instruction, including executing a template extraction instruction through an AI interface according to the historical short message; The server responds to the short message sending request, including the steps of: Acquire the preset template as a first parameter according to the template number of the request parameter; Execute a first replacement instruction according to the doctor, patient, address, time and the first parameter in the request parameters to obtain a first output message; Generate an order number and number source according to the first output message; Execute a second replacement instruction according to the order number and the number source to obtain a second output message; Execute the short message content generation instruction according to the second output message to obtain a hyperlink short message; Obtaining the target user's phone number and random verification code according to the hyperlink short message; The hyperlink short message and the random verification code are connected and combined into a second hyperlink short message content to execute a short message gateway message sending request instruction; The target user executes a short message content jump instruction according to the second hyperlink short message; The server responds to the H5 page access request of the second hyperlink short message by executing the random code verification instruction and returning to the H5 page.

2. The method for sending text messages based on AI according to claim 1, characterized in that: The replacement string includes a string composed of keywords connected by special character strings at the front and back: the keywords include doctor, patient, address, number source, order, and time; the special characters include "<{" and "}>", where the string "<{" is placed in front of the keyword and the string "}>" is placed after the keyword.

3. The method for sending text messages based on AI according to claim 1, characterized in that: The template extraction instruction includes: initiating an AI question according to the AI ​​interface, the question content includes the historical short message + "Please use <{doctor}> to replace the doctor's name in the above content, use <{patient}> to replace the patient's name in the above content, use <{address}> to replace the address name in the above content, use <{time}> to replace the time in the above content, use <{order}> to replace the order number in the above content, and use <{number source}> to replace the number source content in the above content;".

4. The method for sending text messages based on AI according to claim 1, characterized in that: The storage instruction includes executing the preset template numbering and storing it in a database.

5. The method for sending text messages based on AI according to claim 1, characterized in that: The first replacement instruction includes using a regular expression to perform string replacement or direct string replacement, including using the doctor, patient, address, and time in the request parameters to replace "<{doctor}>", "<{patient}>", and "<{address}>" in the first string respectively.

6. The method for sending text messages based on AI according to claim 1, characterized in that: The second replacement instruction includes using the order number and number source to replace "<{order}>" and "<{number source}>" in the first string respectively.

7. The method for sending text messages based on AI according to claim 1, characterized in that: The content generation instruction includes generating a hyperlink short message content according to the second output message.

8. The method for sending text messages based on AI according to claim 1, characterized in that: The SMS gateway message sending request instruction includes executing short message sending if the target user's phone number is a valid number.

9. The method for sending text messages based on AI according to claim 1, characterized in that: The short message content jump instruction includes a target user clicking a hyperlink in the short message content to execute an H5 page access request of the second hyperlink short message.

10. The method for sending text messages based on AI according to claim 1, characterized in that: The random code verification instruction includes the random verification code in the verification request parameter if the random verification code is valid in the library table.