CN107171879B - Method and device for detecting online charging interface message - Google Patents

Method and device for detecting online charging interface message Download PDF

Info

Publication number
CN107171879B
CN107171879B CN201610128180.0A CN201610128180A CN107171879B CN 107171879 B CN107171879 B CN 107171879B CN 201610128180 A CN201610128180 A CN 201610128180A CN 107171879 B CN107171879 B CN 107171879B
Authority
CN
China
Prior art keywords
message
dcc
original code
code file
file
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.)
Active
Application number
CN201610128180.0A
Other languages
Chinese (zh)
Other versions
CN107171879A (en
Inventor
范典华
杨奇民
郑立柯
陈仁强
白国涛
代蕊
刘建
韩林
郭利江
舒敏根
熊文剑
李莉
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.)
Medium Shift Information Technology Co Ltd
Original Assignee
Medium Shift Information Technology 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 Medium Shift Information Technology Co Ltd filed Critical Medium Shift Information Technology Co Ltd
Priority to CN201610128180.0A priority Critical patent/CN107171879B/en
Publication of CN107171879A publication Critical patent/CN107171879A/en
Application granted granted Critical
Publication of CN107171879B publication Critical patent/CN107171879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation
    • 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
    • H04L12/1403Architecture for metering, charging or billing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a device for detecting an online charging interface message, which solve the problems of incomplete and inaccurate test result, huge workload and the like of the conventional method for manually detecting a DCC message. The method of the invention comprises the following steps: segmenting a Diameter credit control DCC message original code file from the online charging interface file; screening a required message sample from the DCC message original code file according to a preset screening rule; and detecting the message sample according to a preset test standard to obtain a detection result. The invention effectively solves the problems of huge labor and time cost existing in manual testing at the present stage, simultaneously solves the problems of incomplete testing result and artificial error, meets the requirements of function and efficiency, and has strong practicability.

Description

