A kind of interface, method and communication system that realizes interface data consistency
Technical field
The present invention relates to realize between the interface method of data consistency, particularly maintains and keep interface, method and the communication system that system interface is realized data consistency about a kind of client.
Background technology
On Communications Market with keen competition, operator is for reducing the churn rate effort.At present, the churn rate of european telecommunication industry is 25%, and the U.S. is 30%.Customer churn gives revenue losses that the telecom operators of the U.S. cause every year up to 9,000,000,000 dollars, also has 7,500,000,000 dollars extra acquisition client expense.And the new business of constantly releasing will speed up client's loss, estimates that according to In-Stat/MDR market research agency the enforcement that number carries will make the churn rate of the U.S. increase to 46%.
The end of the nineties in last century, domestic each operator begins to follow the management aim of " customer-centric, market orientation, be target with the profit ", changed to " profit type " enterprise by " type of production " enterprise, concern client and the client who makes separately according to unified planning, the construction mode of the enforcement that distributes in succession maintain and keep system.
The client maintains and keep system will effectively control customer churn exactly, and how its key is customer churn tendency and early warning are in time found in the customer churn forecast analysis, and the client is maintained effectively and keeps.Forecast analysis for customer churn, be by datas such as the customer consuming behavior in the timing acquiring billing and accounting system, the behaviors of paying the fees, with the related data of gathering with according to historical experience corresponding key index is set and compares, discern according to the result who analyzes various from the net tendency, will be in time to customer manager's early warning to having from the client of net tendency.
Because the billing and accounting system majority of each big operator is provided by different vendor at present, and the client maintains with the system of keeping and need gather the foundation of data relevant with customer consuming behavior, the behavior of paying the fees etc. in the billing and accounting system as the forecast analysis customer churn, these users' initial data often can not directly be obtained from billing and accounting system, therefore, when obtaining these data, just need the interface of data passes, charging tent manufacturer with data by appointment mode derive to maintain and to keep network analysis and use for the client.When the data file that the client maintains and keep system interface provides charging tent manufacturer imports in oneself the system, if can not guarantee the consistency of data, the not warehouse-in that file has, what have does not put in storage fully, the quilt that has is repeatedly put in storage, or even the file of warehouse-in is not the data that produce on the same day ... such data are brought and analyzed, not only do not have the control customer churn, may cause the client of this return visit not paid a return visit on the contrary, the client that should not pay a return visit has but been paid a return visit by the customer manager, causes client's greatly being discontented with operator.
Introduce the existing customer below in conjunction with accompanying drawing 1 and maintain and keep the process that system interface is handled.
Step S101, billing and accounting system is maintained the client and keep the required information of system and derives with document form, leaves under the catalogue of mutual agreement;
Step S102, client maintain and keep the file pretreatment module of system file is carried out the form preliminary treatment, convert the form into library module identification to;
The file that step S103, client maintained and kept system is gone into library module file is put in storage, goes into library information and leaves in the temporary interface table;
Step S104, the execution of day processing operation is that a crontab timed task that is provided by main frame wakes up.Problem just is now, and when this setting of timed task wakes a day processing operation up.If the time that timed task is set is too early, when handling the time of operating, and need all not put in storage with the file of batch importing date of arrival, just may cause follow-up classification, distribution and task to generate the inaccuracy of data; If the timed task time is provided with a little later, guarantee all with batch files all put in storage, so, the time of leaving classification, distribution and task generating run for has just reduced, also do not finish a day task handling operation if arrived the time that operator starts a business morning, the work that will certainly have influence on operator so carries out; Furtherly, the timed task time is provided with earlier and neither fixes a little later, along with the increase and decrease of data volume, the time a little later that perhaps begins to be provided with, when data volume is big, also can't satisfy the total data warehouse-in.In addition, unusually cause the incorrect derivation of data if run into network problem or billing and accounting system, at this moment, if do not go to carry out any judgement but equal time once handling operation to beginning the execution day, equally also can cause follow-up classification, distribution and task to generate the inaccuracy of data;
Step S105, a day processing operation is not arrived constantly, continues to wait for;
Step S106, the execution day is handled operation, finishes classification, distribution and task and generates.
Summary of the invention
For solving the above problems, the objective of the invention is to, a kind of interface, method and communication system that realizes interface data consistency proposed, to solve the various valid data files that charging tent manufacturer is provided, put in storage for same batch, can not guarantee data consistency, and follow-up classification, distribution and task generate the problem of accuracy and efficient.
For achieving the above object, the invention provides a kind of interface of realizing interface data consistency, maintain with the system of keeping with the client with billing and accounting system and be connected, wherein, comprising:
One file pretreatment module is used for the described client that described billing and accounting system derives is maintained and keeps the file of system's information needed, carries out the form preliminary treatment, and the format conversion of described file is become the discernible form of file warehouse-in module;
One file is gone into library module, is used for process format pretreatment file is imported temporary interface table, after described file warehouse-in finishes, the ready sign of file described in the database is revised as ready state;
One task is carried out top control module, be used for regularly reading the ready sign of described database file, when described ready when being masked as ready state, activation is handled the follow-up work of described file, and follow-up work is carried out in coordination, after the task successful execution finishes, the ready sign of recovery file.
The interface of above-mentioned realization interface data consistency, wherein, described file pretreatment module further comprises:
One preliminary treatment configuration file, the length of include file name information, each row of data, each field seperator, each field name and each field start position information.
The interface of above-mentioned realization interface data consistency, wherein, described file is gone into library module and is further comprised:
One goes into base configuration file, comprises the line number of field seperator and single warehouse-in in the temporary interface table of log database user name, login password, log database Service name, the file name information that will put in storage, warehouse-in and field name thereof, the storing process that calls, the file.
The interface of above-mentioned realization interface data consistency, wherein, described task is carried out top control module and is further comprised:
One time task module, be used to set circular wait duration and maximum wait duration, regularly start inquiry according to described circular wait duration to the ready sign of file described in the database, calculate the number of times of accumulative total circular wait, and be converted into the wait duration, if described wait duration less than described maximum wait duration, then continues circular wait, if surpassed the maximum wait duration, stop continuing to wait for.
For achieving the above object, the present invention also provides a kind of method that realizes interface data consistency, wherein, comprising:
Step 1 comprises the file that the client maintained and kept system's information needed to what billing and accounting system derived, carries out the form preliminary treatment, and the format conversion of described file is become the discernible form of file warehouse-in module;
Step 2 will import in the temporary interface table through the format pretreatment file, after described file warehouse-in finishes, the ready sign of file described in the database will be revised as ready state;
Step 3 regularly reads the ready sign of file in the described database, when described ready when being masked as ready state, activation is handled the follow-up work of described file, and coordinate to carry out follow-up work, after the task successful execution finishes, the ready sign of recovery file.
The method of above-mentioned realization interface data consistency wherein, further comprises before the described step 1:
Billing and accounting system is maintained and is kept system required relate to client, user, account and/or account data information with described client and derives with document form, leave under the assigned address, wherein the file of different types of information adopts different filenames, and the file of a plurality of information of the same type adopts different serial numbers respectively.
The method of above-mentioned realization interface data consistency, wherein, described step 1 further comprises:
Step 71, the file that will get access to from described assigned address is copied into two parts equally, and a file is carried out anticipating of file format according to the preliminary treatment configuration file, and another part file is carried out compress backup;
Step 72 through after the preliminary treatment, is sent the file of preliminary treatment success into the input position that file is gone into library module, the file of preliminary treatment failure is put under the preliminary treatment failure file outgoing position backed up.
The method of above-mentioned realization interface data consistency, wherein, described step 2 further comprises:
Step 81, in database, inquire the state that to put file type in storage and be the lock release condition, then lock earlier, then according to going into base configuration file, a file of described type is put in storage, after putting in storage successfully, will lock release, carry out the warehouse-in of the next file of described type again according to above-mentioned steps;
Step 82, according to the serial number of described type file, the file of judging described type is all behind the warehouse-in, and the ready sign of type file described in the described database is revised as ready state.
The method of above-mentioned realization interface data consistency, wherein, described step 3 further comprises:
Step 91, whether the ready sign that regularly reads the file of all types in the described database all is ready state, if not all be ready state, then continue circular wait, enter step 94,, then enter step 92 if all for ready state;
Step 92 activates the follow-up work of file in the described database is handled, and enters step 93;
Step 93 is coordinated the sequencing that classification, distribution and task generate, and after the follow-up work of file was finished in described database, that revises described file readyly was masked as not ready state, and log also successfully withdraws from;
Step 94 is converted into the wait duration with the number of times that adds up circular wait, if this duration then returns step 91 less than the maximum wait duration of default, if surpassed the maximum wait duration, then enters step 95;
Step 95 stops continuing to wait for, the misregistration daily record, and send a warning information, notice classification, distribution and task generate failure.
For achieving the above object, the present invention also provides a kind of communication system that realizes above-mentioned any method, comprising:
One client maintains and keeps system, is used to realization the client to be maintained effectively and keeps and carry out corresponding data classification, distribution and professional the generation and handle;
One billing and accounting system is used for the client is maintained and keep the form derivation of system's information needed with file, leaves under the appointed positions;
One client maintains and keeps system interface;
Wherein, described client maintains and keeps system interface and further comprises:
One file pretreatment module is used for the described client that described billing and accounting system derives is maintained and keeps the file of system's information needed, carries out the form preliminary treatment, and the format conversion of described file is become the discernible form of file warehouse-in module;
One file is gone into library module, is used for process format pretreatment file is imported temporary interface table, after described file warehouse-in finishes, the ready sign of file described in the database is revised as ready state;
One task is carried out top control module, be used for regularly reading the ready sign of described database file, when described ready when being masked as ready state, activation is handled the follow-up work of described file, and follow-up work is carried out in coordination, after the task successful execution finishes, the ready sign of recovery file.
Above-mentioned communication system, wherein, described communication system further comprises:
One file directory is maintained and is kept system interface and be connected with described billing and accounting system and client, and the described client that being used to deposit described billing and accounting system derives with document form maintains and keep system's information needed.
Technology of the present invention, compared with prior art, can effectively control the consistency that imports with batch data, solve because of data to be analyzed do not import, data to be analyzed import as yet fully, data to be analyzed are repeatedly imported and non-ly be directed to the problem that classification, distribution and task that system brings generate the inaccuracy of data with batch data.
Description of drawings
Fig. 1 is the processing schematic diagram that the prior art client maintained and kept system interface;
Fig. 2 is the structural representation of the communication system of realization interface data consistency provided by the present invention;
Fig. 3 is that client of the present invention maintains and keep the schematic flow sheet that system interface is realized the processing procedure of interface data consistency.
Embodiment
Below in conjunction with accompanying drawing the specific embodiment of the invention is described.
Fig. 2 is a kind of communication system 10 provided by the invention, this communication system 10 comprises: billing and accounting system 100 mainly provides customer data, subscriber data, Account Profile, user's set meal, account relation, comprehensive bill, subscriber arrearage information, the real-time telephone expenses of user, User Agreement, user's moon telephone expenses and account's advance deposit initial data.These initial data are derived with the form of file by billing and accounting system 100, and FTP is to the file directory of appointment 400 times;
The client maintains and keeps system interface 200, is a kind of interface arrangement of realizing interface data consistency, comprising:
File pretreatment module 210 is used for the described client that described billing and accounting system derives is maintained and keeps the file of system's information needed, carries out the form preliminary treatment, and the format conversion of described file is become file warehouse-in module 220 discernible forms;
File is gone into library module 220, is used for process format pretreatment file is imported temporary interface table, after described file warehouse-in finishes, the ready sign of file described in the database is revised as ready state;
Task is carried out top control module 230, be used for regularly reading the ready sign of described database file, when described ready when being masked as ready state, activation is handled the follow-up work of described file, and follow-up work is carried out in coordination, after the task successful execution finishes, the ready sign of recovery file.
Wherein, file pretreatment module 210 also comprises a preliminary treatment configuration file 211, file pretreatment module 210 reads the information of preliminary treatment configuration file 211, file under the original document assigned catalogue 400 is carried out the conversion in advance of form, and the form after the conversion will be guaranteed to be gone into library module 220 by file and be discerned.
File is gone into library module 220 and is comprised one and go into base configuration file 221, file is gone into library module 220 according to going into the file output directory that base configuration file 221 finds file pretreatment module 210, and read under this catalogue through pretreated file and put in storage, file is at first put in storage in the temporary interface table, when one type file after all warehouse-in finishes, revised file ready is masked as ready state; Task execution top control module 230 mainly is that the ready sign of pending file becomes ready state, and when activating, coordinates classification, distribution and the task generating run of follow-up work.
Task is carried out top control module 230 and when is activated by time control parameter and the common decision of State Control parameter, task is carried out top control module 230 and is comprised a time task module 231, be used to set circular wait duration and maximum wait duration, regularly start inquiry according to described circular wait duration to the ready sign of file in the database, calculate the number of times of accumulative total circular wait, and be converted into the wait duration, if described wait duration is less than described maximum wait duration, then continue circular wait, if surpassed the maximum wait duration, stop continuing to wait for.
Be masked as ready state when all files are ready, and as yet not overtime task module 231 set maximum wait time the time, task is carried out top control module 230 and will be activated;
The client maintains and keeps system 300, is used for after top control module is activated, and classification, distribution and the task of file being carried out follow-up work generate.
As shown in Figure 3, be client of the present invention to be maintained and keep system interface realize that the processing procedure of data consistency describes, and comprises the steps:
Step S301, billing and accounting system is maintained the client and keep system's 300 required information such as client, user, account and account data that relate to 100 evenings every day to be derived with document form, leaves under the catalogue of mutual agreement.The filename difference (that is, the file type difference) of different information, if file of the same type is a plurality of, then four serial numbers are distinguished later on, four serial numbers are XXXX behind last file of generation;
The file pretreatment module 210 that step S302, client maintained and kept system interface 200 at first is copied into two parts to the file that gets access to equally, and portion is used for carrying out anticipating of file format, and another part is then carried out compress backup.Anticipating according to preliminary treatment configuration file 211 of file format carried out, this preliminary treatment configuration file 211 include file name information, the length of each row of data, each field seperator, each field name and each field start position information.Through after the preliminary treatment, the file of preliminary treatment success is sent into the input directory that file is gone into library module 220, and the file of preliminary treatment failure is put under the preliminary treatment failure file output directory and backed up;
Step S303, the file that the client maintained and kept system interface 200 is gone into library module 220 and is at first judged to data base querying whether will put the file type state in storage is the lock release condition, if lock release condition, then lock earlier, and begin to put in storage, after putting in storage successfully Deng a file, to lock release, carry out the warehouse-in of next file of the same type, when reading back four serial numbers and be the file of XXXX, that revises this class file in the database readyly is masked as ready state, show this this a collection of class file all warehouse-in finish.File is gone into library module 220 equally also has one to go into base configuration file 221, this is gone into base configuration file 221 and comprises log database user name, password and log database Service name, the file name information of putting in storage, the temporary interface table name and the field name thereof of warehouse-in, the storing process that calls, the line number of field seperator and single warehouse-in in the file.Warehouse-in module invokes storing process, mainly be the data in some interface tables are carried out further regular, as date format, client, user and account's ID form etc.So far, all data by with batch the client that imports to maintain and keep in the system;
Step S304, task is carried out top control module 230 and is started by timed task module 231, after task is carried out top control module 230 startups, read not is that the ready sign of all types of files all is ready state, top control module can be every (configurable) circular wait in 30 seconds so, wait for once can adding up, enter step S305 this moment.If read the ready sign of all types of files, then enter step S306 all for ready state;
Step S305 is converted into the wait duration according to the number of times of accumulative total, if these when treating maximum wait duration that duration sets less than timed task module 231, are then got back to step S304, otherwise enter step S308;
Step S306, task execution top control module 230 reads the ready sign of all types of files and all is ready state, and then the follow-up executable operations of this module will be activated, and change step S307 over to;
Step S307, task is carried out top control module 230 and is coordinated the sequencing that classification, distribution and task generate, because classification and distribution institute data updated can offer task and generate, after waiting for that all follow-up works dispose, the ready sign of revising file in the database is not all for ready, and log also successfully withdraws from;
Step S308, when the wait duration that is converted into of number of times of accumulative total during, stop continuing to wait for the misregistration daily record greater than the maximum wait duration of default, a concurrent short message alarm information is to SMS platform, and reporting system keeper this day classification, distribution and task generate failure.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; being familiar with those of ordinary skill in the art ought can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.