Summary of the invention
In view of this, the purpose of the embodiment of the invention is to provide CDR date storage method, display packing and system, realizes finding the data that satisfy user's needs fast from the CDR data of magnanimity.
For achieving the above object, the embodiment of the invention provides following technical scheme:
A kind of storage means of call detail record CDR data comprises:
Obtain the CDR data;
The described CDR data of each class generate four subfiles, wherein:
First subfile is used to deposit the CDR essential information;
Second subfile is used to deposit the additional information of CDR;
The 3rd subfile is used to deposit raw data packets and the superpacket of CDR;
The 4th subfile is used to deposit the index of CDR file content;
Described four subfiles are write storage medium, and described four subfiles are interrelated.
Describedly described four subfiles write storage medium specifically comprise:
Described four subfiles are all write disk;
Perhaps, described first subfile is write database, second, third and the 4th subfile are write disk.
Described four subfiles have identical filename, different suffix names.
Described first subfile comprises: CDR file header and CDR data division, and wherein, described file header comprises that the first CDR time started stabs and the last CDR time started stabs; Described CDR data division comprises the sign of this CDR, the position that additional information files is deposited, the file identification of higher level CDR and the sign of higher level CDR.
Described second subfile comprises: file header and additional data area, and wherein, described additional data area comprises: other not isometric information field that initial data package informatin, higher level CDR position, current C DR deposit and other additional informations of current C DR correspondence; Wherein, described raw data packets information comprises the position of described packet in the packet file and the position of the pairing CDR of subordinate of this packet.
Described the 3rd subfile comprises: packet file header and packet information, wherein,
When the CDR data after described synthesizing are agreement CDR data, the initial data of store data bag in the described packet information;
When the CDR data after described synthesizing are upper strata CDR data, deposit the positional information of current data packet entity in the described packet information.
Described the 4th subfile comprises: file header, CDR file index table and packet file index table.
A kind of CDR data display method comprises:
Obtain the display condition of user's input;
The identification information of the CDR that meets described display condition that filters out, the identification information storage of described CDR is in internal memory;
From first subfile of having deposited the CDR essential information, obtain the essential information of CDR according to described CDR identification information, find the original document filename of CDR;
According to described first subfile and deposited incidence relation between second subfile of CDR additional information, utilize described raw filename to find the pairing deposit data of CDR position, described incidence relation obtains according to the 4th subelement of depositing CDR file content index;
Related according between described second subfile and the 3rd subfile of having deposited raw data packets and superpacket, utilize the pairing deposit data of described CDR position to read the CDR initial data, described incidence relation obtains according to the 4th subelement of depositing CDR file content index;
Utilize the essential information structure CDR data of described CDR initial data and described CDR;
The CDR data that display structure goes out.
Before the identification information of the CDR that meets described display condition that filters out, also comprise:
Described CDR identification information is divided into groups.
Described CDR identification information is divided into groups specifically to comprise:
According to time sequencing the CDR data are divided into groups;
According to CDR bar number the CDR data are divided into groups;
Type according to the CDR data is divided into groups to the CDR data; Perhaps
State according to the CDR data divides into groups to the CDR data.
A kind of CDR data presentation system comprises:
Acquiring unit is used to obtain the display condition of user's input;
Structural unit is used for the identification information structure CDR data according to the CDR that meets described display condition that filters out;
Display unit is used for the CDR data that display structure goes out.
Described structural unit specifically comprises:
First searches subelement, is used for obtaining the essential information of CDR according to described CDR identification information from first subfile of having deposited the CDR essential information, finds the original document filename of CDR;
Second searches subelement, be used for according to described first subfile and deposited incidence relation between second subfile of CDR additional information, utilize described raw filename to find the pairing deposit data of CDR position, described incidence relation obtains according to the 4th subelement of depositing CDR file content index;
The 3rd searches subelement, be used for related according between described second subfile and the 3rd subfile of having deposited raw data packets and superpacket, utilize the pairing deposit data of described CDR position to read the CDR initial data, described incidence relation obtains according to the 4th subelement of depositing CDR file content index;
The constructor unit is used to utilize the essential information of described CDR initial data and described CDR to construct the CDR data.
Described display unit also is used for the filtration progress by progress bar display structure unit.
As seen, in embodiments of the present invention, described display packing is to obtain the display condition of user's input; The identification information of the CDR that meets described display condition that filters out, the identification information storage of described CDR is in internal memory; According to described CDR identification information structure CDR data; The CDR data that display structure goes out, by the display packing that the embodiment of the invention provided, by filtering out the CDR identification information that meets user's display condition earlier, construct the CDR data again, saved Installed System Memory, greatly save system resource, improved the operating efficiency of system, alleviated the pressure of system.。
Embodiment
The embodiment of the invention provides CDR date storage method, display packing and system, for making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in further detail
Referring to Fig. 1, in an embodiment of the present invention, the method that the embodiment of the invention provides of realization may further comprise the steps:
Step 101: obtain the CDR data.
Step 102: the described CDR data of each class are told four subfiles.
The difference of data based self agreement of the CDR after synthetic has different types, as the CDR data of CDMA, and A11 type CDR data etc.Each class CDR data generates four subfiles, distinguishes with four kinds of different suffix names respectively, is respectively:
*.cdr, be used for depositing the CDR essential information, all central fields require isometric, help filter operation;
*.apd, be used for depositing the additional information of each bar CDR, for example corresponding data package location or the like;
*.dat, be used for depositing in raw data packets or superpacket;
*.map, be used for depositing the index of file content;
Wherein, " * " represents four filenames that subfile is identical, and these four subfile mutual group become a CDR file group of finishing, and are interrelated between four subfiles, when the user need copy or be mobile, are that whole file group is operated simultaneously.
Step 103: described four subfiles are write storage medium.
Four subfiles will write the storage that storage medium just can be finished the CDR data after generating.
Four subfiles all can be write disk; Perhaps will
*.cdr write database, and three subfiles will being left write disk.
Below the structure of four subfiles is introduced one by one.
The subfile that with cdr is suffix is called the CDR file, is made of CDR header file and CDR data division.
Each CDR file all has the header file of oneself, referring to table 1, comprising timestamp.The purpose of doing like this for later on according to the time period CDR data are retrieved be convenience with quick.
Table 1
Field name |
Length | Explanation |
Version |
|
1 |
Currency is 1, for compatibility, so design version |
Information completely whether |
1 |
Whether sign is a CDR file that all forms |
Keep |
2 |
0 |
The CDR size |
2 |
Require the necessary equal and opposite in direction of CDR of all storages |
The CDR number |
2 |
In the middle of the number of the CDR that deposits |
The first CDR time started stabs |
8 |
|
The end CDR time started stabs |
8 |
|
The data division of CDR file be the original storage information of each CDR data referring to table 2, this part information is fixed length, helps process like this and searches and filter.
Table 2
Field name |
Length | Explanation |
CDR_ID |
|
8 |
The sign of this CDR |
The additional information deposit position |
8 |
Deposit position in additional information files |
The CDR time started stabs |
8 |
|
The CDR concluding time stabs |
8 |
|
Whether CDR finishes |
1 |
0..1 |
CDR finishes reason |
1 |
User definition must be realized |
The CDR current state |
2 |
User definition must be realized |
The FILE_ID of higher level CDR |
4 |
The FILE sign of corresponding higher level CDR |
The FILE_CDR_ID of higher level CDR |
8 |
The ID of corresponding higher level CDR |
Other CDR field |
4*N |
Specify by the user, require 4 byte-aligned |
Wherein, CDR_ID is the unique identification of CDR, when creating, CDR produces, and be the unique identification of this CDR in whole life cycle.
For the content of each field is better understood, explain several notions here, promptly synthetic CDR and agreement CDR.
CDR is divided into synthetic CDR and agreement CDR from synthetic scope.Give an example below these two notions are described: device A is made a phone call to equipment B, the centre must be via equipment C, the communication protocol that adopts between A and the C is Proto AC, the communication protocol that adopts between B and the C is Proto BC, CDR person between CDR between A and the C and B and the C is agreement CDR so, they have only described the communication process between adjacent two equipment, with the CDR between A-C, the C-B combine (being associated together) just formed synthetic CDR, it described device A to equipment B the full call flow process.Obviously, in such cases, synthetic CDR is the higher level CDR of agreement CDR, and agreement CDR is the CDR of subordinate of synthetic CDR.
So the FILE_CDR_ID of the FILE_ID of higher level CDR and higher level CDR just is meant with respect to the FILE sign of the upper level CDR of current C DR and the ID of corresponding higher level CDR in the table 2.
The subfile that with apd is suffix is a CDR accessory information file, comprises the attachment data district of header file and CDR.
The accessory information of CDR comprises other not isometric information fields that initial data package informatin, higher level CDR position, this CDR deposit and other additional informations of this CDR correspondence.
Wherein, the initial data package informatin specifically comprises: the information of packet number and each packet, and the information of each packet comprises: the position of the decoding interpretative version string of the position of packet in the packet file, this packet and the CDR of subordinate of this packet correspondence.
Higher level CDR position comprises: the index of this CDR place file and the index of this CDR in file.
Subordinate CDR position comprises: the index of this CDR place file and the index of this CDR in file.
With dat be suffix be the packet file of CDR data, comprise file header and packet information two parts.
Information such as original, the association that the store data bag is relevant in each packet information, the content that the packet of agreement CDR and non-agreement CDR is deposited is different.
Table 3
Field name |
Length | Explanation |
Version |
|
1 |
Currency is 1, for compatibility, so design version |
Information completely whether |
1 |
Whether sign is a CDR file that all forms |
Keep |
2 |
0 |
The CDR size |
2 |
Require the necessary equal and opposite in direction of CDR of all storages |
The CDR number |
2 |
In the middle of the number of the CDR that deposits |
The first CDR time started stabs |
8 |
|
The end CDR time started stabs |
8 |
|
Table 4
Field name |
Length |
Explanation |
The filename at packet entity place |
|
|
The file index position of packet entity |
4 |
The position of the entity of this packet |
The FILE_ID of corresponding CDR |
4 |
The file index of corresponding this layer CDR |
FILE_CDR_ID |
|
8 |
The sign of corresponding this layer CDR |
This packet out of Memory |
|
Original other field in the CPT form |
Table 3 is the packet file of agreement CDR correspondence, table 4 is the corresponding packet file of upper strata CDR (non-agreement CDR), from table 3 and table 4 as can be seen, what deposit in the packet file of agreement CDR correspondence is the original data message of packet, what deposit in the packet file of higher level CDR correspondence is the position of packet entity, is the location index of packet name and this packet.
No matter it can also be seen that from table 3 and table 4, be agreement CDR or the higher level is CDR, all preserved the position of this layer CDR in the pairing packet, its objective is in order to realize that packet is to the index between the CDR file (promptly being the file of suffix with cdr).
The subfile that with map is suffix is the CDR index file, and the index that is used for depositing the CDR file closes and the index relative of packet file.
The CDR index file comprises file header and CDR file index table and packet file index table.
After according to preceding method the CDR data being stored, as shown in Figure 2 interrelated between the CDR specifically comprises:
1., higher level's (N level) CDR packet is searched data entity: the file ID and the file index position of having deposited the packet entity in the higher level CDR packet, at first obtain the position of packet entity, obtain the packet entity according to the incidence relation 12 between the entity content in location index in the packet and the N+1 level packet then by the incidence relation 4 between packet index position and the database file concordance list.
2., search corresponding packet from CDR: if agreement CDR, as the N+1 level CDR among Fig. 2, at first find the corresponding raw data file name of CDR file data part, find the pairing deposit data of this CDR position according to the incidence relation 1 between the original packet information in CDR data division and the CDR additional information files, carry out reading of data by the incidence relation 2 between original packet information in the described CDR additional information files and the packet file data package informatin then.
It should be noted that: if synthetic CDR, for example be N level CDR, what find by the incidence relation 2 between original packet information in the described CDR additional information files and the packet file data package informatin is the position that the packet entity is deposited, also should continue to search the entity of this data correspondence, the description during 1. method sees.
3., CDR from the data search correspondence: at first according to the incidence relation 3 between packet file and the CDR index file, use the index FILE_ID of corresponding this layer CDR place file in CDR file index table, to find corresponding filename, according to the incidence relation 5 of packet file and CDR file data part, find corresponding CDR then in conjunction with CDR_ID.
4., the CDR of subordinate searches higher level CDR: each CDR has deposited the position of corresponding higher level CDR in its additional information, be the FILE_ID+CDR_ID that incidence relation 6 between data division and the accessory information file finds the pairing higher level CDR of CDR at first by the CDR file, find the filename of the pairing higher level CDR of FILE_ID then by the incidence relation between accessory information file and the index file 7, add that by the filename that obtains CDR_ID finds corresponding higher level CDR through the incidence relation 8 between additional information files and the higher level CDR file data part.
5., higher level CDR packet is searched the CDR of subordinate: each packet among higher level CDR all might corresponding CDR of subordinate, find corresponding data to wrap in FILE_ID and CDR_ID among the CDR of subordinate by the incidence relation 9 between higher level CDR file data part and the higher level CDR accessory information file, is a concrete CDR filename with FILE_ID by incidence relation 10 index between higher level CDR additional information files and the higher level CDR index file, adds that then CDR_ID finds the CDR of subordinate by the incidence relation 11 between higher level CDR additional information files and the CDR of the subordinate file.
It should be noted that agreement CDR does not have packet file index table.
As can be seen from Figure 2, after the CDR storage being four subfiles, because interrelated between four subfiles, so can realize between the CDR of the superior and the subordinate data and the index between the subfile of CDR data at the corresponding levels and searching according to aforesaid method.
The embodiment of the invention also provides a kind of CDR data display method, and referring to Fig. 3, this method comprises:
Step 301: the display condition that obtains user's input.
In embodiments of the present invention, the CDR data are stored, just after storage finishes, the CDR identification information of having deposited in the first kind subfile of CDR essential information is stored in the internal memory according to aforesaid storage means.
Step 302: the identification information of the CDR that meets described display condition that filters out;
Step 303: utilize the CDR identification information structure CDR data that filter out.
Wherein, described structure specifically comprises:
From first subfile of having deposited the CDR essential information, obtain the essential information of CDR according to described CDR identification information, find the original document filename of CDR;
According to described first subfile and deposited incidence relation between second subfile of CDR additional information, utilize described raw filename to find the pairing deposit data of CDR position, described incidence relation obtains according to the 4th subelement of depositing CDR file content index;
Related according between described second subfile and the 3rd subfile of having deposited raw data packets and superpacket, utilize the pairing deposit data of described CDR position to read the CDR initial data, described incidence relation obtains according to the 4th subelement of depositing CDR file content index;
Utilize the essential information structure CDR data of described CDR initial data and described CDR.
Step 304: the CDR data that display structure goes out.
As previously mentioned, in the embodiment of the invention, behind the display condition that has obtained the user, at first filter out the identification information of the CDR data that meet display condition, utilize described identification information that this CDR entity object is constructed in internal memory again, because the CDR identification information storage is in internal memory, so can soon qualified CDR identification information be filtered out according to the filtercondition that the user provides, construct in internal memory according to the CDR data of the interrelated relation in the CDR subfile then user's needs, thereby the CDR data of needs have been realized showing to the user fast, in addition, because in existence of CDR solid data and the memory device, just just in internal memory, construct when needed, so method provided by the invention has been saved taking Installed System Memory, alleviate system pressure, improved the efficient of system.
Preferably, in order further to accelerate the rate of filtration, before filtering the CDR identification information, the filtercondition that provides according to the user also comprises:
Described CDR identification information is divided into groups.
CDR after can adopting different standards to storage in actual applications divides into groups, and for example the time that produces according to the CDR data divides into groups;
Perhaps, according to CDR bar number the CDR data are divided into groups;
Perhaps the CDR data are divided into groups according to the type of CDR data.
Comprise in the CDR data of all generations and synthetic CDR that finishes and the CDR two states that is synthesizing, can the CDR data be divided into groups according to the state of CDR data in certain embodiments.
In certain embodiments, can be in conjunction with multiple packet mode, concrete combination is determined according to actual needs.
In the face of magnanimity CDR data,, be easy to cause system in case of system halt because of data volume is too huge if adopt the modes that all show.
By aforesaid step, by the CDR identification information is divided into groups, behind the display condition that obtains the user, according to the content of user's demand explicit user needs, many-sided multi-level minimizing software shows the burden of CDR.
Being the CDR data shows by group, for example can divide state to show, as all CDR, the CDR that synthesize, synthesize three types of CDR that finish, can also only show nearest CDR data on this basis.
When the user select to show certain CDR grouping after, the CDR identification information in other CDR groupings will can not submitted to the interface display functional module, simultaneously, after the user chose the type of demonstration, then the CDR data of other types were not then submitted to the interface yet and are handled.In addition, under the situation about either way being provided with in front, if the CDR number is still many, the user can also select only to show some nearest CDR, by the maximum that once shows the CDR data is set demonstration quantity is controlled.
Fig. 4 and Fig. 5 are the process sectional drawing of the CDR data display method that the embodiment of the invention provided.The program interface of the embodiment of the invention obtains the display condition of user's input by the mode of drop-down menu.Can also obtain the display condition of user's input by modes such as for example dialog boxes in other embodiments, the embodiment of the invention does not limit this.
What the user selected in the CDR display type control combination frame among Fig. 4 is to show all processes, corresponding is the CDR data of whole states, show in the control in file group, what the user selected is first packetized file, obviously in embodiments of the present invention, the CDR data of all processes in first packetized file have been equivalent to choose.
After the user had determined display condition, system just filtered out the CDR data that meet display condition according to the display condition of user's input of being obtained from the CDR data set after the grouping.
Shown among Fig. 4 that the record number is 15043, current displayed record number is 5000, controls the CDR data that once can show at most by maximum show value setting, avoids a data presented to cause situations such as system in case of system halt above system loading.
Fig. 5 is another process sectional drawing of the method that the embodiment of the invention provided, as seen from the figure, the display condition of user's input is for only showing the building-up process and second file group, promptly show CDR data synthetic in second file group, after filtering, the record number is 190, compares with Fig. 4, and the pressure of demonstration reduces greatly.
When the user thinks the information of certain certain row of row in the displayed map 5, can trigger the Presentation Function of certain certain row of row, the mode of triggering can be content or other mode that need check by double-clicking.
Behind the specifying information that will show that obtains user's triggering, from dynamic group, obtain the identification information of the CDR that will show.At first judge the position of this CDR according to the identification information of this CDR, the information structuring that reads CDR self according to the positional information of CDR goes out the CDR object then, and the field of checking according to user's needs shows content corresponding to the user.
If the user will check the packet of CDR correspondence, in internal memory, construct this CDR object so after, find corresponding packet according to the object of this CDR.Because in the embodiment of the invention, CDR stores according to the method shown in the explanation of Fig. 1 and correspondence thereof, promptly can find corresponding packet according to CDR in conjunction with the incidence relation shown in Fig. 2, repeats no more herein.
Contrast by Fig. 4 and Fig. 5 as can be seen, by the CDR data are prestored, divide into groups, show the CDR data according to needing selectively of user to the user, make the pressure that has greatly alleviated system when the user finds the CDR data that oneself need apace.
Referring to Fig. 6, the embodiment of the invention also provides a kind of CDR data presentation system, comprising:
No matter adopt which kind of packet mode, what preserve in each grouping of above-mentioned CDR is not the CDR entity object, but the relevant identification information of these CDR, be that these groupings are actually the set of CDR identification information, comprising the identification information of each CDR with and affiliated file group information, be equivalent to the dynamic marks information sets.Because the CDR data described in the embodiment of the invention are stored according to aforesaid storage means, so the identification information by CDR, we can know the position at CDR entity object place, can save the space of internal memory so well.
Acquiring unit 601 is used to obtain the display condition of user's input.
Structural unit 602 is used for the identification information structure CDR data according to the CDR that meets described display condition that filters out.
Wherein, referring to Fig. 7, described structural unit 602 specifically comprises:
First searches subelement 701, is used for obtaining the essential information of CDR according to described CDR identification information from first subfile of having deposited the CDR essential information, finds the original document filename of CDR;
Second searches subelement 702, be used for according to described first subfile and deposited incidence relation between second subfile of CDR additional information, utilize described raw filename to find the pairing deposit data of CDR position, described incidence relation obtains according to the 4th subelement of depositing CDR file content index;
The 3rd searches subelement 703, be used for related according between described second subfile and the 3rd subfile of having deposited raw data packets and superpacket, utilize the pairing deposit data of described CDR position to read the CDR initial data, described incidence relation obtains according to the 4th subelement of depositing CDR file content index;
Constructor unit 704 is used to utilize the essential information of described CDR initial data and described CDR to construct the CDR data.
Display unit 603 is used for the CDR data that display structure goes out.
Described display unit 603 also is used for the filtration progress by progress bar display structure unit.
The described display system of Fig. 6 is by at first choosing appropriate C DR identification information according to needing of user, show to the user constructing the CDR data that satisfy user's needs according to described identification information, the system that the embodiment of the invention provided has saved taking Installed System Memory, alleviate system pressure, improved the efficient of system.
Make the pressure that has greatly alleviated system when the user finds the CDR data that oneself need apace.
Preferably, in order further to accelerate the retrieval to the CDR identification information that satisfies filtercondition, system shown in Figure 6 also comprises:
Grouped element is used for the CDR identification information of internal memory is divided into groups.
CDR after can adopting different standards to storage in actual applications divides into groups, and for example the time that produces according to the CDR data divides into groups;
Perhaps the CDR data are divided into groups according to the type of CDR data.
Comprise in the CDR data of all generations and synthetic CDR that finishes and the CDR two states that is synthesizing, can the CDR data be divided into groups according to the state of CDR data in certain embodiments.
In certain embodiments, can be in conjunction with multiple packet mode, concrete combination is determined according to actual needs.
By the CDR identification information is divided into groups, make system that the embodiment of the invention provided can many-sided multi-level minimizing software show the burden of CDR, further accelerated display speed, the operating efficiency of system is provided.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.