Method and device for detecting online charging interface message
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for detecting an online charging interface message.
Background
The online charging is a charging mode for performing real-time charging and arrearage risk Control based on a Diameter Credit Control (DCC) message of a Gy interface between a core network service Control network element and a service support system, and is currently mainly used in communication operator network systems at home and abroad. Because the operator network is huge, the manufacturers of core network service control network elements and service support systems are more, and the difference of equipment provided by the manufacturers is large, the message difference of the Gy interface is very large, the problem of serious interface intercommunication is caused, and the use of local and roaming voice and data packet flow services is greatly influenced. The voice and data packet flow service is the main business of an operator, and the standardized test must be carried out on the DCC message of the online charging interface, and the test is continuously carried out on a new online version.
At present, the detection of the DCC message of the online charging interface mainly adopts a manual detection mode. Manual detection has many drawbacks: firstly, the service scene messages with low frequency are used, the messages cannot be sampled manually, and the detection result is not comprehensive. Secondly, the DCC protocol has complex structure, multiple fields and types and the like, and has very high requirements on the service technical capability of test executors; thirdly, the operator production system has a large number of interfaces, a large number of DCC messages, a large amount of test workload, a large amount of manpower input, and a large number of human errors.
Disclosure of Invention
The invention aims to provide a method and a device for detecting an online charging interface message, which are used for solving the problems of incomplete and inaccurate test result, huge workload and the like in the conventional manual DCC message detection mode.
In order to achieve the above object, the present invention provides a method for detecting an online charging interface message, including:
segmenting a Diameter credit control DCC message original code file from the online charging interface file;
screening a required message sample from the DCC message original code file according to a preset screening rule;
and detecting the message sample according to a preset test standard to obtain a detection result.
Wherein, the DCC message source code file is divided from the online charging interface file, which comprises:
analyzing the online charging interface file to obtain a TCP message;
analyzing the TCP message according to a TCP protocol to obtain a DCC message code;
judging whether the DCC message code is empty or not;
and if the DCC message code is not empty, segmenting the DCC message original code file in the DCC message code according to the length value corresponding to the length attribute in the DCC message code, otherwise, discarding the DCC message code, wherein the data length of the segmented DCC message original code file is equal to the length value corresponding to the length attribute.
Wherein, the analyzing the online charging interface file to obtain the TCP packet includes:
analyzing the online charging interface file to obtain an original code file containing a plurality of Ethernet frames;
analyzing the original code file according to the format of the Ethernet frame to obtain an IP data message;
and analyzing the IP data message according to an IP protocol to obtain the TCP message.
Wherein, the analyzing the TCP message according to the TCP protocol to obtain the DCC message code includes:
judging whether the value of the length attribute of the current Ethernet frame in the TCP message is 0 or not to obtain a judgment result;
if the judgment result is yes, and m continuous 0 bytes exist at the tail of the current Ethernet frame, moving the initial position of the next Ethernet frame backwards by m bytes, and segmenting the DCC message code from the current Ethernet frame according to the initial position of the moved next Ethernet frame, wherein the m Ethernet marks the difference value between the length of the zero data message and the theoretical minimum frame length;
and if the judgment result is negative, acquiring the initial position of the next Ethernet frame, and segmenting the DCC message code from the current Ethernet frame according to the initial position of the next Ethernet frame.
Wherein, the screening out the required message samples from the DCC message original code file according to the preconfigured screening rule comprises:
carrying out format conversion processing on the DCC message original code file to obtain a converted DCC message original code file, wherein the converted DCC message original code file is an XML file based on a tree structure;
and screening out required message samples from the converted DCC message original code file according to the screening rule.
Wherein, according to the screening rule, screening out the required message sample from the converted DCC message original code file, comprises:
analyzing the AVP field in the DCC message original code file after conversion;
judging whether the AVP field is a predetermined field which is required to be carried for N times in the screening rule, wherein N is an integer greater than 1;
if the AVP field is a predetermined field which is required to be carried for N times in the screening rule, judging whether the frequency of the occurrence of the predetermined field in the DCC message original code file is greater than or equal to N;
and if the occurrence times of the preset fields in the DCC message original code file are more than or equal to N, taking the DCC message original code file as a message sample carrying N preset fields.
Wherein, the detecting the message sample according to the preset testing standard to obtain the detecting result comprises:
and detecting the format of the message sample and each AVP field contained in the message sample according to a preset test standard to obtain a detection result, wherein the detection result is an XML file based on a tree structure.
The invention also provides a device for detecting the online charging interface message, which comprises:
the acquisition module is used for segmenting a Diameter credit control DCC message original code file from the online charging interface file;
the screening module is used for screening out required message samples from the DCC message original code file according to a pre-configured screening rule;
and the detection module is used for detecting and processing the message sample according to a preset test standard to obtain a detection result.
Wherein the acquisition module comprises:
the first obtaining sub-module is used for analyzing and processing the online charging interface file to obtain a TCP message;
the second obtaining submodule is used for analyzing and processing the TCP message according to a TCP protocol to obtain a DCC message code;
the judging submodule is used for judging whether the DCC message code is empty or not;
and the third obtaining submodule is used for splitting the DCC message original code file in the DCC message code according to the length value corresponding to the length attribute in the DCC message code if the DCC message code is not empty, and otherwise, discarding the DCC message code, wherein the data length of the split DCC message original code file is equal to the length value corresponding to the length attribute.
Wherein the first obtaining sub-module includes:
the first obtaining unit is used for analyzing the online charging interface file to obtain an original code file containing a plurality of Ethernet frames;
the second obtaining unit is used for analyzing the original code file according to the format of the Ethernet frame to obtain an IP data message;
and the third acquisition unit is used for analyzing and processing the IP data message according to an IP protocol to obtain the TCP message.
Wherein the second obtaining sub-module includes:
the first judging unit is used for judging whether the value of the length attribute of the current Ethernet frame in the TCP message is 0 or not to obtain a judging result;
a first processing unit, configured to, if the determination result is yes and m consecutive 0 bytes exist at the end of the current ethernet frame, move the start position of the next ethernet frame backward by m bytes, and according to the start position of the moved next ethernet frame, segment the DCC message code from the current ethernet frame, where m is a difference between the length of the ethernet quasi-zero data message and the theoretical minimum frame length;
and the second processing unit is used for acquiring the initial position of the next Ethernet frame if the judgment result is negative, and segmenting the DCC message code from the current Ethernet frame according to the initial position of the next Ethernet frame.
Wherein the screening module comprises:
the conversion submodule is used for carrying out format conversion processing on the DCC message original code file to obtain a converted DCC message original code file, and the converted DCC message original code file is an XML file based on a tree structure;
and the screening submodule is used for screening out a required message sample from the converted DCC message original code file according to the screening rule.
Wherein the screening submodule comprises:
the analysis unit is used for analyzing the AVP field in the DCC message original code file after the conversion;
a second judging unit, configured to judge whether the AVP field is a predetermined field that is required to be carried N times in the filtering rule, where N is an integer greater than 1;
a third determining unit, configured to determine whether the number of times that the predetermined field appears in the DCC message original code file is greater than or equal to N if the AVP field is a predetermined field that is required to be carried N times in the screening rule;
and the processing unit is used for taking the DCC message original code file as a message sample carrying N predetermined fields if the frequency of the occurrence of the predetermined fields in the DCC message original code file is greater than or equal to N.
The detection module is specifically configured to perform detection processing on the format of the message sample and each AVP field included in the message sample according to a preset test standard to obtain a detection result, where the detection result is an XML file based on a tree structure.
The embodiment of the invention has the following beneficial effects:
the method for detecting the online charging interface message of the embodiment of the invention divides a Diameter credit control DCC message original code file from an online charging interface file; screening a required message sample from the DCC message original code file according to a preset screening rule; the message sample is detected and processed according to the preset test standard to obtain a detection result, so that the problems of huge labor and time cost in manual test at the present stage are solved, the problems of incomplete test result and artificial error are solved, the requirements of functions and efficiency are met, and the method has strong practicability.
Drawings
Fig. 1 is a flowchart illustrating a method for detecting an online charging interface message according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a process of segmenting a DCC message source code file from an online charging interface file according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an embodiment of the present invention in which non-standard null data is automatically identified in Ethernet frames;
FIG. 4 is a flowchart illustrating the operation of message packet screening in an embodiment of the present invention;
FIG. 5 is a flowchart illustrating the operation of message autofilter based on the field-by-field counter according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating automated comparison of message packets according to an embodiment of the present invention;
fig. 7 is a block diagram of a device for detecting an online charging interface message according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings.
The embodiment of the invention provides a method and a device for detecting an online charging interface message, which solve the problems of incomplete and inaccurate test result, huge workload and the like of the conventional method for manually detecting a DCC message.
The first embodiment:
as shown in fig. 1, the method for detecting an online charging interface message according to the embodiment of the present invention includes:
step 11: and segmenting a Diameter credit control DCC message source code file from the online charging interface file.
Specifically, an online charging interface message file in a CAP (CAP and other message forms) of an IP (Internet protocol) port of a production system server is obtained, and a DCC (DCC) message original code file is automatically divided from the online charging interface message file in the CAP and other message forms.
Step 12: and screening required message samples from the DCC message original code file according to a pre-configured screening rule.
Here, the filtering rule may specifically include a value of the AVP field, a filtering message number attribute, and the like. The automatic file segmentation process and the automatic message sample screening process can quickly find out a low-frequency sample of the service scene message from the TB-level interface message of the production system, and solve the problem of incomplete test range caused by incomplete samples.
Step 13: and detecting the message sample according to a preset test standard to obtain a detection result.
Specifically, the format of the message sample and each AVP field contained in the message sample are detected according to a preset test standard to obtain a detection result, wherein the detection result is an XML file based on a tree structure. Through the automatic matching of the message samples and the automatic message detection process, the machine can replace manual work to complete the large-batch test execution work function, and most of testers can be released. The XML detection result storage technology based on the tree structure can completely store the test result of the complex DCC message, so that the test result does not need to be filtered again manually, and the result storage technologies in other automatic test technologies do not have the effect.
The method for detecting the online charging interface message of the embodiment of the invention divides a Diameter credit control DCC message original code file from an online charging interface file; screening a required message sample from the DCC message original code file according to a preset screening rule; the message sample is detected and processed according to the preset test standard to obtain a detection result, so that the problems of huge labor and time cost in manual test at the present stage are solved, the problems of incomplete test result and artificial error are solved, the requirements of functions and efficiency are met, and the method has strong practicability.
Further, the step 11 includes: analyzing the online charging interface file to obtain a TCP message; analyzing the TCP message according to a TCP protocol to obtain a DCC message code; judging whether the DCC message code is empty or not; and if the DCC message code is not empty, segmenting the DCC message original code file in the DCC message code according to the length value corresponding to the length attribute in the DCC message code, otherwise, discarding the DCC message code, wherein the data length of the segmented DCC message original code file is equal to the length value corresponding to the length attribute.
Specifically, the analyzing the online charging interface file to obtain the TCP packet includes: analyzing the online charging interface file to obtain an original code file containing a plurality of Ethernet frames; analyzing the original code file according to the format of the Ethernet frame to obtain an IP data message; and analyzing the IP data message according to an IP protocol to obtain the TCP message.
The following describes a process of dividing a DCC message original code file from an online charging interface file according to an embodiment of the present invention with reference to fig. 2.
As shown in fig. 2, the process includes:
step 21: acquiring a batch of online charging interface messages in CAP and other message formats at an IP port of a production system server.
Step 22: and analyzing messages in formats such as CAP and the like to obtain an original code file containing a plurality of Ethernet frames.
Step 23: and analyzing the Ethernet frame according to the format of the Ethernet frame to obtain the IP datagram.
Step 24: and analyzing the IP datagram according to the IP protocol to obtain a TCP message.
Step 25: and analyzing the TCP message according to the TCP protocol to obtain a DCC message code.
When the TCP message is analyzed, a data packet of a part of the TCP message is zero data, that is, the data length is 0. According to the international standard of the Ethernet frame, the data length is 0, 6 bits of 0 are filled in the data link layer, and the frame length of the Ethernet frame message reaches 60 bits (the minimum frame length required by the standard). However, because the existing interface packet capturing software can only capture packets at the data link layer or above of the ISO model, the packets captured by the online charging interface can be classified into three types according to the length, one type is that the frame length is greater than 60 bits (non-zero data messages sent and received by the server), and the second type is that the frame length is 60 bits (standard zero data messages received by the server); three classes are 54 bits long (server sends out a non-standard zero data message, not yet supplemented with 6 bits 0). The last type of message is a non-standard message, and no special identification bit is provided in the current ethernet standard frame structure to distinguish the second type of message from the third type of message, so the third type of message affects the normal cutting of the TCP file, and all the segmentation of the DCC message following the third type of message generates errors.
When the TCP protocol is analyzed, the invention designs a non-standard zero data to Ethernet frame automatic identification technology. Specifically, as shown in fig. 3, the method includes the steps of 31: judging whether the length attribute len in the TCP is 0, if so, the DCC message code is empty, executing the step 32, otherwise, jumping to the step 34; step 32: whether there are 6 consecutive 0 bytes at the end of the ethernet frame. If yes, it indicates that the consecutive 6 bytes of 0 are filled, step 33 is executed, otherwise, it indicates that the ethernet frame is not filled, the starting position of the next ethernet frame does not need to be moved backwards, and step 34 is skipped; step 33: moving 6 bytes backwards to the starting position of the next Ethernet frame; step 34: obtaining the initial position of the next Ethernet frame; step 35: and outputting the DCC message code.
Step 26: it is determined whether the DCC message code is not empty.
Step 27: if not, according to DCC protocol, analyzing head of DCC Message to obtain Length Message Length of DCC Message.
Step 28: if it is empty, the DCC message code is discarded.
Step 29: and judging whether the Length of the DCC Message code is greater than or equal to the Message Length.
Step 210: and if the DCC message code is larger than or equal to the DCC message code, segmenting the DCC message original code file in the DCC message code according to the length value corresponding to the length attribute in the DCC message code.
And the data length of the divided DCC message original code file is equal to the length value corresponding to the length attribute, and the divided DCC message original code file is stored in a TXT text format.
Step 211: it is determined whether it is the last ethernet frame.
Step 212: and if the last Ethernet frame exists, ending the process.
Step 213: if not, the next ethernet frame is acquired and the process goes to step 23.
The method for detecting the online charging interface message of the embodiment of the invention adopts the technology of automatic identification of non-standard zero data and Ethernet frames, and can more accurately segment DCC original codes from the online charging interface message interface files in a production system of a communication operator.
Further, the step 12 includes:
carrying out format conversion processing on the DCC message original code file to obtain a converted DCC message original code file, wherein the converted DCC message original code file is an XML file based on a tree structure; and screening out required message samples from the converted DCC message original code file according to the screening rule.
Wherein, the screening out the required message sample from the converted DCC message original code file according to the preset screening rule comprises: analyzing the AVP field in the DCC message original code file after conversion; judging whether the AVP field is a predetermined field which is required to be carried for N times in the screening rule, wherein N is an integer greater than 1; if the AVP field is a predetermined field which is required to be carried for N times in the screening rule, judging whether the frequency of the occurrence of the predetermined field in the DCC message original code file is greater than or equal to N; and if the occurrence times of the preset fields in the DCC message original code file are more than or equal to N, taking the DCC message original code file as a message sample carrying N preset fields.
The following describes in detail the processing flow of message packet screening in the embodiment of the present invention with reference to fig. 4.
As shown in fig. 4, includes:
step 41: and configuring a screening rule.
Specifically, each type of message configures a corresponding screening rule, including values of AVP fields, and screening message number attributes.
Step 42: the DCC message source code file is selected as the input file for message screening.
Step 43: and analyzing the DCC message, and storing the analyzed DCC message result by using a hierarchical tree structure XML file.
Step 44: and the analyzed DCC message contains a field required to be carried in the screening configuration. If so, go to step 45; otherwise, jumping to step 48;
supplementary explanation: in step 44, the same DCC message may carry a plurality of the same fields in the same layer, and the values of the same fields are consistent or inconsistent. For such a situation, a general alignment algorithm may miss a field for the detection of the same field.
The embodiment of the invention designs an automatic message screening technology based on a same-field counter. The specific execution steps, as shown in fig. 5, include: step 51: the frequency of appearance of the same field required to be carried in the screening configuration is n, and the count of the design counter is 0; step 52: resolving an AVP field in the message packet; step 53: whether the AVP field is a request to carry field. If so, go to step 54; otherwise, jumping to step 57; step 54: the counter count is incremented by 1; step 55: whether the count is more than or equal to the occurrence frequency n of the same field required to be carried; step 56: if yes, the condition of carrying a plurality of same fields is required to be met, and the output result is Y; otherwise, go to step 57; and 57: whether the AVP field is the last field; step 58: if so, the condition that a plurality of same fields are required to be carried is not met, and the output result is N; otherwise, go to step 52.
Step 45: the analyzed DCC message requires whether the values of the carried field and the optional field are equal to the values required in the screening configuration. If so, go to step 46; otherwise, jumping to step 48;
step 46: and whether the analyzed DCC message does not contain fields which are required to be not carried in the screening configuration.
Step 47: if yes, the DCC message is stored in the directory of the corresponding scene, and step 48 is executed; otherwise, jumping to step 48;
and 48: whether the total number of DCC messages that have been screened is less than the number of screened messages in the configuration. If so, go to step 49; otherwise, jumping to step 410;
step 49: whether the message packet is the last message packet. If so, go to step 410; otherwise, go to step 42;
step 410: and (6) ending.
The automatic screening process of the message sample of the embodiment of the invention adopts the automatic screening technology of the message based on the same-field counter, and can accurately find out the message packet of which the same field needs to appear in the same message for many times.
Further, the step 13 specifically includes: and detecting the format of the message sample and each AVP field contained in the message sample according to a preset test standard to obtain a detection result, wherein the detection result is an XML file based on a tree structure.
The following describes in detail the processing flow of automatic comparison of message packets in the embodiment of the present invention with reference to fig. 6.
Step 61: and configuring test cases of various types of messages. The method comprises the steps of selecting fields and values of optional fields, and the fields and the like are not required to be carried;
step 62: automatically matching the test cases of various messages with corresponding message packets;
and step 63: according to the comparison rules of various messages configured in the foreground and the background, the format of each message packet and each AVP field contained in the message packet are compared in a hierarchical and full mode, and the method specifically comprises the following steps:
analyzing the message packet, analyzing the message packet according to the configuration of the background AVP field, packaging the message packet into an XML format, and storing the XML format in a database; detecting whether the AVP field is a necessary field of a level specified by a scene test case configured in the foreground, and whether the field is carried and the value is correct or not; whether the AVP field meets the requirements of background comparison rules or not is detected, and hierarchical full quantity comparison including incidence relation, mutual exclusion relation, nesting relation, data format, value taking and the like among the fields is carried out; marking AVP fields with detected problems with different colors according to the classification, and storing the problem description in a classified manner; because the DCC message detection result must be accurately described to the first field, if the result is not recorded according to the XML of the tree structure, the result of the same field in the same message is mixed up, namely, the problem of inaccurate detection result exists. In order to solve the problem, the invention packages the description content of the test result into XML with a tree structure according to the structure of the original message packet, and stores the XML in a database, thereby improving the accuracy of the test result; problem detection reports and statistical reports are automatically generated.
Step 64: and outputting the detection result documents of all the message packets.
The XML detection result storage technology based on the tree structure can completely store the test result of the complex DCC message, so that the test result does not need to be filtered again manually, and the result storage technologies in other automatic test technologies do not have the capability. After the automatic detection technology is applied, a tester only needs to perform simple interface operation, the skill requirement of test executive personnel is reduced, and the personnel cost is reduced.
Second embodiment:
as shown in fig. 7, an embodiment of the present invention further provides a device for detecting an online charging interface message, where the device includes:
an obtaining module 71, configured to segment a Diameter credit control DCC message source code file from an online charging interface file;
a screening module 72, configured to screen a required message sample from the DCC message source code file according to a preconfigured screening rule;
and the detection module 73 is configured to perform detection processing on the message sample according to a preset test standard to obtain a detection result.
In the apparatus for detecting an online charging interface message according to the embodiment of the present invention, the obtaining module 71 includes:
the first obtaining sub-module 711 is configured to perform parsing on the online charging interface file to obtain a TCP packet;
the second obtaining sub-module 712, configured to perform parsing on the TCP packet according to a TCP protocol to obtain a DCC message code;
a judging submodule 713, configured to judge whether the DCC message code is empty;
the third obtaining sub-module 714 is configured to, if the DCC message code is not empty, divide the DCC message original code file in the DCC message code according to a length value corresponding to a length attribute in the DCC message code, and otherwise, discard the DCC message code, where a data length of the divided DCC message original code file is equal to the length value corresponding to the length attribute.
In the apparatus for detecting an online charging interface message according to the embodiment of the present invention, the first obtaining sub-module 711 includes:
a first obtaining unit 7111, configured to analyze the online charging interface file to obtain an original code file including a plurality of ethernet frames;
a second obtaining unit 7112, configured to perform parsing on the source code file according to the format of the ethernet frame to obtain an IP data packet;
a third obtaining unit 7113, configured to perform parsing processing on the IP data packet according to an IP protocol, so as to obtain the TCP packet.
In the apparatus for detecting an online charging interface message according to the embodiment of the present invention, the second obtaining sub-module 712 includes:
a first determining unit 7121, configured to determine whether a value of a length attribute of a current ethernet frame in the TCP packet is 0, so as to obtain a determination result;
a first processing unit 7122, configured to, if the determination result is yes and m consecutive 0 bytes exist at the end of the current ethernet frame, shift the start position of the next ethernet frame backward by m bytes, and according to the start position of the moved next ethernet frame, segment the DCC message code from the current ethernet frame, where the length of the m ethernet standard zero data message is equal to the difference between the theoretical minimum frame lengths;
the second processing unit 7123 is configured to, if the determination result is negative, obtain a starting position of a next ethernet frame, and segment the DCC message code from the current ethernet frame according to the starting position of the next ethernet frame.
In the apparatus for detecting an online charging interface message according to the embodiment of the present invention, the screening module 72 includes:
the conversion sub-module 721 is configured to perform format conversion processing on the DCC message original code file to obtain a converted DCC message original code file, where the converted DCC message original code file is an XML file based on a tree structure;
and the screening submodule 722 is configured to screen out a required message sample from the converted DCC message original code file according to the screening rule.
In the apparatus for detecting an online charging interface message according to the embodiment of the present invention, the screening submodule 722 includes:
an analyzing unit 7221 configured to analyze an AVP field in the converted DCC message original code file;
a second determining unit 7222, configured to determine whether the AVP field is a predetermined field that is required to be carried N times in the screening rule, where N is an integer greater than 1;
a third determining unit 7223, configured to determine whether the number of times that the predetermined field appears in the DCC message original code file is greater than or equal to N if the AVP field is the predetermined field that is required to be carried N times in the screening rule;
the processing unit 7224 is configured to, if the number of times the predetermined field appears in the DCC message original code file is greater than or equal to N, take the DCC message original code file as a message sample carrying N predetermined fields.
In the apparatus for detecting an online charging interface message according to the embodiment of the present invention, the detection module 73 is specifically configured to perform detection processing on the format of the message sample and each AVP field included in the message sample according to a preset test standard to obtain a detection result, where the detection result is an XML file based on a tree structure.
It should be noted that the apparatus is an apparatus corresponding to the above method embodiment, and all the implementations in the above method embodiment are applicable to the embodiment of the apparatus, and the same technical effect can be achieved.
The method and the device for detecting the online charging interface message of the embodiment of the invention divide a Diameter credit control DCC message original code file from an online charging interface file; screening a required message sample from the DCC message original code file according to a preset screening rule; the message sample is detected and processed according to the preset test standard to obtain a detection result, so that the problems of huge labor and time cost in manual test at the present stage are solved, the problems of incomplete test result and artificial error are solved, the requirements of functions and efficiency are met, and the method has strong practicability.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A method for detecting an online charging interface message is characterized by comprising the following steps:
segmenting a Diameter credit control DCC message original code file from the online charging interface file;
screening a required message sample from the DCC message original code file according to a preset screening rule;
detecting the message sample according to a preset test standard to obtain a detection result;
the screening out the required message samples from the DCC message original code file according to the pre-configured screening rule comprises the following steps:
carrying out format conversion processing on the DCC message original code file to obtain a converted DCC message original code file, wherein the converted DCC message original code file is an XML file based on a tree structure;
screening out required message samples from the converted DCC message original code file according to the screening rule;
the screening out the required message samples from the converted DCC message original code file according to the screening rule comprises:
analyzing the AVP field in the DCC message original code file after conversion;
judging whether the AVP field is a predetermined field which is required to be carried for N times in the screening rule, wherein N is an integer greater than 1;
if the AVP field is a predetermined field which is required to be carried for N times in the screening rule, judging whether the frequency of the occurrence of the predetermined field in the DCC message original code file is greater than or equal to N;
and if the occurrence times of the preset fields in the DCC message original code file are more than or equal to N, taking the DCC message original code file as a message sample carrying N preset fields.
2. The method for detecting the online charging interface message as claimed in claim 1, wherein the splitting the DCC message original code file from the online charging interface file comprises:
analyzing the online charging interface file to obtain a TCP message;
analyzing the TCP message according to a TCP protocol to obtain a DCC message code;
judging whether the DCC message code is empty or not;
and if the DCC message code is not empty, segmenting the DCC message original code file in the DCC message code according to the length value corresponding to the length attribute in the DCC message code, otherwise, discarding the DCC message code, wherein the data length of the segmented DCC message original code file is equal to the length value corresponding to the length attribute.
3. The method for detecting an online charging interface message according to claim 2, wherein the analyzing the online charging interface file to obtain a TCP packet comprises:
analyzing the online charging interface file to obtain an original code file containing a plurality of Ethernet frames;
analyzing the original code file according to the format of the Ethernet frame to obtain an IP data message;
and analyzing the IP data message according to an IP protocol to obtain the TCP message.
4. The method for detecting an online charging interface message according to claim 2, wherein the analyzing the TCP packet according to a TCP protocol to obtain a DCC message code comprises:
judging whether the value of the length attribute of the current Ethernet frame in the TCP message is 0 or not to obtain a judgment result;
if the judgment result is yes, and m continuous 0 bytes exist at the tail of the current Ethernet frame, moving the initial position of the next Ethernet frame backwards by m bytes, and segmenting the DCC message code from the current Ethernet frame according to the initial position of the moved next Ethernet frame, wherein m is the difference value between the length of the Ethernet standard zero data message and the theoretical minimum frame length;
and if the judgment result is negative, acquiring the initial position of the next Ethernet frame, and segmenting the DCC message code from the current Ethernet frame according to the initial position of the next Ethernet frame.
5. The method for detecting an online charging interface message according to claim 1, wherein the detecting the message sample according to a preset test standard to obtain a detection result comprises:
and detecting the format of the message sample and each AVP field contained in the message sample according to a preset test standard to obtain a detection result, wherein the detection result is an XML file based on a tree structure.
6. An apparatus for detecting an online charging interface message, comprising:
the acquisition module is used for segmenting a Diameter credit control DCC message original code file from the online charging interface file;
the screening module is used for screening out required message samples from the DCC message original code file according to a pre-configured screening rule;
the detection module is used for detecting and processing the message sample according to a preset test standard to obtain a detection result;
the screening module includes:
the conversion submodule is used for carrying out format conversion processing on the DCC message original code file to obtain a converted DCC message original code file, and the converted DCC message original code file is an XML file based on a tree structure;
the screening submodule is used for screening a required message sample from the converted DCC message original code file according to the screening rule;
the screening submodule comprises:
the analysis unit is used for analyzing the AVP field in the DCC message original code file after the conversion;
a second judging unit, configured to judge whether the AVP field is a predetermined field that is required to be carried N times in the filtering rule, where N is an integer greater than 1;
a third determining unit, configured to determine whether the number of times that the predetermined field appears in the DCC message original code file is greater than or equal to N if the AVP field is a predetermined field that is required to be carried N times in the screening rule;
and the processing unit is used for taking the DCC message original code file as a message sample carrying N predetermined fields if the frequency of the occurrence of the predetermined fields in the DCC message original code file is greater than or equal to N.
7. The apparatus for detecting the online charging interface message as claimed in claim 6, wherein the obtaining module comprises:
the first obtaining sub-module is used for analyzing and processing the online charging interface file to obtain a TCP message;
the second obtaining submodule is used for analyzing and processing the TCP message according to a TCP protocol to obtain a DCC message code;
the judging submodule is used for judging whether the DCC message code is empty or not;
and the third obtaining submodule is used for splitting the DCC message original code file in the DCC message code according to the length value corresponding to the length attribute in the DCC message code if the DCC message code is not empty, and otherwise, discarding the DCC message code, wherein the data length of the split DCC message original code file is equal to the length value corresponding to the length attribute.
8. The apparatus for detecting an online charging interface message according to claim 7, wherein the first obtaining sub-module comprises:
the first obtaining unit is used for analyzing the online charging interface file to obtain an original code file containing a plurality of Ethernet frames;
the second obtaining unit is used for analyzing the original code file according to the format of the Ethernet frame to obtain an IP data message;
and the third acquisition unit is used for analyzing and processing the IP data message according to an IP protocol to obtain the TCP message.
9. The apparatus for detecting an online charging interface message according to claim 7, wherein the second obtaining sub-module comprises:
the first judging unit is used for judging whether the value of the length attribute of the current Ethernet frame in the TCP message is 0 or not to obtain a judging result;
a first processing unit, configured to, if the determination result is yes and m consecutive 0 bytes exist at the end of the current ethernet frame, move the start position of the next ethernet frame backward by m bytes, and segment the DCC message code from the current ethernet frame according to the start position of the moved next ethernet frame, where m is a difference between the length of the ethernet standard zero data message and the theoretical minimum frame length;
and the second processing unit is used for acquiring the initial position of the next Ethernet frame if the judgment result is negative, and segmenting the DCC message code from the current Ethernet frame according to the initial position of the next Ethernet frame.
10. The apparatus for detecting an online charging interface message according to claim 6, wherein the detection module is specifically configured to perform detection processing on the format of the message sample and each AVP field included in the message sample according to a preset test standard to obtain a detection result, where the detection result is an XML file based on a tree structure.
CN201610128180.0A 2016-03-07 2016-03-07 Method and device for detecting online charging interface message Active CN107171879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610128180.0A CN107171879B (en) 2016-03-07 2016-03-07 Method and device for detecting online charging interface message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610128180.0A CN107171879B (en) 2016-03-07 2016-03-07 Method and device for detecting online charging interface message

