Multi-scene short message verification code pushing method based on large language model
By using a large language model-based approach, combined with intelligent recognition of scene tags and risk levels and strategy orchestration, a personalized delivery plan is generated, which solves the shortcomings of existing SMS verification code push technologies and achieves high success rate, low latency and high security SMS verification code push.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing SMS verification code push methods lack in-depth analysis of user operation types, device characteristics, historical interaction records, and potential risk factors, resulting in an inability to make personalized adjustments according to different scenarios. Furthermore, insufficient model reasoning and intelligence can easily lead to delayed delivery or failure to send verification codes.
A method based on a large language model is adopted. By intelligently identifying scene tags and risk levels, combined with SMS channel status information and strategy orchestration module, a personalized delivery plan is generated. The dynamic generation and online optimization of verification code SMS content are realized, and the improved GTrXL large language model is used for reasoning and strategy updates.
It improves the success rate and timeliness of SMS verification code delivery, enhances adaptability and security, and solves the problems of insufficient context utilization, limited reasoning ability, inflexible channel scheduling and lagging feedback mechanism in existing technologies.
Smart Images

Figure CN121645157A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information communication and intelligent services, and in particular to a multi-scene short message verification code pushing method based on a large language model. BACKGROUND
[0002] As a general identity authentication means in Internet services, financial payments, e-commerce, government affairs and various mobile applications, short message verification codes have been widely used. Users usually need to receive and input short message verification codes sent by the system when logging in, registering, confirming payment, retrieving passwords, and performing high-risk operations to complete identity verification and risk control. The existing short message verification code pushing method generally uses a fixed channel, a fixed template and a static configuration method, that is, according to the operator or region to which the user's mobile phone number belongs, a single short message channel is selected for sending, and the short message content is generated through a previously configured verification code template. Although this method can meet the basic identity verification requirements, as the business scale expands, the application scenarios become more complex, and the fraud attack methods become more diversified, the traditional technology gradually exposes its defects.
[0003] In terms of insufficient use of contextual data, the existing technology usually selects a short message channel only according to the user's mobile phone number and operator information, lacking in-depth analysis of user operation types, device characteristics, historical interaction records and potential risk factors. This results in the inability of the short message pushing strategy to be individually adjusted according to different scenarios. For example, the verification code pushing for a user in a high-risk payment scenario should be different from that in a normal login scenario, but the existing technology often cannot distinguish between the two. In terms of insufficient model reasoning and intelligence, the traditional method usually uses a rule engine or simple decision logic to determine the short message pushing path, lacking the semantic understanding and reasoning ability based on a deep learning model, especially a large language model. This method has limitations in dealing with complex business constraints, compliance requirements and dynamic risk changes, and is prone to cause verification code delay delivery or sending failure. SUMMARY
[0004] One object of the present application is to provide a multi-scene short message verification code pushing method based on a large language model. The present application makes full use of standardized processing and coding of contextual data, modeling of structured prompt templates and improved GTrXL large language model reasoning mechanisms, and describes in detail the intelligent identification of scene tags and risk levels, the generation of individual delivery plans in combination with short message channel state information and strategy arrangement modules, and the whole process of dynamic generation and online optimization of verification code short message content. The present application has the advantages of high pushing success rate, low sending delay, strong adaptability and good multi-scene security.
[0005] According to the multi-scene short message verification code pushing method based on a large language model of the present application, the following steps are included:
[0006] collecting context data of a service system and preprocessing the context data;
[0007] standardizing and encoding the preprocessed context data to generate a scenario feature vector and a risk feature vector;
[0008] combining the scenario feature vector and the risk feature vector according to a structured prompt template to generate a model input sequence;
[0009] performing inference on the model input sequence using an improved GTrXL large language model, introducing a risk perception gating mechanism, and outputting a scenario label and a risk level;
[0010] obtaining channel constraint data according to the scenario label and the risk level, combining short message channel state information and sending configuration information;
[0011] performing policy arrangement on the channel constraint data to generate a delivery plan;
[0012] generating a verification code short message content according to the delivery plan;
[0013] submitting the verification code short message content through a sending channel, recording a submission serial number, listening to a sending receipt, obtaining a delivery status and a failure code, triggering a retry when a successful sending receipt is not received, and inputting the delivery status and the failure code into the improved GTrXL large language model to update policy parameters.
[0014] Optionally, the context data includes user identification, operation type, terminal information, geographic location, historical interaction record, and risk control feature, and the preprocessing includes timestamp alignment and missing value completion.
[0015] Optionally, the generation of the scenario feature vector and the risk feature vector specifically includes:
[0016] dividing the preprocessed context data into numerical fields, category fields, text fields, space-time fields, and risk fields;
[0017] performing standardization processing on the numerical fields to obtain a standardized numerical vector, the standardization processing being to subtract the mean value of the field in a statistical window from the original numerical value and divide by the standard deviation of the field in the statistical window;
[0018] performing normalization processing on proportional numerical values in the numerical fields to obtain a normalized numerical vector, the normalization processing being to subtract the minimum value of the field in a statistical window from the original numerical value and divide by the difference between the maximum value and the minimum value of the field in the statistical window;
[0019] Perform one-hot encoding on the category field to construct a category vector, the process of which is to count all values of the category field and number them as indexes 1 to K, create a vector with a length of K and initial values of all 0, and set the value of the index position to 1 and the values of the remaining positions to 0 to obtain the category vector;
[0020] Perform subword processing on the text field to obtain a subword sequence, and average the embedding vectors of the subword sequence in the embedding matrix to obtain a text vector;
[0021] Perform bucketing processing on the spatiotemporal field and the risk field to obtain a spatiotemporal vector and a risk vector, the bucketing processing referring to dividing the continuous values of the spatiotemporal field and the risk field into discrete intervals according to a preset rule, replacing the original numerical values with interval indexes, and then inputting the embedding matrix, the embedding matrix referring to a parameter matrix that maps the bucketing indexes into dense vectors;
[0022] Concatenate the standardized numerical vector, the normalized numerical vector, the category vector, the text vector, the spatiotemporal vector, and the risk vector in a predetermined order to form a context vector;
[0023] Perform linear projection and normalization processing on the context vector to obtain a scene feature vector and a risk feature vector, the linear projection referring to transformation of the context vector by a projection matrix and a bias term, and the normalization processing referring to division of each element of the context vector by the two-norm of the context vector.
[0024] Optionally, the generation of the model input sequence specifically includes:
[0025] Concatenate the scene feature vector and the risk feature vector in a predetermined order to form a condition vector;
[0026] Perform serialization processing on the condition vector according to a structured prompt template to generate an intermediate sequence, the structured prompt template referring to a preset formatted input specification that converts the scene feature vector and the risk feature vector into an input sequence with annotations and delimiters;
[0027] Add a start token at the starting position of the intermediate sequence and an end token at the end position to generate a token sequence;
[0028] Map each token in the token sequence to a corresponding embedding vector through an embedding matrix and arrange the embedding vectors in sequence to form an embedding sequence;
[0029] Assign a position index to each position in the token sequence, map the position index to a position vector, add the position vector to the corresponding embedding vector to obtain an input vector, and combine all the input vectors in sequence to form a model input sequence, the mapping process referring to inputting the index of each position in the token sequence into the embedding matrix to obtain a corresponding low-dimensional dense position vector.
[0030] Optionally, the output of the scene label and risk level specifically includes:
[0031] The model input sequence is fed into the improved GTrXL large language model for inference. The improved GTrXL large language model includes an input embedding module, a multi-head self-attention module, a cross-segment memory module, and a task output module. The input embedding module converts the token sequence in the model input sequence into a dense embedding vector representation. The multi-head self-attention module introduces a risk adjustment factor through a risk perception gating mechanism and calculates the attention output matrix. The cross-segment memory module updates the memory state in the historical inference process. The task output module outputs scene labels and risk levels through a classifier and a hierarchical predictor, respectively.
[0032] In the input embedding module, the token sequence in the model input sequence is mapped to an embedding vector to form an input matrix;
[0033] In the multi-head self-attention module, the input matrix is projected into a query matrix, a key matrix, and a value matrix, and a risk-aware gating mechanism is introduced to obtain the attention output matrix;
[0034] The risk perception gating mechanism refers to obtaining a risk adjustment factor from the risk feature vector through linear transformation, and introducing the risk adjustment factor into the attention weight calculation to dynamically correct the attention distribution;
[0035] In the cross-segment memory module, the attention output matrix is fused with the historical memory state to update the current memory state;
[0036] The current memory state is input into the task output module to obtain scene labels and risk levels. The scene labels are output by a classifier that performs multi-category discrimination on the current memory state, and the risk levels are output by a hierarchical predictor that performs risk level stratification based on the current memory state.
[0037] Optionally, obtaining the channel constraint data specifically includes:
[0038] Establish a collection of SMS channels by using scenario tags and risk levels;
[0039] Obtain the SMS channel status information and sending configuration information of the SMS channel set, and perform normalization processing on the SMS channel status information and sending configuration information to obtain the normalization result. The SMS channel status information includes the frequency limiting threshold, expected delay and failure code statistics of each SMS channel, and the sending configuration information includes the sending quota of each SMS channel.
[0040] A risk adaptive weight vector is generated based on the risk level, and the risk adaptive weight vector is obtained through linear transformation and normalization.
[0041] The normalized result is weighted and combined with the risk adaptive weight vector to obtain the comprehensive score of the SMS channel;
[0042] The comprehensive score is determined based on a preset threshold to obtain the indication quantity of the SMS channel;
[0043] The frequency limiting threshold, expected latency, failure code statistics, transmission quota, comprehensive score, and indication quantity are combined and concatenated into channel constraint data.
[0044] Optionally, the generation of the delivery plan specifically includes:
[0045] The channel constraint data is used for strategy orchestration to obtain the SMS channel priority sequence. The strategy orchestration is based on the comprehensive score and indication of the SMS channel to prioritize the channels.
[0046] In the SMS channel priority sequence, the highest-ranked SMS channel is selected as the primary sending channel, and the lower-ranked SMS channel is selected as the backup sending channel, forming a primary and backup channel pair;
[0047] By combining the expected delay of the main sending channel with the risk level, a delivery timing is generated. The delivery timing is generated by selecting the SMS channel with the smallest expected delay in the SMS channel priority sequence, and then adding delay compensation obtained from the risk level.
[0048] During the delivery process, based on failure code statistics and sending quota, the number of retries and the retry interval are set. When the cumulative failure rate of the main sending channel is greater than the preset threshold, a retry is triggered and the number of retries and the retry interval are recorded.
[0049] The delivery plan is generated by combining the primary sending channel, backup sending channel, delivery timing, number of retries, and retry interval.
[0050] Optionally, the generation of the verification code SMS content specifically includes:
[0051] Receive delivery plans and generate SMS signatures and SMS template numbers;
[0052] The length of the verification code is calculated based on the risk level and preset parameters, and a number string matching the length of the verification code is generated within the numerical range to obtain the verification code content.
[0053] Based on the configuration parameters in the delivery plan, the validity period of the verification code is generated, and the SMS signature, SMS template number, verification code length and verification code content are combined to form a set of verification code elements.
[0054] The verification code element set and the verification code validity period are combined to generate the verification code SMS content.
[0055] Optionally, the update of the strategy parameters specifically includes:
[0056] Receive the verification code SMS content, select the main sending channel in the delivery plan as the current sending channel, submit the verification code SMS content through the current sending channel, generate a submission serial number and record the submission time;
[0057] Within a preset timeout window, listen for and parse delivery receipts and delivery status and failure codes. The timeout window is composed of the expected delay, delay compensation corresponding to the risk level, and safety margin in the channel constraint data. When no successful delivery receipt is received within the timeout window, the delivery status is marked as unsuccessful and the failure code is recorded.
[0058] When the delivery status is marked as unsuccessful, a retry is performed according to the number of retry attempts and the retry interval in the delivery plan. When the maximum number of retry attempts is reached, a new sending channel is selected from the set of backup sending channels in the delivery plan to continue sending.
[0059] After each retry, the delivery status and failure code are recorded to form a feedback vector. The feedback vector is then recursively updated using the improved GTrXL large language model, and the update strategy parameters are output.
[0060] The beneficial effects of this invention are:
[0061] This invention, by introducing standardized processing and encoding of contextual data, can fully utilize multi-dimensional information such as user identifiers, operation types, terminal information, geographical location, and historical interaction records to generate scene feature vectors and risk feature vectors, providing more comprehensive and accurate input for subsequent inference. Based on this, it combines structured prompt templates to perform serialization modeling of the feature vectors, enabling the model input sequence to simultaneously reflect business scenarios, risk levels, and semantic constraints, thus overcoming the shortcomings of existing technologies that rely solely on limited parameters for channel selection. By employing an improved GTrXL large language model and introducing a risk-aware gating mechanism, this invention can dynamically adjust the attention distribution during model inference, more accurately outputting scene labels and risk levels, and achieving adaptive analysis of complex business constraints and security requirements.
[0062] This invention introduces the calculation of channel constraint data in channel scheduling, comprehensively considering factors such as SMS channel availability, frequency limiting threshold, expected latency, failure code statistics, and sending quotas, thus avoiding the limitations of existing technologies that overly rely on single channel parameters. Through a strategy orchestration module, the channel constraint data is sorted and combined to generate a delivery plan that includes the primary sending channel, backup sending channel, delivery timing, number of retries, and retry interval, making the SMS verification code push process more reasonable, flexible, and efficient. Simultaneously, this invention introduces a risk level and compliance constraint adjustment mechanism in the verification code content generation stage, dynamically adjusting the SMS signature, template number, verification code length, and validity period. Combined with sensitive word filtering and variable verification, this effectively improves the compliance and security of SMS content.
[0063] Regarding feedback and adaptive optimization, this invention forms a feedback vector from delivery status and failure code, and recursively updates it by inputting it into an improved GTrXL large language model in real time. This allows the strategy parameters and structured prompt templates to be continuously corrected based on actual delivery results. This design not only improves the success rate and timeliness of SMS verification code delivery but also maintains good adaptability and stability under dynamically changing business environments and risk levels. Through these improvements, this invention effectively solves the problems of insufficient context utilization, limited reasoning ability, inflexible channel scheduling, lack of intelligent delivery strategies, and lagging feedback mechanisms in existing technologies, ultimately achieving a high success rate, low latency, and high security SMS verification code push method in multiple scenarios. Attached Figure Description
[0064] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0065] Figure 1 This is an overall flowchart of a multi-scenario SMS verification code push method based on a large language model proposed in this invention;
[0066] Figure 2 This is a schematic diagram of the module structure of the improved GTrXL large language model for a multi-scenario SMS verification code push method based on a large language model proposed in this invention. Detailed Implementation
[0067] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0068] refer to Figures 1-2 A multi-scenario SMS verification code push method based on a large language model includes the following steps:
[0069] Collect context data from the business system and preprocess it;
[0070] The preprocessed context data is standardized and encoded to generate scene feature vectors and risk feature vectors.
[0071] The scene feature vector and risk feature vector are combined according to the structured prompt template to generate the model input sequence;
[0072] An improved GTrXL large language model is used for inference on the input sequence of the model. By introducing a risk perception gating mechanism, scene labels and risk levels are output.
[0073] Based on scenario tags and risk levels, combined with SMS channel status information and sending configuration information, channel constraint data is obtained;
[0074] The channel constraint data is used for strategy orchestration to generate a delivery plan;
[0075] Generate the verification code SMS content according to the delivery plan;
[0076] The verification code SMS content is submitted through the sending channel and the submission serial number is recorded. The sending receipt is monitored and the delivery status and failure code are obtained. If no successful sending receipt is received, a retry is triggered, and the delivery status and failure code are input into the improved GTrXL large language model to update the strategy parameters.
[0077] In this embodiment, the context data includes user identifier, operation type, terminal information, geographical location, historical interaction records and risk control features, and the preprocessing includes timestamp alignment and missing value completion.
[0078] In this embodiment, the generation of the scene feature vector and the risk feature vector specifically includes:
[0079] The preprocessed context data is divided into fields, resulting in numeric fields, category fields, text fields, spatiotemporal fields, and risk fields;
[0080] Standardize the numerical field to obtain a standardized numerical vector. The standardization process involves subtracting the mean of the field within the statistical window from the original numerical value and dividing it by the standard deviation of the field within the statistical window.
[0081] Normalization is performed on the proportional values in the numerical field to obtain a normalized numerical vector. The normalization process is to subtract the minimum value of the field in the statistical window from the original value and divide it by the difference between the maximum and minimum values of the field in the statistical window.
[0082] Perform one-hot encoding on the category field to construct a category vector. The construction process involves counting all values of the category field and numbering them as indices 1 to K, creating a vector of length K with all initial values of 0, setting the value at the index position to 1, and setting the other positions to 0, thus obtaining the category vector.
[0083] The text field is subtotalized to obtain a subtotal sequence, and the average of the embedding vectors of the subtotal sequence in the embedding matrix is taken to obtain the text vector.
[0084] Bucketing is performed on the spatiotemporal field and the risk field to obtain spatiotemporal vector and risk vector. The bucketing process refers to dividing the continuous values of the spatiotemporal field and the risk field into discrete intervals according to preset rules, replacing the original values with interval indices, and then inputting them into an embedding matrix. The embedding matrix refers to a parameter matrix that maps the bucket index to a dense vector.
[0085] Standardized numerical vectors, normalized numerical vectors, category vectors, text vectors, spatiotemporal vectors, and risk vectors are concatenated in a predetermined order to form a context vector;
[0086] The context vector is linearly projected and normalized to obtain the scene feature vector and the risk feature vector. The linear projection refers to the transformation of the context vector by the projection matrix and the bias term. The normalization process is to divide each element of the context vector by the L2 norm of the context vector.
[0087] In this embodiment, the generation of the model input sequence specifically includes:
[0088] The scene feature vector and risk feature vector are concatenated in a predetermined order to form a condition vector;
[0089] The condition vector is serialized according to the structured prompt template to generate an intermediate sequence. The structured prompt template refers to a preset formatted input specification, which converts the scene feature vector and risk feature vector into an input sequence with annotations and delimiters.
[0090] Add a start marker at the beginning of the intermediate sequence and an end marker at the end to generate a token sequence;
[0091] Each token in the token sequence is mapped to its corresponding embedding vector through an embedding matrix, and these vectors are then arranged sequentially to form an embedding sequence.
[0092] Assign a position index to each position in the token sequence, map the position index to a position vector, add it to the corresponding embedding vector to obtain the input vector, and combine all the input vectors in order to form the model input sequence. The mapping process refers to inputting the index of each position in the token sequence into the embedding matrix to obtain the corresponding low-dimensional dense position vector.
[0093] In this embodiment, the output of the scene label and risk level specifically includes:
[0094] The model input sequence is fed into the improved GTrXL large language model for inference. The improved GTrXL large language model includes an input embedding module, a multi-head self-attention module, a cross-segment memory module, and a task output module. The input embedding module converts the token sequence in the model input sequence into a dense embedding vector representation. The multi-head self-attention module introduces a risk adjustment factor through a risk perception gating mechanism and calculates the attention output matrix. The cross-segment memory module updates the memory state in the historical inference process. The task output module outputs scene labels and risk levels through a classifier and a hierarchical predictor, respectively.
[0095] In the input embedding module, the token sequence in the model input sequence is mapped to an embedding vector to form an input matrix;
[0096] In the multi-head self-attention module, the input matrix is projected into a query matrix, a key matrix, and a value matrix. A risk-aware gating mechanism is introduced to obtain the attention output matrix:
[0097] ;
[0098] in, For the attention output matrix, The dimension of the key vector. For risk adjustment matrix, For risk feature vectors, For querying the matrix, The key matrix, For value matrices, For the index of attention head, For transpose, Normalization operator;
[0099] The risk perception gating mechanism refers to obtaining a risk adjustment factor from the risk feature vector through linear transformation, and introducing the risk adjustment factor into the attention weight calculation to dynamically correct the attention distribution;
[0100] In the cross-segment memory module, the attention output matrix is fused with the historical memory state to update and obtain the current memory state:
[0101] ;
[0102] in, The current memory state, For the state of historical memory, For memorizing the weight matrix, For bias vectors, For the Sigmoid function, This is element-wise multiplication;
[0103] The current memory state is input into the task output module to obtain scene labels and risk levels. The scene labels are output by a classifier that performs multi-category discrimination on the current memory state, and the risk levels are output by a hierarchical predictor that performs risk level stratification based on the current memory state.
[0104] In this embodiment, obtaining the channel constraint data specifically includes:
[0105] Establish a collection of SMS channels by using scenario tags and risk levels;
[0106] Obtain the SMS channel status information and sending configuration information of the SMS channel set, and perform normalization processing on the SMS channel status information and sending configuration information to obtain the normalization result. The SMS channel status information includes the frequency limiting threshold, expected delay and failure code statistics of each SMS channel, and the sending configuration information includes the sending quota of each SMS channel.
[0107] A risk adaptive weight vector is generated based on the risk level, and the risk adaptive weight vector is obtained through linear transformation and normalization.
[0108] The normalized result is weighted and combined with the risk adaptive weight vector to obtain the comprehensive score of the SMS channel;
[0109] The comprehensive score is determined based on a preset threshold to obtain the indication quantity of the SMS channel;
[0110] The frequency limiting threshold, expected latency, failure code statistics, transmission quota, comprehensive score, and indication quantity are combined and concatenated into channel constraint data.
[0111] In this embodiment, the generation of the delivery plan specifically includes:
[0112] The channel constraint data is used for strategy orchestration to obtain the SMS channel priority sequence. The strategy orchestration is based on the comprehensive score and indication of the SMS channel to prioritize the channels.
[0113] In the SMS channel priority sequence, the highest-ranked SMS channel is selected as the primary sending channel, and the lower-ranked SMS channel is selected as the backup sending channel, forming a primary and backup channel pair;
[0114] By combining the expected delay of the main sending channel with the risk level, a delivery timing is generated. The delivery timing is generated by selecting the SMS channel with the smallest expected delay in the SMS channel priority sequence, and then adding delay compensation obtained from the risk level.
[0115] During the delivery process, based on failure code statistics and sending quota, the number of retries and the retry interval are set. When the cumulative failure rate of the main sending channel is greater than the preset threshold, a retry is triggered and the number of retries and the retry interval are recorded.
[0116] The delivery plan is generated by combining the primary sending channel, backup sending channel, delivery timing, number of retries, and retry interval.
[0117] In this embodiment, the generation of the verification code SMS content specifically includes:
[0118] Receive delivery plans and generate SMS signatures and SMS template numbers;
[0119] The length of the verification code is calculated based on the risk level and preset parameters, and a number string matching the length of the verification code is generated within the numerical range to obtain the verification code content.
[0120] Based on the configuration parameters in the delivery plan, the validity period of the verification code is generated, and the SMS signature, SMS template number, verification code length and verification code content are combined to form a set of verification code elements.
[0121] The verification code element set and the verification code validity period are combined to generate the verification code SMS content.
[0122] In this embodiment, the updating of the strategy parameters specifically includes:
[0123] Receive the verification code SMS content, select the main sending channel in the delivery plan as the current sending channel, submit the verification code SMS content through the current sending channel, generate a submission serial number and record the submission time;
[0124] Within a preset timeout window, listen for and parse delivery receipts and delivery status and failure codes. The timeout window is composed of the expected delay, delay compensation corresponding to the risk level, and safety margin in the channel constraint data. When no successful delivery receipt is received within the timeout window, the delivery status is marked as unsuccessful and the failure code is recorded.
[0125] When the delivery status is marked as unsuccessful, a retry is performed according to the number of retry attempts and the retry interval in the delivery plan. When the maximum number of retry attempts is reached, a new sending channel is selected from the set of backup sending channels in the delivery plan to continue sending.
[0126] After each retry, the delivery status and failure code are recorded to form a feedback vector. The feedback vector is then recursively updated using the improved GTrXL large language model, and the update strategy parameters are output.
[0127] Example 1:
[0128] In a major internet finance payment platform, SMS verification codes are a crucial means of ensuring user identity verification and transaction security. However, in traditional systems, the limited SMS channel scheduling methods, often relying on fixed channels and preset templates, lead to verification code delays or failures during peak business periods. For example, during peak payment times or in cross-border transaction scenarios, the verification code delivery failure rate increases significantly, severely impacting user experience and business continuity.
[0129] This embodiment employs a multi-scenario SMS verification code push method based on a large language model. The system first collects user context data, such as operation type, device information, historical interaction behavior, and risk characteristics. After standardization and encoding, scenario feature vectors and risk feature vectors are obtained, and a structured prompt template is used to construct the model input sequence. The improved GTrXL large language model introduces a risk-aware gating mechanism during inference, outputting accurate scenario labels and risk levels. For example, when a user is detected making cross-border payments late at night, the model determines it as a high-risk scenario and dynamically generates a corresponding verification code strategy.
[0130] In the channel scheduling phase, the system comprehensively considers the availability, expected latency, failure rate, and sending quota of SMS channels to generate channel constraint data, and then generates a delivery plan through the strategy orchestration module. Unlike traditional methods, this module dynamically selects the optimal primary and backup channels, and adjusts the delivery timing and retry strategy based on scenario tags and risk levels. Finally, the system generates verification code SMS content according to the delivery plan, and provides real-time feedback on delivery status and failure codes after sending, for online updating of model strategy parameters.
[0131] Actual results show that this method can significantly improve the success rate and timeliness of SMS verification code delivery. In high-concurrency scenarios, the average reception latency of verification codes is reduced to less than 2 seconds, and the failure rate drops to below 1%. In high-risk payment and cross-border transaction scenarios, the validity period of verification codes is dynamically shortened, ensuring both security and user experience.
[0132] Table 1 Comparison of SMS verification code push effects on financial payment platforms
[0133] Scenario category User request volume Verification code length Validity period Average receiving latency (seconds) SMS delivery rate Failure rate User satisfaction Normal login scenario 200,000 6 digits 5 minutes 1.6 99.2% 0.8% 96% High-risk payment scenario 120,000 8 digits 2 minutes 2.0 98.6% 1.4% 94% Cross-border transfer scenario 80,000 8 digits 2 minutes 2.4 97.8% 2.2% 92% High-concurrency peak scenario 300,000 6 digits 5 minutes 1.9 99.0% 1.0% 95%
[0134] As shown in Table 1, in normal login scenarios, this method stabilizes the average reception latency at around 1.6 seconds, with an SMS delivery rate exceeding 99%, a failure rate below 1%, and user satisfaction remaining above 96%. In high-risk payment and cross-border transfer scenarios, although the verification code length increases to 8 digits and the validity period is shortened to 2 minutes, the average reception latency is still controlled between 2 and 2.4 seconds, and the SMS delivery rate remains above 97%, indicating that the system can guarantee the security and availability of verification codes under high-risk conditions. In high-concurrency peak scenarios, with user requests exceeding 300,000, this method still controls the reception latency within 2 seconds and reduces the failure rate to 1%, significantly outperforming traditional methods. Overall, the data shows that this invention can achieve high success rate, low latency, and high security in verification code SMS delivery across multiple scenarios, improving user experience and system reliability.
Claims
1. A large language model-based multi-scene short message verification code pushing method, characterized in that, The method comprises the following steps: Collecting and preprocessing context data of a service system; Standardizing and encoding the preprocessed context data to generate a scenario feature vector and a risk feature vector; Combining the scenario feature vector and the risk feature vector according to a structured prompt template to generate a model input sequence; Using an improved GTrXL large language model to infer the model input sequence, outputting a scenario label and a risk level by introducing a risk perception gating mechanism; According to the scenario label and the risk level, combining the short message channel state information and the sending configuration information to obtain channel constraint data; Arranging the channel constraint data to generate a delivery plan; Generating a verification code short message content according to the delivery plan; Submitting the verification code short message content through the sending channel and recording the submission serial number, listening to the sending receipt and obtaining the delivery status and failure code, triggering a retry when a successful sending receipt is not received, and inputting the delivery status and failure code into the improved GTrXL large language model to update the strategy parameters.
2. The method of claim 1, wherein the method is based on a large language model and is used for multi-scene short message code verification push. The context data includes user identification, operation type, terminal information, geographic location, historical interaction record and risk control feature, and the preprocessing includes timestamp alignment and missing value completion.
3. The method of claim 1, wherein the method is based on a large language model and is used for multi-scene short message verification code pushing. The generation of the scenario feature vector and the risk feature vector specifically comprises: Dividing the preprocessed context data into fields to obtain numerical fields, category fields, text fields, space-time fields and risk fields; Performing standardization processing on the numerical fields to obtain a standardized numerical vector, wherein the standardization processing is to subtract the mean value of the field in the statistical window from the original numerical value and divide by the standard deviation of the field in the statistical window; Performing normalization processing on the proportional numerical values in the numerical fields to obtain a normalized numerical vector, wherein the normalization processing is to subtract the minimum value of the field in the statistical window from the original numerical value and divide by the difference between the maximum and minimum values of the field in the statistical window; Performing one-hot encoding on the category fields to construct a category vector, wherein the construction process is to count all values of the category field and number them as indexes 1 to K, create a vector with a length of K and initial values all being 0, and set the numerical value of the index position to 1 and the rest to 0 to obtain the category vector; Performing sub-word processing on the text fields to obtain a sub-word sequence, and averaging the embedding vectors of the sub-word sequence in an embedding matrix to obtain a text vector; Performing bucketing processing on the space-time fields and the risk fields to obtain space-time vectors and risk vectors, wherein the bucketing processing refers to dividing the continuous values of the space-time fields and the risk fields into discrete intervals according to a preset rule, replacing the original numerical values with interval indexes, and inputting the embedding matrix, wherein the embedding matrix refers to a parameter matrix that maps the bucketing indexes to dense vectors; Concatenating the standardized numerical vector, the normalized numerical vector, the category vector, the text vector, the space-time vector and the risk vector in a predetermined order to form a context vector; Performing linear projection and normalization processing on the context vector to obtain a scenario feature vector and a risk feature vector, wherein the linear projection refers to transforming the context vector by a projection matrix and a bias term, and the normalization processing refers to dividing each element of the context vector by the two-norm of the context vector.
4. The multi-scene short message verification code pushing method based on a large language model according to claim 1, characterized in that, The generation of the model input sequence specifically comprises: concatenating the scene feature vector and the risk feature vector in a predetermined order to form a conditional vector; serializing the conditional vector according to a structured prompt template to generate an intermediate sequence, wherein the structured prompt template refers to a preset formatted input specification for converting the scene feature vector and the risk feature vector into an input sequence with annotations and delimiters; adding a start token at the start position of the intermediate sequence and an end token at the end position to generate a token sequence; mapping each token in the token sequence to a corresponding embedding vector through an embedding matrix to form an embedding sequence; allocating a position index to each position in the token sequence, mapping the position index to a position vector, adding the position vector to the corresponding embedding vector to obtain an input vector, and combining all input vectors in sequence to form a model input sequence, wherein the mapping process refers to inputting the index of each position in the token sequence into the embedding matrix to obtain a corresponding low-dimensional dense position vector.
5. The multi-scene short message verification code pushing method based on a large language model according to claim 1, characterized in that, The output of the scene label and the risk level specifically comprises: inputting the model input sequence into an improved GTrXL large language model for reasoning, wherein the improved GTrXL large language model comprises an input embedding module, a multi-head self-attention module, a cross-segment memory module, and a task output module, the input embedding module converts the token sequence in the model input sequence into a dense embedding vector representation, the multi-head self-attention module introduces a risk adjustment factor through a risk perception gating mechanism to calculate an attention output matrix, the cross-segment memory module updates the memory state in the historical reasoning process, and the task output module outputs the scene label and the risk level through a classifier and a hierarchical predictor, respectively; in the input embedding module, the token sequence in the model input sequence is mapped to an embedding vector to form an input matrix; in the multi-head self-attention module, the input matrix is projected into a query matrix, a key matrix, and a value matrix, and a risk perception gating mechanism is introduced to obtain an attention output matrix; the risk perception gating mechanism refers to obtaining a risk adjustment factor through linear transformation of the risk feature vector, and introducing the risk adjustment factor into the attention weight calculation to dynamically correct the attention distribution; in the cross-segment memory module, the attention output matrix is fused with the historical memory state to update the current memory state; inputting the current memory state into the task output module to obtain the scene label and the risk level, wherein the scene label is output by the classifier through multi-class discrimination of the current memory state, and the risk level is output by the hierarchical predictor through risk level layering calculation according to the current memory state.
6. The multi-scene short message verification code pushing method based on a large language model according to claim 1, characterized in that, The obtaining of the channel constraint data specifically comprises: establishing a short message channel set through the scene label and the risk level; obtaining short message channel state information and sending configuration information of the short message channel set, normalizing the short message channel state information and the sending configuration information to obtain a normalization result, wherein the short message channel state information comprises a frequency limit threshold, an expected time delay, and a failure code statistic of each short message channel, and the sending configuration information comprises a sending quota of each short message channel; The risk adaptive weight vector is generated according to the risk level, and the risk adaptive weight vector is calculated by linear transformation and normalization; The normalized result is combined with the risk adaptive weight vector to obtain a comprehensive score of the short message channel; The comprehensive score is judged based on a preset threshold to obtain an indication quantity of the short message channel; The frequency limit threshold, the expected time delay, the failure code statistics, the sending quota, the comprehensive score and the indication quantity are combined to splice into channel constraint data.
7. The method of claim 1, wherein the method is based on a large language model and is used for multi-scene short message verification code pushing. The generation of the delivery plan specifically includes: The channel constraint data is arranged in a strategy to obtain a short message channel priority sequence, and the strategy arrangement is performed by priority sorting of the comprehensive score and the indication quantity of the short message channel; The highest ranked short message channel in the short message channel priority sequence is selected as the main sending channel, and the short message channels ranked later are selected as the backup sending channels to form a main-backup channel pair; In combination with the expected time delay and the risk level of the main sending channel, a delivery opportunity is generated, the delivery opportunity is generated for the short message channel with the minimum expected time delay in the short message channel priority sequence, and a delay compensation obtained by superimposing the risk level is obtained; During the execution of the delivery opportunity, based on the failure code statistics and the sending quota, the retry number and the retry interval are set, when the cumulative failure rate of the main sending channel is greater than a preset threshold, the retry is triggered and the retry number and the retry interval are recorded; The main sending channel, the backup sending channel, the delivery opportunity, the retry number and the retry interval are combined to generate the delivery plan.
8. The multi-scene short message verification code pushing method based on a large language model according to claim 1, characterized in that, The generation of the verification code short message content specifically includes: The delivery plan is received to generate a short message signature and a short message template number; The verification code length is calculated according to the risk level and the preset parameter, and a digital string matching the verification code length is generated in a numerical range to obtain the verification code content; According to the configuration parameters in the delivery plan, the verification code validity period is generated, and the short message signature, the short message template number, the verification code length and the verification code content are combined to form a verification code element set; The verification code element set and the verification code validity period are combined to generate the verification code short message content.
9. The multi-scene short message verification code pushing method based on a large language model according to claim 1, characterized in that, The update of the strategy parameter specifically includes: The verification code short message content is received, the main sending channel in the delivery plan is selected as the current sending channel, the verification code short message content is submitted through the current sending channel, a submission serial number is generated and a submission time is recorded; The sending receipt is listened to within a preset timeout time window, and the delivery state and the failure code are parsed, the timeout time window is composed of the expected time delay, the delay compensation corresponding to the risk level and the safety margin in the channel constraint data, and when no successful sending receipt is received within the timeout time window, the delivery state is marked as unsuccessful and the failure code is recorded; When the delivery state is marked as unsuccessful, the retry is performed according to the retry number and the retry interval in the delivery plan, and when the upper limit of the retry number is reached, a new sending channel is selected from the backup sending channel set in the delivery plan to continue sending; After each retry, the delivery state and the failure code are recorded to form a feedback vector, and the feedback vector is updated by the improved GTrXL large language model to output the updated strategy parameter.