Short message text processing method and short message text receiving method
Through the SMS text processing method, SMS text is automatically parsed and analyzed to identify key information and vocabulary relationships, solving the automation problem of bank account transaction record management and improving business processing efficiency and accuracy.
Patent Information
- Application Number
- CN202410709520.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, the management of bank account transaction records and business logic processing mainly rely on manual methods, resulting in low real-time performance and low efficiency, and lack of automated and intelligent import management methods.
Provides a SMS text processing method that obtains the SMS text to be processed, parses it to obtain the key information of the SMS, performs feature conversion, syntactic analysis and semantic dependency analysis, identifies the effective SMS text, and performs business accounting based on the key information and the relationship between words to achieve Automated business processing.
It improves the automatic import and business processing efficiency of bank account transaction records, realizes real-time and intelligent management, and significantly improves processing efficiency and accuracy.
Smart Images

Figure CN118569804A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to a method for processing short message text and a method for receiving short message text. Background Art
[0002] Generally speaking, management application software requires transaction records of bank accounts to carry out corresponding business logic processing and verification of payment plans. The main solution at present is manual method (manual entry or file import), which has low real-time performance and low efficiency.
[0003] Therefore, how to achieve intelligent management of automatic and timely import of bank account transaction records through simple and economical methods has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] Based on this, it is necessary to provide a text message processing method and a text message receiving method that can automatically parse text messages and perform business processing in response to the above technical problems.
[0005] A method for processing short message text, the method comprising:
[0006] Obtaining a text message to be processed, and parsing the text message to be processed to obtain key information of the text message;
[0007] Based on the SMS text to be processed and the SMS key information, feature conversion is performed on the SMS text to be processed to obtain an SMS word vector;
[0008] Performing syntactic analysis based on the SMS word vector to obtain SMS sentence structure features, and performing semantic dependency analysis on the SMS word vector to obtain the relationship between SMS words;
[0009] Identifying the SMS text to be processed to obtain a valid SMS text to be processed;
[0010] Business accounting is performed based on the valid SMS text to be processed, the corresponding SMS key information, and the relationship between SMS words.
[0011] In some embodiments, the parsing of the to-be-processed SMS text to obtain SMS key information includes:
[0012] Performing corpus cleaning on the SMS text to be processed to obtain a cleaned SMS text to be processed;
[0013] Segmenting the cleaned SMS text to be processed to obtain vocabulary units;
[0014] Performing part-of-speech tagging on the vocabulary unit to obtain key entities in the vocabulary unit;
[0015] In some embodiments, the SMS type corresponding to the SMS text to be processed includes at least one of the following: a valid SMS type, an invalid SMS type, and a SMS type to be verified;
[0016] Performing business accounting for the valid SMS types;
[0017] Deleting the invalid SMS type;
[0018] A secondary check is performed on the type of the SMS to be verified based on a robot learning algorithm to classify the SMS to be verified into an invalid SMS type or a valid SMS type.
[0019] In some embodiments, the identifying the SMS text to be processed to obtain a valid SMS text to be processed includes:
[0020] Determine the degree of match between the text of the short message to be processed and the known pattern based on a similarity algorithm, and determine the category of the short message to be processed based on the matching result; or,
[0021] The category of the SMS text to be processed is determined based on a pre-trained text classification model.
[0022] In some embodiments, the method further comprises:
[0023] After obtaining the SMS text to be processed, performing integrity analysis on the SMS text to be processed;
[0024] In response to the to-be-processed SMS text being a complete text, parsing the complete to-be-processed SMS text to obtain SMS key information;
[0025] In response to the to-be-processed SMS text being an incomplete text, a context SMS text associated with the to-be-processed SMS text is obtained, and a complete text consisting of the to-be-processed SMS text and the associated context SMS text is parsed to obtain SMS key information.
[0026] In some embodiments, the obtaining of a context SMS text associated with the SMS text to be processed includes:
[0027] Perform integrity analysis on the SMS text to be processed based on the pre-trained large model.
[0028] A method for receiving short message texts, the method comprising at least two communication cards;
[0029] The SMS in each communication card are queued based on the contextual association between the SMS;
[0030] Different communication cards process SMS texts in parallel, and receive and process SMS from multiple communication cards in parallel based on thread pool or asynchronous processing framework;
[0031] The method further includes processing the received SMS text to be processed based on the SMS text processing method described above.
[0032] In some embodiments, the SMS in each communication card is queued based on the context association relationship, and multiple SMS messages belonging to the same complete SMS content are queued and sent and received in sequence, or,
[0033] The SMS messages in each communication card are queued based on time sequence, and multiple SMS messages are queued and sent and received in sequence based on time sequence, or
[0034] The text messages in each communication card are queued based on the priority order, and multiple text messages are queued in turn for sending and receiving based on the priority order.
[0035] In some embodiments, the parallel reception and processing of multiple communication card text messages based on a thread pool or an asynchronous processing framework includes:
[0036] Dynamically adjust the thread pool size or the number of asynchronous tasks based on system load and SMS processing speed.
[0037] In some embodiments, the method further comprises:
[0038] The target communication card is determined based on the operator of each communication card, the number of text messages sent and received, and the location information, and the text message is sent based on the target communication card.
[0039] A text message processing device, comprising:
[0040] An acquisition module is used to acquire the SMS text to be processed, and parse the SMS text to be processed to obtain the SMS key information;
[0041] A conversion module, used for performing feature conversion on the to-be-processed SMS text to obtain an SMS word vector based on the to-be-processed SMS text and the SMS key information;
[0042] An analysis module, configured to perform syntactic analysis based on the SMS word vector to obtain SMS sentence structure features, and perform semantic dependency analysis on the SMS word vector to obtain the relationship between SMS words;
[0043] An identification module, used for identifying the SMS text to be processed to obtain a valid SMS text to be processed;
[0044] The accounting module is used to perform business accounting based on the valid SMS text to be processed and the corresponding SMS key information and the relationship between SMS words.
[0045] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the SMS text processing method and the SMS text receiving method provided in the above embodiments are implemented.
[0046] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the SMS text processing method and SMS text receiving method provided in the above embodiments.
[0047] The above-mentioned SMS text processing method, SMS text receiving method, device, computer equipment and storage medium can realize automatic business verification through intelligent analysis and processing of SMS content, thereby greatly improving business processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A flowchart of a text message processing method provided in an embodiment;
[0049] Figure 2 A flowchart of a method for receiving a text message provided in an embodiment;
[0050] Figure 3 A structural block diagram of a text message processing device provided in one embodiment;
[0051] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] In one embodiment, Figure 1 As shown, a text message processing method is provided, comprising the following steps:
[0054] Step 101, obtaining a text message to be processed, and parsing the text message to be processed to obtain key information of the text message.
[0055] The short message text to be processed is received by the communication card. In some embodiments, the short message text to be processed can be received by the communication card, and the obtained short message text to be processed is parsed based on the calculation module to obtain key information in the short message text.
[0056] Key information may include the number from which the SMS is sent, the content of the SMS, the purpose of the SMS, etc. Extract key information and identify key information in the SMS, such as phone number, address, amount, etc., according to business needs. This can be achieved through regular expressions, keyword matching, or natural language processing technology (such as named entity recognition).
[0057] In some embodiments, the SMS content can be parsed through a custom template, such as designing a set of flexible template definition rules. In some embodiments, users can also be allowed to customize the SMS format and content.
[0058] In some embodiments, key information in the text message can be quickly extracted based on a regular expression or JSON format template parsing engine.
[0059] In some embodiments, the SMS content can be parsed based on the intelligent big model. The intelligent big model can integrate advanced natural language processing (NLP) models to perform semantic analysis and information extraction on SMS texts in non-fixed formats. In addition, in some embodiments, model training data can be used to continuously improve the accuracy and anti-interference of model parsing.
[0060] In some embodiments, the parsing of the SMS text to be processed to obtain SMS key information includes: performing corpus cleaning on the SMS text to be processed to obtain cleaned SMS text to be processed; performing segmentation processing on the cleaned SMS text to be processed to obtain vocabulary units; and performing part-of-speech tagging on the vocabulary units to obtain key entities in the vocabulary units.
[0061] Among them, the text of the SMS to be processed is cleaned, including: inputting the acquired SMS text to be processed (i.e., original SMS data) into the system, and cleaning the noise (such as irrelevant symbols, typos, etc.) in the SMS text to be processed based on data cleaning technology.
[0062] In some embodiments, after obtaining the SMS text to be processed, the SMS text to be processed is analyzed and cleaned. For example, numbers and punctuation marks in the SMS text to be processed can be deleted based on a regular matching algorithm. This can remove noise data in the SMS text and reduce interference with actual tasks.
[0063] The to-be-processed SMS text is segmented to obtain vocabulary units, including: segmenting the SMS text data after data cleaning, and segmenting the SMS content into meaningful vocabulary units through a segmentation algorithm. Wherein, segmentation refers to division into word units (tokens), which is a sequence labeling task. For the segmentation of Latin-based sentences such as English, the segmentation can be performed by spaces. For Chinese sentences, since Chinese words are continuous, it can be implemented based on tools such as stuttering word segmentation (based on algorithms such as trie tree and Viterbi to achieve the maximum probability of word segmentation). See the following embodiment, after segmenting "200 yuan of funds were credited to a certain bank account", "such and such bank", "account", "funds", "credit", "200", "yuan" can be obtained.
[0064] importjieba jieba.lcut("200 yuan was deposited into a certain bank account")>>>['such and such bank','account','funds','deposit','200','yuan'].
[0065] Get the SMS text to be processed and preprocess it, including removing stop words, punctuation marks, numbers and special characters, and converting the text to lowercase. This helps reduce noise and simplify subsequent processing. Perform word segmentation on the preprocessed SMS text, including splitting the SMS text into words or phrases. This can be achieved by using existing word segmentation tools (such as Jieba) or custom word segmentation rules.
[0066] In some embodiments, after the SMS text data to be processed is segmented and the text is cleaned, fine-tuning can be performed by comparing the effect difference before and after. For example, the frequency of the next word, sentence length and other indicators can be counted, and visualization can be performed through tools such as word cloud. Specifically, the WordCloud and matplotlib.pyplot libraries can be imported first. Then, the SMS text data to be processed is assigned to the variable text. Next, a WordCloud object is created, and parameters such as the width, height, maximum font size, background color, and color mapping of the word cloud are set. Finally, a word cloud is generated by calling the generate() method and displayed using the imshow() function.
[0067] In some embodiments, after word segmentation, irrelevant words (e.g., stop words) may be deleted, and for English, different forms of words such as plural, voice, tense, etc. may be unified, that is, stem / word form restoration.
[0068] Specifically, stop words are words that appear frequently in the text but do not contribute much to the analysis, such as "the", "a", "an", etc. In Python, you can use the nltk library to remove these stop words.
[0069] Standardize number representation. You can replace numbers in the text with a unified symbol, such as "X", to maintain consistency during analysis.
[0070] Label encoding, which converts labels (such as whether a text message is spam) into numerical form (0 or 1), is a standard practice for machine learning models to handle classification problems.
[0071] Stemming, which reduces words to their stem or root form by removing their suffixes, helps reduce the number of different forms of a word and is often used in information retrieval or document classification.
[0072] Lemmatization, which is a more complex technique that takes into account the morphology and syntax of words to ensure that the lemmatized words are in a legal lexical form. Lexicons and grammar rules can be used.
[0073] Choose the order of processing. In some cases, lemmatization can be performed before stemming to ensure that the natural language sentence is converted into a standardized sequence of tokens.
[0074] Word segmentation processing,For English text, correct word segmentation is crucial, because incorrect segmentation will lead to errors in subsequent text processing.
[0075] Considering context, when stemming and lemmatizing, can help determine the correct form of a word more accurately.
[0076] Use professional tools and take advantage of professional natural language processing tools such as NLTK, spaCy, etc., which provide rich functions to support text preprocessing.
[0077] Evaluation and Adjustment,After preprocessing, the processing effect should be evaluated and,adjusted as needed to ensure that the preprocessing step can effectively improve the,performance of the model.
[0078] By following these steps, you can effectively clean and prepare your text data, making it more suitable for machine learning and natural language processing tasks.
[0079] In the above embodiment, noise information can be removed by cleaning preprocessing the SMS text to be processed, and non-text characters can be cleaned, stop words can be removed, and stemming can be performed by word segmentation processing of the SMS text data.
[0080] In some embodiments, considering that the digits in the SMS text may have certain meanings, the digits may be replaced with X for processing, and the labels are unified into numerical values (0 / 1) to indicate whether the SMS is spam.
[0081] In some embodiments, the method further comprises: performing part-of-speech tagging on the vocabulary unit to obtain key entities in the vocabulary unit.
[0082] Among them, in the process of part-of-speech tagging and named entity recognition, the data after word segmentation is passed to the part-of-speech tagging module, the correct part of speech is marked for each word / vocabulary, and the key entities in the text message (such as names, places, organizations, etc.) are identified in the named entity recognition module.
[0083] In the above embodiment, part-of-speech tagging is to simply analyze the components in the sentence and distinguish between nouns, verbs, adjectives and other categories. For the tasks of syntactic analysis and information extraction, texts with part-of-speech tagging will bring great convenience. Commonly used part-of-speech tagging methods include rule-based, statistical and deep learning methods. Tools such as HanLP and Jieba word segmentation have this function.
[0084] In the above embodiment, named entity recognition (NER) is a supervised series annotation task, also known as "proper name recognition". It refers to the recognition of entities with specific meanings in the text, mainly including key information such as accounts, names of counterpart institutions, time, and proper nouns. For example, the text of the SMS to be processed is "2,000 yuan was credited to account 2345 of a certain bank on November 1, 2023, and the counterparty is: certain Technology Co., Ltd." The key information that can be obtained through named entity recognition includes the name of the bank (such and such bank), the event (November 1, 2023), the event (credit), and the counterparty (such and such Technology Co., Ltd.).
[0085] In the above embodiment, by identifying some key account names and counterparty organizations through named entity recognition (NER), it is very convenient to extract "information about where someone goes and what they do", which is very convenient for completing tasks such as information extraction. In some embodiments, the model implementation of NER can be BiLSTM-CRF, Bert-CRF, etc.
[0086] Step 102: Based on the SMS text to be processed and the SMS key information, feature conversion is performed on the SMS text to be processed to obtain an SMS word vector.
[0087] It is understandable that for natural language text, computers cannot understand the meaning behind words, so before inputting the model, the first thing to do is to numerically represent the words. In some embodiments, the text in the SMS text to be processed is converted into a numerical word vector before it can be input into the model. In some embodiments, the fasttext model can be used, and its main input parameters are the input corpus after word segmentation and the dimension size of the word vector. The average of all the word vectors of the sentence is taken to generate a sentence vector for each sentence.
[0088] In some embodiments, the conversion method includes one-hot encoding and word embedding distribution method. One-hot encoding is a simple representation method, which uses a single digit to indicate whether each word appears.
[0089] Furthermore, the representation of a sentence is to accumulate the onehot of each word, which is often referred to as the bag-of-words model (bow) representation of a sentence.
[0090] ## Bag of words representation
[0091] fromsklearn.feature_extraction.textimportCountVectorizer
[0092] bow=CountVectorizer(analyzer='word',strip_accents='ascii',tokenizer=[],lowercase=True,max_features=100,)
[0093] Distributed representation of word embeddings. There are tens of thousands of words in natural language. In some embodiments, one-hot encoding has the defects of high dimensionality and no connection between words. In this case, distributed representation of word embeddings can be used to construct a low-dimensional, dense vector representation that implies the relationship between words through neural network learning. Common models such as Word2Vec, Fasttext, and Bert learn the vector representation of each word. After representation learning, similar words are relatively close in the vector space.
[0094] #Fasttextembed model
[0095] fromgensim.modelsimportFastText,word2vec model=FastText(text,size=100,sg=1,window=3,min_count=1,iter=10,min_n=3,max_n=6,word_ngrams=1,workers=12)print(model.wv['hello'])
[0096] #Word vector
[0097] model.save('. / data / fasttext100dim')
[0098] In the above embodiment, the annotated SMS text to be processed is converted into a numerical feature representation through a pre-trained word vector model to facilitate subsequent machine learning processing.
[0099] In some embodiments, the learned word representation vector can also be weighted by importance. A suitable weighting method can have a good improvement effect on the task. Commonly used weighting methods include chi-square chi2, TF-IDF, etc. TF-IDF is a statistical method, the core idea of which is to assume that the importance of a word is proportional to the proportion of its appearance in a certain article and inversely proportional to the proportion of its appearance in other articles.
[0100]
[0101] Step 103: Perform syntactic analysis based on the SMS word vector to obtain SMS sentence structure features, and perform semantic dependency analysis on the SMS word vector to obtain the relationship between SMS words.
[0102] Among them, syntactic and semantic dependency analysis are basic sentence-level tasks in traditional natural languages. Semantic dependency analysis refers to analyzing the semantic relationship between content words in a sentence structure. This relationship is a factual or logical relationship and only exists when the words enter the sentence. The purpose of semantic dependency analysis is to answer the question of "Who did what to whom when and where" in the sentence.
[0103] Analyze the relationship between words in SMS and understand how words in SMS are related to each other through natural language processing techniques such as lexical analysis, syntactic analysis, and semantic analysis. For example, dependency syntactic analysis can be used to identify the subordinate relationship between words.
[0104] For example, the text of the SMS to be processed is "200 yuan was credited to XX Bank on November 1, 2024, and the other party is XX Technology Co., Ltd.". Semantic dependency analysis can answer four questions, namely, who credited XX Bank, to whom XX Technology Co., Ltd. credited, what XX Technology Co., Ltd. did to XX Bank, and when XX Technology Co., Ltd. credited XX Bank.
[0105]
[0106] Traditional natural language processing mostly refers to the summary of natural language by linguists. Through syntactic and semantic analysis, the connection between words (subject, predicate, object, agent, patient, etc.) can be excavated for the formulation of text rules and information extraction (such as regular matching and superimposing semantic rules for knowledge extraction or feature construction). In some embodiments, you can also refer to the examples of spacy library and HIT NLP.
[0107] With the popularization of powerful sequential modeling and word embedding methods such as deep learning technology RNN / LSTM, it is possible to characterize the implicit grammatical structure of sentences and learn contextual information to a certain extent, which has gradually replaced traditional natural language processing processes such as lexical and syntactic.
[0108] The above syntactic and semantic dependency analysis performs syntactic analysis on feature data to determine sentence structure, and understands the relationship between words through semantic dependency analysis.
[0109] Step 104: Identify the SMS text to be processed to obtain valid SMS text to be processed.
[0110] In some embodiments, a similarity algorithm can be used to evaluate the degree of match between the text of the SMS to be processed and a known pattern, and then the SMS can be classified into predetermined categories through a text classification task, where the SMS category can be a valid SMS, an invalid SMS, or an SMS to be verified, or the SMS category can also be a normal SMS, a suspected fraud SMS, an emergency SMS, etc.
[0111] In some embodiments, a text classification model can also be trained to determine the type of the SMS to be processed based on the text classification model. For example, a binary classification model of fasttext embedding and lightgbm can be used, and when the categories are unbalanced, lgb cost-sensitive learning is used to solve the problem (ie, class_weight = 'balanced'). Hyperparameters can be manually configured in a simple manner, and better hyperparameters can be searched.
[0112] In some embodiments, the SMS type corresponding to the SMS text to be processed includes at least one of the following: a valid SMS type, an invalid SMS type, and an SMS type to be verified; business accounting is performed on the valid SMS type; the invalid SMS type is deleted; and a secondary verification is performed on the SMS type to be verified based on a robot learning algorithm to classify the SMS to be verified into an invalid SMS type or a valid SMS type.
[0113] In some embodiments, the screening of valid text messages may include rule screening and AI model-assisted verification.
[0114] Among them, rule-based filtering can formulate filtering rules based on information such as SMS numbers, content keywords, etc. to filter out spam or invalid messages. It can also allow users to customize filtering rules to meet the needs of different business scenarios.
[0115] Among them, AI-assisted verification can use machine learning models to conduct secondary verification of SMS messages that are suspected to be valid but difficult to determine. Deep learning models can be introduced to analyze text content to improve verification accuracy. Assuming that there are two types of SMS samples, spam (junk SMS) and ham (legitimate and legal), this is used for analysis, which is a typical binary classification problem with imbalanced categories.
[0116] In some embodiments, a similarity algorithm (sentence relationship task) can be used to screen text messages. In natural language processing tasks, we often need to determine the similarity between two documents (sentence relationship), such as the retrieval system outputs the most relevant text, and the recommendation system recommends similar articles. Commonly used methods for text similarity matching include: text edit distance, WMD, BM2.5, word vector similarity, Approximate Nearest Neighbor, and some supervised (neural network) models to determine the similarity between texts.
[0117] Among them, text classification is a classic NLP task, which is to match text series to predicted categories. One is to input a sequence and output the category of the entire sequence, such as short messages, microblog classification, intent recognition, etc. The other is to input a sequence and output the category of each position in the sequence. The series annotation mentioned above can be regarded as a classification task at word granularity, such as entity naming recognition.
[0118] The mainstream is to use pre-training and end-to-end learning of (neural network) classification models for classification tasks. Deep learning learns the expression of features and then performs classification, which greatly reduces artificial features. However, based on experience in actual projects, for some difficult tasks (tasks with high noise), it is still necessary to add some artificial feature engineering.
[0119] Among them, text generation is the prediction task of generating sequences from categories or from sequences to sequences. According to different input divisions, automatic text generation can include text-to-text generation, meaning-to-text generation, data-to-text generation, and image-to-text generation. Specific applications include machine translation, text summary understanding, reading comprehension, casual conversation, writing, and picture description. Commonly used models include RNN, CNN, seq2seq, and Transformer.
[0120] Step 105, performing business accounting based on the valid SMS text to be processed and the corresponding SMS key information and the relationship between SMS words.
[0121] In some embodiments, automatic business verification is performed based on the effective SMS to be processed obtained through screening. The information required for automatic business verification is obtained based on the obtained SMS key information and the relationship between SMS words. For example, the relevant account can be matched according to the account information obtained by parsing the SMS, as well as the latest record corresponding to the relevant account, and the income and balance comparison is performed based on the obtained record data. If the comparison is consistent, the income record is directly generated. If the comparison is inconsistent, the information obtained by parsing this SMS shall prevail, and this record shall be marked for subsequent secondary verification (for example, relevant personnel may be notified for verification).
[0122] In some embodiments, it can also include automatic duplication check of SMS messages, and can mark duplicate SMS messages based on the system for secondary verification. It can also provide report export function and support multiple formats (such as Excel, PDF, etc.).
[0123] Business logic processing implements specific business logic based on the extracted key information and the relationship between words. For example, if the name and purchase quantity of a specific product are mentioned in the text message, this information can be checked with the inventory management system to confirm whether the stock is sufficient. In addition, corresponding replies or notifications can be generated based on the content of the text message.
[0124] Business accounting: Perform corresponding business accounting based on the results of business logic processing, for example, calculating order totals, updating inventory information, generating financial statements, etc.
[0125] Feedback: Feedback the results of business accounting to users or other systems in an appropriate form. This can be achieved through text messages, emails or other communication methods.
[0126] In a specific embodiment, using a trained text classification model to classify the SMS text to be processed includes the following steps:
[0127] 1) Data preprocessing: You need to ensure that the format of the new SMS (the SMS text to be processed) is consistent with the input format of the SMS content used during model training. This step includes performing the same preprocessing steps such as text cleaning, word segmentation, and stop word removal. In some cases, you may also need to perform stemming, word form restoration, and n-gram construction on the text.
[0128] 2) Feature conversion: In some embodiments, the model can be trained on the basis of fasttext word vectors, so it is also necessary to convert the preprocessed SMS text into the corresponding fasttext word vectors. This usually involves mapping each word or n-gram to their fasttext word vector representation, and may perform some additional feature engineering, such as concatenation, averaging, or applying other transformations.
[0129] 3) Model input: Input the converted features into the LightGBM model. For a binary classification problem, the model will output a probability value between 0 and 1, representing the probability that the text message belongs to the positive class.
[0130] 4) Category determination: Based on the probability value output by the model, we need to set a threshold to determine the category of the SMS. For example, SMS with a probability value greater than 0.5 can be classified as positive (such as spam SMS), while SMS with a probability value less than or equal to 0.5 can be classified as negative (such as normal SMS).
[0131] 5) Application of results: The classification results can be used for a variety of purposes. For example, if a text message is classified as spam, the system can automatically move it to the spam bin, prevent it from notifying the user, or continue with the next step of analysis.
[0132] Regarding processing of different categories of SMS texts, including:
[0133] Once the SMS is categorized, different actions can be taken on it:
[0134] Spam: These can be filtered out and not displayed to the user, or marked as read and may be recorded in a spam database to improve the classification algorithm in the future.
[0135] Normal or Important SMS: These messages should notify the user promptly and, depending on the content, may require further action such as replying or forwarding.
[0136] In order to improve the practicality of the model, the following points are also designed:
[0137] Performance monitoring: Regularly monitor the performance of the model to ensure that the classification accuracy meets expectations. If the model performance deteriorates, retraining or adjustment may be required.
[0138] Feedback Mechanism: Implement a user feedback system to allow users to mark misclassified SMS messages, which will help improve the model.
[0139] Model iteration: As new data accumulates, the model is retrained regularly to adapt to new patterns and trends.
[0140] The model is continuously optimized through performance monitoring, user feedback, and model iteration to improve classification results and user experience.
[0141] Model evaluation: The training set and test set are divided according to a certain index, and the AUC, F1score and other indicators of the distribution verification training set and test set are used to judge the performance of the model and decide whether the model can be used.
[0142] Result output and feedback learning: The final classification result is output to the user or system for corresponding operation. At the same time, the feedback from the user or system is used to continuously optimize and adjust the model parameters to improve the accuracy of the system.
[0143] Through the above steps, our system can efficiently process SMS content and demonstrate excellent performance in practical applications. This integration solution not only improves the processing speed and accuracy, but also enhances the adaptability and scalability of the system. Therefore, in this application, by designing this SMS processing system, a more complex and intelligent SMS content processing system can be realized.
[0144] In some embodiments, the method further includes: after obtaining the SMS text to be processed, performing an integrity analysis on the SMS text to be processed; in response to the SMS text to be processed being a complete text, parsing the complete SMS text to be processed to obtain SMS key information; in response to the SMS text to be processed being an incomplete text, obtaining context SMS text associated with the SMS text to be processed, and parsing the complete text composed of the SMS text to be processed and the associated context SMS text to obtain SMS key information.
[0145] In the above embodiment, taking into account the particularity of the SMS scenario, SMS messages with a length greater than a certain value (divided into multiple SMS contents) are merged and processed, so that data analysis can be performed on the complete SMS messages to prevent inaccurate SMS content obtained through analysis due to missing SMS content.
[0146] In some embodiments, the obtaining of contextual SMS text associated with the SMS text to be processed includes: performing integrity analysis on the SMS text to be processed based on a pre-trained large model.
[0147] For the special case where a message is split and sent multiple times, the system will determine the integrity of the message after receiving it. The system determines the integrity of the message in the following ways:
[0148] In some embodiments, the length of the SMS message may be checked to see whether the received SMS message exceeds the maximum length according to the SMS protocol or the prescribed SMS length limit. If the maximum length is exceeded, the SMS message may be truncated or damaged.
[0149] In some embodiments, the SMS format may be checked to see if the SMS conforms to the correct format according to the SMS protocol or specified format requirements, for example, to see if there are necessary separators, whether the field order is correct, etc.
[0150] In some embodiments, the text message content may be checked: the text message content may be parsed and verified to ensure that it contains necessary information and that there are no errors or anomalies. For example, the text message may be checked to see if it contains a valid phone number, date and time, text content, etc.
[0151] In some embodiments, a checksum may be used, and some SMS protocols or systems may use a checksum to verify the integrity of the SMS. By calculating and comparing the checksum, it can be determined whether the SMS is complete and has not been tampered with.
[0152] In some embodiments, the sender can be confirmed, and if there is doubt or uncertainty, the sender can be communicated and confirmed. They can provide more information or explanation about the integrity of the text message.
[0153] In some embodiments, logs and alarms can be recorded, and received SMS messages can be recorded in the system, and an alarm mechanism can be triggered when integrity problems are found. In this way, SMS integrity problems can be discovered and handled in a timely manner.
[0154] In some embodiments, the matching process can also be combined with the AI big model, and after the match is successful, the analysis is performed according to the normal analysis process. If the automatic matching fails, the matching can be performed manually.
[0155] In some embodiments, a method for receiving SMS text includes at least two communication cards; the SMS texts in each communication card are queued based on the contextual association relationship between the SMS texts; the SMS texts are processed in parallel between different communication cards, and based on a thread pool or an asynchronous processing framework, the SMS texts of multiple communication cards are received and processed in parallel; the method also includes processing the received SMS text to be processed based on the method described in any of the above embodiments.
[0156] In some embodiments, the SMS in each communication card is queued based on the context association relationship, and multiple SMS belonging to the same complete SMS content are queued and sent and received in sequence. In this way, the associated SMS can be sent in sequence, and the SMS information received at the receiving end has more content relevance, which prevents the associated SMS content from being sent in a scattered manner, resulting in missing content when the SMS content is finally parsed, causing the SMS information to fail to be obtained.
[0157] In some embodiments, the SMS in each communication card is queued based on the time sequence, and multiple SMS are queued and sent and received in sequence based on the time sequence. In this way, considering that the time interval between multiple SMS belonging to the same complete SMS is the shortest (even simultaneous), multiple SMS can be queued based on the time sequence. In other embodiments, the correlation between different SMS can also be determined in combination with the large model, and the SMS with greater correlation can be sent in sequence.
[0158] The short messages in each communication card are queued based on the priority order, and multiple short messages are queued and sent and received in sequence based on the priority order. The priority order can be determined based on the correlation relationship, time relationship, etc. between different short messages.
[0159] In a specific embodiment, when receiving text messages, a queuing mechanism for the same communication card can be designed with a message queue-based receiving system to ensure that text messages with the same card number are queued in chronological order or priority order. For example, a priority queue algorithm is introduced to give priority to text messages with specific card numbers, specific tags or contents. For example, a queuing waiting mechanism is implemented to avoid data conflicts when processing text messages with the same card number concurrently. For example, in the special case where the content of a text message is split and sent multiple times, the system determines the integrity of the text message after receiving it, combines the AI large model for matching processing, and then parses it according to the normal parsing process after the match is successful. If the automatic match fails, it can be matched manually.
[0160] In some embodiments, the parallel reception and processing of multiple communication card text messages based on a thread pool or an asynchronous processing framework includes: dynamically adjusting the thread pool size or the number of asynchronous tasks based on system load and text message processing speed.
[0161] In some embodiments, different communication cards can be processed in parallel. A thread pool or asynchronous processing framework can be used to achieve parallel reception and processing of multiple card text messages. The thread pool size or the number of asynchronous tasks can be dynamically adjusted according to the system load and text message processing speed.
[0162] In some embodiments, the step of dynamically adjusting the size of the thread pool or the number of asynchronous tasks includes:
[0163] Real-time monitoring of load indicators. Specifically, the system load can be monitored in real time. For example, load detection methods include indicators based on CPU usage, memory usage, queue length, etc.
[0164] Set adjustment thresholds to determine when to increase or decrease the thread pool size. For example, when the number of tasks backlogged in the queue exceeds a certain preset value, increase the number of threads; conversely, when the number of tasks decreases below another preset value, reduce the number of threads.
[0165] Choose the right time to make adjustments to avoid wasting system resources due to frequent adjustments, but also avoid making adjustments too slowly to affect performance.
[0166] Consider the task type. For I / O-intensive tasks, appropriately increasing the number of threads can improve concurrent processing capabilities. For compute-intensive tasks, too many threads may lead to performance degradation.
[0167] Use adaptive algorithms based on historical data and machine learning techniques to predict future load changes and adjust the thread pool size in advance.
[0168] Logging and analysis: monitor the key parameters of the thread pool in real time and record this information in the log for subsequent analysis and optimization.
[0169] Using tool classes, programming languages such as Java provide a wealth of concurrent tool classes that can help achieve dynamic expansion of the thread pool.
[0170] Initial size setting,When setting the initial size of the thread pool, a reasonable estimate should be made based on the needs of the actual application.
[0171] Respond to changes flexibly and dynamically adjust the size of the thread pool according to the number and type of current tasks (such as the proportion of priority tasks) to improve the efficiency and responsiveness of the thread pool.
[0172] Testing and Verification: After implementing the dynamic adjustment strategy, sufficient testing should be carried out to ensure the effectiveness of the strategy and adjustments should be made based on actual operating conditions.
[0173] Document strategies and document dynamic adjustment strategies to ensure that team members understand and can implement them correctly.
[0174] Contingency plans: Prepare contingency plans for possible abnormal situations, such as emergency measures when the system crashes due to too many threads.
[0175] In some embodiments, the method further includes: determining a target communication card based on the operator of each communication card and the number of text messages sent and received, and sending the text message based on the target communication card.
[0176] When sending text messages, the operators of different communication cards, the number of text messages sent and received, etc. will be taken into consideration to forward the text messages in the best and most economical way.
[0177] When sending SMS, the optimal SMS sending strategy is determined based on the SMS charging standards of each operator and the maximum number of SMS messages sent in a month. For example, among the communication cards that have not reached the specified number of messages, the communication card with the lowest fee is given priority. If the fees are the same, the operator is determined based on the card number, and the same region and the same operator channel are given priority for sending.
[0178] In some embodiments, the SMS may be automatically split and sent according to its length, and sent in sequence according to the priority of the message queue.
[0179] In a specific embodiment, the SMS message processing method provided by the present application includes obtaining the SMS text to be processed, preprocessing the SMS text to be processed, including removing stop words, punctuation marks, numbers and special characters, and converting the text to lowercase. This helps to reduce noise and simplify subsequent processing.
[0180] The pre-processed SMS text is segmented, including splitting the SMS text into words or phrases. This can be achieved by using an existing segmentation tool (such as Jieba) or custom segmentation rules.
[0181] Extract key information and identify key information in SMS according to business needs, such as phone number, address, amount, etc. This can be achieved through regular expressions, keyword matching or natural language processing technology (such as named entity recognition).
[0182] Analyze the relationship between words in SMS and understand how words in SMS are related to each other through natural language processing techniques such as lexical analysis, syntactic analysis, and semantic analysis. For example, dependency syntactic analysis can be used to identify the subordinate relationship between words.
[0183] Business logic processing implements specific business logic based on the extracted key information and the relationship between words. For example, if the name and purchase quantity of a specific product are mentioned in the text message, this information can be checked with the inventory management system to confirm whether the stock is sufficient. In addition, corresponding replies or notifications can be generated based on the content of the text message.
[0184] Business accounting: Perform corresponding business accounting based on the results of business logic processing, for example, calculating order totals, updating inventory information, generating financial statements, etc.
[0185] Feedback: Feedback the results of business accounting to users or other systems in an appropriate form. This can be achieved through text messages, emails or other communication methods.
[0186] It should be understood that, although the steps in the drawings are shown in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the drawings may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0187] In one embodiment, Figure 3As shown, a text message processing device 300 is provided. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes:
[0188] The acquisition module 310 is used to acquire the SMS text to be processed, and parse the SMS text to be processed to obtain the SMS key information;
[0189] A conversion module 320, configured to perform feature conversion on the to-be-processed SMS text to obtain an SMS word vector based on the to-be-processed SMS text and the SMS key information;
[0190] An analysis module 330 is used to perform syntactic analysis based on the SMS word vector to obtain SMS sentence structure features, and perform semantic dependency analysis on the SMS word vector to obtain the relationship between SMS words;
[0191] An identification module 340 is used to identify the SMS text to be processed to obtain a valid SMS text to be processed;
[0192] The accounting module 350 is used to perform business accounting based on the valid SMS text to be processed and the corresponding SMS key information and the relationship between SMS words.
[0193] For the specific definition of the SMS text processing device, please refer to the definition of the SMS text processing method above, which will not be repeated here. Each module in the above SMS text processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0194] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store SMS related data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing SMS text or a method for receiving SMS text is implemented.
[0195] Those skilled in the art will understand that Figure 4The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0196] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0197] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0198] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0199] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0200] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for processing short message text, characterized in that: The method comprises: Obtaining a text message to be processed, and parsing the text message to be processed to obtain key information of the text message; Based on the SMS text to be processed and the SMS key information, feature conversion is performed on the SMS text to be processed to obtain an SMS word vector; Performing syntactic analysis based on the SMS word vector to obtain SMS sentence structure features, and performing semantic dependency analysis on the SMS word vector to obtain the relationship between SMS words; Identifying the SMS text to be processed to obtain a valid SMS text to be processed; Business accounting is performed based on the valid SMS text to be processed, the corresponding SMS key information, and the relationship between SMS words.
2. The method according to claim 1, characterized in that The step of parsing the SMS text to be processed to obtain SMS key information includes: Performing corpus cleaning on the SMS text to be processed to obtain a cleaned SMS text to be processed; Segmenting the cleaned SMS text to be processed to obtain vocabulary units; Part-of-speech tagging is performed on the vocabulary unit to obtain key entities in the vocabulary unit.
3. The method according to claim 1, characterized in that The SMS type corresponding to the SMS text to be processed includes at least one of the following: a valid SMS type, an invalid SMS type, and a SMS type to be verified; Performing business accounting for the valid SMS types; Deleting the invalid SMS type; A secondary check is performed on the type of the SMS to be verified based on a robot learning algorithm to classify the SMS to be verified into an invalid SMS type or a valid SMS type.
4. The method according to claim 1, characterized in that: The step of identifying the SMS text to be processed to obtain a valid SMS text to be processed includes: Determine the degree of match between the text of the short message to be processed and the known pattern based on a similarity algorithm, and determine the category of the short message to be processed based on the matching result; or, The category of the SMS text to be processed is determined based on a pre-trained text classification model.
5. The method according to claim 1, characterized in that: The method further comprises: After obtaining the SMS text to be processed, performing integrity analysis on the SMS text to be processed; In response to the to-be-processed SMS text being a complete text, parsing the complete to-be-processed SMS text to obtain SMS key information; In response to the to-be-processed SMS text being an incomplete text, a context SMS text associated with the to-be-processed SMS text is obtained, and a complete text consisting of the to-be-processed SMS text and the associated context SMS text is parsed to obtain SMS key information.
6. The method according to claim 5, characterized in that The acquiring of the context SMS text associated with the SMS text to be processed includes: Perform integrity analysis on the SMS text to be processed based on the pre-trained large model.
7. A method for receiving short message text, characterized in that: The method includes at least two communication cards; The SMS in each communication card are queued based on the contextual association between the SMS; Different communication cards process SMS texts in parallel, and receive and process SMS from multiple communication cards in parallel based on thread pool or asynchronous processing framework; The method further comprises processing the received SMS text to be processed based on the method described in any one of claims 1 to 6.
8. The method according to claim 7, characterized in that The SMS in each communication card is queued based on the contextual relationship, and multiple SMS messages belonging to the same complete SMS content are queued and sent and received in sequence, or, The SMS messages in each communication card are queued based on time sequence, and multiple SMS messages are queued and sent and received in sequence based on time sequence, or The text messages in each communication card are queued based on the priority order, and multiple text messages are queued in turn for sending and receiving based on the priority order.
9. The method according to claim 7, characterized in that: The parallel reception and processing of multiple communication card text messages based on the thread pool or asynchronous processing framework includes: Dynamically adjust the thread pool size or the number of asynchronous tasks based on system load and SMS processing speed.
10. The method according to any one of claims 7 to 9, characterized in that The method further comprises: The target communication card is determined based on the operator of each communication card, the number of sent and received text messages, and the location information, and the text message is sent based on the target communication card.
Citation Information
Patent Citations
Long-short message transmission method of CDMA network
CN101001413A
Bill generation method and device, electronic equipment and medium
CN109598575A
Method and device for auditing short message text based on distributed high concurrency condition
CN111628859A
Text classification method and device and electronic equipment
CN112463968A
Full-automatic bookkeeping process pop-up window processing method, device and system
CN114117050A
Cited By
Large-model-based intelligent overall planning and distribution method for iron and steel industry
CN119558597A
Intelligent overall allocation method based on large model for steel industry
CN119558597B
Real-time processing method based on voice short message
CN120877718A
