CDR inquiry system and querying method
Technical field
The present invention relates to CDR inquiry system and querying method, particularly a kind of the realization searched for and the CDR inquiry system and the querying method of instant output Search Results fast to the call bill data file of the general format of magnanimity.
Background technology
The call bill data file is a kind of file that writes down statistics, each call bill data file is made up of some records, every record comprises some row, and every row all have its corresponding data types, between row and the row two kinds of partitioning schemes is arranged: press separator and separate or separate by regular length.Each call bill data file all has its set form, comprise data type, the row of the columns that every record of file name, filename suffix, call bill data file comprises, every row and be listed as between separation mode etc.
All can adopt the file of above-mentioned form to come record data during user's statistics in telecommunication system, measurement and control area, financial accounting statistics or the like the technical field.Along with the continuous growth of subscriber traffic, different operating processes all can produce the call bill data file of a large amount of different-formats, and these call bill data file loggings different information, is stored in different directories, the different file.The user need inquire about, add up according to certain condition these call bill data files.The demand of user session list inquiry system is to support call bill data file, file format variation, the statistical information of magnanimity can preserve and multiple demand such as importing.
In the prior art, because the difference of call bill data file format, the user is usually at every kind of ticket or inquiry system of the similar ticket exploitation of several form, thereby make the inquiry system function singleness, operate unfriendlyly, inquiry velocity is very slow, not the expectability text formatting, not expectability ticket number range, can not prospective users querying condition, can not realize expeditiously processing to the mass tickets data file.Handle if carry out magnanimity, just the ticket of magnanimity need be imported in the database, utilize database to carry out the query statistic analysis, thereby need building and complicated operations of facility environment.
Global system for mobile communications for example of the prior art (G1obal System of Mobilecommunication, hereinafter to be referred as GSM) short message ticket analyzer, this is the CDR inquiry system of analyzing at the call bill data file that Short Message Center produced of GSM network.Four kinds of tickets that it can only analyze set form simply show analysis result, then can not analyze the ticket of other form.
In a word, there is following shortcoming in existing CDR inquiry system:
1, lacks versatility, can only analyze the format of billing in several predefined particular technology areas;
2, querying condition is fixed, and can not expand;
3, the limited amount of inquiry ticket is not supported the inquiry to the call bill data file of magnanimity, if support the inquiry of the call bill data file of magnanimity is then needed building of facility environment and complicated operations;
4, search efficiency is low, and speed is slower;
5, can not preserve Query Result, can only inquire about again at every turn;
6, statistics is not directly perceived, does not have graphical interfaces.
Summary of the invention
First purpose of the present invention is at the shortage versatility of above-mentioned existing CDR inquiry system existence, does not support slow, the fixing shortcoming of querying condition of inquiry, inquiry velocity to the call bill data file of magnanimity, a kind of CDR inquiry system and querying method are provided, the call bill data file of the arbitrary format of separating with separator or regular length that makes that the user can self-definedly will inquire about, and the user can be provided with the querying condition of multiple condition composite; The querying condition of the multiple condition composite that this system can be provided with the user is handled; According to handling querying condition that the back forms the call bill data file of the user-defined arbitrary format of separating with separator or regular length is inquired about; By the realization of methods such as preliminary treatment and file management the call bill data file of the magnanimity of user's appointment is inquired about fast, and do not needed building and complicated operations of facility environment.
Second purpose of the present invention is low, the slow shortcoming of search efficiency that exists at above-mentioned existing CDR inquiry system, a kind of CDR inquiry system and querying method are provided, manage to be implemented in the query script and can export the result at any time by call bill data file, thereby improve search efficiency according to user's indication to user's appointment.The shortcoming that can not preserve Query Result, can only inquire about again at every turn at above-mentioned existing CDR inquiry system existence, the present invention also can provide a kind of CDR inquiry system and querying method further, this system can preserve Query Result, makes in the inquiry afterwards and can import and export the historical query result.
According to first purpose of the present invention, the invention provides a kind of CDR inquiry system and querying method.Described CDR inquiry system comprises and is used for user's configuration or adds configuration module, CDR inquiry module, the output module of call bill data file format; Interconnect respectively between described configuration module, CDR inquiry module, the output module, single or many conditions that described CDR inquiry module is used for the configuration file preserved according to configuration module and user's input by with/or the querying condition of composition of relations inquire about after the call bill data file that will inquire about is filtered, and preserve the Query Result log file, described output module is used for the content output with the Query Result log file of described CDR inquiry module preservation; The pretreatment module that the configuration file that the CDR inquiry module of described CDR inquiry system also can comprise the input module that is used for the user input query condition further, preserve according to configuration module and the querying condition of user's input filter the call bill data file of user inquiring, and query engine module; Described input module is connected with described pretreatment module, and described pretreatment module is filtered the call bill data file that will inquire about after the querying condition of user's input of described input module record is handled in view of the above; Described pretreatment module is connected with described query engine module, and the Query Result log file is inquired about and preserved to the call bill data file after described query engine module is filtered pretreatment module; Described query engine module is connected with described output module, and described output module is exported the content of the Query Result log file that preserve described query engine module inquiry back.
Described CDR inquiry method is for inquiring about and export Query Result according to the querying condition of user's input to the call bill data file of user's appointment, it is characterized in that: the CDR inquiry module according to single or many conditions of the configuration file of preserving in the configuration module and user input by with/or the querying condition of composition of relations, inquire about after the call bill data file that will inquire about filtered, and preserve the Query Result log file; Output module is exported the content of the Query Result log file that described CDR inquiry module is preserved; Described CDR inquiry method also can specifically may further comprise the steps: at first single or many conditions that the input module of CDR inquiry module is preserved user's input in step 1 by with/or the querying condition of composition of relations, and the querying condition that the pretreatment module of CDR inquiry module is preserved according to configuration file of preserving in the configuration module and input module in step 2 filters the call bill data file of user's appointment; Call bill data file after the query engine module of CDR inquiry module is filtered pretreatment module in step 3 is then inquired about, and Query Result is kept in the Query Result log file; The content of the Query Result log file that output module output query engine module is preserved in step 4.
Described CDR inquiry method can comprise that also configuration module is kept at the format information of the call bill data file that will inquire about of user's configuration or interpolation in the configuration file, and concrete steps can be: configuration module is according to the self-defining call bill data file format information updating configuration file of user's input in step 101; Whether configuration module checks in the configuration file include file type information in step 102, is execution in step 104 then, otherwise execution in step 103; Configuration module notifies the user to add file type information to regenerate configuration file in step 103, and execution in step 102 then; Be that step 104 finishes at last.
The step 2 of described CDR inquiry method also can specifically comprise the steps: at first the form initial interrogation condition of the call bill data file that will inquire about in the configuration file that in step 201 pretreatment module of CDR inquiry module preserves according to configuration module; After the querying condition that pretreatment module is preserved the input module of CDR inquiry module in step 202 formats then, with initial querying condition merging, as the condition set of inquiry; Then the file that all meets the querying condition collection in the call bill data file that the pretreatment module search subscriber provides in step 203.Described step 203 specifically comprises: the file that all meets the querying condition collection in the call bill data file that the method search subscriber by traversal different directories and recursive search subdirectory provides.
The step 3 of described CDR inquiry method can comprise the steps: specifically also that at first the query engine module of CDR inquiry module will be filtered whole consolidation formizations of call bill data file that obtain and the small data file that is divided into user configured length through pretreatment module in step 301; The query engine module is set up the index file of this inquiry in step 302 then, and the storage address of every record in the filename of all small data file and the file is kept in the index file with set form; Then the query engine module is inquired about described index file according to user's querying condition in step 303, obtains the storage address of record corresponding in corresponding small data file name and the file; The query engine module checks in corresponding record according to the storage address that writes down in small data file name and the file in step 304 at last, and it is kept in the Query Result log file.
For realizing second purpose of the present invention, the output module of described CDR inquiry system also can comprise the file manager that can export Query Result in the user inquiring process immediately, is connected with described CDR inquiry module.The content of the Query Result log file of CDR inquiry module preservation is searched and exported to described file manager according to the Query Result record that the user selects by output module in query script.The step 4 of described CDR inquiry method also can comprise the method for file manager instant output Query Result in the user inquiring process of output module, the file manager that specifically comprises the steps: output module in step 41 is inquired about the index file that the CDR inquiry module is preserved according to the call bill data file logging that the user selects by output module, obtains the storage address of corresponding data file; File manager obtains corresponding data file according to the address of finding in step 42 then; Then file manager duplicates described data file in memory buffer in step 43; Last in step 44 content of data file in the file manager output memory buffer.Wherein also can comprise: file manager obtains the length of the data file of current output according to index file, in advance the data file of output next time is copied in the memory buffer before current end of output.
For realizing second purpose of the present invention, the output module of described CDR inquiry system also can comprise the importing module that is used to import and export the historical query result further, is connected with described configuration module with described CDR inquiry module respectively; The historical query record that described importing module is selected by output module according to the user, check according to the configuration file that configuration module is preserved whether the call bill data file format is correct, if correct then search and export the content of the data file corresponding that the CDR inquiry module preserves with the historical query record.The step 4 of described CDR inquiry method can comprise further that also the importing module of output module imports and output historical query result's method, comprises the steps: that specifically at first importing module in step 401 obtains the call bill data file format according to the historical query outcome record file that the user selects by output module; Whether according to file type information check call bill data file format in configuration file correct, be execution in step 403 then if in step 402, importing module, otherwise execution in step 405; In step 403, import the call bill data file of module then according to the correspondence of historical query outcome record file polling CDR inquiry module preservation; In step 404, import the corresponding call bill data file content of module output; Be that step 405 finishes at last.
For realizing second purpose of the present invention, the output module of described CDR inquiry system also can comprise the statistical module that is used for Query Result is carried out statistical analysis further, is connected with described CDR inquiry module; The field that will add up that described statistical module is selected by output module according to the user, this field information in the data file corresponding with the Query Result log file that collection CDR inquiry module is preserved is analyzed the back to the Information Statistics of collecting and is exported.The statistical module that the step 4 of described CDR inquiry method also can comprise output module further specifically comprises the method that Query Result carries out statistical analysis and output: at first the type that statistical module selects to carry out the field of statistical analysis according to the user by output module in step 4001 is collected the information of this field in destination file; Statistical module carries out statistical analysis to the information of collecting in step 4002 then; Statistical module output statistic analysis result in step 4003.Wherein said step 4003 can comprise: statistical module generates statistical log according to statistics.
Further, the method for described file manager instant output Query Result in the user inquiring process can specifically comprise: in query script current Query Result is carried out statistical operation according to the ticket field that the user selects.The statistical module of described output module can specifically comprise the step 4003 that Query Result carries out the method for statistical analysis and output: statistical module is judged employing pie chart or linear graph output statistic analysis result automatically according to the data type of user's needs statistics.
In addition, CDR inquiry system of the present invention also can comprise control module; Described enquiry module, described configuration module, and described output module between interconnect by described control module respectively, described control module is used for the initialization and the maintenance of each module and coordinates each module connecting each other and operating.CDR inquiry system of the present invention also can comprise maintenance module; Described maintenance module is connected with described control module, gets in touch by described control module and other each module, is used for service user interface and configuration file and recording operation daily record.
In technique scheme, by the mass tickets data file consolidation formization that will inquire about and the small data file that is divided into user configured length, and for inquire about the foundation index file corresponding at every turn with the massive data files that will inquire about, thereby make CDR inquiry system of the present invention can support the call bill data file of the arbitrary format separated with separator or regular length, and do not need to introduce database, thereby avoided building and complicated operations of facility environment; Handle by format and merging, make CDR inquiry system of the present invention can support the querying condition of multiple condition composite querying condition; Realize in query script, exporting at any time the effect of Query Result by file manager, thereby improved search efficiency; By file manager the management of data file is reduced the EMS memory occupation problem that the magnanimity inquiry is caused significantly, under lower hardware environment, can carry out the inquiry and the statistics of mass tickets efficiently; Realized preservation and output by the processing that imports module to the historical query result.To the statistical analysis of Query Result with comprise the output intent of pie chart, linear graph etc., realized exporting intuitively the effect of Query Result by statistical module.
As shown from the above technical solution, shortcomings such as the call bill data file format that CDR inquiry system of the present invention and querying method solved the inquiry do not supported in the prior art the call bill data file of magnanimity, be difficult to realize to inquire about complicated query condition, support is single, search efficiency is low, speed is slow, and statistics is difficult to preserve and statistics is not directly perceived; The versatility and the diversity of Business Processing have been realized, make the user only need carry out self-defined any call bill data file format of separating with separator or regular length, just can carry out statistical query work, thereby make the user not need installation database to carry out loaded down with trivial details data importing or the other inquiry system of developing at certain call bill data file any field; Can reach support to the call bill data file of the arbitrary format of separating with separator or regular length of magnanimity carry out quick search, support multiple condition composite querying condition, improve search efficiency, support technique effects such as Query Result are exported in historical query result's preservation and output, support intuitively.
Description of drawings
Fig. 1 is the schematic diagram of the specific embodiment one of CDR inquiry system provided by the invention;
Fig. 2 is the schematic diagram of the specific embodiment two of CDR inquiry system provided by the invention;
Fig. 3 is the schematic diagram of the specific embodiment three of CDR inquiry system provided by the invention;
Fig. 4 is the schematic diagram of the specific embodiment four of CDR inquiry system provided by the invention;
Fig. 5-the 11st, the schematic diagram of the specific embodiment of CDR inquiry method provided by the invention.
Embodiment
Below in conjunction with drawings and Examples, technical scheme of the present invention is described in further detail.
Referring to Fig. 1, be the schematic diagram of the specific embodiment of the invention one.One CDR inquiry system comprises being used for user's configuration or adding configuration module 10, CDR inquiry module 20, the output module 30 of call bill data file format.Interconnect respectively between configuration module 10, CDR inquiry module 20, the output module 30; After filtering the CDR file that will inquire about, inquires about the querying condition that CDR inquiry module 20 is used for the configuration file preserved according to configuration module 10 and user's input, and preserve the Query Result log file, output module 30 is used for the content output with the Query Result log file of CDR inquiry module 20 preservations.
Referring to Fig. 2, be the schematic diagram of the specific embodiment of the invention two.One CDR inquiry system A comprises being used for user's configuration or adding configuration module 10, CDR inquiry module 20, the output module 30 of call bill data file format.Interconnect respectively between configuration module 10, CDR inquiry module 20, the output module 30; CDR inquiry module 20 is inquired about after according to the querying condition of the configuration file of preserving in the configuration module 10 and user's input the CDR file that will inquire about being filtered, and preserve the Query Result log file, output module 30 is exported the content of the Query Result log file that CDR inquiry module 20 is preserved.Pretreatment module 50 and query engine module 40 that CDR inquiry module 20 comprises the input module 60 that is used for the user input query condition, the call bill data file of user inquiring filtered according to the querying condition of user's input.Input module 60 is connected with pretreatment module 50, and pretreatment module 50 is filtered the CDR file that will inquire about after the querying condition of user's input of input module 60 records is handled in view of the above.Pretreatment module 50 is connected with query engine module 40, and the Query Result log file is inquired about and preserved to the call bill data file after 40 pairs of pretreatment module of query engine module 50 are filtered.Query engine module 40 is connected with output module 30, and output module 30 is exported the content of the Query Result log file that preserve query engine module 40 inquiry backs.
Referring to Fig. 3, be the schematic diagram of the specific embodiment of the invention three.One CDR inquiry system B comprises being used for user's configuration or adding configuration module 10, CDR inquiry module 20, the output module 30 of call bill data file format.Interconnect respectively between configuration module 10, CDR inquiry module 20, the output module 30; CDR inquiry module 20 is inquired about according to the querying condition of the configuration file of preserving in the configuration module 10 and user's input, and output module 30 is exported the content of the Query Result log file that CDR inquiry module 20 is preserved.Pretreatment module 50 and query engine module 40 that CDR inquiry module 20 comprises the input module 60 that is used for the user input query condition, the call bill data file of user inquiring filtered according to the querying condition of user's input.Input module 60 is connected with pretreatment module 50, and pretreatment module 50 is filtered the CDR file that will inquire about after the querying condition of user's input of input module 60 records is handled in view of the above.Pretreatment module 50 is connected with query engine module 40, and the Query Result log file is inquired about and preserved to the call bill data file after 40 pairs of pretreatment module of query engine module 50 are filtered.Query engine module 40 is connected with output module 30, and output module 30 is exported the content of the Query Result log file that preserve query engine module 40 inquiry backs.Output module 30 comprises the file manager 70 that can export Query Result in the user inquiring process immediately, the statistical module 90 that is used to import and export historical query result's importing module 80 and is used for Query Result is carried out statistical analysis.File manager 70 is connected with CDR inquiry module 20; The content of the Query Result log file of CDR inquiry module 20 preservations is searched and exported to file manager 70 according to the Query Result record that the user selects by output module 30 in query script.Importing module 80 is connected with configuration module 10 with CDR inquiry module 20 respectively; Import the historical query record that module 80 is selected by output module 30 according to the user, check according to the configuration file that configuration module 10 is preserved whether the call bill data file format is correct, if correct then search and export the content of CDR inquiry module 20 data file corresponding that preserve with the historical query record.Statistical module 90 is connected with CDR inquiry module 20; The field that will add up that statistical module 90 is selected by output module 30 according to the user, this field information in the data file corresponding with the Query Result log file that collection CDR inquiry module 20 is preserved is analyzed the back to the Information Statistics of collecting and is exported.
Referring to Fig. 4, be the schematic diagram of the specific embodiment of the invention four.One CDR inquiry system C comprises being used for user configuration or adding configuration module 10, CDR inquiry module 20, output module 30, the initialization that is used for each module and the maintenance of call bill data file format and coordinate the control module 100 that each module connects each other and operate and be used for service user interface and the maintenance module 110 of configuration file and recording operation daily record; CDR inquiry module 20, configuration module 10, and output module 30 between interconnect by control module 100 respectively, control module 100 is used for the initialization and the maintenance of each module and coordinates each module connecting each other and operating, CDR inquiry module 20 is inquired about according to the querying condition of the configuration file of preserving in the configuration module 10 and user's input, and output module 30 is exported the content of the Query Result log file that CDR inquiry module 20 is preserved.Maintenance module 110 is connected with control module 100, gets in touch by control module 100 and other each module, is used for service user interface and configuration file and recording operation daily record.Pretreatment module 50 and query engine module 40 that CDR inquiry module 20 comprises the input module 60 that is used for the user input query condition, the call bill data file of user inquiring filtered according to the querying condition of user's input.Input module 60 is connected with pretreatment module 50, and pretreatment module 50 is filtered the CDR file that will inquire about after the querying condition of user's input of input module 60 records is handled in view of the above.Pretreatment module 50 is connected with query engine module 40, and the Query Result log file is inquired about and preserved to the call bill data file after 40 pairs of pretreatment module of query engine module 50 are filtered.Query engine module 40 is connected with output module 30, and output module 30 is exported the content of the Query Result log file that preserve query engine module 40 inquiry backs.Output module 30 comprises the file manager 70 that can export Query Result in the user inquiring process immediately, the statistical module 90 that is used to import and export historical query result's importing module 80 and is used for Query Result is carried out statistical analysis.File manager 70 is connected with CDR inquiry module 20; The content of the Query Result log file of CDR inquiry module 20 preservations is searched and exported to file manager 70 according to the Query Result record that the user selects by output module 30 in query script.Importing module 80 is connected with configuration module 10 with CDR inquiry module 20 respectively; Import the historical query record that module 80 is selected by output module 30 according to the user, check according to the configuration file that configuration module 10 is preserved whether the call bill data file format is correct, if correct then search and export the content of CDR inquiry module 20 data file corresponding that preserve with the historical query record.Statistical module 90 is connected with CDR inquiry module 20; The field that will add up that statistical module 90 is selected by output module 30 according to the user, this field information in the data file corresponding with the Query Result log file that collection CDR inquiry module 20 is preserved is analyzed the back to the Information Statistics of collecting and is exported.
Referring to Fig. 5, a kind of CDR inquiry method, comprise: at first single or many conditions that the input module of CDR inquiry module is preserved user's input in step 1 by with/or the querying condition of composition of relations, and the querying condition that the pretreatment module of CDR inquiry module is preserved according to input module in step 2 filters the call bill data file of user's appointment; Call bill data file after the query engine module of CDR inquiry module is filtered pretreatment module in step 3 is then inquired about, and Query Result is kept in the Query Result log file; The content of the Query Result log file that output module output query engine module is preserved in step 4.
Above-mentioned CDR inquiry method comprises that also configuration module is kept at the format information of the call bill data file that will inquire about of user's configuration or interpolation in the configuration file, referring to Fig. 6, its concrete steps are: configuration module is according to the self-defining call bill data file format information updating configuration file of user's input in step 101; Whether configuration module checks in the configuration file include file type information in step 102, is execution in step 104 then, otherwise execution in step 103; Configuration module notifies the user to add file type information to regenerate configuration file in step 103, and execution in step 102 then; Be that step 104 finishes at last.
Referring to Fig. 7, the step 2 of above-mentioned CDR inquiry method specifically comprises the steps: at first the form initial interrogation condition of the call bill data file that will inquire about in the configuration file that in step 201 pretreatment module of CDR inquiry module preserves according to configuration module; After the querying condition that pretreatment module is preserved the input module of CDR inquiry module in step 202 formats then, with initial querying condition merging, as the condition set of inquiry; Then the file that all meets the querying condition collection in the call bill data file that the pretreatment module search subscriber provides in step 203.Described step 203 specifically comprises: the file that all meets the querying condition collection in the call bill data file that the method search subscriber by traversal different directories and recursive search subdirectory provides.
Referring to Fig. 8, the step 3 of above-mentioned CDR inquiry method comprises the steps: specifically that at first the query engine module of CDR inquiry module will be filtered whole consolidation formizations of call bill data file that obtain and the small data file that is divided into user configured length through pretreatment module in step 301; The query engine module is set up the index file of this inquiry in step 302 then, and the storage address of every record in the filename of all small data file and the file is kept in the index file with set form; Then the query engine module is inquired about described index file according to user's querying condition in step 303, obtains the storage address of record corresponding in corresponding small data file name and the file; The query engine module checks in corresponding record according to the storage address that writes down in small data file name and the file in step 304 at last, and it is kept in the Query Result log file.
Referring to Fig. 9, the step 4 of above-mentioned CDR inquiry method can comprise the method for file manager instant output Query Result in the user inquiring process of output module, the file manager that specifically comprises the steps: output module in step 41 is inquired about the index file that the CDR inquiry module is preserved according to the call bill data file logging that the user selects by output module, obtains the storage address of corresponding data file; File manager obtains corresponding data file according to the address of finding in step 42 then; Then file manager duplicates described data file in memory buffer in step 43; Last in step 44 content of data file in the file manager output memory buffer.
Referring to Figure 10, the step 4 of above-mentioned CDR inquiry method can comprise that also the importing module of output module imports and output historical query result's method, comprises the steps: that specifically at first importing module in step 401 obtains the call bill data file format according to the historical query outcome record file that the user selects by output module; Whether according to file type information check call bill data file format in configuration file correct, be execution in step 403 then if in step 402, importing module, otherwise execution in step 405; In step 403, import the call bill data file of module then according to the correspondence of historical query outcome record file polling CDR inquiry module preservation; In step 404, import the corresponding call bill data file content of module output; Be that step 405 finishes at last.
Referring to Figure 11, the statistical module that the step 4 of above-mentioned CDR inquiry method also can comprise output module specifically comprises the method that Query Result carries out statistical analysis and output: at first the type that statistical module selects to carry out the field of statistical analysis according to the user by output module in step 4001 is collected the information of this field in destination file; Statistical module carries out statistical analysis to the information of collecting in step 4002 then; Statistical module output statistic analysis result in step 4003.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.