Disclosure of Invention
In view of the above, the present application provides a data processing method, device and storage medium, which programs the analysis process of a complex core network flow to complete the multi-user concurrent test flow structure, and can modify all important cell fields in the incremental flow to ensure the integrity and authenticity of the flow, and the specific technical scheme is as follows:
in a first aspect, the present application provides a data processing method, the method comprising:
reading a message to be processed, wherein the message to be processed comprises one or more data packets;
Analyzing each data packet and judging the protocol type of each data packet;
acquiring a cell field to be increased corresponding to the protocol type in each data packet according to the protocol type of each data packet;
acquiring the increment quantity corresponding to the cell field to be incremented;
And adding the cell fields to be increased corresponding to the increasing number in the data packet so as to generate a processed message.
In one possible implementation manner, the obtaining, according to a protocol type of each data packet, a cell field to be incremented in each data packet, where the cell field corresponds to the protocol type, includes:
And when the protocol type of the data packet is S1AP, acquiring eNB-IP, eNB-S1apID, MME-IP and MME-S1apID, imsi, msisdn, imei, tac, cellid fields.
In one possible implementation manner, the obtaining, according to a protocol type of each data packet, a cell field to be incremented in each data packet, where the cell field corresponds to the protocol type, includes:
And when the protocol type of the data packet is Diameter, acquiring HSS-IP, MME-IP and session-ID, imsi, msisdn, imei, tac, cellid fields.
In one possible implementation manner, the obtaining, according to a protocol type of each data packet, a cell field to be incremented in each data packet, where the cell field corresponds to the protocol type, includes:
When the protocol type of the data packet is GTPv2, judging the protocol type of the data packet;
And when the protocol type of the data packet is S11, acquiring MME-IP, SGW-IP, tunnel-MME teid/IP, tunnel-SGW teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields.
In one possible implementation manner, the obtaining, according to a protocol type of each data packet, a cell field to be incremented in each data packet, where the cell field corresponds to the protocol type, includes:
When the protocol type of the data packet is GTPv2, judging the protocol type of the data packet;
And when the protocol type of the data packet is S5S8, acquiring SGW-IP, PGW-IP, tunnel-SGW teid/IP, tunnel-PGW teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields.
In one possible implementation manner, the obtaining, according to a protocol type of each data packet, a cell field to be incremented in each data packet, where the cell field corresponds to the protocol type, includes:
And when the protocol type of the data packet is GTPv1-C, acquiring SGSN-IP, GGSN-IP, tunnel-SGSN teid/IP, tunnel-GGSN teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields.
In one possible implementation manner, the obtaining, according to a protocol type of each data packet, a cell field to be incremented in each data packet, where the cell field corresponds to the protocol type, includes:
And when the protocol type of the data packet is GTPU, acquiring SGSN-IP, GGSN-IP, TEID and inner layer SIP/DIP, imsi, msisdn, imei, tac, cellid fields.
In one possible implementation manner, the generating the processed message includes:
traversing the message to be processed, and judging whether the cell field to be increased corresponding to the increasing number is added in each data packet;
If the number of the cell fields to be increased corresponding to the number of the increased cells is increased in each data packet, ending the analysis of each data packet, and obtaining the header information of the message to be processed, the header information of each data packet and the data of each data packet after the number of the increased cell fields to be increased corresponding to the number of the increased cells;
Generating the processed message according to the header information of the message to be processed, the header information of each data packet and the data of each data packet after increasing the increment number corresponding to the cell field to be incremented.
In a second aspect, the present application also provides a data processing apparatus, the apparatus comprising:
The reading module is used for reading a message to be processed, wherein the message to be processed comprises one or more data packets;
The analysis module is used for analyzing each data packet and judging the protocol type of each data packet;
The acquisition module is used for acquiring a cell field to be increased corresponding to the protocol type in each data packet according to the protocol type of each data packet;
the acquisition module is further used for acquiring the increment quantity corresponding to the cell field to be incremented;
And the generating module is used for adding the cell fields to be increased corresponding to the increasing number in the data packet so as to generate a processed message.
In a third aspect, the application also provides a computer readable storage medium having stored therein computer executable instructions which when run on a computer cause the computer to perform the method of any of claims 1-8.
The method comprises the steps of reading a message to be processed, wherein the message to be processed comprises one or more data packets, analyzing each data packet, judging the protocol type of each data packet, obtaining a cell field to be increased corresponding to the protocol type in each data packet according to the protocol type of each data packet, obtaining the increment number corresponding to the cell field to be increased, and increasing the cell field to be increased corresponding to the increment number in the data packet to generate the processed message. By programming the analysis process of the complex core network flow, the multi-user concurrent test flow structure can be automatically completed, and a large amount of manpower is liberated. All important cell fields in the incremental flow can be modified through packet-by-packet analysis, and the integrity and the authenticity of the flow are ensured.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
First, some terms that may appear in the embodiments of the present application will be explained.
The pcap file is a commonly used data message storage format, and is fully called a packet capture.
The Mobility management entity (Mobility MANAGEMENT ENTITY, MME) is mainly responsible for Mobility management and control, including authentication, paging, location update and handover of users, etc.
The service gateway (SERVING GATEWAY, SGW) is mainly responsible for management of the context session of the mobile phone and routing and forwarding of the data packet, and is equivalent to a data transfer station.
The packet data network Gateway (PACKET DATA network Gateway, PGW) is mainly responsible for connecting to external networks, and also for session management and bearer control, IP address allocation, charging support, etc. of the mobile phone.
The home subscriber server (Home Subscriber Server, HSS) is a central database containing subscriber related information and subscription related information. The functions include mobility management, call and session establishment support, user authentication and access authorization.
A base station (eNodeB, eNB) is a bridge between a user UE and the core network.
International mobile subscriber identity (International Mobile Subscriber Identification Number, IMSI), which is a flag that distinguishes mobile subscribers, may be used to distinguish between valid information of mobile subscribers.
MSISDN, full Mobile Subscriber International ISDN/PSTN number, refers to the number that the calling subscriber needs to dial to call a mobile subscriber in the GSM PLMN.
An international mobile equipment identity (International Mobile Equipment Identity, IMEI) for identifying each individual handset in the GSM mobile network.
Tracking area code (TRACKING AREA code of cell servedby neighbor eNB, TAC), in LTE network, the present parameter defines the tracking area code to which a cell belongs, and one tracking area may cover one or more cells.
CELLID, number ID of cell phone signal coverage area.
The Diameter protocol, which is used as the next generation AAA protocol standard by the IETF's AAA working group, supports mobile IP, NAS request, and mobile agent authentication, authorization, and accounting tasks.
eNB-IP、eNB-s1apID、MME-IP、MME-s1apID、HSS-IP、MME-IP、session-ID、MME-IP、SGW-IP、tunnel-mme teid/ip、tunnel-sgw teid/ip、user-ip、PGW-IP、tunnel-pgw teid/ip、SGSN-IP、GGSN-IP、tunnel-sgsn teid/ip、tunnel-ggsn teid/ip、SGSN-IP、GGSN-IP、TEID、 The specific meaning of the above fields of the inner layer SIP/DIP, imsi, msisdn, imei, tac, cellid is described in detail in 3gpp ts23.401, 3gpp ts36.413, 3gpp ts36.414, 3GPPTS29.274, 3gpp ts29.272 and 3GPPTS29.060, which are not described in detail herein.
Referring to fig. 1, a flowchart of a method embodiment provided by the embodiment of the present application is shown, where the embodiment of the present application at least includes the following steps:
S110, reading the message to be processed.
In the embodiment of the application, the message to be processed is read, the message to be processed comprises one or more data packets, and only one message to be processed is read at a time. The message to be processed is an original pcap message which needs concurrency.
S120, analyzing each data packet and judging the protocol type of each data packet.
S130, according to the protocol type of each data packet, acquiring a cell field to be increased corresponding to the protocol type in each data packet.
In the embodiment of the application, the number of the data packets in the message to be processed is obtained, and the data packets are analyzed one by one from the first data packet. When each data packet is analyzed, judging the protocol type of each data packet, and acquiring a cell field to be increased corresponding to the protocol type in each data packet according to the protocol type of each data packet.
As shown in fig. 2, according to the protocol type of each data packet, the cell field to be incremented corresponding to the protocol type in each data packet is obtained, which mainly includes:
s131, when the protocol type of the data packet is S1AP, the fields of eNB-IP, eNB-S1apID, MME-IP and MME-S1apID, imsi, msisdn, imei, tac, cellid are acquired.
S132, when the protocol type of the data packet is Diameter, acquiring HSS-IP, MME-IP and session-ID, imsi, msisdn, imei, tac, cellid fields.
S133, when the protocol type of the data packet is GTPv1-C, acquiring SGSN-IP, GGSN-IP, tunnel-SGSN teid/IP, tunnel-GGSN teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields.
S134, when the protocol type of the data packet is GTPU, the SGSN-IP, GGSN-IP, TEID and inner layer SIP/DIP, imsi, msisdn, imei, tac, cellid fields are acquired.
S135, when the protocol type of the data packet is GTPv2, judging the protocol type of the data packet.
S136, when the protocol type of the data packet is S11, acquiring MME-IP, SGW-IP, tunnel-MME teid/IP, tunnel-SGW teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields.
S137, when the protocol type of the data packet is S5S8, the SGW-IP, PGW-IP, tunnel-SGW teid/IP, tunnel-PGW teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields are acquired.
According to the protocol type of each data packet, the embodiment of the application acquires the cell field to be increased corresponding to the protocol type in each data packet, and can pertinently modify the cell field without being limited by the format of the cell field.
S140, the increment number corresponding to the cell field to be incremented is obtained.
In the embodiment of the application, the increment corresponding to the cell field to be incremented is obtained, namely the increment corresponding to the cell field needing to be incremented is obtained.
S150, adding the cell fields to be increased corresponding to the increasing number in the data packet to generate the processed message.
In the embodiment of the application, after the cell field to be increased corresponding to the protocol type and the increasing number corresponding to the cell field to be increased in each data packet are obtained, the cell field to be increased corresponding to the increasing number is increased in the data packet, so as to generate the processed message.
For example, if the increment number corresponding to the acquired field relevant to the user is 50w, the imsi, msisdn, imei fields relevant to the user are respectively incremented by 50w in the data packet, and if the increment number corresponding to the acquired field relevant to the eNB is 5w, the eNB-IP and eNB-s1apID, tac, cellid fields relevant to the eNB are respectively incremented by 5w in the data packet.
The method mainly comprises the following steps of:
S151, traversing the message to be processed, and judging whether the cell field to be increased corresponding to the increasing number is added in each data packet.
S152, if the cell field to be increased corresponding to the increasing number is added to each data packet, ending the analysis of each data packet, and obtaining the header information of the message to be processed, the header information of each data packet and the data of each data packet after the cell field to be increased corresponding to the increasing number.
S153, generating a processed message according to the header information of the message to be processed, the header information of each data packet and the data of each data packet after increasing the increment number corresponding to the cell field to be incremented.
In the embodiment of the application, after increasing the cell field to be increased corresponding to the increasing number in the data packet, each data packet in the message to be processed needs to be traversed, whether the cell field to be increased corresponding to the increasing number is increased in each data packet is judged, if not, step S120 is returned, if yes, the head information of the message to be processed, the head information of each data packet and the data of each data packet after increasing the cell field to be increased corresponding to the increasing number are obtained, and the processed message is generated according to the head information of the message to be processed, the head information of each data packet and the data of each data packet after increasing the cell field to be increased corresponding to the increasing number. The generated processed message is a signaling_new.pcap file.
In the embodiment of the application, a message to be processed is read, the message to be processed comprises one or more data packets, each data packet is analyzed, the protocol type of each data packet is judged, the cell field to be increased corresponding to the protocol type in each data packet is obtained according to the protocol type of each data packet, the increment number corresponding to the cell field to be increased is obtained, and the cell field to be increased corresponding to the increment number is increased in the data packet to generate the processed message. By programming the analysis process of the complex core network flow, the multi-user concurrent test flow structure can be automatically completed, and a large amount of manpower is liberated. All important cell fields in the incremental flow can be modified through packet-by-packet analysis, and the integrity and the authenticity of the flow are ensured.
Next, a description will be given of a data processing apparatus provided by the present application, and a data processing apparatus described below and a data processing method described above can be referred to correspondingly to each other.
Referring to fig. 3, a schematic structural diagram of a data processing apparatus provided by the present application is shown, where the apparatus includes:
a reading module 301, configured to read a message to be processed, where the message to be processed includes one or more data packets;
The parsing module 302 is configured to parse each of the data packets and determine a protocol type of each of the data packets;
an obtaining module 303, configured to obtain a cell field to be incremented in each data packet according to a protocol type of each data packet;
The obtaining module 303 is further configured to obtain an increment number corresponding to the cell field to be incremented;
a generating module 304, configured to add the cell fields to be incremented corresponding to the increment number to the data packet, so as to generate a processed packet.
In this embodiment of the present application, the obtaining module 303 is specifically configured to, when obtaining the cell field to be incremented in each data packet according to the protocol type of each data packet:
And when the protocol type of the data packet is S1AP, acquiring eNB-IP, eNB-S1apID, MME-IP and MME-S1apID, imsi, msisdn, imei, tac, cellid fields.
In this embodiment of the present application, the obtaining module 303 is specifically configured to, when obtaining the cell field to be incremented in each data packet according to the protocol type of each data packet:
And when the protocol type of the data packet is Diameter, acquiring HSS-IP, MME-IP and session-ID, imsi, msisdn, imei, tac, cellid fields.
In this embodiment of the present application, the obtaining module 303 is specifically configured to, when obtaining the cell field to be incremented in each data packet according to the protocol type of each data packet:
When the protocol type of the data packet is GTPv2, judging the protocol type of the data packet;
And when the protocol type of the data packet is S11, acquiring MME-IP, SGW-IP, tunnel-MME teid/IP, tunnel-SGW teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields.
In this embodiment of the present application, the obtaining module 303 is specifically configured to, when obtaining the cell field to be incremented in each data packet according to the protocol type of each data packet:
When the protocol type of the data packet is GTPv2, judging the protocol type of the data packet;
And when the protocol type of the data packet is S5S8, acquiring SGW-IP, PGW-IP, tunnel-SGW teid/IP, tunnel-PGW teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields.
In this embodiment of the present application, the obtaining module 303 is specifically configured to, when obtaining the cell field to be incremented in each data packet according to the protocol type of each data packet:
And when the protocol type of the data packet is GTPv1-C, acquiring SGSN-IP, GGSN-IP, tunnel-SGSN teid/IP, tunnel-GGSN teid/IP and user-IP, imsi, msisdn, imei, tac, cellid fields.
In this embodiment of the present application, the obtaining module 303 is specifically configured to, when obtaining the cell field to be incremented in each data packet according to the protocol type of each data packet:
And when the protocol type of the data packet is GTPU, acquiring SGSN-IP, GGSN-IP, TEID and inner layer SIP/DIP, imsi, msisdn, imei, tac, cellid fields.
In the embodiment of the present application, when the generating module 304 generates the processed message, the generating module is specifically configured to:
traversing the message to be processed, and judging whether the cell field to be increased corresponding to the increasing number is added in each data packet;
If the number of the cell fields to be increased corresponding to the number of the increased cells is increased in each data packet, ending the analysis of each data packet, and obtaining the header information of the message to be processed, the header information of each data packet and the data of each data packet after the number of the increased cell fields to be increased corresponding to the number of the increased cells;
Generating the processed message according to the header information of the message to be processed, the header information of each data packet and the data of each data packet after increasing the increment number corresponding to the cell field to be incremented.
Embodiments of the present application also provide a computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a computer, perform the functions of any of the method embodiments described above.
In the embodiment of the application, a message to be processed is read, the message to be processed comprises one or more data packets, each data packet is analyzed, the protocol type of each data packet is judged, the cell field to be increased corresponding to the protocol type in each data packet is obtained according to the protocol type of each data packet, the increment number corresponding to the cell field to be increased is obtained, and the cell field to be increased corresponding to the increment number is increased in the data packet to generate the processed message. By programming the analysis process of the complex core network flow, the multi-user concurrent test flow structure can be automatically completed, and a large amount of manpower is liberated. All important cell fields in the incremental flow can be modified through packet-by-packet analysis, and the integrity and the authenticity of the flow are ensured.
It should be noted that, in each embodiment, identical and similar parts are referred to each other. For the device class embodiment, the system class embodiment, since they are substantially similar to the method embodiments, the description is relatively simple, and the relevant points are referred to in the description of the method embodiments.
For the foregoing embodiments, for simplicity of explanation, the same is shown as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently in accordance with the application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.