[go: up one dir, main page]

WO2009076813A1 - Method and device for decoding charge record - Google Patents

Method and device for decoding charge record Download PDF

Info

Publication number
WO2009076813A1
WO2009076813A1 PCT/CN2008/072733 CN2008072733W WO2009076813A1 WO 2009076813 A1 WO2009076813 A1 WO 2009076813A1 CN 2008072733 W CN2008072733 W CN 2008072733W WO 2009076813 A1 WO2009076813 A1 WO 2009076813A1
Authority
WO
WIPO (PCT)
Prior art keywords
unit
file
bill
structural
cdr
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2008/072733
Other languages
French (fr)
Chinese (zh)
Inventor
Changzhen Li
Youyu Mei
Qi Wang
Haibing He
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of WO2009076813A1 publication Critical patent/WO2009076813A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/14Charging, metering or billing arrangements for data wireline or wireless communications

Definitions

  • the present invention relates to the field of CDR decoding technology, and in particular, to a CDR decoding method and apparatus.
  • the billing system needs to face more and more CDR interfaces to handle various format CDR files. For example: abstract syntax notation l ( ASN.l ) structure, automatic message accounting (AMA ) structure, tag-length-content (TLV) structure, length-content (LV) structure, block structure, XML (expandable A list of structures such as logo language) structure.
  • ASN.l abstract syntax notation l
  • AMA automatic message accounting
  • TLV tag-length-content
  • LV length-content
  • XML expandable A list of structures such as logo language
  • a commonly used method for decoding a single format corresponding to multiple formats is as follows: ⁇ A hard coded method is used to decode CDRs of different formats, and each format CDR has an independent decoding method. For example, if the CDR is an ASN.1 structure, a decoder dedicated to decoding the ASN.1 structure is specifically selected for decoding.
  • the prior art has the following disadvantages in carrying out the process of the present invention:
  • the CDRs of each different structure are decoded by hard coding, that is, the CDRs of different structures have a decoding mode applicable only to the structure, and if the CDR format is changed, it may be necessary to rewrite one.
  • Sets the decoding method for the new format For example, if a CDR file of the standard ASN.1 format is used, each CDR file is preceded by 4 bytes of information as an identifier. Then, the decoding method originally used to decode the standard ASN.1 format CDR cannot decode the changed CDR file in the new format.
  • the prior art Prior to the modification of the original decoding program, the prior art has very poor adaptability to CDRs of different formats.
  • An object of the embodiments of the present invention is to provide a method and device for decoding a bill, which can parse an CDR file of any structure in the network.
  • the embodiment of the invention provides a method for decoding a bill, comprising:
  • the extracted bill information is encapsulated in a bill file that can be recognized by the billing system.
  • an embodiment of the present invention further provides an apparatus for decoding a bill, including:
  • a receiving unit configured to receive a bill file to be decoded
  • An identifying unit configured to identify, according to a structural feature of the bill file, a billing information in the bill file according to an identification manner corresponding to a structural feature of the bill file received by the receiving unit; and an extracting unit, configured to extract The bill information obtained by the identification unit;
  • an encapsulating unit configured to encapsulate the bill information extracted by the extracting unit in a bill file that can be recognized by the billing system.
  • the present invention has the following advantages:
  • the embodiment can select a suitable identification mode dialog file for identification, extract the CDR information in the CDR file, and encapsulate the extracted CDR information in the billing.
  • a suitable identification mode dialog file for identification
  • extract the CDR information in the CDR file and encapsulate the extracted CDR information in the billing.
  • the present invention can flexibly adapt to a variety of CDR files, and also facilitates the extension of the CDR file identifying the new structure.
  • FIG. 1 is a schematic block diagram of a method embodiment of a method of the present invention.
  • FIG. 2 is a schematic structural diagram of an embodiment of an CDR file of an ASN.1 structure
  • FIG. 3 is a schematic block diagram of a method for identifying a structural unit of a sequential structure according to the present invention.
  • Figure 4 is a schematic diagram of the structure of the CDR file in the ASN.1 format
  • FIG. 5 is a schematic block diagram of a method for identifying a structural unit of an array structure according to the present invention.
  • FIG. 6 is a schematic block diagram of a method for identifying a structural unit of a selection structure according to the present invention.
  • FIG. 7 is a schematic block diagram showing the flow of the method for identifying and extracting atomic units of the present invention.
  • FIG. 8 is a schematic diagram of a decoding tree of an CDR file of the structure shown in FIG. 2; 9 is a schematic block diagram showing the structure of an apparatus according to an embodiment of the present invention.
  • Figure 10 is a schematic block diagram showing the structure of the identifier in the embodiment of the apparatus shown in Figure 9;
  • FIG 11 is a schematic block diagram showing the structure of the identification unit in the embodiment of the apparatus shown in Figure 10;
  • FIG. 12 is a schematic structural diagram of an embodiment of a bill decoder according to the present invention.
  • An embodiment of the CDR decoding method disclosed in the present invention is: according to the structural characteristics of the CDR file, selecting the identification manner corresponding to the structural features of the received CDR file to identify the CDR information in the CDR file, wherein The identification mode can be saved in advance.
  • the identification manner of the different combinations may be arbitrarily changed according to the structural characteristics of the CDR file, and the corresponding formats in the CDR file are separately decoded; Bill information.
  • the extracted bill information is encapsulated in a bill file that can be recognized by the billing system.
  • the embodiment of the present invention may further set the structural features of the CDR file to be decoded according to the structural features of the CDR file to be decoded before the dialog single decoding. description. Then, when decoding, the received CDR file is regarded as a data stream according to the description of the structural characteristics of the preset CDR file, and the included sub-file is identified from the CDR file header by using the identification method corresponding to the structural unit in the file. Structural units.
  • the sub-structure unit may be further identified by using a recognition method corresponding to each sub-structure unit, and so on, until only the bill information field is identified.
  • the smallest atomic unit and then extracting the bill information in the atom unit, and then encapsulating the bill information in a bill file that can be recognized by the billing system for charging by the billing system, thereby decoding the original bill. the goal of.
  • FIG. 1 it is a schematic block diagram of another embodiment of a CDR decoding method according to the present disclosure.
  • the embodiment includes:
  • S101 Pre-set the description of the structural features of the original CDR file to be decoded according to the structural characteristics of the original CDR file.
  • the description of the structural features of the dialog file may be described in terms of the organizational structure and the encapsulation format of the CDR, wherein the organizational structure is used to represent the structural unit included in the CDR file.
  • the organizational structure is used to represent the structural unit included in the CDR file.
  • the encapsulation format is used to indicate how the CDR file is encapsulated.
  • the file has a file header of several bytes. What symbol indicates the start and end of the file, and the length of the file is a fixed length. Wait.
  • CDR structures include: ASN.1 structure, TLV structure, LV structure, and block. Structure, XML structure, and key value structure.
  • ASN.1 structure The following is an example of how to describe the structure of a bill file by taking a variable-length text bill file with a file header and a file end (hereinafter, the type is simply referred to as the ASN.1 structure).
  • the file header of the CDR file records the processing time of the file (such as "2007-06-09 18:44:23" in the above example), and the total number of CDRs recorded at the end of the file (as in the above example) 4"), the unit records the information of each bill.
  • the single cell includes two types of bill information: a short message service (SMS) and a voice (VOICE).
  • SMS bill has three fields: a calling number, a called number, and Call time
  • VOICE bill has 4 fields: calling number, called number, call time, and end time.
  • the organization structure of the CDR file can also be seen in FIG. 2 at the same time.
  • FIG. 2 is a schematic diagram of the organization structure of the CDR file according to the embodiment.
  • the structural characteristics of the CDR file can be described as:
  • CDR File:: SEQUENCE head Head, // indicates that the bill file includes the file header, the unit, the body of the file, Tail Tail
  • Body: : SEQUENCE OF Record ⁇ indicates that the message contains multiple words
  • Voice :: SEQUENCE // indicates that the voice CDR is a sequential structure, and the CDR information is recorded in the order of calling number, called number, call start time, and end time.
  • Starttime StartTime where "SEQUENCE” in the above description indicates that the CDR file is a structural unit of a sequential structure, and a structural unit of a sequential structure may contain a plurality of sub-structural units.
  • single files need to be decoded sequentially from beginning to end in the order of substructure units when decoding. It is decoded in the order of file header, single cell, and file tail. When a single cell contains multiple CDRs, it is also decoded according to the order of the CDRs. If the fields in a CDR are arranged in order, then the decoding is also performed in the order of the fields. Decoding, until all the contents of the CDR are parsed; "BASIC" in the above description represents an atomic unit, which is used to describe the smallest unit obtained by decomposition, and may contain only one field carrying CDR information in one atom unit;
  • the "SEQUENCE OF" in the above description represents an array structure.
  • the structure unit of an array structure contains only a few sub-structure units of one type. For example, if the array structure has only a single CDR, there can be many CDRs. For the array structure, each cell needs to process each of the included words when decoding.
  • the "CHOICE" in the above description indicates a selection structure, and the structural unit of a selection structure contains only one sub-structure unit, and the sub-structure unit can be of any type, for example, short message, general packet radio service (GPRS, General Packet Radio Service) ) type, etc. Therefore, when decoding, it is necessary to first determine which type of the sub-structure unit is, so that the corresponding processing method can be used for further identification or extraction processing.
  • GPRS General Packet Radio Service
  • the types of organizational structures in the commonly used structural units include, but are not limited to, the following:
  • the collection structure may contain multiple sub-structure units in the structural unit of a collection structure, and the order of arrangement of these sub-structure units may not be fixed. For example, a bill of a collection structure If three fields of eight, B, and C are included, the order of the three fields may be CBA or BCA. Therefore, unlike the sequential structure, when decoding the structural unit of the aggregate structure, it is necessary to first determine which sub-structure unit is currently processed, and then use the corresponding processing method for further identification or extraction processing.
  • S102 Docking according to the description of the structural features of the original CDR file preset in S101 above.
  • the received CDR file identifies the sub-structure unit included in the structural unit by using an identification manner corresponding to the structural unit of the corresponding layer in the CDR, and then identifies the identification method corresponding to the sub-structure unit. smaller sub-units of the structural units contained in the substructure, and so on for identifying the other layer by layer 1 J, wherein until all of the identified atomic units.
  • a bill file is usually encapsulated by a nested structure, that is, a bill file is regarded as the uppermost structural unit
  • the structural unit often contains multiple substructure units, and each substructure unit may also contain several Smaller substructure units, so nested layer by layer until the smallest atomic unit. Therefore, in the identification, the layer-by-layer identification method can usually be used, and the layer-by-layer identification is performed from the uppermost layer by using the recognition method corresponding to the corresponding layer until all atomic units are identified.
  • S104 The extracted bill information is encapsulated in a bill file that is easily recognized by the billing system, and then the encapsulated bill file is sent to the billing system for billing statistics.
  • the extracting operation in the above S103 can be performed not only after identifying all atomic units in the entire bill file, but also directly extracting the contained atomic unit in a bill structure file, and then directly extracting Identify and extract bill information in another sub-structure unit.
  • each layer structural unit may also contain different types of sub-structure units, and therefore, when nested in a bill file
  • each layer structural unit may also contain different types of sub-structure units, and therefore, when nested in a bill file
  • the structural units of the corresponding layers are identified by corresponding identification methods to identify all substructures included.
  • the unit, and then according to the organizational structure characteristics of each sub-structure unit respectively select the identification manner corresponding to the sub-structure unit to identify smaller sub-structure units. Since the organizational structure and format of each structural unit may be different, different layers need to use different identification methods corresponding to them.
  • the identification method of the sub-structure units is sequentially identified one by one in order, for example, the first sub-parent
  • the structural unit performs further recognition processing, and when the first sub-structural unit identifies the After the atomic unit is present, the second sub-structural unit is further identified in order, until all the sub-structural units included in the structural unit of the sequential structure are identified, and the method may specifically include:
  • the determining the condition of the structural unit may be specifically determining whether the encapsulation format of the structural unit belongs to a specified type, for example: the specified encapsulation format of the structural unit to be identified is a file in the ASN.1 format, as shown in FIG. , A file in ASN.1 format includes a label (TAG) part, a length (length) part, and a content (Content) part. Therefore, whether the encapsulation format of the structural unit to be identified is an ASN.1 structure can be determined by identifying whether the TAG part is included in the structural unit.
  • TAG label
  • Content content
  • S302 Indicate, according to the encapsulation format of the structural unit, the functional scope of the structural unit and all sub-structural units included in the structural unit. Then execute S303.
  • the purpose of indicating the scope of action of the structural unit is to ensure that all sub-structure units are identified within the length of the structural unit, by ensuring that all of the structural units contain CDR information.
  • the atomic units are all identifiable to further ensure that the CDR information carried in the structural unit can be extracted.
  • the purpose of indicating the scope of action of all sub-structure units in the structural unit is to: ensure that all smaller sub-structure units included in all sub-structure units are identified within the length range of all sub-structure units To ensure that all the CDR information contained in all sub-structural units can be extracted.
  • the TAG part is used to determine whether the data stream passing through the TAG part of the Length part satisfies the score to calculate its score, the LENGH part.
  • ASN.l eigenunit decoding condition the sum of the sub-structural unit and the content part of the Content Partifier [1] calculates the total scope of the structural unit.
  • the text line recognizes the line of text to be processed by the newline character. Length of length text line [2] Whether the data stream satisfies the condition
  • the data of the data to be processed is determined by the flag of the previous step block identifier, and all the sub-[5] streams are obtained for the structural unit of the structural unit.
  • the code condition uses the scope of the current data stream, that is, the arbitrary identification defined by the parent structure defined by the parent structure.
  • the pre-defined length can be obtained from the current data stream.
  • the predefined length [7] defines the length that is satisfied.
  • the separator identifies the length of the length separator that can be searched from the current data stream to the current displacement to the current separator to the separator [8] separator separator. Including the length of the separator itself
  • Key Value or Key: Value through the previous steps, get all its children through the previous steps or ⁇ Key>Value ⁇ Key>, etc.
  • the structural unit can only identify and process the data stream within the scope of the action, and all data within the scope of the scope must be identified and processed to ensure that the structural unit is identified. It will not cross the border, and at the same time ensure that the bill information will not be lost.
  • S303 Identify, by using the identification manner corresponding to the sub-structure unit, the sub-structure units included in the respective scopes are identified one by one in order to obtain all atomic units in all sub-structure units.
  • S304 may be performed; when it is not normally recognized, S306 is performed.
  • the method for sequentially identifying for example, first identifying the sub-structure unit by using an identification method suitable for the first sub-structure unit, and when the sub-structure unit further includes other smaller sub-structure units, And respectively identifying the smaller sub-structure units by respective applicable identification methods until all atomic units included in the sub-structure unit are identified; then if there is a second sub-structure unit, then the second sub- The structural unit is further identified, and so on.
  • S304 Determine whether the identification of all the sub-structure units in the structural unit is completed, and if yes, proceed to S305; otherwise, return to the S303 to continue identifying the next sub-structural unit in sequence.
  • determining whether the scope of the structural unit is identified is as follows: Since a bill file is recognized as a data stream when it is recognized, it is recognized from the file header of the bill, to In the case of a single cell, since a single subunit contains a plurality of substructure units, it begins to identify according to the organizational structure of the unit, and uses a corresponding identification method to identify, and when identifying a plurality of substructure units, One of the sub-structure units is identified layer by layer until all atomic units in the sub-structure unit are identified, and then the other sub-structure units are identified.
  • the single-word of the dialog file needs to be recognized one-tailed, and only when all the information within the scope of the structural unit of the bill file is identified, that is, processing
  • the contents of the CDRs of all lengths can be considered to have completed the identification of the CDR file. Therefore, the purpose of this step is to ensure the correctness and integrity of the entire bill file.
  • the above S305 is a CDR file for the currently identified structural unit, that is, the structural unit of the uppermost layer. If the currently identified structural unit is a sub-structure unit included in the bill file, then in S305, after determining that the scope of the currently identified structural unit is identified, before the end of the identification process, Requiring the upper parent structure unit to return the length successfully recognized by the structural unit, so that after the upper parent structural unit receives the successfully recognized length of the structural unit, it can determine how much length information is still in the parent structural unit. Identification, for the parent structural unit to determine whether it is recognized within the scope of the parent structural unit.
  • the determination of S304 may not be performed first, but the next sub-structural unit may be continuously identified in order, and after sequentially identifying, the S304 is executed, and the S304 is determined. When it is obtained that the sub-structural unit is not recognized, it returns to S303 to identify the unrecognized sub-structural unit.
  • the identification method is to separately identify the included sub-structure units, for example, one of the sub-structure units is further identified, and from the sub-structure unit. After all the atomic units are identified, the other sub-structure units are identified until all the sub-structure units contained in the structural unit of the array structure are identified.
  • the identification method of the structural unit of the array structure is basically the same as the identification method of the structural unit of the sequential structure shown in FIG. 3, except that the sub-structure units included in the structural unit of the array structure are of the same type, therefore,
  • the sub-structure units included in the structural unit of the array structure can be identified by the same identification method.
  • the identification method of this embodiment may specifically include: S501: determining whether the structural unit to be decoded meets the recognition condition of the predefined structural unit, and if yes, identifying all the sub-structure units included in the structural unit according to the encapsulation format of the satisfied structural unit, and then executing S502 Otherwise, execute S506.
  • the method for determining the identification condition of the structural unit may be specifically determined to determine whether the encapsulation format of the structural unit belongs to a specified type.
  • the method for judging the identification condition in the embodiment is the same as that in the embodiment shown in FIG. - Narrative.
  • S502 Indicate, according to the encapsulation format of the structural unit, the functional scope of the structural unit and all sub-structural units included in the structural unit. Then execute S503.
  • S503 Identify the sub-structure units included by using the identification method corresponding to the sub-structure unit to obtain all the atom units in all the sub-structure units. In the identification process, after each sub-structure unit is identified, S504 may be performed; when it is not recognized properly, S506 is performed.
  • S504 Determine whether the identification of all the sub-structure units in the structural unit is completed. If yes, proceed to S505; otherwise, return to S503 to continue identifying other sub-structure units.
  • the above S505 is a CDR file for the currently identified structural unit, that is, the structural unit of the uppermost layer. If the currently identified structural unit is a sub-structure unit included in the bill file, then in S505, after determining that the scope of the currently identified structural unit is identified, before the end of the identification process, Requiring the upper parent structure unit to return the length successfully recognized by the structural unit, so that after the upper parent structural unit receives the successfully recognized length of the structural unit, it can determine how much length information is still in the parent structural unit. Identification, for the parent structural unit to determine whether the identification within the scope of the parent structural unit is completed.
  • the determination of S504 may not be performed first, but another sub-structural unit may continue to be recognized. After the identification is performed, the S504 is executed, and the determination is performed in S504. If there is a substructure unit that is not recognized, then return to S503 to identify the unrecognized substructure unit.
  • the sub-structural unit is further identified.
  • the identification manner of this embodiment may specifically include:
  • S601 determining whether the current structural unit to be decoded satisfies the identification condition of the predefined structural unit, and if so, identifying the sub-structure unit included in the structural unit according to the encapsulation format of the satisfied structural unit, and then executing S602; Otherwise, S606 is performed.
  • the method for determining the identification condition of the structural unit may be specifically determined to determine whether the encapsulation format of the structural unit belongs to a specified type.
  • the method for judging the identification condition in the embodiment is the same as that in the embodiment shown in FIG. - Narrative.
  • S602 Indicate, according to the encapsulation format of the structural unit, the functional scope of the structural unit and the sub-structural unit included in the structural unit. Then execute S603. Types, such as voice, or short messages. Among them, the type of the sub-structural unit can be judged according to the conditions as stipulated in Table 1.
  • S604 Identify the sub-structure unit by using a recognition manner corresponding to the sub-structure unit type to obtain all atom units included in the sub-structure unit. After the recognition is completed, S605 may be performed; when the recognition is not possible, S607 is performed.
  • S605 determining whether the recognition is completed within the scope of the sub-structure unit, and if yes, proceeding to S606; otherwise, returning to the S604 to continue the identification.
  • S606 Determine whether the scope of the structure unit is recognized, and if yes, end the identification process; otherwise, execute S607.
  • the above S606 is a CDR file for the currently identified structural unit, that is, the structural unit of the uppermost layer. If the currently identified structural unit is a sub-structure unit included in the bill file, in the S606, after determining that the scope of the currently identified structural unit is determined, before the end of the identification process, Returning, to the upper-level parent structural unit, the length successfully recognized by the structural unit, so that after the upper-level parent structural unit receives the successfully recognized length of the structural unit, it can determine how much length of the parent structural unit is not recognized. For the mother structural unit Whether the break is recognized within the scope of the parent structural unit.
  • the order of the sub-structure units is not fixed. Therefore, before further identifying each sub-structure unit, the sub-structure to be identified needs to be determined. Which structure the cells belong to in order to select the corresponding recognition mode for further identification of each sub-structure unit. Since the identification structure of the collection structure is substantially the same as the identification method of the selection structure shown in FIG. 6, it will not be described here.
  • the encapsulation format identifies the field containing the bill information, and then extracts the field to obtain the bill information.
  • the method for identifying and extracting the atomic unit includes:
  • S701 determining whether the current atomic unit to be decoded satisfies the recognition condition of the predefined structural unit, and if yes, identifying all the fields in the atomic unit that contain the bill information according to the encapsulation format of the satisfied structural unit, and then S702 is performed; otherwise, S705 is performed.
  • the method for determining the recognition condition in this embodiment is the same as that in the embodiment shown in FIG. 3, and is not described again here.
  • S702 Indicate the range of the atomic unit according to the encapsulation format of the atomic unit, and then execute S703.
  • S703 Determine whether it is necessary to extract the bill information, and if yes, execute S704; otherwise, execute S705.
  • S704 Select a corresponding extractor according to the coding characteristics of the field, and extract the bill information in the field according to the extracting manner of the extractor. If the extraction is completed, the process ends; when the extraction cannot be performed normally, S705 is executed.
  • Table 2 The extraction method corresponding to the different coding modes of the fields can be seen in Table 2.
  • BCD code Two-decimal code (BCD) code BCD code Each byte is converted into two character tags [F], but ends after encountering F
  • the structure description of the original bill is set, in addition to the language setting, the node layout of the decoding tree can be directly changed on the decoding tree, and the nodes of each node are set.
  • the configuration parameters are used to implement the setting of the structure description of the entire bill file.
  • FIG. 8 it is a decoding tree diagram of the CDR file of the structure shown in FIG. 2.
  • Each leaf node on the decoding tree represents an atomic unit
  • the non-leaf node represents a structural unit of a composite type
  • each node has an identifier for determining whether the structural unit of the corresponding node in the received bill file is Meet predefined recognition conditions.
  • the corresponding extractor and output fields need to be configured to encapsulate the extracted bill information into the specified output field.
  • [] indicates the structure type of the node; ⁇ Represents the identifier of the node; () represents the extractor of the atomic node; ⁇ > represents the output field of the atomic node.
  • the structure type of field 1 is BASIC (ie atomic unit), the identifier is 8 (ie separator identifier), the extractor is A (ie ASCII extractor), and the output field is Caller.
  • the embodiment of the present invention further discloses a device for CDR decoding.
  • FIG. 9 it is a schematic block diagram of an apparatus embodiment of the present invention.
  • the device includes: a receiving unit 901, The identification unit 902, the extraction unit 903, and the encapsulation unit 904, wherein:
  • the receiving unit 901 is configured to receive a bill file to be decoded. After the receiving unit 901 receives the bill file to be decoded, the identifying unit 902 performs the bill file received in the receiving unit 901.
  • the specific manner of the identification is as follows: Selecting an identification manner corresponding to the structural feature of the CDR file received by the receiving unit 901 to identify the CDR information in the CDR file.
  • the identification unit 902 various identifiers (not shown) corresponding to various structural features that may appear in the bill file may be stored, and each of the identifiers is saved in each identifier.
  • the identification method to which the structural features are applied, the identifier (not shown) is used to identify the bill file according to the saved recognition manner.
  • the identification unit 902 further includes a selection and identification unit (not shown) for selecting a corresponding identifier (not shown) according to the structural features of the to-be-decoded bill file to use the identifier.
  • the device (not shown) identifies the CDR file received in the receiving unit 901, and obtains the CDR information contained in the CDR file;
  • the extracting unit 903 is configured to extract the bill information obtained by the identifying unit 902;
  • the encapsulating unit 904 is configured to encapsulate the bill information extracted by the extracting unit 903 in a bill file that can be recognized by the billing system, so that the billing system can charge.
  • the device may further include a configuration unit (not shown) for pre-passing the configuration unit (not shown in the figure) before decoding the received CDR file. ) Set the description of the structure characteristics of the CDR file to be decoded. Then, at the time of decoding, the selection identification unit (not shown) in the identification unit 902 selects and follows the structural characteristics of the to-be-decoded bill file described in the configuration unit (not shown). The identifier (not shown) corresponding to the structural feature of the CDR file received by the receiving unit 901 identifies the CDR information in the CDR file.
  • the configuration unit may describe the structure of the bill file in a language format.
  • the identification unit 902 can select an appropriate identifier according to the structural features of the bill file to be decoded.
  • the method identifies the bill information from the bill file.
  • the corresponding identifier (not shown) is called for identification at the time of recognition, and therefore, even when the structure of the CDR file is changed, it is only required to be set.
  • the struct unit of the CDR file also includes a sub-structure unit, and the sub-structure unit may further include a smaller sub-structure unit. Therefore, on the basis of the foregoing embodiment shown in FIG. 9, the identifying unit 902 in the device may use the received CDR file layer by layer according to the encapsulation format characteristic of the structural unit in the received CDR file.
  • the identifier corresponding to the structural unit (not shown) identifies all the sub-structure units included in the structural unit until the sub-structure unit is an atomic unit containing bill information.
  • FIG. 10 it is a schematic block diagram of the structure of the identifier in the device embodiment shown in FIG. 9.
  • the device is based on the device embodiment shown in FIG.
  • the identifier in the identification unit 902 specifically includes: an encapsulation format determining unit 9021, and a sub-structure unit determining unit 9022, where:
  • the package format determining unit 9021 is configured to determine that the structural unit is satisfied by determining whether the structural unit to be identified currently meets a recognition condition of a structural unit preset in the setting unit (not shown)
  • Package format
  • the sub-structural unit determining unit 9022 is configured to identify all sub-structural units included in the structural unit according to the encapsulation format determined by the encapsulation format determining unit 9021.
  • the structural characteristics of the sub-structure unit preset in the setting unit may be described, and then the corresponding identifier (not shown) is selected.
  • the substructure unit is further identified to further identify a smaller substructure included in the substructure unit Unit.
  • the analogy by layer is identified layer by layer with a corresponding identifier (not shown) until the atomic unit containing the smallest bill information is identified.
  • the re-selected identifier may also include the same structure as the identifier shown in FIG. 10 above, and is not described again here.
  • FIG. 11 is a schematic structural block diagram of an identification unit in the apparatus embodiment shown in FIG. 10.
  • the identification unit 902 further includes an action range indicating unit 9023. , control unit 9024, wherein:
  • the range indicating unit 9023 is configured to indicate, according to the encapsulation format determined by the encapsulation format determining unit 9021, the scope of action of all the sub-structure units determined in the structural unit and the sub-structure unit determining unit 9022;
  • the control unit 9024 is configured to determine, according to the scope of action of the structural unit indicated by the range indicating unit 9023, if the identification is completed within the scope of the structural unit, the device is instructed to be extracted. Unit 903 performs the extraction function; otherwise, an identification error is reported.
  • the embodiment of the present invention further provides a bill demodulator (Mediation), which is a bill decoding device between a network device and a downstream billing system, and is responsible for collecting bills from the network element.
  • the dialog is pre-processed and sent to the downstream billing system for billing or settlement.
  • the CDR demodulator can handle CDR files in different formats of different upstream network devices (including devices of different versions and different vendors).
  • FIG. 12 which is a schematic structural diagram of an embodiment of a bill decoder according to the present invention, the bill decoder includes: a data collecting device 1201, a bill decoding device 1202, and a data distributing device 1203, wherein:
  • the data collecting device 1201 is configured to collect a bill from the network element device
  • the CDR decoding device 1202 is configured to receive the CDR file to be decoded collected by the data collection device 1201, and select and identify the recognition manner corresponding to the structural characteristics of the received CDR file according to the structural characteristics of the CDR file. Out the bill information in the bill file, and encapsulating the extracted bill information in a bill file that can be recognized by the billing system;
  • the data distribution device 1203 is configured to send the CDRs encapsulated by the CDR decoding device 1202 to the charging system.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
  • the present invention can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is a better implementation. the way.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product, which may be stored in a storage medium such as a read only memory/random memory. (ROM/RAM), diskette, optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform various embodiments of the present invention or portions of an embodiment. Methods.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method for decoding charge record includes: selecting an identification method corresponding to structure character of the received charge record file and identifying charge record information in the charge record file according to the structure character of the charge record file; extracting the charge record information; encapsulating the extracted charge record information into a charge record file identifiable by charging system. A device for decoding charge record includes: receiving unit used for receiving the charge record file to be decoded; identifying unit used for selecting an identification method corresponding to structure character of the charge record file received by the receiving unit and identifying charge record information in the charge record file according to the structure character of the charge record file; extracting unit used for extracting the charge record information identified by the identifying unit; encapsulating unit used for encapsulating the charge record information extracted by the extracting unit into a charge record file identifiable by charging system.