Publications (2)

Publication Number Publication Date
CN107171879A CN107171879A (en) 2017-09-15
CN107171879B true CN107171879B (en) 2020-01-07

Family

ID=59849253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610128180.0A Active CN107171879B (en) 2016-03-07 2016-03-07 Method and device for detecting online charging interface message

Country Status (1)

Country Link
CN (1) CN107171879B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109874118B (en) * 2017-12-04 2020-08-18 中国移动通信集团公司 Online charging system testing method and virtual network element
CN109981548B (en) * 2017-12-28 2021-09-10 中移信息技术有限公司 Method and device for analyzing charging message
CN110896545B (en) * 2018-09-13 2023-04-25 中移信息技术有限公司 Online charging roaming fault positioning method, related device and storage medium
CN110855493B (en) * 2019-11-18 2022-08-09 上海新炬网络信息技术股份有限公司 Application topological graph drawing device for mixed environment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1773918A (en) * 2004-11-08 2006-05-17 华为技术有限公司 Charge system and method based on IP short-message service
CN101534294A (en) * 2009-01-21 2009-09-16 凌阳科技股份有限公司 Method and system for realizing download of network data in multimedia player
CN101908051A (en) * 2009-06-03 2010-12-08 东元电机股份有限公司 Network multimedia playing method
WO2011015089A1 (en) * 2009-08-06 2011-02-10 中兴通讯股份有限公司 Method and apparatus for self-adaptive coding and decoding
CN102546671A (en) * 2012-03-08 2012-07-04 北京神州数码思特奇信息技术股份有限公司 Message transmission method based on diameter credit control (DCC) protocol

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8170055B2 (en) * 2005-12-29 2012-05-01 Alcatel Lucent Method of converting between radius message and diameter messages

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1773918A (en) * 2004-11-08 2006-05-17 华为技术有限公司 Charge system and method based on IP short-message service
CN101534294A (en) * 2009-01-21 2009-09-16 凌阳科技股份有限公司 Method and system for realizing download of network data in multimedia player
CN101908051A (en) * 2009-06-03 2010-12-08 东元电机股份有限公司 Network multimedia playing method
WO2011015089A1 (en) * 2009-08-06 2011-02-10 中兴通讯股份有限公司 Method and apparatus for self-adaptive coding and decoding
CN102546671A (en) * 2012-03-08 2012-07-04 北京神州数码思特奇信息技术股份有限公司 Message transmission method based on diameter credit control (DCC) protocol

