Short message processing method, device, equipment, medium and product
By verifying user permissions for SMS instructions, generating SMS content and deducting fees, the problem of traditional SMS platforms being unable to parse civil aviation SMS instructions and being unable to perform separate statistics and billing for airline agents is solved, and the adaptability and cost control effect of SMS services are improved.
Patent Information
- Application Number
- CN202411910596.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-23
AI Technical Summary
Traditional SMS platforms cannot parse civil aviation SMS instructions, and cannot conduct separate statistics and bill airline agents, resulting in low adaptability of SMS services.
User permission verification is performed by obtaining SMS instructions, SMS content is generated, and the user account is deducted after the content is sent to the operator gateway. The method includes preprocessing and grouping of SMS instructions, selecting appropriate SMS templates, and performing differentiated deductions based on user type and SMS usage frequency.
It realizes the analysis and adaptation of civil aviation SMS instructions, improves the adaptability of SMS services, and provides users with more reasonable cost control through a flexible deduction mechanism.
Smart Images

Figure CN119767259A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a text message processing method, device, equipment, medium and product. Background Art
[0002] At present, the real-time update of key information such as flight status and passenger lists has become the focus of passengers. Passengers expect to receive instant push of this information through the most convenient way, such as SMS service. Therefore, SMS service has become an irreplaceable and important part of the aviation information service field.
[0003] However, traditional SMS platforms are unable to parse civil aviation SMS instructions, and are unable to perform separate statistical billing for aviation information agents, resulting in low adaptability of SMS services. Summary of the invention
[0004] The present invention provides a short message processing method, device, equipment, medium and product, which can solve the technical problem of low adaptability of short message services existing in the prior art.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] In a first aspect, an embodiment of the present invention provides a method for processing a text message, the method comprising:
[0007] Verify user permissions based on the SMS instructions obtained;
[0008] When the user authority verification is passed, the SMS content is generated based on the SMS instruction;
[0009] After the generated SMS content is determined to be sent to the operator gateway, the user account is deducted based on the user information corresponding to the SMS instruction.
[0010] Optionally, the user authority verification based on the acquired SMS instruction includes:
[0011] Preprocessing and grouping the acquired SMS instructions to obtain multiple groups of preprocessed sub-SMS instructions;
[0012] The user authority is verified based on the preset group name and the plurality of groups of pre-processed sub-SMS instructions.
[0013] Optionally, the step of preprocessing and grouping the acquired SMS instructions to obtain multiple groups of preprocessed sub-SMS instructions includes:
[0014] Convert the host Chinese code of the SMS command into the national standard code, and delete the special characters in the SMS command to obtain the pre-processed SMS command;
[0015] Based on the information types contained in the preprocessed SMS instructions, the preprocessed SMS instructions are grouped to obtain multiple groups of preprocessed sub-SMS instructions;
[0016] The SMS instruction includes: passenger order record information, passenger identity information, flight information, mobile phone number information to be sent and flight change information.
[0017] Optionally, the step of verifying user authority based on the preset group name and the multiple groups of pre-processed sub-SMS instructions includes:
[0018] Determine a target sub-sms instruction from a plurality of groups of pre-processed sub-sms instructions based on a preset group name;
[0019] Verify whether the user type corresponding to the target sub-SMS instruction is a free user, a postpaid user or a prepaid user, and whether the number of free SMS messages or the balance of the prepaid user is greater than zero;
[0020] If so, it is determined that the user authority verification is passed.
[0021] Optionally, the step of generating SMS content based on the SMS instruction includes:
[0022] Determining a first SMS template according to whether the SMS instruction contains flight change information;
[0023] Determining a second SMS template according to the flight information included in the SMS instruction;
[0024] Determining a third SMS template according to the passenger order record information contained in the SMS instruction;
[0025] Fill in the first SMS template, the second SMS template and the third SMS template to generate SMS content.
[0026] Optionally, determining the first SMS template according to whether the SMS instruction contains flight change information includes:
[0027] Determining whether the flight is changed according to whether the SMS instruction contains flight change information;
[0028] If the flight is changed, the flight change SMS template is determined to be the first SMS template;
[0029] If the flight has not been changed, the normal flight SMS template is determined as the first SMS template.
[0030] Optionally, determining the second SMS template according to the flight information included in the SMS instruction includes:
[0031] Determine whether the flight is a multi-segment flight according to the flight information contained in the SMS instruction;
[0032] If it is a multi-segment flight, the multi-segment flight sub-template is determined as the second SMS template;
[0033] If it is not a multi-segment flight, the single-segment flight sub-template is determined as the second SMS template.
[0034] Optionally, determining the third SMS template according to the passenger order record information included in the SMS instruction includes:
[0035] Determine whether it is necessary to send the weather information according to the passenger order record information contained in the SMS instruction;
[0036] If weather needs to be sent, query the weather data and determine that the weather sub-template is the third SMS template;
[0037] If weather information does not need to be sent, the third SMS template is empty.
[0038] Optionally, after the generated SMS content is determined to be sent to the operator gateway, before the user account is deducted based on the user information corresponding to the SMS instruction, the method includes:
[0039] Check whether the generated SMS content is successfully sent to the operator gateway;
[0040] When the operator returns a successful delivery result, the generated SMS content is sent to the operator gateway;
[0041] When the sending result returned by the operator is sending timeout, it is determined that the generated SMS content has failed to be sent.
[0042] Optionally, the step of deducting fees from a user account based on the user information corresponding to the SMS instruction includes:
[0043] When it is determined that the user type is not a free user based on the user information corresponding to the SMS instruction, detecting whether the number of free SMS messages in the user account is zero;
[0044] If it is not zero, detecting whether the character length of the sent SMS content exceeds a first preset number of characters;
[0045] If the number of characters does not exceed the first preset number, the number of free SMS messages in the user account is reduced by one;
[0046] If the number of characters exceeds the first preset number, a second preset number of characters is used as one text message to send, and the total number of text messages sent is counted, wherein the first preset number is greater than the second preset number;
[0047] Compare the total number of SMS messages sent with the number of SMS gifts;
[0048] If the total number of text messages sent is greater than the number of free text messages, the difference between the total number of text messages sent and the number of free text messages is calculated, and the user account is charged according to the difference and the cost of a single text message;
[0049] If the total number of SMS messages sent is less than or equal to the number of free SMS messages, the number of free SMS messages in the user account will be subtracted from the total number of SMS messages sent.
[0050] In a second aspect, an embodiment of the present invention provides a short message processing device, the device comprising:
[0051] The permission verification module is configured to verify the user's permission based on the obtained SMS instruction;
[0052] The SMS generation module is configured to generate SMS content based on the SMS instruction when the user authority verification is passed;
[0053] The information deduction module is configured to deduct fees from the user account based on the user information corresponding to the SMS instruction after the generated SMS content is determined to be sent to the operator gateway.
[0054] Optionally, the authority verification module is configured to:
[0055] Preprocessing and grouping the acquired SMS instructions to obtain multiple groups of preprocessed sub-SMS instructions;
[0056] The user authority is verified based on the preset group name and the plurality of groups of pre-processed sub-SMS instructions.
[0057] Optionally, the SMS generation module is configured to:
[0058] Determining a first SMS template according to whether the SMS instruction contains flight change information;
[0059] Determining a second SMS template according to the flight information included in the SMS instruction;
[0060] Determining a third SMS template according to the passenger order record information contained in the SMS instruction;
[0061] Fill in the first SMS template, the second SMS template and the third SMS template to generate SMS content.
[0062] Optionally, the information fee deduction module is configured to:
[0063] When it is determined that the user type is not a free user based on the user information corresponding to the SMS instruction, detecting whether the number of free SMS messages in the user account is zero;
[0064] If it is not zero, detecting whether the character length of the sent SMS content exceeds a first preset number of characters;
[0065] If the number of characters does not exceed the first preset number, the number of free SMS messages in the user account is reduced by one;
[0066] If the number of characters exceeds the first preset number, a second preset number of characters is used as one text message to send, and the total number of text messages sent is counted, wherein the first preset number is greater than the second preset number;
[0067] Compare the total number of SMS messages sent with the number of SMS gifts;
[0068] If the total number of text messages sent is greater than the number of free text messages, the difference between the total number of text messages sent and the number of free text messages is calculated, and the user account is charged according to the difference and the cost of a single text message;
[0069] If the total number of SMS messages sent is less than or equal to the number of free SMS messages, the number of free SMS messages in the user account will be subtracted from the total number of SMS messages sent.
[0070] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor; the processor is used to read and execute a computer program stored in the memory to implement the steps of the aforementioned text message processing method.
[0071] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions, when executed, implement the steps of the aforementioned method for processing short messages.
[0072] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the aforementioned text message processing method.
[0073] The beneficial effects brought by the technical solution provided by the embodiment of the present invention include:
[0074] Perform user authority verification based on the obtained SMS command; when the user authority verification is passed, generate SMS content based on the SMS command, that is, generate customized reminder SMS content for various flights according to the SMS command sent by the user, which not only ensures that passengers can receive accurate flight information, but also meets passengers' specific needs for services such as flight reminders;
[0075] After the generated SMS content is determined to be sent to the operator gateway, the user account is deducted based on the user information corresponding to the SMS instruction, thereby providing differentiated deduction services for upstream users based on user type, SMS usage frequency and possible gifting rules. This not only increases the flexibility of billing, but also brings more reasonable cost control to users.
[0076] The present invention improves the adaptability of SMS services, and solves the technical problem in the related art that the SMS instructions of civil aviation cannot be parsed, and separate statistics and billing cannot be performed on aviation information agents, resulting in low adaptability of SMS services. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0078] Figure 1 A schematic diagram of the system composition of the short message processing method of the present invention;
[0079] Figure 2 A schematic diagram of a flow chart of an embodiment of a method for processing short messages of the present invention;
[0080] Figure 3 for Figure 2 Detailed flow chart of step S20;
[0081] Figure 4 for Figure 2 Detailed flow chart of step S30;
[0082] Figure 5 This is a schematic diagram of the functional modules of an embodiment of a short message processing device of the present invention;
[0083] Figure 6 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0084] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0086] In a first aspect, an embodiment of the present invention provides a method for processing short messages.
[0087] Reference Figure 1 , Figure 1 Schematic diagram of the system composition of the SMS processing method of the present invention. Figure 1 As shown, the SMS instruction sent by the SMS instruction sender is received, and then the user authority is verified. After the verification is passed, the SMS content is generated based on the SMS instruction, and the generated SMS content is sent to the operator gateway. After the generated SMS content is sent, regardless of whether the SMS content is sent successfully, the SMS content will be stored, but only the SMS content that is sent successfully will be charged. Among them, the SMS instruction sender is a user of the civil aviation black screen system, who sends SMS through the black screen instruction, and is generally a channel sales agent.
[0088] In one embodiment, referring to Figure 2 , Figure 2 FIG. 1 is a flow chart of an embodiment of a method for processing short messages of the present invention. Figure 2 As shown, the SMS processing method includes:
[0089] Step S10, performing user authority verification based on the acquired SMS instruction;
[0090] In some specific embodiments, step S10 includes:
[0091] Step S101, preprocessing and grouping the acquired SMS instructions to obtain multiple groups of preprocessed sub-SMS instructions;
[0092] In some specific embodiments, step S101 includes:
[0093] Convert the host Chinese code of the SMS command into the national standard code, and delete the special characters in the SMS command to obtain the pre-processed SMS command;
[0094] Based on the information types contained in the preprocessed SMS instructions, the preprocessed SMS instructions are grouped to obtain multiple groups of preprocessed sub-SMS instructions;
[0095] The SMS instruction includes: passenger order record information, passenger identity information, flight information, mobile phone number information to be sent and flight change information.
[0096] In this embodiment, the SMS instruction sent by the user is obtained, wherein the SMS instruction includes: passenger order record information (PNR information), passenger identity information (NAD information), flight information (TVL information), mobile phone number information to be sent (SMS information) and flight change information (OPT information).
[0097] The host Chinese code (USAS) of the acquired SMS command is converted into the national standard code (GB18030-2022), and special characters in the SMS command, such as the character "\r", are deleted to obtain the preprocessed SMS command, so as to group the preprocessed SMS command.
[0098] Specifically, based on the information type contained in the pre-processed SMS instructions, when the pre-processed SMS instructions are grouped, the content type of the group is determined by the group name. The content types corresponding to each group name are as follows:
[0099] PNR: stores the order number date and booking account information;
[0100] NAD: stores the passenger information of the order, and there can be multiple NADs;
[0101] TVL: Flight information, including flight date, flight number, departure and arrival dates, and flight status;
[0102] SMS: user mobile phone number information to be sent;
[0103] OPT: Flight change information.
[0104] The SMS instruction is based on EDI (standard format for electronic data interchange) format data. For example, the SMS instruction is shown in Table 1.
[0105] Table 1
[0106]
[0107]
[0108] As shown in Table 1, UNH represents the beginning of the SMS command. After the preprocessed SMS commands are grouped, multiple groups of preprocessed sub-SMS commands are obtained, including passenger order record information (PNR information), passenger identity information (NAD information), flight information (TVL information), mobile phone number information to be sent (SMS information) and flight change information (OPT information).
[0109] Among them, the passenger order record information (PNR information) is:
[0110] "PNR+MZQ5P+WNZ120+040701++++N" means: no need to send weather information, the PNR number is MZQ5P, the responsible group office is WNZ120, and the creation date is July 1, 2004. It should be noted that if the passenger order record information contains the need to send weather information, the passenger order record information (PNR information) is: "PNR+MZQ5P+WNZ120+040701++++Y".
[0111] The passenger identity information (NAD information) is "NAD+1+ZHANGSAN Zhang San CHD / ", which means: the number of passengers is 1, the passenger's English name is ZHANGSAN, the passenger's Chinese name is Zhang San. It should be noted that the CHD suffix is directly deleted. If there are multiple passengers, the passenger names are separated by commas.
[0112] The flight information (TVL information) is as follows:
[0113] "TVL+WNZ+CAN+CZ+3528++040701+2045+040701+2230+Y+HK+1++++Y+N+N+N+N+N", which means: the departure airport code is WNZ, the arrival airport code is CAN, the airline code is CZ, the flight number is 3528, the flight number suffix is none, the departure date is 040701, the departure time is 2045, the arrival date is 040701, the arrival time is 2230, the cabin class is Y, the status code is HK, the number of seats is 1, the modification flag is Y, the irregular flight flag is N, the ASR reserved seat flag is N, the code sharing flag is N, the arrival situation unknown flag is N, and the OPEN segment flag is N.
[0114] The mobile phone number information to be sent (SMS information) is "SMS+19999999999+1+D", which means: the mobile phone number is 19999999999, the passenger sequence is 1, and the SMS template language sending type is D, so the SMS template language is sent in Chinese. It should be noted that if the SMS template language sending type is I, the SMS template language is converted to be sent in English. If the passenger sequence is 0, then this user is the leader of the group passenger, and the list of the group needs to be sent to this user separately.
[0115] The flight change information (OPT information) is "OPT+SCH", which means: this SMS instruction is a flight change SMS instruction. If this group does not appear, it is a normal flight SMS instruction.
[0116] Furthermore, Table 1 also includes: ticket issuing information (TKT information), contact information (CTC information), and agent information (CTA information).
[0117] Among them, the ticket issuing information (TKT information) is "TKT+TL+040701+1745", which means: the ticket issuing type is TL, the ticket issuing time limit date is July 1, 2004, and the ticket issuing time limit is 17:45.
[0118] The contact information (CTC information) is "CTC+19999999999", which means the user's mobile phone number is 19999999999.
[0119] The agent information (CTA information) is “CTA+WNZ+T WNZ120 / T 023-1111111 / XXX XXX XXXX AIRBOOKING OFFICE / XX XXX XXX”, which means: agent’s contact information, location is “WNZ”, agent’s office number is WNZ120, contact number is 023-1111111, agent’s branch name is “XXX XXX XXXX AIRBOOKING OFFICE”, and agent’s name is “XX XXX XXX”.
[0120] Step S102: verifying the user authority based on the preset group name and the plurality of groups of pre-processed sub-SMS instructions.
[0121] In some specific embodiments, step S102 includes:
[0122] Determine a target sub-sms instruction from a plurality of groups of pre-processed sub-sms instructions based on a preset group name;
[0123] Verify whether the user type corresponding to the target sub-SMS instruction is a free user, a postpaid user or a prepaid user, and whether the number of free SMS messages or the balance of the prepaid user is greater than zero;
[0124] If so, it is determined that the user authority verification is passed.
[0125] In this embodiment, the preset group name is PNR, and the target sub-SMS instruction is matched with the group name that is the same as the preset group name PNR from multiple groups of pre-processed sub-SMS instructions, that is, the target sub-SMS instruction is determined to be the passenger order record information (PNR information). According to the PNR number and the responsible group office number in the passenger order record information (PNR information), the user type saved in the database is queried by the system, and based on the user type, it is determined whether the user has the authority to send SMS content, that is, whether the user type is a free user, a postpaid user or a prepaid user, and the number of free SMS messages or the balance of the prepaid user is greater than zero. If so, it is determined that the user has the authority to send SMS content, that is, the user authority verification is passed; otherwise, it is determined that the user authority verification is not passed, that is, the user does not have the authority to send SMS content, and the SMS content of the user is not sent.
[0126] Step S20, when the user authority verification is passed, generating SMS content based on the SMS instruction;
[0127] In this embodiment, in order to achieve the flexibility and scalability of SMS service and reduce the coupling between different SMS types, a templated design method is used to generate SMS content. The SMS generation system is based on SMS templates and is divided into two types: top-level templates and sub-templates. This design can flexibly select and combine SMS templates according to different SMS instruction attributes. The top-level template includes: group member SMS template, flight change SMS template and normal flight SMS template. The sub-template is used to fill in the specific content of the top-level template, and the sub-template includes: flight sub-template and weather sub-template. Among them, the flight sub-template is divided into two types to meet different needs, specifically multi-segment flight sub-template and single-segment flight sub-template. The multi-segment flight sub-template is suitable for complex itineraries containing multiple segments, and the single-segment flight sub-template is suitable for simple itineraries with a single segment; the weather sub-template is used to enhance the practicality of the SMS content. Each SMS template supports both Chinese and English to meet the language preferences of different users. In the process of SMS content generation, the system will select the most suitable SMS template for content filling according to the parameters and attributes of the SMS instruction. Through this templated design, the SMS generation system not only improves the efficiency of development and maintenance, but also ensures the diversity and personalization of SMS content, meeting the needs of different users.
[0128] Specifically, when the user authority verification is passed, a list of mobile phone number information (SMS information) to be sent is obtained based on the information contained in the SMS instruction. If the list of mobile phone number information (SMS information) to be sent is not empty, then the SMS template language sending type (Chinese or English) of each user is determined based on each mobile phone number information (SMS information) to be sent in the list of mobile phone number information (SMS information). Furthermore, it is necessary to determine whether each user is a group leader based on each mobile phone number information (SMS information) to be sent in the list of mobile phone number information (SMS information). A list of team members is generated using the group member SMS template, and the team list is sent separately to the group leader to inform the group leader of the team members.
[0129] Then, select a SMS template based on flight change information, flight information, and passenger order record information, and fill in the SMS template to generate the SMS content.
[0130] In some specific embodiments, referring to Figure 3 , Figure 3 for Figure 2 Detailed flow chart of step S20 in FIG. Figure 3 As shown, the step of generating SMS content based on the SMS instruction includes:
[0131] Step S201, determining a first SMS template according to whether the SMS instruction contains flight change information;
[0132] In some specific embodiments, step S201 includes:
[0133] Determining whether the flight is changed according to whether the SMS instruction contains flight change information;
[0134] If the flight is changed, the flight change SMS template is determined to be the first SMS template;
[0135] If the flight has not been changed, the normal flight SMS template is determined as the first SMS template.
[0136] In this embodiment, it is detected whether the SMS instruction contains flight change information (OPT information), such as "OPT+SCH". If the SMS instruction contains "OPT+SCH", it is a flight change SMS instruction, and the flight change is determined, and the flight change SMS template is determined to be the first SMS template.
[0137] If the SMS instruction does not include "OPT+SCH", it is a normal flight SMS instruction, and it is determined that the flight has not been changed, and the normal flight SMS template is determined to be the first SMS template.
[0138] Step S202, determining a second SMS template according to the flight information included in the SMS instruction;
[0139] In some specific embodiments, step S202 includes:
[0140] Determine whether the flight is a multi-segment flight according to the flight information contained in the SMS instruction;
[0141] If it is a multi-segment flight, the multi-segment flight sub-template is determined as the second SMS template;
[0142] If it is not a multi-segment flight, the single-segment flight sub-template is determined as the second SMS template.
[0143] In this embodiment, it is detected whether the SMS instruction contains multiple flight information (TVL information). If it contains at least two flight information (TVL information), it is determined that the flight is a multi-segment flight, and the multi-segment flight sub-template is determined to be the second SMS template; if it only contains one flight information (TVL information), it is determined that the flight is not a multi-segment flight, that is, it is determined that the flight is a single-segment flight, and the single-segment flight sub-template is determined to be the second SMS template.
[0144] Step S203, determining a third SMS template according to the passenger order record information contained in the SMS instruction;
[0145] In some specific embodiments, step S203 includes:
[0146] Determine whether it is necessary to send the weather information according to the passenger order record information contained in the SMS instruction;
[0147] If weather needs to be sent, query the weather data and determine that the weather sub-template is the third SMS template;
[0148] If weather information does not need to be sent, the third SMS template is empty.
[0149] In this embodiment, according to the passenger order record information (PNR information) contained in the SMS instruction, if the PNR information is "PNR+MZQ5P+WNZ120+040701++++N", it is determined that the user needs to send the weather, then the weather data is queried and the weather sub-template is determined to be the third SMS template; if the PNR information is "PNR+MZQ5P+WNZ120+040701++++Y", it is determined that the user does not need to send the weather, then the third SMS template is empty.
[0150] Step S204, filling in the first SMS template, the second SMS template and the third SMS template to generate SMS content.
[0151] In this embodiment, after determining the first SMS template, the second SMS template and the third SMS template, if the first SMS template is a flight change SMS template, the second SMS template is a single-segment flight sub-template, and the third SMS template is a weather sub-template, then the flight change information, flight information and weather data are filled into the placeholders of the first SMS template, the second SMS template and the third SMS template to generate the SMS content.
[0152] It is easy to imagine that if the first SMS template, the second SMS template and the third SMS template are other template types, the SMS content can be generated after the corresponding information is filled into the placeholder of each template.
[0153] Optionally, in one embodiment, before step S30, the method further includes:
[0154] Check whether the generated SMS content is successfully sent to the operator gateway;
[0155] When the operator returns a successful delivery result, the generated SMS content is sent to the operator gateway;
[0156] When the sending result returned by the operator is sending timeout, it is determined that the generated SMS content has failed to be sent.
[0157] In this embodiment, after the SMS content is generated, the generated SMS content and information such as the user to whom the SMS content needs to be sent are placed in a queue to be sent. When the SMS content is sent, the SMS content is read from the queue to be sent, and the format of the operator's SMS interface is adapted according to the generated SMS content, and the generated SMS content is sent to the operator's gateway. Since the SMS content is sent in an asynchronous queue, the SMS content, the user to whom the SMS content needs to be sent, the SMS content sending time, and the SMS content sending status are stored regardless of whether the SMS content is sent successfully, so as to verify the sending with the SMS instruction sender, wherein the sending status of whether the SMS content is sent successfully is indicated by a flag.
[0158] Furthermore, after determining that the SMS is sent successfully, the user account will be asynchronously deducted. If it is determined that the SMS fails to be sent, the SMS content is recorded as timed out, and the user account will not be deducted.
[0159] Step S30, after determining that the generated SMS content is sent to the operator gateway, the user account is deducted based on the user information corresponding to the SMS instruction.
[0160] In some specific embodiments, referring to Figure 4 , Figure 4 for Figure 2 Detailed flow chart of step S30 in FIG. Figure 4 As shown, step S30 includes:
[0161] Step S301, when it is determined that the user type is not a free user based on the user information corresponding to the SMS instruction, detecting whether the number of free SMS messages in the user account is zero;
[0162] Step S302, if it is not zero, detecting whether the character length of the sent SMS content exceeds a first preset number of characters;
[0163] Step S303, if the number of characters does not exceed the first preset number, the number of free SMS messages in the user account is reduced by one;
[0164] Step S304, if the number of characters exceeds the first preset number, sending a text message with a second preset number of characters as one text message, and counting the total number of sent text messages, wherein the first preset number is greater than the second preset number;
[0165] Step S305, comparing the total number of sent SMS messages with the number of free SMS messages;
[0166] Step S306, if the total number of sent text messages is greater than the number of free text messages, the difference between the total number of sent text messages and the number of free text messages is calculated, and the user account is charged according to the difference and the cost of a single text message;
[0167] Step S307: If the total number of sent text messages is less than or equal to the number of free text messages, the number of free text messages in the user account is subtracted from the total number of sent text messages.
[0168] In this embodiment, the user of civil aviation SMS processing is an agent who sells civil aviation tickets, so it is necessary to deduct fees from the agent who uses instructions to send SMS. Specifically, according to the PNR number and the responsible group office number in the passenger order record information (PNR information), the user type saved in the database is queried by the system. When it is found that the user type is not a free user, the number of free SMS in the user account is checked to see if it is zero.
[0169] If the number of free SMS messages in the user account is not zero, it is detected whether the character length of the sent SMS content exceeds a first preset number of characters.
[0170] If the character length of the sent text message does not exceed the first preset number of characters, the number of free text messages in the user account is reduced by one. It is easy to think that since the number of free text messages in the user account is not zero, it means that there is at least one free text message in the user account. Therefore, if the character length of the sent text message does not exceed the first preset number of characters, the number of free text messages in the user account can be directly deducted by one, and then the number of free text messages in the user account is updated for subsequent comparison and deduction.
[0171] If the character length of the sent text message exceeds the first preset number of characters, the second preset number of characters is used as one sent text message, and the total number of sent text messages is counted. Specifically, taking the first preset number of characters as 70 characters and the second preset number of characters as 67 characters as an example, if the character length of the sent text message exceeds 70 characters, every 67 characters is counted as one sent text message, and rounded up. It is easy to think that if the last character is less than 67 characters, it will be counted as 67 characters, that is, if the character length of the sent text message is 100 characters, it will be counted as two sent text messages.
[0172] Furthermore, the total number of sent text messages is compared with the number of free text messages. If the total number of sent text messages is less than or equal to the number of free text messages, the number of free text messages in the user account is subtracted from the total number of sent text messages to obtain a new number of free text messages. Furthermore, the number of free text messages in the user account is updated based on the new number of free text messages for subsequent comparison and deduction.
[0173] If the total number of text messages sent is greater than the number of free text messages, the difference between the total number of text messages sent and the number of free text messages is calculated, and then the difference is multiplied by the cost of a single text message. The product is the fee deducted from the user's account.
[0174] This flexible billing method can provide differentiated deduction services for upstream users based on user type, SMS usage frequency and possible gifting rules. It not only increases the flexibility of billing, but also brings more reasonable cost control to users.
[0175] In this embodiment, user authority verification is performed based on the obtained SMS instruction; when the user authority verification is passed, the SMS content is generated based on the SMS instruction, that is, customized reminder SMS content for various flights is generated according to the SMS instruction sent by the user, which not only ensures that passengers can receive accurate flight information, but also meets the passengers' specific needs for services such as flight reminders;
[0176] After the generated SMS content is determined to be sent to the operator gateway, the user account is deducted based on the user information corresponding to the SMS instruction, realizing the provision of differentiated deduction services for upstream users based on user type, SMS usage frequency and possible gifting rules, thus not only increasing the flexibility of billing, but also bringing more reasonable cost control to users. Through this embodiment, the adaptability of SMS services is improved, and the technical problem that the relevant technology cannot parse civil aviation SMS instructions and cannot perform separate statistical billing for aviation information agents, resulting in low adaptability of SMS services, is solved.
[0177] In a second aspect, an embodiment of the present invention further provides a device for processing short messages.
[0178] In one embodiment, referring to Figure 5 , Figure 5 Schematic diagram of the functional modules of an embodiment of a short message processing device of the present invention. Figure 5 As shown, the short message processing device includes:
[0179] The authority verification module 10 is configured to verify the user authority based on the obtained SMS instruction;
[0180] The SMS generation module 20 is configured to generate SMS content based on the SMS instruction when the user authority verification is passed;
[0181] The information deduction module 30 is configured to deduct fees from the user account based on the user information corresponding to the SMS instruction after determining that the generated SMS content is sent to the operator gateway.
[0182] Optionally, in one embodiment, the authority verification module 10 is specifically configured to:
[0183] Preprocessing and grouping the acquired SMS instructions to obtain multiple groups of preprocessed sub-SMS instructions;
[0184] The user authority is verified based on the preset group name and the plurality of groups of pre-processed sub-SMS instructions.
[0185] Optionally, in one embodiment, the authority verification module 10 is specifically configured to:
[0186] Convert the host Chinese code of the SMS command into the national standard code, and delete the special characters in the SMS command to obtain the pre-processed SMS command;
[0187] Based on the information types contained in the preprocessed SMS instructions, the preprocessed SMS instructions are grouped to obtain multiple groups of preprocessed sub-SMS instructions;
[0188] The SMS instruction includes: passenger order record information, passenger identity information, flight information, mobile phone number information to be sent and flight change information.
[0189] Optionally, in one embodiment, the authority verification module 10 is specifically configured to:
[0190] Determine a target sub-sms instruction from a plurality of groups of pre-processed sub-sms instructions based on a preset group name;
[0191] Verify whether the user type corresponding to the target sub-SMS instruction is a free user, a postpaid user or a prepaid user, and whether the number of free SMS messages or the balance of the prepaid user is greater than zero;
[0192] If so, it is determined that the user authority verification is passed.
[0193] Optionally, in one embodiment, the SMS generation module 20 is specifically configured to:
[0194] Determining a first SMS template according to whether the SMS instruction contains flight change information;
[0195] Determining a second SMS template according to the flight information included in the SMS instruction;
[0196] Determining a third SMS template according to the passenger order record information contained in the SMS instruction;
[0197] Fill in the first SMS template, the second SMS template and the third SMS template to generate SMS content.
[0198] Optionally, in one embodiment, the SMS generation module 20 is specifically configured to:
[0199] Determining whether the flight is changed according to whether the SMS instruction contains flight change information;
[0200] If the flight is changed, the flight change SMS template is determined to be the first SMS template;
[0201] If the flight has not been changed, the normal flight SMS template is determined as the first SMS template.
[0202] Optionally, in one embodiment, the SMS generation module 20 is specifically configured to:
[0203] Determine whether the flight is a multi-segment flight according to the flight information contained in the SMS instruction;
[0204] If it is a multi-segment flight, the multi-segment flight sub-template is determined as the second SMS template;
[0205] If it is not a multi-segment flight, the single-segment flight sub-template is determined as the second SMS template.
[0206] Optionally, in one embodiment, the SMS generation module 20 is specifically configured to:
[0207] Determine whether it is necessary to send the weather information according to the passenger order record information contained in the SMS instruction;
[0208] If weather needs to be sent, query the weather data and determine that the weather sub-template is the third SMS template;
[0209] If weather information does not need to be sent, the third SMS template is empty.
[0210] Optionally, in one embodiment, the SMS processing further includes a detection module configured to:
[0211] Check whether the generated SMS content is successfully sent to the operator gateway;
[0212] When the operator returns a successful delivery result, the generated SMS content is sent to the operator gateway;
[0213] When the sending result returned by the operator is sending timeout, it is determined that the generated SMS content has failed to be sent.
[0214] Optionally, in one embodiment, the information fee deduction module 30 is configured to:
[0215] When it is determined that the user type is not a free user based on the user information corresponding to the SMS instruction, detecting whether the number of free SMS messages in the user account is zero;
[0216] If it is not zero, detecting whether the character length of the sent SMS content exceeds a first preset number of characters;
[0217] If the number of characters does not exceed the first preset number, the number of free SMS messages in the user account is reduced by one;
[0218] If the number of characters exceeds the first preset number, a second preset number of characters is used as one text message to send, and the total number of text messages sent is counted, wherein the first preset number is greater than the second preset number;
[0219] Compare the total number of SMS messages sent with the number of SMS gifts;
[0220] If the total number of text messages sent is greater than the number of free text messages, the difference between the total number of text messages sent and the number of free text messages is calculated, and the user account is charged according to the difference and the cost of a single text message;
[0221] If the total number of SMS messages sent is less than or equal to the number of free SMS messages, the number of free SMS messages in the user account will be subtracted from the total number of SMS messages sent.
[0222] Among them, the functional implementation of each module in the above-mentioned short message processing device corresponds to each step in the above-mentioned short message processing method embodiment, and its functions and implementation processes are no longer repeated here one by one.
[0223] In a third aspect, an embodiment of the present invention further provides an electronic device, whose structure is as follows: Figure 6 As shown, it includes: a memory and a processor, and the processor is used to read and execute the computer program stored in the memory to implement the above-mentioned text message processing method.
[0224] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions, when executed, implement the aforementioned method for processing short messages.
[0225] In a fifth aspect, an embodiment of the present invention provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the above-mentioned SMS processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0226] Finally, it should be noted that: in some processes described in the embodiments of the present invention, multiple operations or steps appearing in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present invention or may be executed in parallel, and the sequence number of the operation is only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0227] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for processing short messages, characterized in that: The method comprises: Verify user permissions based on the SMS instructions obtained; When the user authority verification is passed, the SMS content is generated based on the SMS instruction; After the generated SMS content is determined to be sent to the operator gateway, the user account is deducted based on the user information corresponding to the SMS instruction.
2. The method for processing short messages according to claim 1, characterized in that: The user authority verification based on the obtained SMS instruction includes: Preprocessing and grouping the acquired SMS instructions to obtain multiple groups of preprocessed sub-SMS instructions; The user authority is verified based on the preset group name and the plurality of groups of pre-processed sub-SMS instructions.
3. The method for processing short messages according to claim 2, characterized in that: The step of preprocessing and grouping the acquired SMS instructions to obtain multiple groups of preprocessed sub-SMS instructions includes: Convert the host Chinese code of the SMS command into the national standard code, and delete the special characters in the SMS command to obtain the pre-processed SMS command; Based on the information types contained in the preprocessed SMS instructions, the preprocessed SMS instructions are grouped to obtain multiple groups of preprocessed sub-SMS instructions; The SMS instruction includes: passenger order record information, passenger identity information, flight information, mobile phone number information to be sent and flight change information.
4. The method for processing short messages according to claim 2, characterized in that: The step of verifying user authority based on the preset group name and the plurality of groups of pre-processed sub-SMS instructions includes: Determine a target sub-sms instruction from a plurality of groups of pre-processed sub-sms instructions based on a preset group name; Verify whether the user type corresponding to the target sub-SMS instruction is a free user, a postpaid user or a prepaid user, and whether the number of free SMS messages or the balance of the prepaid user is greater than zero; If so, it is determined that the user authority verification is passed.
5. The method for processing short messages according to claim 1, characterized in that: The step of generating SMS content based on the SMS instruction includes: Determining a first SMS template according to whether the SMS instruction contains flight change information; Determining a second SMS template according to the flight information included in the SMS instruction; Determining a third SMS template according to the passenger order record information contained in the SMS instruction; Fill in the first SMS template, the second SMS template and the third SMS template to generate SMS content.
6. The method for processing short messages according to claim 5, characterized in that: The determining the first SMS template according to whether the SMS instruction contains flight change information includes: Determining whether the flight is changed according to whether the SMS instruction contains flight change information; If the flight is changed, the flight change SMS template is determined to be the first SMS template; If the flight has not been changed, the normal flight SMS template is determined as the first SMS template.
7. The method for processing short messages according to claim 5, characterized in that: The step of determining a second SMS template according to the flight information included in the SMS instruction includes: Determine whether the flight is a multi-segment flight according to the flight information contained in the SMS instruction; If it is a multi-segment flight, the multi-segment flight sub-template is determined as the second SMS template; If it is not a multi-segment flight, the single-segment flight sub-template is determined as the second SMS template.
8. The method for processing short messages according to claim 5, characterized in that: The step of determining a third SMS template according to the passenger order record information contained in the SMS instruction includes: Determine whether it is necessary to send the weather information according to the passenger order record information contained in the SMS instruction; If weather needs to be sent, query the weather data and determine that the weather sub-template is the third SMS template; If weather information does not need to be sent, the third SMS template is empty.
9. The method for processing short messages according to claim 1, characterized in that: After the generated SMS content is determined to be sent to the operator gateway, before the user account is deducted based on the user information corresponding to the SMS instruction, the method includes: Check whether the generated SMS content is successfully sent to the operator gateway; When the operator returns a successful delivery result, the generated SMS content is sent to the operator gateway; When the sending result returned by the operator is sending timeout, it is determined that the generated SMS content has failed to be sent.
10. The method for processing short messages according to claim 1, characterized in that: The step of deducting fees from the user account based on the user information corresponding to the SMS instruction includes: When it is determined that the user type is not a free user based on the user information corresponding to the SMS instruction, detecting whether the number of free SMS messages in the user account is zero; If it is not zero, detecting whether the character length of the sent SMS content exceeds a first preset number of characters; If the number of characters does not exceed the first preset number, the number of free SMS messages in the user account is reduced by one; If the number of characters exceeds the first preset number, a second preset number of characters is used as one text message to send, and the total number of text messages sent is counted, wherein the first preset number is greater than the second preset number; Compare the total number of SMS messages sent with the number of SMS gifts; If the total number of text messages sent is greater than the number of free text messages, the difference between the total number of text messages sent and the number of free text messages is calculated, and the user account is charged according to the difference and the cost of a single text message; If the total number of SMS messages sent is less than or equal to the number of free SMS messages, the number of free SMS messages in the user account will be subtracted from the total number of SMS messages sent.
11. A short message processing device, characterized in that: The device comprises: The permission verification module is configured to verify the user's permission based on the obtained SMS instruction; The SMS generation module is configured to generate SMS content based on the SMS instruction when the user authority verification is passed; The information deduction module is configured to deduct fees from the user account based on the user information corresponding to the SMS instruction after the generated SMS content is determined to be sent to the operator gateway.
12. The short message processing device according to claim 11, characterized in that: The authority verification module is configured to: Preprocessing and grouping the acquired SMS instructions to obtain multiple groups of preprocessed sub-SMS instructions; The user authority is verified based on the preset group name and the plurality of groups of pre-processed sub-SMS instructions.
13. The short message processing device according to claim 11, characterized in that: The SMS generation module is configured to: Determining a first SMS template according to whether the SMS instruction contains flight change information; Determining a second SMS template according to the flight information included in the SMS instruction; Determining a third SMS template according to the passenger order record information contained in the SMS instruction; Fill in the first SMS template, the second SMS template and the third SMS template to generate SMS content.
14. The short message processing device according to claim 11, characterized in that: The information fee deduction module is configured to: When it is determined that the user type is not a free user based on the user information corresponding to the SMS instruction, detecting whether the number of free SMS messages in the user account is zero; If it is not zero, detecting whether the character length of the sent SMS content exceeds a first preset number of characters; If the number of characters does not exceed the first preset number, the number of free SMS messages in the user account is reduced by one; If the number of characters exceeds the first preset number, a second preset number of characters is used as one text message to send, and the total number of text messages sent is counted, wherein the first preset number is greater than the second preset number; Compare the total number of SMS messages sent with the number of SMS gifts; If the total number of text messages sent is greater than the number of free text messages, the difference between the total number of text messages sent and the number of free text messages is calculated, and the user account is charged according to the difference and the cost of a single text message; If the total number of SMS messages sent is less than or equal to the number of free SMS messages, the number of free SMS messages in the user account will be subtracted from the total number of SMS messages sent.
15. An electronic device, characterized in that: include: Memory and processor; The processor is used to read and execute the computer program stored in the memory to implement the steps of the text message processing method as described in any one of claims 1-10.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed, the steps of the text message processing method as described in any one of claims 1 to 10 are implemented.
17. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the text message processing method as described in any one of claims 1-10 are implemented.
Citation Information
Patent Citations
Handset short message function for real-time dynamic of airport arrival flight
CN101951578A
Charging management and control method and system based on aviation passenger communication and mobile terminal
CN109802840A
Service provider architecture and method for delivering content services to mobile communication customers
US20020156732A1
System and method for rich short messaging service
US20230007449A1