Description

一种话单解码方法和装置  Single card decoding method and device

本申请要求于 2007 年 12 月 13 日提交中国专利局、 申请号为 200710195369.2、 发明名称为 "一种话单解码方法和装置" 的中国专利申请的 优先权, 其全部内容通过引用结合在本申请中。  The present application claims priority to Chinese Patent Application No. 200710195369. 2, entitled "A CDR Decoding Method and Apparatus", filed on Dec. 13, 2007, the entire contents of in.

技术领域 Technical field

本发明涉及话单解码技术领域, 尤其涉及一种话单解码方法和装置。  The present invention relates to the field of CDR decoding technology, and in particular, to a CDR decoding method and apparatus.

背景技术 Background technique

随着电信系统的发展, 网络设备为用户提供的服务越来越丰富, 其种类也 越发繁多, 即使同类设备由于供应商和版本不同, 向下游计费系统提供的话单 接口也常会不同。 因此, 计费系统需要面对越来越多的话单接口, 处理各种格 式的话单文件。例如:抽象语法表示法 l ( ASN.l )结构、 自动报文记帐(AMA ) 结构、 标签 -长度 -内容(TLV )结构、 长度 -内容(LV )结构、 块状结构、 XML (可扩展标识语言)结构等结构的话单。 通常, 计费系统为了计费, 首先对这 些原始话单文件进行解码,从中提取出一条条具体的话单信息, 然后再做进一 步的计费处理。 目前, 常用的一种对应多种格式的话单解码的方法是: 釆用硬 编码的方式对不同格式的话单进行解码,每种格式的话单都具有一套独立的解 码方式。 例如, 如果话单为 ASN.1结构, 则专门选择专用于解码 ASN.1结构 的解码器进行解码。 然而, 本发明人在进行本发明的过程中, 发现该现有技术 具有以下缺点:  With the development of telecommunication systems, network devices provide more and more services for users, and the types thereof are more and more numerous. Even if similar devices are different in terms of vendors and versions, the bill interfaces provided to downstream charging systems are often different. Therefore, the billing system needs to face more and more CDR interfaces to handle various format CDR files. For example: abstract syntax notation l ( ASN.l ) structure, automatic message accounting (AMA ) structure, tag-length-content (TLV) structure, length-content (LV) structure, block structure, XML (expandable A list of structures such as logo language) structure. Generally, for billing, the billing system first decodes the original bill files, extracts a specific bill information from the billing system, and then performs further billing processing. At present, a commonly used method for decoding a single format corresponding to multiple formats is as follows: 硬 A hard coded method is used to decode CDRs of different formats, and each format CDR has an independent decoding method. For example, if the CDR is an ASN.1 structure, a decoder dedicated to decoding the ASN.1 structure is specifically selected for decoding. However, the inventors have found that the prior art has the following disadvantages in carrying out the process of the present invention:

现有技术由于对每种不同结构的话单都釆用硬编码的方式进行解码处理, 即对不同结构的话单具有仅该结构适用的解码方式,如果处理的话单格式发生 变动就可能需要重新编写一套适用新格式的解码方式。 例如, 如果将标准 ASN.1格式的话单文件, 每个话单文件的前面加上 4个字节的信息作为标识。 那么原来用于解码标准 ASN.1格式话单的解码方式则无法对变化后的新格式 的话单文件进行解码。 除非对原来的解码程序进行修改, 因此现有技术对不同 格式的话单适应能力非常差。  In the prior art, since the CDRs of each different structure are decoded by hard coding, that is, the CDRs of different structures have a decoding mode applicable only to the structure, and if the CDR format is changed, it may be necessary to rewrite one. Sets the decoding method for the new format. For example, if a CDR file of the standard ASN.1 format is used, each CDR file is preceded by 4 bytes of information as an identifier. Then, the decoding method originally used to decode the standard ASN.1 format CDR cannot decode the changed CDR file in the new format. Prior to the modification of the original decoding program, the prior art has very poor adaptability to CDRs of different formats.

发明内容 Summary of the invention

本发明实施例的目的在于提供一种话单解码方法和装置,能够对网络中的 任意结构的话单文件进行解析。 本发明实施例提供了一种话单解码方法, 包括: An object of the embodiments of the present invention is to provide a method and device for decoding a bill, which can parse an CDR file of any structure in the network. The embodiment of the invention provides a method for decoding a bill, comprising:

按照话单文件的结构特点,选择与接收到的话单文件的结构特点对应的识 别方式识别出所述话单文件中的话单信息;  According to the structural characteristics of the CDR file, selecting the identification manner corresponding to the structural features of the received CDR file to identify the CDR information in the CDR file;

提取所述话单信息;  Extracting the bill information;

将所提取出的话单信息封装在计费系统能够识别的话单文件中。  The extracted bill information is encapsulated in a bill file that can be recognized by the billing system.

基于上述技术方案, 本发明实施例还提供了一种用于话单解码的装置, 包 括:  Based on the foregoing technical solution, an embodiment of the present invention further provides an apparatus for decoding a bill, including:

接收单元, 用于接收待解码的话单文件;  a receiving unit, configured to receive a bill file to be decoded;

识别单元, 用于按照话单文件的结构特点,选择与所述接收单元所接收到 的话单文件的结构特点对应的识别方式识别出所述话单文件中的话单信息; 提取单元, 用于提取由所述识别单元识别得到的话单信息;  An identifying unit, configured to identify, according to a structural feature of the bill file, a billing information in the bill file according to an identification manner corresponding to a structural feature of the bill file received by the receiving unit; and an extracting unit, configured to extract The bill information obtained by the identification unit;

封装单元,用于将由所述提取单元所提取的话单信息封装在计费系统能够 识别的话单文件中。  And an encapsulating unit, configured to encapsulate the bill information extracted by the extracting unit in a bill file that can be recognized by the billing system.

与现有技术相比, 本发明具有以下优点:  Compared with the prior art, the present invention has the following advantages:

本发明实施例能够根据话单文件的结构特点,在解码时能够选择适合的识 别方式对话单文件进行识别,提取得到该话单文件中的话单信息, 并将所提取 的话单信息封装在计费系统能够识别的话单文件中,即便当话单文件的结构发 生改变, 也只需才艮据新话单文件的结构特点, 重新选择对应的识别方式, 而无 需更换整个解码处理方式,因此本发明实施例能够灵活地适应结构多样的话单 文件, 同时也对识别新结构的话单文件的扩展提供了便利。  According to the structural features of the CDR file, the embodiment can select a suitable identification mode dialog file for identification, extract the CDR information in the CDR file, and encapsulate the extracted CDR information in the billing. In the CDR file that the system can recognize, even if the structure of the CDR file changes, it is only necessary to re-select the corresponding identification mode according to the structural characteristics of the new CDR file, without replacing the entire decoding processing mode, so the present invention The embodiment can flexibly adapt to a variety of CDR files, and also facilitates the extension of the CDR file identifying the new structure.

附图说明 DRAWINGS

图 1为本发明一种方法实施例的流程示意框图;  1 is a schematic block diagram of a method embodiment of a method of the present invention;

图 2为一种 ASN.1结构的话单文件实施例的组织结构示意图;  2 is a schematic structural diagram of an embodiment of an CDR file of an ASN.1 structure;

图 3为本发明识别顺序结构的结构单元的方法流程示意框图;  3 is a schematic block diagram of a method for identifying a structural unit of a sequential structure according to the present invention;

图 4为 ASN.1格式的话单文件结构示意图;  Figure 4 is a schematic diagram of the structure of the CDR file in the ASN.1 format;

图 5为本发明识别数组结构的结构单元的方法流程示意框图;  5 is a schematic block diagram of a method for identifying a structural unit of an array structure according to the present invention;

图 6为本发明识别选择结构的结构单元的方法流程示意框图;  6 is a schematic block diagram of a method for identifying a structural unit of a selection structure according to the present invention;

图 7为本发明原子单元的识别和提取方法流程示意框图;  7 is a schematic block diagram showing the flow of the method for identifying and extracting atomic units of the present invention;

图 8为图 2所示结构的话单文件的解码树示意图; 图 9为本发明一种装置实施例的结构示意框图; 8 is a schematic diagram of a decoding tree of an CDR file of the structure shown in FIG. 2; 9 is a schematic block diagram showing the structure of an apparatus according to an embodiment of the present invention;

图 10为图 9所示装置实施例中的识别器的结构示意框图;  Figure 10 is a schematic block diagram showing the structure of the identifier in the embodiment of the apparatus shown in Figure 9;

图 11为图 10所示装置实施例中的识别单元的结构示意框图;  Figure 11 is a schematic block diagram showing the structure of the identification unit in the embodiment of the apparatus shown in Figure 10;

图 12为本发明话单解码器实施例结构示意图。  FIG. 12 is a schematic structural diagram of an embodiment of a bill decoder according to the present invention.

具体实施方式 detailed description

下面结合附图对本发明的实施方式做进一步的详细阐述。  The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

本发明公开的一种话单解码方法实施例为: 按照话单文件的结构特点,选 择与接收到的话单文件的结构特点对应的识别方式识别出所述话单文件中的 话单信息, 其中, 所述识别方式可以预先设置保存。  An embodiment of the CDR decoding method disclosed in the present invention is: according to the structural characteristics of the CDR file, selecting the identification manner corresponding to the structural features of the received CDR file to identify the CDR information in the CDR file, wherein The identification mode can be saved in advance.

在识别时, 如果话单文件由多种结构格式组成, 则可以根据话单文件的结 构特点,任意变化不同组合的识别方式, 分别对所述话单文件中相应格式进行 解码; 然后提取所述话单信息。  In the identification, if the CDR file is composed of a plurality of structural formats, the identification manner of the different combinations may be arbitrarily changed according to the structural characteristics of the CDR file, and the corresponding formats in the CDR file are separately decoded; Bill information.

将所提取出的话单信息封装在计费系统能够识别的话单文件中。  The extracted bill information is encapsulated in a bill file that can be recognized by the billing system.

此外, 在上述方法实施例的基础上, 对于结构较复杂的话单文件, 本发明 实施例还可以在对话单解码前根据待解码的话单文件的结构特点,设置对待解 码话单文件的结构特点的描述。 然后在解码时,将收到的话单文件当作数据流 按照预先设置的话单文件的结构特点的描述,从话单文件头开始釆用与该文件 中结构单元对应的识别方式识别出包含的子结构单元。当一个结构单元中包含 了多个子结构单元时,还可以再分别釆用与每个子结构单元对应的识别方式对 子结构单元做进一步识别,依次类推, 直到识别出只包含了话单信息字段的最 小的原子单元, 然后提取出所述原子单元中的话单信息, 再将所述话单信息封 装在计费系统能够识别的话单文件中以供计费系统计费,从而达到对原始话单 解码的目的。  In addition, on the basis of the foregoing method embodiments, for the CDR file with a more complicated structure, the embodiment of the present invention may further set the structural features of the CDR file to be decoded according to the structural features of the CDR file to be decoded before the dialog single decoding. description. Then, when decoding, the received CDR file is regarded as a data stream according to the description of the structural characteristics of the preset CDR file, and the included sub-file is identified from the CDR file header by using the identification method corresponding to the structural unit in the file. Structural units. When a structural unit includes a plurality of sub-structure units, the sub-structure unit may be further identified by using a recognition method corresponding to each sub-structure unit, and so on, until only the bill information field is identified. The smallest atomic unit, and then extracting the bill information in the atom unit, and then encapsulating the bill information in a bill file that can be recognized by the billing system for charging by the billing system, thereby decoding the original bill. the goal of.

以下介绍本发明公开的另一种话单解码方法实施例,如图 1所示, 为本发 明另一种话单解码方法实施例的流程示意框图, 该实施例包括:  The following is a schematic block diagram of another embodiment of the CDR decoding method disclosed in the present invention. As shown in FIG. 1 , it is a schematic block diagram of another embodiment of a CDR decoding method according to the present disclosure. The embodiment includes:

S101 : 根据原始话单文件的结构特点,预先设置待解码的原始话单文件的 结构特点的描述。  S101: Pre-set the description of the structural features of the original CDR file to be decoded according to the structural characteristics of the original CDR file.

其中,对话单文件的结构特点的描述可从话单的组织结构和封装格式上进 行描述, 其中, 所述组织结构用于表示话单文件中包含的结构单元的情况。 例 如: 可以描述一个话单文件中是怎样包含话单体的,每个话单体中怎样包含话 单的, 这些话单种类如何, 又是如何排列的等。 所述封装格式用于表示该话单 文件是按照怎样的格式封装的, 例如, 该文件中有几个字节的文件头, 通过什 么符号表示该文件的起止, 该文件的长度是否为定长等。 The description of the structural features of the dialog file may be described in terms of the organizational structure and the encapsulation format of the CDR, wherein the organizational structure is used to represent the structural unit included in the CDR file. example For example: It can describe how a single CDR contains words, how each CDR contains CDRs, how these CDRs are arranged, and how they are arranged. The encapsulation format is used to indicate how the CDR file is encapsulated. For example, the file has a file header of several bytes. What symbol indicates the start and end of the file, and the length of the file is a fixed length. Wait.

由于电信网络中的网元设备种类具有多样性,因此不同的网元设备生成的 话单文件的结构也各不相同, 例如: 常见的话单结构有: ASN.1 结构、 TLV 结构、 LV结构、 块状结构、 XML结构、 以及关键值(KeyValue )结构等。 下 面以带文件头和文件尾的变长文本话单文件(以下将该类型简称为 ASN.1 结 构的话单)为例, 来举例说明一下如何描述话单文件的结构:  Because the types of network element devices in a telecommunication network are diverse, the structure of the CDR files generated by different network element devices is also different. For example, common CDR structures include: ASN.1 structure, TLV structure, LV structure, and block. Structure, XML structure, and key value structure. The following is an example of how to describe the structure of a bill file by taking a variable-length text bill file with a file header and a file end (hereinafter, the type is simply referred to as the ASN.1 structure).