Also Published As

Publication number Publication date
CN107171879A (en) 2017-09-15

Similar Documents

Publication Publication Date Title
CN107171879B (en) Method and device for detecting online charging interface message
CN112235326B (en) Internet of things equipment data analysis method and device and electronic equipment
CN107426059B (en) DPI equipment feature library automatic updating method and system, DPI equipment and cloud server
CN105827422B (en) A kind of method and device of determining network element alarming incidence relation
WO2015039478A1 (en) Method and apparatus for recognizing junk messages
EP4096226A1 (en) Fault detection method and apparatus for live broadcast service, electronic device, and readable storage medium
US10237147B2 (en) Heuristic network traffic classification using byte-distributions
CN107347016B (en) Signaling flow model identification method and abnormal signaling flow identification method
CN112565338A (en) Method and system for capturing, filtering, storing and analyzing Ethernet message in real time
CN108234452B (en) System and method for identifying network data packet multilayer protocol
CN106535240A (en) Mobile APP centralized performance analysis method based on cloud platform
CN113505048A (en) Unified monitoring platform based on application system portrait and implementation method
CN109857842B (en) Method and device for recognizing fault-reporting text
CN107769988A (en) The method, apparatus and the network equipment that information is sent and detection messages are lost
WO2018120853A1 (en) Bus signal protocol decoding method
CN107360062A (en) Verification method, system and the DPI equipment of DPI equipment recognition results
CN108063764B (en) Network traffic processing method and device
CN111080362A (en) Advertisement monitoring system and method
CN109842511B (en) Method and system for determining TCP performance parameters
CN116383742A (en) Rule chain setting processing method, system and medium based on feature classification
EP3013000B1 (en) Traffic statistics collection method and apparatus
CN115242724A (en) High-speed network traffic service classification method based on two-stage clustering
CN112217896A (en) JSON message conversion method and related device
CN116866214B (en) Regional network quality analysis system based on statistical session
CN108933683B (en) Network acceleration sensing method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 518048 Shenzhen Riverside Road, Futian District, Shenzhen, Guangdong, 1141

Applicant after: Medium shift information technology Co., Ltd.

Address before: 518048 Guangdong province Futian District Shenzhen City Binhe Road, No. 9023, building 11, 41 layers of the country through the

Applicant before: China Mobile (Shenzhen) Co., Ltd.

GR01 Patent grant
GR01 Patent grant