Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of short message service (SMS) data processing method and system, is used for solving prior art, technological deficiency such as, autgmentability difference low to the short message service treatment effeciency.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of short message service (SMS) data processing method comprises:
The service handling information of short-message users is formed the business datum file and be saved under the specified services path;
Under the specified services path, read described business datum file, described business datum file is handled, and the business datum after will handling is saved in the Service Database.
Synchronizing traffic data after will handling when further, the business datum after will handling is saved in the Service Database is in the memory database of service processor.
Further, described business datum file adopts the text form; Described service handling information comprises the service handling information of normal users and black list user's service handling information; In described business datum file,, can both customize the business datum of oneself at each user.
Further, when the check mark section business is handled, number section business data are converted to the record corresponding with unique user deposit in the middle of the described business datum file, system carries out batch process to the record in the business datum file.
Further, described business datum file handled comprised:
Whether the file name of judging described business datum file compliant, if meet then it is carried out subsequent treatment, if do not meet the processing that then stops this business datum file;
Judge whether record format, Subscriber Number and the customer service attribute of the business record in the described business datum file meet the business rule of setting, then carry out in-stockroom operation if meet, otherwise next bar business record of log reprocessing.
Further, described business datum file handled comprised:
Judge whether described business datum file has had the history of processing, handle progress record, continue to handle since the breakpoint place that handled last time if then read the history of this business datum file; Otherwise start anew to handle; Real time record is handled progress record in the process that the business datum file content is handled.
Based on said method, the present invention proposes a kind of short message service (SMS) data treatment system, and for reaching this purpose, technical scheme of the present invention is achieved in that
Service scripts forms module, is used for service handling information with short-message users and forms the business datum file and be saved under the specified services path;
Service Processing Module is used for reading described business datum file under the specified services path, described business datum file is handled, and the business datum after will handling is saved in the Service Database.
Further, described system also comprises: synchronization module is used for the business datum after handling is synchronized in real time the memory database of service processor.
Further, described Service Processing Module comprises:
The rule judgment module, whether the record format, Subscriber Number and the customer service attribute that are used for title, business datum file to the business datum file meet business rule is judged, carries out if meet then the historical judge module of notifier processes; Otherwise the notice logger module is carried out;
Handle historical judge module, be used to judge whether described business datum file has had the history of processing, if then the notifier processes position determination module is carried out, otherwise notice is gone into the library module execution;
Handle position determination module, be used for existing the history that reads this business datum file under the situation of handling history to handle progress record, work as the pre-treatment position and be set to the historical position of handling; Work as the original position that the pre-treatment position is set to the business datum file when not existing processing historical, notice is gone into the library module execution then;
Go into library module, be used for the business datum that meets business rule is carried out in-stockroom operation;
Logger module is used for according to the judged result of rule judgment module or goes into the result log of library module.
Business datum file of the present invention adopts easily expands, handles text mode flexibly; Provide short message user and black list user's the function of opening an account, revise, deleting, effectively compatible former all subscription and unsubscription functions of system of opening an account comprehensively; The all short message users and the business datum of blacklist all in time are synchronized to the memory bank of short message service center after depositing database in, user data can be updated in time, and user property can in time come into force; Action type is distinguished by operation flag by system, at each user in the business datum file, can both customize the business information of oneself, having solved traditional short message receiving system can only increase in batches according to number section, revise the problem of user profile, and solved the problem that traditional short message receiving system can not personalized each customer service; The compatible tradition section of the present invention is opened an account, but the colon section is more flexible, and support section blacklist.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, by the following examples and with reference to accompanying drawing, the present invention is described in more detail.
Fig. 1 is the flow chart of business data processing of the present invention, and service attribute that the present invention can the batch process normal users or black list user's service attribute comprise user's increase, revises and operation such as deletion action.
Step 101: the service handling information of short-message users is concentrated the business datum file that forms textual form;
It is professional corresponding that described service handling information and system are supported, for example for the business of normal users, can comprise user's the business datum of opening an account, the modification business datum of user profile, deletion user's business datum, corresponding black list user can comprise the business datum of the business datum that increases blacklist, the business datum of revising blacklist and deletion blacklist.Described business datum file can come the differentiated service type by filename, and it is current in the business of handling which kind of type by certain naming rule system can be discerned.
Each bar record in the business datum file is corresponding to a short message user's a business operation, in the business datum file at each user, can both customize the business information of oneself, having solved traditional short message receiving system can only increase, revise the problem of user profile in batches according to number section, and has solved the technical problem that traditional short message receiving system can not each customer service of personalized customization;
The present invention adopts the text mode to come storage service to accept information, and text file can be generated automatically by other system form by appointment, but also hand-coding.The form of business datum record is arranged in system in the text.
Type of service when pre-treatment is distinguished by the title of business datum file by system; Described type of service comprises opening an account, revise, deleting of short message user and black list user.
The present invention can be according to the different field demand customization text formatting of opening an account, and does not influence between mutually.The file directory level can dispose voluntarily according to on-the-spot resource.
Step 102: the business datum file is uploaded under the service path of appointment by file transfer protocol (FTP) ftp mode;
Except that by also using other protocol mode to upload the business datum file the ftp mode.
Step 103: after uploading to the business datum file under the specified services path, system can detect whether new business datum file is arranged under this service path by self-timing, if then execution in step 104 is arranged; Otherwise finish;
Also can mate the business datum file, thereby realize carrying out different business operations, and avoid file illegal or that do not meet standard is handled according to different file types according to the file designation rule.
Step 104: judged whether the processing historical record, if execution in step 105 then; Otherwise execution in step 106;
May be in the system handles process because of the processing procedure of abnormal conditions interrupting service data file, in order to address this is that, the current processing file of real time record of the present invention reaches the processing position when the pre-treatment file, at system restoration just often, system can continue to begin to carry out from breakpoint according to handling historical record.
Step 105: the processing position of reading interruption last time from handle historical record is as current initiated process position, and execution in step 107 then;
Step 106: the initiated process position is made as starts anew; Promptly from article one recording start;
Step 107: from professional data file, read a business datum record, to verifying, judge whether to meet business norms, if compliant execution in step 108 then when the business datum of pre-treatment record according to data format definition, professional constraints etc.; Otherwise execution in step 111;
Business norms of the present invention comprise:
(1) record format of business datum record compliant whether, for example whether requirement of compliance with system such as field number, separator;
(2) whether the field attribute of business datum record meets business rule, and for example whether the value of the figure place of Subscriber Number, each field is in the scope of business constraint or the like;
(3) condition of a certain business of execution is as carrying out a certain business at such user according to user property;
For example certain areas only allow the prepaid user is put in storage processing, then need Subscriber Number is analyzed before warehouse-in, then allow warehouse-in if number is the prepaid user, otherwise refusal and misregistration daily record.
Step 108: from professional data file, extract a record, carry out in-stockroom operation;
In this step, user or blacklist information are write database according to operation flag, operation flag is given by system, and for example 0 expression increases, and 1 expression is revised, 2 expression deletions etc.The default action type can be arranged, for example do not have operation flag and then represent to increase.In the business datum file, can be by above-mentioned sign at each user in the business datum file, can both customize the business information of oneself, having solved traditional short message receiving system can only increase in batches according to number section, revise the problem of user profile, and solved the problem that traditional short message receiving system can not personalized each customer service;
The compatible tradition section business of the present invention, but the colon section is more flexible, when the check mark section business is handled, the present invention general's section business data are converted to many records corresponding with unique user and deposit in the middle of the described business datum file, and system carries out the processing of batch one by one to the record in the business datum file.For example traditional blacklist is opened an account and is not supported number section blacklist, goes into the blacklist storehouse if will realize whole number segment, then needs the manual mode that repeats to import one number and select the blacklist attribute to submit on the interface to realize.Text open an account in batches then can the section of the number of realization relatively easily blacklist function.For example can be by fast section being converted to one number and writing file by the text edit tool, system can discern this document automatically and blacklist is put in storage.The tradition blacklist is not supported " forever " blacklist, and the text mode of opening an account in batches then can be supported, just can solve as long as the blacklist time is set to infinity.
Step 109: judge whether warehouse-in is successful, if successful then execution in step 110; Otherwise execution in step 111;
Step 110: will put data sync in storage in the middle of memory database; Described memory database refers to reside in the online transaction processing system database in the internal memory, be used to improve the processing speed of front-end business processor, undertaken synchronously by certain cycle according to business demand between itself and the background data base, if but can cause synchronizing cycle the business datum of current warehouse-in in time not coming into force than length, the present invention is behind the in-stockroom operation of the background data base of finishing business datum, at once it is synchronized to memory database, postpones thereby reduce.
Step 111: write down current execution journal;
Log record of the present invention comprises Subscriber Number, operation flag, execution result, failure cause or the like.
The present invention can accurately navigate to the number of the success of not opening an account according to log record when system exception, and can open an account once more at these numbers.
Step 112: record is worked as the pre-treatment position as historical record;
Step 113: judge whether the record in the business datum file disposes, if be untreated the then execution in step 107 that finishes; Otherwise execution in step finishes to carry out.
Fig. 2 is a short message service (SMS) data treatment system structure chart of the present invention, comprises that service scripts forms module, Service Processing Module, synchronization module.
Service scripts formation module is used for the service handling information formation business datum file of short-message users and is saved under the specified services path; Described service handling information comprises the service handling information of normal users and black list user's service handling information; In the business datum file,, can both customize the business information of oneself at each user.
Service Processing Module is used for reading described business datum file under the specified services path, and described business datum file is handled, and the business datum after handling is saved in the Service Database; Service Processing Module further comprises the rule judgment module, handles historical judge module, handles position determination module, goes into library module and logger module etc.The rule judgment module is used for whether the record format of the title of business datum file, business datum file, Subscriber Number and customer service attribute are met business rule to be judged, then notifies library module to carry out if meet; Otherwise the notice logger module is carried out; Going into library module is used for the business datum that meets business rule is carried out in-stockroom operation; Logger module is used for according to the judged result of rule judgment module or goes into the result log of library module.Handle historical judge module, be used to judge whether described business datum file has had the history of processing; Handle position determination module, be used for existing the history that reads this business datum file under the situation of handling history to handle progress record, work as the pre-treatment position and be set to handle the position from history; When not existing processing historical, work as the original position that the pre-treatment position is set to the business datum file.When the check mark section business is handled, form module by service scripts and the section business data are converted to the record corresponding with unique user deposit in the middle of the described business datum file, by Service Processing Module batch process carried out in the record in the business datum file.
Synchronization module is used for the business datum after handling is synchronized in real time the memory database of service processor.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.