例如:  E.g:

2007-06-09 18:44:23  2007-06-09 18:44:23

13920004301,13345961111,2007-06-09 18:44:23  13920004301, 13345961111, 2007-06-09 18:44:23

13924308017,13345964111,2007-06-09 18:34:33, 2007-06-09 18:44:25 13924243701,13323111157,2007-06-09 18:44:33, 2007-06-09 18:48:23 13640430163,13239611516,2007-06-09 18:54:23  13924308017, 13345964111, 2007-06-09 18:34:33, 2007-06-09 18:44:25 13924243701,13323111157,2007-06-09 18:44:33, 2007-06-09 18:48:23 13640430163,13239611516,2007-06-09 18:54:23

4  4

其中, 所述话单文件的文件头记录该文件的处理时间 (如上述示例中的 "2007-06-09 18:44:23" ), 文件尾记录话单的总数(如上述示例中的" 4" ), 话单 体则记录每条话单的信息。 其中, 所述话单体包含了短消息业务(SMS, Short Messaging Service )和语音(VOICE )两种类型的话单信息, 其中, SMS话单 有 3个字段: 主叫号码、 被叫号码、 和呼叫时间, VOICE话单有 4个字段: 主叫号码、 被叫号码、 呼起时间、 和终止时间。 所述话单文件的组织结构还可 同时参见图 2所示, 图 2为本实施例所述话单文件的组织结构示意图。  The file header of the CDR file records the processing time of the file (such as "2007-06-09 18:44:23" in the above example), and the total number of CDRs recorded at the end of the file (as in the above example) 4"), the unit records the information of each bill. The single cell includes two types of bill information: a short message service (SMS) and a voice (VOICE). The SMS bill has three fields: a calling number, a called number, and Call time, VOICE bill has 4 fields: calling number, called number, call time, and end time. The organization structure of the CDR file can also be seen in FIG. 2 at the same time. FIG. 2 is a schematic diagram of the organization structure of the CDR file according to the embodiment.

根据上述示例的话单文件的结构特点,则可将该话单文件的结构特点描述 为:  According to the structural characteristics of the CDR file of the above example, the structural characteristics of the CDR file can be described as:

CDR File:: = SEQUENCE head Head, //表示该话单文件包括文件头, 话单体, 文件尾 body Body, tail Tail CDR File:: = SEQUENCE head Head, // indicates that the bill file includes the file header, the unit, the body of the file, Tail Tail

Head:: = BASIC ProcessTime;//表示文件头为记录处理时 Head:: = BASIC ProcessTime; / / indicates that the file header is for record processing

间的原子单元  Atomic unit

Tail: := BASIC RecordNum; //表示文件尾为记录话单总数  Tail: := BASIC RecordNum; / / indicates that the end of the file is the total number of recorded bills

的原子单元  Atomic unit

Body: := SEQUENCE OF Record 〃表示话单体为包含多条话  Body: := SEQUENCE OF Record 〃 indicates that the message contains multiple words

单的数组结构  Single array structure

Record ::= CHOICE //表示话单为选择结构, 包含语音和短消 Record ::= CHOICE // indicates that the bill is a selection structure, including voice and short

息两种格式 voice Voice,  Two formats of voice voice,

sms Sms Sms Sms

Voice ::= SEQUENCE //表示语音话单为顺序结构, 按照主叫号, 被 叫号, 呼叫起始时间, 和终止时间的顺序记 录话单信息 Voice ::= SEQUENCE // indicates that the voice CDR is a sequential structure, and the CDR information is recorded in the order of calling number, called number, call start time, and end time.

{ {

callernum CallerNum; Callernum CallerNum;

callernum CalledNum, Callernum CalledNum,

starttime StartTime, Starttime StartTime,

endtime EndTime Endtime EndTime

} }

Sms ::= SEQUENCE //表示短消息话单为顺序结构, 按照主叫号, 被叫号, 和起始时间的顺序记录话单信息 callernum CallerNum; callednum CalledNum, Sms ::= SEQUENCE // indicates that the short message CDR is a sequential structure, and the CDR information is recorded in the order of the calling number, the called number, and the starting time. Callednum CalledNum,

starttime StartTime 其中, 上述描述中的 "SEQUENCE" 表示该话单文件为顺序结构的结构 单元, 一个顺序结构的结构单元中可包含多个子结构单元。对于顺序结构的话 单文件在解码时需要按照子结构单元的顺序从头到尾逐次解码。 如按照文件 头、 话单体、 文件尾的顺序解码。 当话单体包含了多条话单时, 也同样按照各 条话单的排列顺序解码, 如果一条话单中的字段都按照顺序排列, 那么在解码 时也同样要按着字段的排列顺序进行解码, 直到该话单的所有内容解析完毕; 上述描述中的 "BASIC" 表示原子单元, 用于描述分解得到的最小单元, 在一个原子单元中可以仅包含一个携带话单信息的一个字段;  Starttime StartTime where "SEQUENCE" in the above description indicates that the CDR file is a structural unit of a sequential structure, and a structural unit of a sequential structure may contain a plurality of sub-structural units. For sequential structures, single files need to be decoded sequentially from beginning to end in the order of substructure units when decoding. It is decoded in the order of file header, single cell, and file tail. When a single cell contains multiple CDRs, it is also decoded according to the order of the CDRs. If the fields in a CDR are arranged in order, then the decoding is also performed in the order of the fields. Decoding, until all the contents of the CDR are parsed; "BASIC" in the above description represents an atomic unit, which is used to describe the smallest unit obtained by decomposition, and may contain only one field carrying CDR information in one atom unit;

上述描述中的 "SEQUENCE OF" 表示数组结构, 一个数组结构的结构单 元中只包含一种类型的若干个子结构单元, 例如,数组结构的话单体只包含话 单, 可以有很多条话单。对于数组结构的话单体在解码时需要对包含的每条话 单进行处理。  The "SEQUENCE OF" in the above description represents an array structure. The structure unit of an array structure contains only a few sub-structure units of one type. For example, if the array structure has only a single CDR, there can be many CDRs. For the array structure, each cell needs to process each of the included words when decoding.

上述描述中的 "CHOICE" 表示选择结构, 一个选择结构的结构单元只包 含一个子结构单元, 该子结构单元的种类可以为任意类型, 例如, 短信、 通用 分组无线业务(GPRS, General Packet Radio Service )类型等。 因此, 在解码 时, 需要先判断该子结构单元是哪种类型, 以便釆用相应的处理方式做进一步 的识别或者提取处理。  The "CHOICE" in the above description indicates a selection structure, and the structural unit of a selection structure contains only one sub-structure unit, and the sub-structure unit can be of any type, for example, short message, general packet radio service (GPRS, General Packet Radio Service) ) type, etc. Therefore, when decoding, it is necessary to first determine which type of the sub-structure unit is, so that the corresponding processing method can be used for further identification or extraction processing.

对于 ASN.1 结构的话单, 其常用的结构单元中的组织结构类型除了上述 列举的几种外, 还包括但不限于此:  For the CDRs of the ASN.1 structure, the types of organizational structures in the commonly used structural units include, but are not limited to, the following:

集合结构, 用 "SET" 表示, 一个集合结构的结构单元中可包含多个子结 构单元, 这些子结构单元的排列顺序可以不固定。 例如, 一条集合结构的话单 如果包含八、 B、 C三个字段, 这三个字段排列的顺序可能是 CBA也可能是 BCA。 因此, 与顺序结构不同, 对于集合结构的结构单元在解码时, 需要先判 断当前处理的是哪个子结构单元,然后再釆用相应的处理方式做进一步的识别 或者提取处理。  The collection structure, represented by "SET", may contain multiple sub-structure units in the structural unit of a collection structure, and the order of arrangement of these sub-structure units may not be fixed. For example, a bill of a collection structure If three fields of eight, B, and C are included, the order of the three fields may be CBA or BCA. Therefore, unlike the sequential structure, when decoding the structural unit of the aggregate structure, it is necessary to first determine which sub-structure unit is currently processed, and then use the corresponding processing method for further identification or extraction processing.

S102: 按照上述 S101中预置的对原始话单文件的结构特点的描述, 对接 收到的话单文件釆用与该话单中相应层的结构单元对应的识别方式识别出所 述结构单元中包含的子结构单元,然后再釆用与所述子结构单元对应的识别方 式识别出所述子结构单元中包含的更小的子结构单元, 依此类推进行逐层识 另1 J , 直到识别出其中所有的原子单元。 S102: Docking according to the description of the structural features of the original CDR file preset in S101 above. The received CDR file identifies the sub-structure unit included in the structural unit by using an identification manner corresponding to the structural unit of the corresponding layer in the CDR, and then identifies the identification method corresponding to the sub-structure unit. smaller sub-units of the structural units contained in the substructure, and so on for identifying the other layer by layer 1 J, wherein until all of the identified atomic units.

由于一个话单文件通常釆用嵌套结构封装,即将一个话单文件看作是最上 层的结构单元, 那么该结构单元往往包含了多个子结构单元, 而每个子结构单 元也有可能还包含了若干个更小的子结构单元,这样逐层嵌套直到最小的原子 单元。 因此, 在识别时, 通常可釆用逐层识别的方式, 从最上层开始釆用与相 应层对应的识别方式进行逐层识别, 直到识别得到所有原子单元。  Since a bill file is usually encapsulated by a nested structure, that is, a bill file is regarded as the uppermost structural unit, the structural unit often contains multiple substructure units, and each substructure unit may also contain several Smaller substructure units, so nested layer by layer until the smallest atomic unit. Therefore, in the identification, the layer-by-layer identification method can usually be used, and the layer-by-layer identification is performed from the uppermost layer by using the recognition method corresponding to the corresponding layer until all atomic units are identified.

S103: 当从所述 S102中得知从所述原始话单文件中识别出所有的原子单 元后, 分别从各原子单元中提取相应的话单信息。  S103: After learning from the S102 that all the atomic units are identified from the original CDR file, the corresponding CDR information is extracted from each atomic unit.

S104: 将所提取的话单信息封装在计费系统容易识别的话单文件中,再将 封装后的话单文件发送至所述计费系统, 以供计费统计。  S104: The extracted bill information is encapsulated in a bill file that is easily recognized by the billing system, and then the encapsulated bill file is sent to the billing system for billing statistics.

此外, 上述 S103中的提取动作不仅可以在识别出整个话单文件中所有原 子单元后执行,而且还可以在话单文件中某一个子结构单元识别出包含的原子 单元后就直接提取, 然后再识别和提取另一个子结构单元中的话单信息。  In addition, the extracting operation in the above S103 can be performed not only after identifying all atomic units in the entire bill file, but also directly extracting the contained atomic unit in a bill structure file, and then directly extracting Identify and extract bill information in another sub-structure unit.

本领域技术人员知道,话单文件的组织结构有很多种, 可以有不同类型的 结构单元, 每一层结构单元中还可以包含不同类型的子结构单元, 因此, 当一 个话单文件中嵌套了多层不同类型的结构单元时, 在上述 S102中需要分别根 据每层的结构单元的组织结构特点,釆用相应的识别方式对相应层的结构单元 进行识别, 以识别出包含的所有子结构单元, 然后再根据每个子结构单元的组 织结构特点,分别选择与所述子结构单元相对应的识别方式进而识别出更小的 子结构单元。 由于每层结构单元的组织结构和格式可能会有不同, 因此不同层 需要釆用与之对应的不同的识别方式。  Those skilled in the art know that there are many kinds of organization structures of a bill file, and there may be different types of structural units, and each layer structural unit may also contain different types of sub-structure units, and therefore, when nested in a bill file When a plurality of different types of structural units are used, in the above S102, according to the structural characteristics of the structural units of each layer, the structural units of the corresponding layers are identified by corresponding identification methods to identify all substructures included. The unit, and then according to the organizational structure characteristics of each sub-structure unit, respectively select the identification manner corresponding to the sub-structure unit to identify smaller sub-structure units. Since the organizational structure and format of each structural unit may be different, different layers need to use different identification methods corresponding to them.

下面根据常用的几种不同组织结构的结构单元,分别举例说明一下本实施 例中对不同结构单元釆用的具体识别方式, 例如:  In the following, according to the commonly used structural units of different organizational structures, specific identification methods for different structural units in this embodiment are respectively illustrated, for example:

如图 3所示,对于顺序结构的结构单元, 由于包含的子结构单元为顺序排 列的, 因此釆用的识别方式为按照顺序对包含的子结构单元逐个识别, 例如, 先对第一个子结构单元做进一步识别处理,当第一个子结构单元中识别出了所 有的原子单元后, 然后再按照顺序对第二个子结构单元做进一步识别处理, 直 到该顺序结构的结构单元中包含的所有的子结构单元都识别完毕,该方法可具 体包括: As shown in FIG. 3, for the structural unit of the sequential structure, since the included sub-structural units are sequentially arranged, the identification method of the sub-structure units is sequentially identified one by one in order, for example, the first sub-parent The structural unit performs further recognition processing, and when the first sub-structural unit identifies the After the atomic unit is present, the second sub-structural unit is further identified in order, until all the sub-structural units included in the structural unit of the sequential structure are identified, and the method may specifically include:

S301 : 判断当前待解码的结构单元是否满足预定义的结构单元的识别条 件, 若是, 则可以按照所满足的结构单元的封装格式识别得到所述结构单元中 包含的所有子结构单元, 然后执行 S302; 否则, 执行 S306。  S301: determining whether the structural unit to be decoded meets the recognition condition of the predefined structural unit, and if yes, identifying all the sub-structure units included in the structural unit according to the encapsulation format of the satisfied structural unit, and then executing S302 Otherwise, execute S306.

其中,判断结构单元的识别条件可以具体为判断所述结构单元的封装格式 是否属于指定类型, 例如: 指定的待识别的结构单元的封装格式为 ASN.1格 式的文件, 如参见图 4所示, 一个 ASN.1格式的文件包括标签(TAG )部分、 长度( Length )部分和内容( Content )部分。 因此, 可以通过识别结构单元中 是否包含 TAG部分,来确定待识别的结构单元的封装格式是否为 ASN.1结构。  The determining the condition of the structural unit may be specifically determining whether the encapsulation format of the structural unit belongs to a specified type, for example: the specified encapsulation format of the structural unit to be identified is a file in the ASN.1 format, as shown in FIG. , A file in ASN.1 format includes a label (TAG) part, a length (length) part, and a content (Content) part. Therefore, whether the encapsulation format of the structural unit to be identified is an ASN.1 structure can be determined by identifying whether the TAG part is included in the structural unit.

S302:根据该结构单元的封装格式标明所述结构单元和该结构单元包含的 所有子结构单元的作用范围。 然后再执行 S303。  S302: Indicate, according to the encapsulation format of the structural unit, the functional scope of the structural unit and all sub-structural units included in the structural unit. Then execute S303.

其中, 标明所述结构单元的作用范围的目的在于: 为了能够在所述结构单 元的长度范围内保证所有的子结构单元都被识别过,通过保证所述结构单元中 所有包含了话单信息的原子单元都能够识别,以进一步保证所述结构单元中携 带的话单信息都能被提取。  The purpose of indicating the scope of action of the structural unit is to ensure that all sub-structure units are identified within the length of the structural unit, by ensuring that all of the structural units contain CDR information. The atomic units are all identifiable to further ensure that the CDR information carried in the structural unit can be extracted.

其中, 标明所述结构单元中所有子结构单元的作用范围的目的在于: 为了 能够保证在所述所有子结构单元的长度范围内,识别出所有子结构单元中包含 的所有更小的子结构单元,以保证所有子结构单元中的包含的所有的话单信息 都能被提取。  The purpose of indicating the scope of action of all sub-structure units in the structural unit is to: ensure that all smaller sub-structure units included in all sub-structure units are identified within the length range of all sub-structure units To ensure that all the CDR information contained in all sub-structural units can be extracted.

由于常用的话单文件的封装格式有很多种,不同的封装格式釆用不同的识 别方法识别其中包含的子结构单元, 可以通过相应的识别器实现, 下面根据常 用的几种不同封装格式的结构单元,分别举例说明一下本实施例中不同格式的 结构单元对应的判断方法, 以及标明作用范围的方法, 如表 1所示。 需要说明 的是, 表 1所列方法同样适用于本发明的其他实施例中。  Since there are many kinds of package formats for commonly used CDR files, different package formats use different recognition methods to identify sub-structure units contained therein, which can be implemented by corresponding identifiers. The following structural units are based on several commonly used different package formats. For example, the method for judging the corresponding structural units of different formats in the present embodiment and the method for indicating the range of action are respectively illustrated, as shown in Table 1. It should be noted that the methods listed in Table 1 are equally applicable to other embodiments of the present invention.

表 1  Table 1

判断结构单元是否满足条 子结构单元的 结构单元的作 识别器  Judging whether the structural unit satisfies the structural unit of the strip structure unit

件 作用范围 用范围 通过 TAG部分来判断要处 通过 Length部 通过 TAG 部 理的数据流是否满足该结 分来计算其所 分、 LENGH部Scope of use The TAG part is used to determine whether the data stream passing through the TAG part of the Length part satisfies the score to calculate its score, the LENGH part.

ASN.l识 构单元解码条件; 有子结构单元 分和 Content部 别器【1】 的作用范围 分的总和计算 该结构单元的 总的作用范围 文本行识 通过换行符判断要处理的 文本行的长度 文本行的长度 别器【2】 数据流是否满足条件 ASN.l eigenunit decoding condition; the sum of the sub-structural unit and the content part of the Content Partifier [1] calculates the total scope of the structural unit. The text line recognizes the line of text to be processed by the newline character. Length of length text line [2] Whether the data stream satisfies the condition

通过换行符和预定义的长 通过预定义的 通过预定义的 度值判断要处理的数据流 长度来获得其 长度以及换行 定长文本  Use line breaks and predefined lengths to determine the length of the stream to be processed and the line break length by predefining the length of the stream to be processed by a predefined degree value

是否满足条件 所有子结构单 符的长度来计 行识别器  Whether the condition of all substructures is satisfied by the length of the line identifier

元的作用范围 算该结构单元 【3】  The scope of the element is calculated as the structural unit [3]

的总的作用范 围  General role range

通过换行符、预定义的分隔 通过前面步骤 通过前面步骤 变长文本  By line breaks, predefined separations, through the previous steps, through the previous steps, lengthening the text

符和字段个数判断要处理 获得其所有子 获得该结构单 行识别器  The number of fields and the number of fields to be judged to be processed to obtain all of its children.

的数据流是否满足条件 结构单元的作 元的总的作用 【4】  Whether the data stream satisfies the condition The total role of the unit of the structural unit [4]

用范围 范围  Range of use

通过预定义的块头和块尾 通过前面步骤 通过前面步骤 块识别器 的标志判断要处理的数据 获得其所有子 获得其所有子 【5】 流是否满足该结构单元解 结构单元的作 结构单元的作 码条件 用范围 用范围 当前数据流即满足 母结构所限定 母结构所限定 任意识别  Through the pre-defined block header and block tail, through the previous steps, the data of the data to be processed is determined by the flag of the previous step block identifier, and all the sub-[5] streams are obtained for the structural unit of the structural unit. The code condition uses the scope of the current data stream, that is, the arbitrary identification defined by the parent structure defined by the parent structure.

的最大作用范 的最大作用范 器【6】  The largest role of the largest role of the scope [6]

围 围  Surrounding

定长识别 从当前数据流中能取到预 预定义的长度 预定义的长度 器【7】 定义的长度即满足 Fixed length recognition The pre-defined length can be obtained from the current data stream. The predefined length [7] defines the length that is satisfied.

分隔符识 能从当前数据流中搜索到 当前位移到分 当前位移到分 别器【8】 分隔符 隔符的长度 隔符的长度,包 括分隔符本身 的长度 The separator identifies the length of the length separator that can be searched from the current data stream to the current displacement to the current separator to the separator [8] separator separator. Including the length of the separator itself

Key: Value或者 Key: Value 通过前面步骤 通过前面步骤 或者 <Key>Value<Key>等 获得其所有子 获得其所有子 Key: Value or Key: Value through the previous steps, get all its children through the previous steps or <Key>Value<Key>, etc.

KeyValue KeyValue

样式的识别类型。根据预定 结构单元的作 结构单元的作 识别器【9】  The type of recognition of the style. According to the predetermined structural unit as the structural unit of the identification device [9]

义的 Key值判断要处理的 用范围 用范围  The Key value of the meaning is judged to be used.

数据流是否满足条件  Whether the data stream satisfies the condition

当前数据流即满足 根据 L 计算其 L计算值 + L本 The current data stream is satisfied. Calculate its L calculation value based on L + L this

LV识别器 LV recognizer

所有子结构单 身的长度的总 【10】  Total length of all substructures [10]

元的作用范围 和  The scope of the element

通过上述标明出结构单元的作用范围后,使得结构单元只能对该作用范围 内的数据流进行识别处理, 并且作用范围内的所有数据都必须得到识别处理, 以保证所述结构单元在识别时不会越界, 同时又保证了话单信息不会丟失。  After the scope of action of the structural unit is indicated by the above, the structural unit can only identify and process the data stream within the scope of the action, and all data within the scope of the scope must be identified and processed to ensure that the structural unit is identified. It will not cross the border, and at the same time ensure that the bill information will not be lost.

S303: 分别釆用与子结构单元对应的识别方式,按照顺序对所包含的各子 结构单元在各自作用范围内逐个识别,以得到所有子结构单元中的所有原子单 元。 在识别过程中, 在每识别完一个子结构单元后, 可执行 S304; 当无法正 常识别时, 执行 S306。  S303: Identify, by using the identification manner corresponding to the sub-structure unit, the sub-structure units included in the respective scopes are identified one by one in order to obtain all atomic units in all sub-structure units. In the identification process, after each sub-structure unit is identified, S304 may be performed; when it is not normally recognized, S306 is performed.

所述顺序识别的方法例如:先釆用适用于第一个子结构单元的识别方式对 该子结构单元做进一步识别处理,当该子结构单元中还包含了其他更小的子结 构单元时, 再分别釆用各自适用的识别方式分别识别所述更小的子结构单元, 直到识别出所述子结构单元中包含的所有原子单元;然后如果还有第二个子结 构单元, 再对第二个子结构单元做进一步识别处理, 依此类推。  The method for sequentially identifying, for example, first identifying the sub-structure unit by using an identification method suitable for the first sub-structure unit, and when the sub-structure unit further includes other smaller sub-structure units, And respectively identifying the smaller sub-structure units by respective applicable identification methods until all atomic units included in the sub-structure unit are identified; then if there is a second sub-structure unit, then the second sub- The structural unit is further identified, and so on.

S304: 判断所述结构单元中所有子结构单元的作用范围内是否都识别完 毕, 若是, 则继续执行 S305; 否则, 返回至所述 S303 , 以按照顺序继续识别 下一个子结构单元。  S304: Determine whether the identification of all the sub-structure units in the structural unit is completed, and if yes, proceed to S305; otherwise, return to the S303 to continue identifying the next sub-structural unit in sequence.

S305: 判断在所述结构单元的作用范围内是否识别完毕, 若是, 则结束识 别流程; 否则, 执行 S306。  S305: Determine whether the recognition is completed within the scope of the structural unit, and if yes, end the identification process; otherwise, execute S306.

其中, 判断结构单元的作用范围是否识别完毕的目的在于: 由于一个话单 文件在识别时会将该话单文件当作一个数据流,从话单的文件头开始识别, 到 话单体时, 由于一个话单体中包含了多个子结构单元, 则开始按照该话单体的 组织结构特点, 釆用相应的识别方式进行识别, 在对多个子结构单元识别时, 会先对其中一个子结构单元逐层识别,直到识别出该子结构单元中所有的原子 单元, 然后再对其他子结构单元识别。 当话单体中的所有子结构单元都被识别 完成后,还需对话单文件的话单尾进行识别, 只有当将所述话单文件的结构单 元的作用范围内的所有信息都识别, 即处理了话单所有长度的内容, 才能认为 完成了该话单文件的识别。 因此, 该步骤的目的在于保证整个话单文件的正确 性和完整性。 The purpose of determining whether the scope of the structural unit is identified is as follows: Since a bill file is recognized as a data stream when it is recognized, it is recognized from the file header of the bill, to In the case of a single cell, since a single subunit contains a plurality of substructure units, it begins to identify according to the organizational structure of the unit, and uses a corresponding identification method to identify, and when identifying a plurality of substructure units, One of the sub-structure units is identified layer by layer until all atomic units in the sub-structure unit are identified, and then the other sub-structure units are identified. After all the sub-structure units in the cell are recognized, the single-word of the dialog file needs to be recognized one-tailed, and only when all the information within the scope of the structural unit of the bill file is identified, that is, processing The contents of the CDRs of all lengths can be considered to have completed the identification of the CDR file. Therefore, the purpose of this step is to ensure the correctness and integrity of the entire bill file.

S306: 报告识别错误。  S306: The report identifies an error.

此外, 上述 S305是针对当前识别的结构单元为一个话单文件, 即为最上 一层的结构单元。如果当前识别的结构单元为话单文件中包含的某一个子结构 单元时, 则所述 S305中, 当判断得到所述当前识别的结构单元的作用范围识 别完毕后, 在结束识别流程之前,还需要向上层母结构单元返回所述结构单元 成功识别的长度,以便所述上层母结构单元收到所述结构单元的成功识别的长 度后, 能够确定该母结构单元中还有多少长度的信息没有识别,供母结构单元 判断是否在母结构单元的作用范围内是否识别完毕。  In addition, the above S305 is a CDR file for the currently identified structural unit, that is, the structural unit of the uppermost layer. If the currently identified structural unit is a sub-structure unit included in the bill file, then in S305, after determining that the scope of the currently identified structural unit is identified, before the end of the identification process, Requiring the upper parent structure unit to return the length successfully recognized by the structural unit, so that after the upper parent structural unit receives the successfully recognized length of the structural unit, it can determine how much length information is still in the parent structural unit. Identification, for the parent structural unit to determine whether it is recognized within the scope of the parent structural unit.

此外, 上述 S303中当一个子结构单元识别完毕后, 还可以不先执行 S304 的判断, 而是按照顺序继续识别下一个子结构单元, 等依次识别后, 再执行所 述 S304 , 当 S304中判断得到还有子结构单元没有识别到时, 则再返回至所述 S303对未识别的子结构单元进行识别。  In addition, after the sub-structural unit is identified in the above S303, the determination of S304 may not be performed first, but the next sub-structural unit may be continuously identified in order, and after sequentially identifying, the S304 is executed, and the S304 is determined. When it is obtained that the sub-structural unit is not recognized, it returns to S303 to identify the unrecognized sub-structural unit.

如图 5所示,对于数组结构的结构单元, 釆用的识别方式为对包含的子结 构单元分别识别, 例如, 先对其中的一个子结构单元做进一步识别处理, 当从 该子结构单元中识别出了所有的原子单元后,再识别其他子结构单元, 直到该 数组结构的结构单元中包含的所有的子结构单元都识别完毕。  As shown in FIG. 5, for the structural unit of the array structure, the identification method is to separately identify the included sub-structure units, for example, one of the sub-structure units is further identified, and from the sub-structure unit. After all the atomic units are identified, the other sub-structure units are identified until all the sub-structure units contained in the structural unit of the array structure are identified.

数组结构的结构单元的识别方式与上述图 3 所示的顺序结构的结构单元 的识别方法基本相同, 不同之处在于,数组结构的结构单元中包含的子结构单 元都为同一种类型, 因此, 在本实施例中可以对数组结构的结构单元中包含的 子结构单元都釆用相同的识别方式进行识别。 本实施例的识别方法可具体包 括: S501 : 判断当前待解码的结构单元是否满足预定义的结构单元的识别条 件, 若是, 则可以按照所满足的结构单元的封装格式识别得到所述结构单元中 包含的所有子结构单元, 然后执行 S502; 否则, 执行 S506。 The identification method of the structural unit of the array structure is basically the same as the identification method of the structural unit of the sequential structure shown in FIG. 3, except that the sub-structure units included in the structural unit of the array structure are of the same type, therefore, In this embodiment, the sub-structure units included in the structural unit of the array structure can be identified by the same identification method. The identification method of this embodiment may specifically include: S501: determining whether the structural unit to be decoded meets the recognition condition of the predefined structural unit, and if yes, identifying all the sub-structure units included in the structural unit according to the encapsulation format of the satisfied structural unit, and then executing S502 Otherwise, execute S506.

其中,判断结构单元的识别条件可以具体为判断所述结构单元的封装格式 是否属于指定类型,本实施例中的判断识别条件的方法与图 3所示实施例中的 相同, 在此不再——赘述。  The method for determining the identification condition of the structural unit may be specifically determined to determine whether the encapsulation format of the structural unit belongs to a specified type. The method for judging the identification condition in the embodiment is the same as that in the embodiment shown in FIG. - Narrative.

S502:根据该结构单元的封装格式标明所述结构单元和该结构单元包含的 所有子结构单元的作用范围。 然后再执行 S503。  S502: Indicate, according to the encapsulation format of the structural unit, the functional scope of the structural unit and all sub-structural units included in the structural unit. Then execute S503.

S503 : 釆用与子结构单元对应的识别方式,对所包含的子结构单元进行识 另 以得到所有子结构单元中的所有原子单元。 在识别过程中, 在每识别完一 个子结构单元后, 可执行 S504; 当无法正常识别, 则执行 S506。  S503: Identify the sub-structure units included by using the identification method corresponding to the sub-structure unit to obtain all the atom units in all the sub-structure units. In the identification process, after each sub-structure unit is identified, S504 may be performed; when it is not recognized properly, S506 is performed.

S504: 判断所述结构单元中所有子结构单元的作用范围内是否都识别完 毕? 若是, 则继续执行 S505; 否则, 返回所述 S503 , 以继续识别其他子结构 单元。  S504: Determine whether the identification of all the sub-structure units in the structural unit is completed. If yes, proceed to S505; otherwise, return to S503 to continue identifying other sub-structure units.

S505 : 判断所述结构单元的作用范围是否识别完毕, 若是, 则结束识别流 程; 否则, 执行 S506。  S505: determining whether the scope of action of the structural unit is recognized, and if yes, ending the recognition process; otherwise, executing S506.

S506: 报告识别错误。  S506: The report identifies an error.

此外, 上述 S505针对当前识别的结构单元为一个话单文件, 即为最上一 层的结构单元。如果当前识别的结构单元为话单文件中包含的某一个子结构单 元时, 则所述 S505中, 当判断得到所述当前识别的结构单元的作用范围识别 完毕后,在结束识别流程之前,还需要向上层母结构单元返回所述结构单元成 功识别的长度,以便所述上层母结构单元收到所述结构单元的成功识别的长度 后, 能够确定该母结构单元中还有多少长度的信息没有识别,供母结构单元判 断是否在母结构单元的作用范围内识别完毕。  In addition, the above S505 is a CDR file for the currently identified structural unit, that is, the structural unit of the uppermost layer. If the currently identified structural unit is a sub-structure unit included in the bill file, then in S505, after determining that the scope of the currently identified structural unit is identified, before the end of the identification process, Requiring the upper parent structure unit to return the length successfully recognized by the structural unit, so that after the upper parent structural unit receives the successfully recognized length of the structural unit, it can determine how much length information is still in the parent structural unit. Identification, for the parent structural unit to determine whether the identification within the scope of the parent structural unit is completed.

此外, 上述 S503中当一个子结构单元识别完毕后, 还可以先不执行 S504 的判断, 而是继续识别另一个子结构单元, 等都识别后, 再执行所述 S504 , 当 S504中判断得到还有子结构单元没有识别到时,则再返回至所述 S503对未 识别的子结构单元进行识别。  In addition, after the sub-structural unit is identified in the above S503, the determination of S504 may not be performed first, but another sub-structural unit may continue to be recognized. After the identification is performed, the S504 is executed, and the determination is performed in S504. If there is a substructure unit that is not recognized, then return to S503 to identify the unrecognized substructure unit.

如图 6所示,对于选择结构的结构单元, 由于选择结构的结构单元只包含 一个子结构单元, 而所述子结构单元可以为各种类型, 因此, 在对该子结构单 元做进一步识别前, 需要先确定子结构单元属于哪一种类型。 以便根据相应类 型的组织结构和封装格式的特点选择对应的识别方式对子结构单元做进一步 识别。 本实施例的识别方式可具体包括: As shown in FIG. 6, for the structural unit of the selected structure, since the structural unit of the selected structure only contains A sub-structure unit, and the sub-structure unit can be of various types. Therefore, before further identifying the sub-structure unit, it is necessary to determine which type the sub-structure unit belongs to. In order to select the corresponding identification method according to the characteristics of the corresponding type of organizational structure and packaging format, the sub-structural unit is further identified. The identification manner of this embodiment may specifically include:

S601 : 判断当前待解码的结构单元是否满足预定义的结构单元的识别条 件, 若是, 则可以按照所满足的结构单元的封装格式识别得到所述结构单元中 包含的子结构单元, 然后执行 S602; 否则, 执行 S606。  S601: determining whether the current structural unit to be decoded satisfies the identification condition of the predefined structural unit, and if so, identifying the sub-structure unit included in the structural unit according to the encapsulation format of the satisfied structural unit, and then executing S602; Otherwise, S606 is performed.

其中,判断结构单元的识别条件可以具体为判断所述结构单元的封装格式 是否属于指定类型,本实施例中的判断识别条件的方法与图 3所示实施例中的 相同, 在此不再——赘述。  The method for determining the identification condition of the structural unit may be specifically determined to determine whether the encapsulation format of the structural unit belongs to a specified type. The method for judging the identification condition in the embodiment is the same as that in the embodiment shown in FIG. - Narrative.

S602:根据该结构单元的封装格式标明所述结构单元和该结构单元包含的 子结构单元的作用范围。 然后再执行 S603。 种类型, 如语音、 或短消息等类型。 其中, 可按照表 1所列举的满足条件判断 子结构单元的类型。  S602: Indicate, according to the encapsulation format of the structural unit, the functional scope of the structural unit and the sub-structural unit included in the structural unit. Then execute S603. Types, such as voice, or short messages. Among them, the type of the sub-structural unit can be judged according to the conditions as stipulated in Table 1.

S604: 釆用与所述子结构单元类型对应的识别方式,对该子结构单元进行 识别, 以得到所述子结构单元中包含的所有原子单元。 在识别完后, 可执行 S605; 当无法正常识别时, 执行 S607。  S604: Identify the sub-structure unit by using a recognition manner corresponding to the sub-structure unit type to obtain all atom units included in the sub-structure unit. After the recognition is completed, S605 may be performed; when the recognition is not possible, S607 is performed.

S605 : 判断在所述子结构单元的作用范围内是否识别完毕, 若是, 则继续 执行 S606; 否则, 返回至所述 S604 , 继续识别。  S605: determining whether the recognition is completed within the scope of the sub-structure unit, and if yes, proceeding to S606; otherwise, returning to the S604 to continue the identification.

S606: 判断在所述结构单元的作用范围是否识别完毕, 若是, 则结束识别 流程; 否则, 执行 S607。  S606: Determine whether the scope of the structure unit is recognized, and if yes, end the identification process; otherwise, execute S607.

S607: 报告识别错误。  S607: The report identifies an error.

此外, 上述 S606针对当前识别的结构单元为一个话单文件, 即为最上一 层的结构单元。 如果当前识别的结构单元为话单文件中包含的一个子结构单 元, 则在所述 S606中, 当判断得到所述当前识别的结构单元的作用范围识别 完毕后,在结束识别流程之前,还需要向上层母结构单元返回所述结构单元成 功识别的长度,以便所述上层母结构单元收到所述结构单元的成功识别的长度 后, 能够确定该母结构单元中还有多少长度的内容没有识别,供母结构单元判 断在母结构单元的作用范围内是否识别完毕。 In addition, the above S606 is a CDR file for the currently identified structural unit, that is, the structural unit of the uppermost layer. If the currently identified structural unit is a sub-structure unit included in the bill file, in the S606, after determining that the scope of the currently identified structural unit is determined, before the end of the identification process, Returning, to the upper-level parent structural unit, the length successfully recognized by the structural unit, so that after the upper-level parent structural unit receives the successfully recognized length of the structural unit, it can determine how much length of the parent structural unit is not recognized. For the mother structural unit Whether the break is recognized within the scope of the parent structural unit.

此外, 对于集合结构的结构单元, 由于集合结构中包含多个子结构单元, 各子结构单元的排列顺序不固定, 因此, 在对各子结构单元做进一步识别前, 需要先确定待识别的子结构单元分别属于哪种结构 ,以便选择相应的识别方式 进行对各子结构单元进一步识别。由于集合结构的识别方式与图 6所示的选择 结构的识别方式大致相同, 在此不再赘述。  In addition, for the structural unit of the set structure, since the set structure includes a plurality of sub-structure units, the order of the sub-structure units is not fixed. Therefore, before further identifying each sub-structure unit, the sub-structure to be identified needs to be determined. Which structure the cells belong to in order to select the corresponding recognition mode for further identification of each sub-structure unit. Since the identification structure of the collection structure is substantially the same as the identification method of the selection structure shown in FIG. 6, it will not be described here.

如图 7所示,对于原子单元, 由于原子结构单元属于话单文件的最小结构 单元, 因此当识别到原子单元时, 无需再做进一步的子结构单元的识别, 而是 根据所述原子单元的封装格式识别出包含话单信息的字段,然后提取所述字段 得到话单信息, 对于原子单元的识别和提取方法包括:  As shown in FIG. 7, for an atomic unit, since the atomic structural unit belongs to the smallest structural unit of the CDR file, when the atomic unit is recognized, no further sub-structural unit identification is required, but according to the atomic unit The encapsulation format identifies the field containing the bill information, and then extracts the field to obtain the bill information. The method for identifying and extracting the atomic unit includes:

S701 : 判断当前待解码的原子单元是否满足预定义的结构单元的识别条 件, 若是, 则可以按照所满足的结构单元的封装格式识别得到所述原子单元中 包含有话单信息的所有字段, 然后执行 S702; 否则, 执行 S705。 是否属于指定类型,本实施例中的判断识别条件的方法与图 3所示实施例中的 相同, 在此不再——赘述。  S701: determining whether the current atomic unit to be decoded satisfies the recognition condition of the predefined structural unit, and if yes, identifying all the fields in the atomic unit that contain the bill information according to the encapsulation format of the satisfied structural unit, and then S702 is performed; otherwise, S705 is performed. The method for determining the recognition condition in this embodiment is the same as that in the embodiment shown in FIG. 3, and is not described again here.

S702: 根据所述原子单元的封装格式标明所述原子单元的作用范围, 然后 执行 S703。  S702: Indicate the range of the atomic unit according to the encapsulation format of the atomic unit, and then execute S703.

S703:判断是否需要提取话单信息,若是,则执行 S704;否则,执行 S705。 S704: 根据所述字段的编码特点, 选择相应的提取器, 按照该提取器的提 取方式提取所述字段中话单信息。 如果提取完毕, 则结束本流程; 当无法正常 提取时,执行 S705。其中,字段的不同编码方式所对应的提取方法可参见表 2。  S703: Determine whether it is necessary to extract the bill information, and if yes, execute S704; otherwise, execute S705. S704: Select a corresponding extractor according to the coding characteristics of the field, and extract the bill information in the field according to the extracting manner of the extractor. If the extraction is completed, the process ends; when the extraction cannot be performed normally, S705 is executed. The extraction method corresponding to the different coding modes of the fields can be seen in Table 2.

表 2  Table 2

提取器 原始值 提取方式  Extractor raw value extraction method

普通字段串 从偏移量开始取值, 直到串尾 Normal field string takes the value from the offset until the end of the string

ASCII提取器【A】 ASCII extractor [A]

符或者指定的最大长度  Or the specified maximum length

有符号大端 转换成主机能表示的整数值 有符号大端整数提取器【B】  Signed big end Converted to an integer value that the host can represent. Signed big endian integer extractor [B]

整数  Integer

有符号小端整数提取器【C】 有付" ^小 转换成主机能表示的整数值 整数 Signed little endian integer extractor [C] has paid "^ small conversion into an integer value that the host can represent Integer

无符号大端 转换成主机能表示的整数值 无符号大端整数提取器【D】  Unsigned big end Converted to an integer value that the host can represent Unsigned big endian integer extractor [D]

整数  Integer

无符号小端 转换成主机能表示的整数值 无符号小端整数提取器【E】  Unsigned little end Converted to an integer value that the host can represent Unsigned little endian integer extractor [E]

整数  Integer

二 -十进制编码(BCD )码提 BCD码 每个字节转换成两个字符标 取器【F】 识, 但是遇到 F后结束  Two-decimal code (BCD) code BCD code Each byte is converted into two character tags [F], but ends after encountering F

TBCD码 每个字节转换成两个字符标 TBCD code converts each byte into two characters

TBCD码提取器【G】 识, 但是这两个字符要进行反 转并且遇到 F后结束 TBCD code extractor [G], but these two characters are reversed and end after encountering F

十六进制 每个字节转换成两个字符标 十六进制提取器【H】 识, 转换后的长度为原来的两 倍  Hexadecimal Each byte is converted into two characters. Hexadecimal extractor [H], the converted length is twice the original

S705: 报告识别错误。  S705: The report identifies an error.

此外, 在上述图 1所示的实施例中的 S102中, 设置原始话单的结构描述 除了釆用语言设置外,还可以直接在解码树上通过改变解码树的节点布局, 以 及设置各节点的配置参数来实现对整个话单文件的结构描述的设置。  In addition, in S102 in the embodiment shown in FIG. 1 above, the structure description of the original bill is set, in addition to the language setting, the node layout of the decoding tree can be directly changed on the decoding tree, and the nodes of each node are set. The configuration parameters are used to implement the setting of the structure description of the entire bill file.

下面仍以上述图 1所示实施例中所列举的图 2所示的 ASN.1结构的话单 文件的结构特点为例,根据表 1和表 2中所列举的识别器和提取器,详细说明 一下如何使用解码树设置原始话单文件的结构描述:  In the following, the structural features of the CDR file of the ASN.1 structure shown in FIG. 2 listed in the embodiment shown in FIG. 1 are taken as an example, and the identifiers and extractors listed in Table 1 and Table 2 are described in detail. How to use the decoding tree to set the structure description of the original bill file:

如图 8所述, 为图 2所示结构的话单文件的解码树示意图。该解码树上的 每个叶子节点表示一个原子单元, 非叶子节点表示复合类型的结构单元,在每 个节点上都有一个识别器,用于判断收到的话单文件中对应节点的结构单元是 否满足预定义的识别条件。对于存在话单信息的叶子节点还需要配置相应的提 取器和输出字段, 以便将提取得到的话单信息封装到指定的输出字段上。  As shown in FIG. 8, it is a decoding tree diagram of the CDR file of the structure shown in FIG. 2. Each leaf node on the decoding tree represents an atomic unit, and the non-leaf node represents a structural unit of a composite type, and each node has an identifier for determining whether the structural unit of the corresponding node in the received bill file is Meet predefined recognition conditions. For the leaf node that has the bill information, the corresponding extractor and output fields need to be configured to encapsulate the extracted bill information into the specified output field.

其中, 对每个节点配置识别器、 提取器、 以及组织结构类型等参数时, 可 以直接使用识别器或提取器的标号以及特殊符号进行设置, 例如: []表示该节 点的结构类型; {}表示该节点的识别器; ()表示该原子节点的提取器; <>表 示该原子节点的输出字段。 以图 8所示的解码树中左下角的节点为例: 其中, 字段 1的结构类型为 BASIC (即原子单元 ), 识别器为 8 (即分隔符识别器), 提取器是 A (即 ASCII提取器 ), 输出字段是 Caller。 When configuring parameters such as recognizer, extractor, and organization type for each node, you can directly set the identifier of the recognizer or extractor and special symbols, for example: [] indicates the structure type of the node; {} Represents the identifier of the node; () represents the extractor of the atomic node; <> represents the output field of the atomic node. Take the node in the lower left corner of the decoding tree shown in Figure 8 as an example: The structure type of field 1 is BASIC (ie atomic unit), the identifier is 8 (ie separator identifier), the extractor is A (ie ASCII extractor), and the output field is Caller.

基于上述技术方案, 本发明实施例还公开了一种用于话单解码的装置, 如 图 9所示, 为本发明一种装置实施例的结构示意框图, 所述装置包括: 接收单 元 901、 识别单元 902、 提取单元 903、 封装单元 904, 其中:  Based on the foregoing technical solution, the embodiment of the present invention further discloses a device for CDR decoding. As shown in FIG. 9 , it is a schematic block diagram of an apparatus embodiment of the present invention. The device includes: a receiving unit 901, The identification unit 902, the extraction unit 903, and the encapsulation unit 904, wherein:

所述接收单元 901 , 用于接收待解码的话单文件; 当所述接收单元 901收 到待解码的话单文件后,由所述识别单元 902对所述接收单元 901中所接收到 的话单文件进行识别, 其识别的具体方式为: 选择与所述接收单元 901所接收 到的话单文件的结构特点对应的识别方式识别出所述话单文件中的话单信息。  The receiving unit 901 is configured to receive a bill file to be decoded. After the receiving unit 901 receives the bill file to be decoded, the identifying unit 902 performs the bill file received in the receiving unit 901. The specific manner of the identification is as follows: Selecting an identification manner corresponding to the structural feature of the CDR file received by the receiving unit 901 to identify the CDR information in the CDR file.

其中,在所述识别单元 902中可以保存有与话单文件可能出现的各种结构 特点所对应的各种识别器(图中未示出), 在每个识别器中都保存有各自对应 的结构特点所适用的识别方式, 所述识别器(图中未示出)用于按照所保存的 识别方式识别话单文件。 所述识别单元 902中还包括选择识别单元(图中未示 出), 用于按照所述待解码话单文件的结构特点, 选择相应的识别器(图中未 示出), 以使用该识别器 (图中未示出) 来识别所述接收单元 901 中收到的话 单文件, 得到所述话单文件中包含的话单信息;  In the identification unit 902, various identifiers (not shown) corresponding to various structural features that may appear in the bill file may be stored, and each of the identifiers is saved in each identifier. The identification method to which the structural features are applied, the identifier (not shown) is used to identify the bill file according to the saved recognition manner. The identification unit 902 further includes a selection and identification unit (not shown) for selecting a corresponding identifier (not shown) according to the structural features of the to-be-decoded bill file to use the identifier. The device (not shown) identifies the CDR file received in the receiving unit 901, and obtains the CDR information contained in the CDR file;

当所述识别单元 902识别得到所述话单文件中的所有话单信息时,由所述 提取单元 903提取。所述提取单元 903用于提取由所述识别单元 902识别得到 的话单信息;  When the identification unit 902 identifies all the bill information in the bill file, it is extracted by the extracting unit 903. The extracting unit 903 is configured to extract the bill information obtained by the identifying unit 902;

所述封装单元 904, 用于将由所述提取单元 903所提取的话单信息封装在 计费系统能够识别的话单文件中, 以便所述计费系统计费。  The encapsulating unit 904 is configured to encapsulate the bill information extracted by the extracting unit 903 in a bill file that can be recognized by the billing system, so that the billing system can charge.

此外, 对于结构较复杂的话单文件, 所述装置还可以包括配置单元(图中 未示出), 用于在对收到的话单文件解码前, 预先通过所述配置单元(图中未 示出)设置待解码的话单文件的结构特点描述。 然后, 在解码时, 由所述识别 单元 902中的选择识别单元(图中未示出)按照所述配置单元(图中未示出) 中描述的待解码话单文件的结构特点,选择与所述接收单元 901所接收到的话 单文件的结构特点对应的识别器(图中未示出)识别出所述话单文件中的话单 信息。  In addition, for a more complicated CDR file, the device may further include a configuration unit (not shown) for pre-passing the configuration unit (not shown in the figure) before decoding the received CDR file. ) Set the description of the structure characteristics of the CDR file to be decoded. Then, at the time of decoding, the selection identification unit (not shown) in the identification unit 902 selects and follows the structural characteristics of the to-be-decoded bill file described in the configuration unit (not shown). The identifier (not shown) corresponding to the structural feature of the CDR file received by the receiving unit 901 identifies the CDR information in the CDR file.

其中, 所述配置单元(图中未示出)可釆用语言形式描述话单文件的结构 特点,还可以釆用解码树的设置方式, 通过改变解码树的节点布局以及设置各 节点的配置参数来实现对整个话单文件的结构描述的设置。 The configuration unit (not shown) may describe the structure of the bill file in a language format. Features, you can also use the decoding tree setting method, by changing the node layout of the decoding tree and setting the configuration parameters of each node to achieve the structure description of the entire CDR file.

上述实施例由于针对话单信息的不同结构特点, 预先设置了不同的识别 器, 因此在对话单文件解码时, 能够通过所述识别单元 902根据待解码的话单 文件的结构特点, 选择合适的识别方式从所述话单文件中识别得到话单信息。 本实施例由于可以才艮据预置的结构特点描述,在识别时调用相应的识别器(图 中未示出)进行识别, 因此, 即便当话单文件的结构发生改变, 也只需在设置 单元(图中未示出) 中简单更新变化环节的结构描述, 或者只需在识别单元 902 中添加新的识别器 (图中未示出), 而不用再对整个解码流程的原始代码 进行修改。 因此, 本实施例能够灵活地适应结构多样的话单文件, 也为新格式 的话单文件的识别方式的扩展提供了便利。 并且还提高了解码效率。  In the foregoing embodiment, different identifiers are set in advance for different structural features of the bill information. Therefore, when the dialog file is decoded, the identification unit 902 can select an appropriate identifier according to the structural features of the bill file to be decoded. The method identifies the bill information from the bill file. In this embodiment, since it can be described according to the preset structural features, the corresponding identifier (not shown) is called for identification at the time of recognition, and therefore, even when the structure of the CDR file is changed, it is only required to be set. A structural description of a simple update change section in a unit (not shown), or simply adding a new recognizer (not shown) in the identification unit 902, without modifying the original code of the entire decoding process. . Therefore, the present embodiment can flexibly adapt to a variety of CDR files, and also facilitates the extension of the recognition mode of the CDR files in the new format. And also improve the decoding efficiency.

与此同时, 当所述话单文件为嵌套结构时, 即话单文件的结构单元中还包 含了子结构单元, 在子结构单元中可能还包含了更小的子结构单元。 因此在上 述图 9所示实施例的基础上,所述装置中的识别单元 902可根据收到的话单文 件中结构单元的封装格式特点,对接收到的话单文件逐层釆用与相应层的结构 单元对应的识别器(图中未示出)识别出所述结构单元中包含的所有子结构单 元, 直到子结构单元为包含有话单信息的原子单元。  At the same time, when the CDR file is a nested structure, the struct unit of the CDR file also includes a sub-structure unit, and the sub-structure unit may further include a smaller sub-structure unit. Therefore, on the basis of the foregoing embodiment shown in FIG. 9, the identifying unit 902 in the device may use the received CDR file layer by layer according to the encapsulation format characteristic of the structural unit in the received CDR file. The identifier corresponding to the structural unit (not shown) identifies all the sub-structure units included in the structural unit until the sub-structure unit is an atomic unit containing bill information.

如图 10所示, 为图 9所示装置实施例中的识别器的结构示意框图, 当话 单文件为多层嵌套时, 所述装置在图 9所示装置实施例的基础上, 所述识别单 元 902中的识别器具体包括: 封装格式确定单元 9021、 和子结构单元确定单 元 9022, 其中:  As shown in FIG. 10, it is a schematic block diagram of the structure of the identifier in the device embodiment shown in FIG. 9. When the CDR file is multi-layer nested, the device is based on the device embodiment shown in FIG. The identifier in the identification unit 902 specifically includes: an encapsulation format determining unit 9021, and a sub-structure unit determining unit 9022, where:

所述封装格式确定单元 9021 , 用于通过判断当前待识别的结构单元满足 所述设置单元(图中未示出)中预置的哪一种结构单元的识别条件, 确定所述 结构单元所满足的封装格式;  The package format determining unit 9021 is configured to determine that the structural unit is satisfied by determining whether the structural unit to be identified currently meets a recognition condition of a structural unit preset in the setting unit (not shown) Package format

所述子结构单元确定单元 9022, 用于按照所述封装格式确定单元 9021所 确定的封装格式识别得到所述结构单元中包含的所有子结构单元。  The sub-structural unit determining unit 9022 is configured to identify all sub-structural units included in the structural unit according to the encapsulation format determined by the encapsulation format determining unit 9021.

当确定得到子结构单元后, 可按照所述设置单元(图中未示出)中预置的 所述子结构单元的结构特点描述, 再选择相应的识别器(图中未示出)对所述 子结构单元做进一步识别,进而识别得到所述子结构单元中包含的更小子结构 单元。 依次类推逐层釆用相应的识别器(图中未示出)逐层识别, 直到识别得 到包含有最小的话单信息的原子单元。其中,再次选择的识别器(图中未示出) 中可同样包含与上述图 10所示识别器相同的结构, 在此不再——赘述。 After determining the sub-structure unit, the structural characteristics of the sub-structure unit preset in the setting unit (not shown) may be described, and then the corresponding identifier (not shown) is selected. The substructure unit is further identified to further identify a smaller substructure included in the substructure unit Unit. The analogy by layer is identified layer by layer with a corresponding identifier (not shown) until the atomic unit containing the smallest bill information is identified. Wherein, the re-selected identifier (not shown) may also include the same structure as the identifier shown in FIG. 10 above, and is not described again here.

此外, 在上述图 10所示装置实施例的基础上, 为了保证整个话单文件的 正确性和完整性,还可标明话单文件中的结构单元以及包含的所有子结构单元 的作用范围。 以便保证在作用范围内的信息都被识别到。 如图 11所示, 图 11 为图 10所示装置实施例中的识别单元的结构示意框图,在上述图 10所示装置 实施例的基础上, 所述识别单元 902还包括作用范围标明单元 9023、 控制单 元 9024, 其中:  In addition, on the basis of the device embodiment shown in FIG. 10 above, in order to ensure the correctness and integrity of the entire CDR file, the functional units in the CDR file and the scope of the included sub-structure units may also be indicated. In order to ensure that the information within the scope of the scope is identified. As shown in FIG. 11, FIG. 11 is a schematic structural block diagram of an identification unit in the apparatus embodiment shown in FIG. 10. On the basis of the apparatus embodiment shown in FIG. 10, the identification unit 902 further includes an action range indicating unit 9023. , control unit 9024, wherein:

所述作用范围标明单元 9023 , 用于根据所述封装格式确定单元 9021所确 定的封装格式标明所述结构单元和所述子结构单元确定单元 9022中确定的所 有子结构单元的作用范围;  The range indicating unit 9023 is configured to indicate, according to the encapsulation format determined by the encapsulation format determining unit 9021, the scope of action of all the sub-structure units determined in the structural unit and the sub-structure unit determining unit 9022;

所述控制单元 9024 , 用于根据由所述作用范围标明单元 9023所标明的所 述结构单元的作用范围判断, 若在所述结构单元的作用范围内都识别完毕, 则 指令所述装置的提取单元 903执行所述提取功能; 否则, 则报告识别错误。  The control unit 9024 is configured to determine, according to the scope of action of the structural unit indicated by the range indicating unit 9023, if the identification is completed within the scope of the structural unit, the device is instructed to be extracted. Unit 903 performs the extraction function; otherwise, an identification error is reported.

本发明实施例还提供了一种话单解调器 (Mediation ), 该话单解码器是介 于网络设备和下游计费系统之间的话单解码设备, 负责从网元上釆集话单,对 话单进行解码预处理后送往下游的计费系统进行计费或结算。该话单解调器能 够处理上游不同的网络设备 (包括不同版本和不同供应商的设备)的不同格式 的话单文件。 参照图 12 , 为本发明话单解码器实施例结构示意图, 该话单解 码器包括: 数据釆集装置 1201、 话单解码装置 1202和数据分发装置 1203 , 其 中:  The embodiment of the present invention further provides a bill demodulator (Mediation), which is a bill decoding device between a network device and a downstream billing system, and is responsible for collecting bills from the network element. The dialog is pre-processed and sent to the downstream billing system for billing or settlement. The CDR demodulator can handle CDR files in different formats of different upstream network devices (including devices of different versions and different vendors). Referring to FIG. 12, which is a schematic structural diagram of an embodiment of a bill decoder according to the present invention, the bill decoder includes: a data collecting device 1201, a bill decoding device 1202, and a data distributing device 1203, wherein:

数据釆集装置 1201 , 用于从网元设备釆集话单;  The data collecting device 1201 is configured to collect a bill from the network element device;

话单解码装置 1202 , 用于接收数据釆集装置 1201釆集到的待解码的话单 文件, 并按照话单文件的结构特点,选择与所接收到的话单文件结构特点对应 的识别方式识别并提取出所述话单文件中的话单信息,并将所提取出的话单信 息封装在计费系统能够识别的话单文件中;  The CDR decoding device 1202 is configured to receive the CDR file to be decoded collected by the data collection device 1201, and select and identify the recognition manner corresponding to the structural characteristics of the received CDR file according to the structural characteristics of the CDR file. Out the bill information in the bill file, and encapsulating the extracted bill information in a bill file that can be recognized by the billing system;

数据分发装置 1203 , 用于将话单解码装置 1202封装后的话单发送到计费 系统。 以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的 单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也 可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目 的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。 The data distribution device 1203 is configured to send the CDRs encapsulated by the CDR decoding device 1202 to the charging system. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本发明 可借助软件加必需的通用硬件平台的方式来实现, 当然也可以通过硬件,但很 多情况下前者是更佳的实施方式。基于这样的理解, 本发明的技术方案本质上 或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机 软件产品可以存储在存储介质中, 如只读存储器 /随机存储器(ROM/RAM )、 磁碟、 光盘等, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述 的方法。  Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is a better implementation. the way. Based on this understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product, which may be stored in a storage medium such as a read only memory/random memory. (ROM/RAM), diskette, optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform various embodiments of the present invention or portions of an embodiment. Methods.

以上所述的本发明实施方式, 并不构成对本发明保护范围的限定。任何在 本发明的精神和原则之内所作的修改、等同替换和改进等, 均应包含在本发明 的保护范围之内。  The embodiments of the present invention described above are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims

权 利 要 求 Rights request 1、 一种话单解码方法, 其特征在于, 包括:  A method for decoding a bill, characterized in that it comprises: 按照话单文件的结构特点,选择与接收到的话单文件的结构特点对应的识 别方式识别出所述话单文件中的话单信息;  According to the structural characteristics of the CDR file, selecting the identification manner corresponding to the structural features of the received CDR file to identify the CDR information in the CDR file; 提取所述话单信息;  Extracting the bill information; 将所提取出的话单信息封装在计费系统能够识别的话单文件中。  The extracted bill information is encapsulated in a bill file that can be recognized by the billing system. 2、 如权利要求 1所述的话单解码方法, 其特征在于, 在初次执行所述识 别动作之前还包括: 根据话单文件的结构特点,预先设置待解码的话单文件的 结构特点的描述;  The CDR decoding method according to claim 1, wherein before the performing the identifying operation, the method further comprises: pre-setting a description of the structural features of the CDR file to be decoded according to the structural characteristics of the CDR file; 所述按照话单文件的结构特点,选择与接收到的话单文件的结构特点对应 的识别方式识别出所述话单文件中的话单信息具体为:  According to the structural characteristics of the CDR file, selecting the identification manner corresponding to the structural features of the received CDR file to identify the CDR information in the CDR file is: 按照预置的话单文件的结构的描述,对接收到的话单文件釆用与所述话单 文件中包含的结构单元对应的识别方式识别出所述结构单元中包含的子结构 单元;  Depicting, according to the description of the structure of the preset CDR file, the sub-structure unit included in the structural unit by using the identification manner corresponding to the structural unit included in the CDR file; 再釆用与所述子结构单元对应的识别方式对所述子结构单元做进一步识 另1 J , 识别得到包含话单信息的原子单元; Then preclude the use of the partial structural units corresponding to the substructure of identification unit identifying further another 1 J, the identification unit comprises a CDR atoms obtained information; 所述提取所述话单信息具体为:  The extracting the bill information is specifically: 从所述原子单元中提取所述话单信息。  Extracting the bill information from the atomic unit. 3、 如权利要求 2所述的话单解码方法, 其特征在于, 所述釆用与结构单 元对应的识别方式识别出所述结构单元中包含的子结构单元具体包括:  The CDR decoding method according to claim 2, wherein the identifying the sub-structure unit included in the structural unit by using the identification manner corresponding to the structural unit comprises: 判断当前待识别的结构单元是否满足预置的结构单元的识别条件, 若是, 则按照所满足的结构单元的封装格式识别得到所述结构单元中包含的所有子 结构单元。  Determining whether the current structural unit to be identified satisfies the recognition condition of the preset structural unit, and if so, identifying all the sub-structure units included in the structural unit according to the encapsulation format of the satisfied structural unit. 4、 如权利要求 2或 3所述的话单解码方法, 其特征在于, 在所述釆用与 所述子结构单元对应的识别方式对所述子结构单元做进一步识别之前, 还包 括:  The CDR decoding method according to claim 2 or 3, further comprising: before further identifying the sub-structure unit by using the identification manner corresponding to the sub-structure unit; 根据所述结构单元的封装格式标明所述结构单元和该结构单元包含的所 有子结构单元的作用范围;  Determining, according to the encapsulation format of the structural unit, the functional scope of the structural unit and all sub-structural units included in the structural unit; 所述对子结构单元做进一步识别具体为: 在所述所有子结构单元的作用范围内对子结构单元做进一步识别。 The further identifying of the pair of sub-structure units is specifically as follows: The sub-structure units are further identified within the scope of action of all of the sub-structural units. 5、 如权利要求 4所述的话单解码方法, 其特征在于, 在所述提取所述话 单信息之前还包括:  The CDR decoding method according to claim 4, further comprising: before the extracting the bill information: 判断在所述结构单元的作用范围内是否都识别完毕, 若是, 则执行所述提 取步骤; 否则, 报告识别错误。  It is judged whether or not the recognition is completed within the scope of action of the structural unit, and if so, the extraction step is performed; otherwise, the report identifies an error. 6、 如权利要求 2所述的话单解码方法, 其特征在于, 当所述结构单元为 顺序结构时,所述釆用与所述子结构单元对应的识别方式对所述子结构单元做 进一步识别具体为:  The CDR decoding method according to claim 2, wherein when the structural unit is a sequential structure, the 做 is further identified by the identification manner corresponding to the sub-structure unit Specifically: 按照顺序分别釆用相应的识别方式对不同的子结构单元做进一步识别。  Different sub-structure units are further identified by the corresponding identification methods in order. 7、 一种用于话单解码的装置, 其特征在于, 包括: 7. A device for CDR decoding, comprising: 接收单元, 用于接收待解码的话单文件;  a receiving unit, configured to receive a bill file to be decoded; 识别单元, 用于按照话单文件的结构特点,选择与所述接收单元所接收到 的话单文件的结构特点对应的识别方式识别出所述话单文件中的话单信息; 提取单元, 用于提取由所述识别单元识别得到的话单信息;  An identifying unit, configured to identify, according to a structural feature of the bill file, a billing information in the bill file according to an identification manner corresponding to a structural feature of the bill file received by the receiving unit; and an extracting unit, configured to extract The bill information obtained by the identification unit; 封装单元,用于将由所述提取单元所提取的话单信息封装在计费系统能够 识别的话单文件中。  And an encapsulating unit, configured to encapsulate the bill information extracted by the extracting unit in a bill file that can be recognized by the billing system. 8、 如权利要求 7所述的用于话单解码的装置, 其特征在于, 所述装置还 包括:  The device for CDR decoding according to claim 7, wherein the device further comprises: 配置单元, 用于按照话单文件的结构特点, 配置待解码的话单文件的结构 特点的描述;  a configuration unit, configured to configure a description of the structural features of the CDR file to be decoded according to the structural characteristics of the CDR file; 所述识别单元包括: 各种识别器和选择识别单元, 其中:  The identification unit includes: a plurality of identifiers and a selection recognition unit, wherein: 所述各种识别器, 分别保存有与话单文件的结构特点对应的识别方式, 用 于按照所保存的识别方式识别话单文件;  Each of the identifiers respectively stores an identification manner corresponding to a structural feature of the bill file, and is configured to identify the bill file according to the saved recognition manner; 所述选择识别单元, 用于按照所述配置单元中话单文件的结构特点的描 述,选择相应的识别器以识别所述接收单元中的话单文件,得到所述话单文件 中的话单信息。  The selection and identification unit is configured to select a corresponding identifier to identify the bill file in the receiving unit according to the description of the structural features of the bill file in the configuration unit, and obtain the bill information in the bill file. 9、 如权利要求 8所述的用于话单解码的装置, 其特征在于, 所述识别器 包括:  9. The apparatus for bill decoding according to claim 8, wherein the identifier comprises: 封装格式确定单元,用于通过判断当前待识别的结构单元是否满足预置的 结构单元的识别条件, 确定所述结构单元所满足的封装格式; 识别得到所述结构单元中包含的所有子结构单元。 An encapsulation format determining unit, configured to determine whether the current structural unit to be identified satisfies a preset Identifying conditions of the structural unit, determining a package format that the structural unit satisfies; identifying all sub-structure units included in the structural unit. 10、 如权利要求 9所述的话单解码方法, 其特征在于, 所述识别单元还包 括: 明所述结构单元和所述子结构单元确定单元中确定的所有子结构单元的作用 范围;  The CDR decoding method according to claim 9, wherein the identification unit further comprises: a range of actions of all the sub-structure units determined in the structural unit and the sub-structure unit determining unit; 控制单元 ,用于根据由所述作用范围标明单元所标明的所述结构单元的作 用范围判断, 若在所述结构单元的作用范围内都识别完毕, 则指令所述提取单 元执行所述提取功能; 否则, 则报告识别错误。  a control unit, configured to determine, according to the scope of action of the structural unit indicated by the range indicating unit, if the identification is completed within the scope of the structural unit, instructing the extracting unit to perform the extracting function Otherwise, the report identifies the error. 11、 一种话单解调器, 其特征在于, 包括: 数据釆集装置、 话单解码装置 和数据分发装置, 其中:  11. A bill demodulator, comprising: a data collection device, a bill decoding device, and a data distribution device, wherein: 数据釆集装置, 用于从网元设备釆集话单;  a data collecting device, configured to collect a bill from the network element device; 话单解码装置, 用于接收数据釆集装置釆集到的待解码的话单文件, 并按 照话单文件的结构特点,选择与所接收到的话单文件结构特点对应的识别方式 识别并提取出所述话单文件中的话单信息,并将所提取出的话单信息封装在计 费系统能够识别的话单文件中;  The bill decoding device is configured to receive the bill file to be decoded collected by the data collecting device, and select and identify the picking method corresponding to the structural characteristics of the received bill file according to the structural characteristics of the bill file. Declaring the bill information in the single file, and encapsulating the extracted bill information in the bill file that the billing system can recognize; 数据分发装置, 用于将话单解码装置封装后的话单发送到计费系统。  The data distribution device is configured to send the bills encapsulated by the bill decoding device to the billing system.
PCT/CN2008/072733 2007-12-13 2008-10-17 Method and device for decoding charge record Ceased WO2009076813A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200710195369.2 2007-12-13
CN2007101953692A CN101459746B (en) 2007-12-13 2007-12-13 Phone bill decoding method and apparatus

Publications (1)

Publication Number Publication Date
WO2009076813A1 true WO2009076813A1 (en) 2009-06-25

Family

ID=40770360

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/072733 Ceased WO2009076813A1 (en) 2007-12-13 2008-10-17 Method and device for decoding charge record

Country Status (2)

Country Link
CN (1) CN101459746B (en)
WO (1) WO2009076813A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164389B (en) * 2011-12-14 2015-10-28 中国移动(深圳)有限公司 A kind of disposal route of user-defined format plane ticket and system
CN102883082B (en) * 2012-09-07 2014-06-25 华为软件技术有限公司 Ticket decoding method and device
CN105848128A (en) * 2016-03-28 2016-08-10 贵阳朗玛信息技术股份有限公司 Telephone bill processing method and system
CN111126003A (en) * 2019-12-10 2020-05-08 中盈优创资讯科技有限公司 Method and device for processing bill data
CN112153227A (en) * 2020-09-25 2020-12-29 马宇轩 Dynamic configuration based telephone interface system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999009733A1 (en) * 1997-08-14 1999-02-25 Telia Ab (Publ) Improvements in, or relating to, telecommunications systems
WO2000059199A1 (en) * 1999-03-25 2000-10-05 British Telecommunications Public Limited Company Bill image generation
US6134307A (en) * 1998-09-21 2000-10-17 Iridium Ip Llc Call conversion process for a business system for a global telecommunications network
US20050114699A1 (en) * 2002-03-08 2005-05-26 Maurizio De Paola Method for decoding charging data records in mobile telephone networks and the relative system
CN101001159A (en) * 2006-12-30 2007-07-18 华为技术有限公司 Decoding method and decoder

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999009733A1 (en) * 1997-08-14 1999-02-25 Telia Ab (Publ) Improvements in, or relating to, telecommunications systems
US6134307A (en) * 1998-09-21 2000-10-17 Iridium Ip Llc Call conversion process for a business system for a global telecommunications network
WO2000059199A1 (en) * 1999-03-25 2000-10-05 British Telecommunications Public Limited Company Bill image generation
US20050114699A1 (en) * 2002-03-08 2005-05-26 Maurizio De Paola Method for decoding charging data records in mobile telephone networks and the relative system
CN101001159A (en) * 2006-12-30 2007-07-18 华为技术有限公司 Decoding method and decoder

Also Published As

Publication number Publication date
CN101459746B (en) 2011-04-06
CN101459746A (en) 2009-06-17

Similar Documents

Publication Publication Date Title
CN111639138B (en) Data processing method, device, equipment and storage medium
CN111953776A (en) Application service message pushing method and device, computer equipment and computer storage medium
CN101702793B (en) Implementation method, system and equipment of USSD service in CDMA network
WO2009076813A1 (en) Method and device for decoding charge record
CN102647414B (en) Protocol analysis method, protocol analysis device and protocol analysis system
CN101345654A (en) Index computing method and apparatus
CN102163221A (en) Pattern matching method and device thereof
WO2013127108A1 (en) Method and device for saving short message
CN105740292B (en) A kind of coding/decoding method and device
CN112583765B (en) GOOSE and SV communication system and message analysis method thereof
CN110136712A (en) Realize the method and device of intelligent sound AI function
WO2010127583A1 (en) Method and terminal for playing stream media
WO2014067409A1 (en) Queue scheduling method, apparatus and system
JP2009515489A (en) Method and apparatus for fragmenting system information messages in a wireless network
CN104272774A (en) Systems and methods for processing encoded data streams
CN108460044B (en) Data processing method and device
CN108243015B (en) A method for extracting bill information, a bill server and a network management server
CN100417088C (en) A method for front and back alarm synchronization
WO2008032992A1 (en) Method for downloading multimedia contents to electronic picture frame
CN102711060B (en) Multimedia message processing method, smart card and terminal equipment
JP2011154659A (en) Case data generating program, method, and device
CN116233317A (en) Real-time VoLTE voice restoration and detection method and device for network traffic
EP3257235B1 (en) A method and apparatus for data mediation
CN116055296A (en) A method, system, device, and storage medium for area restriction management of the Internet of Things
CN103929447A (en) A method for parsing HTTP chunked encoded data

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 08862149

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 08862149

Country of ref document: EP

Kind code of ref document: A1