CN111181802B - Protocol data simulation method, device and computer readable storage medium - Google Patents

Protocol data simulation method, device and computer readable storage medium Download PDF

Info

Publication number
CN111181802B
CN111181802B CN201911257628.9A CN201911257628A CN111181802B CN 111181802 B CN111181802 B CN 111181802B CN 201911257628 A CN201911257628 A CN 201911257628A CN 111181802 B CN111181802 B CN 111181802B
Authority
CN
China
Prior art keywords
protocol data
data set
protocol
conversion
address
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
CN201911257628.9A
Other languages
Chinese (zh)
Other versions
CN111181802A (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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou 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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201911257628.9A priority Critical patent/CN111181802B/en
Publication of CN111181802A publication Critical patent/CN111181802A/en
Application granted granted Critical
Publication of CN111181802B publication Critical patent/CN111181802B/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/18Protocol analysers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Abstract

The embodiment of the invention relates to the technical field of performance testing, and discloses a protocol data simulation method. According to a protocol data acquisition request, capturing an original protocol data set from a network by using a pre-constructed packet capturing tool, performing data division on the original protocol data set according to a preset quintuple judgment method to obtain a standard protocol data set, performing data replacement operation on the standard protocol data set according to a preset data replacement principle to obtain a conversion protocol data set, and performing character string conversion on the conversion protocol data set to obtain an analog protocol data set. The invention also provides a protocol data simulation device and a computer readable storage medium. The invention can realize the function of simulating the protocol data quickly, conveniently and simply.

Description

Protocol data simulation method, device and computer readable storage medium
Technical Field
The embodiment of the invention relates to the technical field of performance test, in particular to a performance test of protocol data simulation and custom encrypted protocol data.
Background
With the rapid development of the internet, more and more network users are available, and especially in a short time, when a large number of network users simultaneously make network requests, the network users can bring little pressure on the gateway information inspection platform, so that the performance test of the gateway information inspection platform in advance becomes a problem which needs to be solved urgently at present.
The performance test mainly aims to send the flow of the virtual user to the background under the simulation gateway so as to verify whether the processing capacity of the background can reach the expected index, and how to simulate the user flow of million levels, namely, simulating protocol data becomes one of the most important links of the performance test. Most of the current methods for simulating protocol data are based on the corresponding relationship between user demand information and a protocol data model, and then the protocol data are generated according to the corresponding relationship. Although the purpose of simulating protocol data can be achieved, the method is complicated because the corresponding relation between the user and the protocol data model needs to be obtained, and when the demand of the user is million-level protocol data, the method is time-consuming and serious, occupies a computing memory, and is difficult to realize the function of generating the simulation protocol data quickly, simply and conveniently.
Disclosure of Invention
The invention aims to provide a protocol data simulation method, a protocol data simulation device and a computer readable storage medium, which realize the function of generating simulation protocol data quickly and simply.
In order to solve the above technical problem, an embodiment of the present invention provides a method for protocol data simulation, where the method includes:
capturing an original protocol data set from a network by using a pre-constructed packet capturing tool according to a protocol data acquisition request;
according to a preset quintuple judgment method, carrying out data division on the original protocol data set to obtain a standard protocol data set;
according to a preset data replacement principle, performing data replacement operation on the standard protocol data set to obtain a conversion protocol data set;
and performing character string conversion on the conversion protocol data set to obtain an analog protocol data set.
Preferably, the method further comprises:
and carrying out encryption operation on the simulation protocol data set according to a pre-constructed encryption algorithm to obtain an encrypted protocol data set.
Preferably, the method further comprises:
and carrying out byte group conversion operation on the encryption protocol data set to obtain an encryption protocol byte group, packaging and inputting the encryption protocol byte group to a pre-constructed performance test tool, and executing performance test operation.
Preferably, the data partitioning comprises:
cleaning the original protocol data set, and carrying out proportion configuration on the cleaned original protocol data set according to a protocol type proportion configured in advance to obtain a primary protocol data set;
and judging whether quintuple information among each primary protocol data in the primary protocol data set is the same or not according to the quintuple judging method, placing the same primary protocol data in the preset same data stream, and summarizing the data stream to obtain a standard protocol data set.
Preferably, the proportional configuration comprises:
extracting all protocol types from the protocol type proportion to obtain a required protocol type set;
removing protocol type data different from the required protocol type set from the cleaned original protocol data set to obtain a required protocol data set;
and dividing the protocol type proportion of the required protocol data set according to the protocol type proportion, and completing the proportion configuration to obtain a primary protocol data set.
Preferably, the quintuple information includes: source IP address, source port, destination IP address, destination port, and transport layer protocol.
Preferably, the data replacement operation comprises:
performing byte reverse order operation on each standard protocol data in the standard protocol data set;
judging whether the target IP address in each standard protocol data is an intranet IP address or not, and replacing the target IP address with an extranet IP address if the target IP address is the intranet IP address;
and adding two bytes of 0,1 at the beginning of the data of each standard protocol data to finish the data replacement operation and obtain the conversion protocol data set.
Preferably, the character string conversion includes:
carrying out binary conversion on the conversion protocol data set;
and according to a pre-constructed character string conversion code, performing character string conversion on the conversion protocol data set which completes the binary conversion to obtain the simulation protocol data set.
The embodiment of the present invention further provides a protocol data simulation apparatus, including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the protocol data simulation method.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which when executed by a processor implements the protocol data simulation method described above.
The invention firstly uses a packet capturing tool to capture an original protocol data set from a network, and carries out data division, data replacement and character string conversion on the original protocol data set to obtain a simulation protocol data set. Therefore, the protocol data simulation method, the protocol data simulation device and the computer readable storage medium provided by the invention can realize the function of generating simulation protocol data quickly, simply and conveniently.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a schematic flowchart of a protocol data simulation method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart illustrating a proportional allocation step in a protocol data simulation method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart illustrating a data replacement step in a protocol data simulation method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating a performance test performed by using the simulation protocol data generated in FIG. 1 according to another embodiment of the present invention;
fig. 5 is a schematic diagram illustrating an internal structure of a protocol data simulation apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram illustrating a protocol data simulator in the protocol data simulation apparatus according to an embodiment of the present invention;
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the present invention relates to a method for simulating protocol data, and the core of the present embodiment lies in simulating the characteristics and effects of protocol data. The following describes the implementation details of the protocol data simulation of the present embodiment in detail, and the following is only provided for the convenience of understanding and is not necessary for implementing the present embodiment.
The protocol data simulation in the present embodiment includes:
and S1, capturing the original protocol data set from the network by using a pre-constructed packet capturing tool according to the protocol data acquisition request.
The invention mainly aims to simulate protocol data, in particular to simulate millions of protocol data, so as to conveniently use the simulated protocol data to carry out performance test, gateway test and the like.
Preferably, the protocol data acquisition request may be an instruction, for example, a click key related to the protocol data acquisition request is pre-designed in a graphical interface, and a user only needs to click the click key related to the protocol data acquisition request to generate the instruction of the protocol data acquisition request.
The packet capturing tool is a tool for sending a request to a network server and acquiring a result of the request. The invention can use the packet capturing tools such as wireshark, glidder, Httpwatch and the like to achieve the purpose of capturing and obtaining the original protocol data set from the network.
In particular, the original protocol data set may be an original gateway address of the user. Further, the original protocol data set is stored in a pcap file storage format, the pcap file storage format includes a file header, a data header and data content, wherein the file header, the data header and the data content all occupy a certain number of bytes, for example, the file header occupies 1-8 bytes, and the data header occupies 9-16 bytes.
And S2, according to a preset quintuple judgment method, carrying out data division on the original protocol data set to obtain a standard protocol data set.
In detail, the data partitioning includes: cleaning the original protocol data set, carrying out proportion configuration on the cleaned original protocol data set according to a preset protocol type proportion to obtain a primary protocol data set, judging whether quintuple of primary protocol data in the primary protocol data set is the same according to the quintuple judging method, placing the same primary protocol data in a preset same data stream, and summarizing the data stream to obtain a standard protocol data set.
Furthermore, the cleaning is to filter the uplink and downlink data in the original protocol data and retain the quintuple information of the original protocol data, so that the protocol data can be more truly met. The quintuple information includes: the source IP address, source port, destination IP address, destination port, and transport layer protocol five sets of information, such as: 192.168.1.110000 TCP 121.14.88.7680 is protocol data only including quintuple information, and a terminal with a source IP address of 192.168.1.1 is connected with a terminal with a destination IP address of 121.14.88.76 and a destination port of 80 by using a TCP protocol through a source port 10000.
In detail, the implementation steps of the proportional configuration are shown in fig. 2, and include the following steps:
and S21, extracting all protocol types from the protocol type proportion to obtain a required protocol type set, wherein the required protocol type set is in the cleaned original protocol data set.
And S22, removing the protocol type data different from the required protocol type set to obtain a required protocol data set.
And S23, dividing the protocol type proportion of the required protocol data set according to the protocol type proportion, and completing the proportion configuration to obtain a primary protocol data set.
Furthermore, the protocol types include multiple types, such as the above-mentioned TCP, and other http, https, ftp, smtp, pop3, etc., so that the screening and proportion configuration can be performed according to the actual needs of the user, for example, the user a only needs three protocol types, namely https, ftp, and smtp, and the proportion of each protocol can be set to 3:2: 5; or it may be configured by adopting the possibility that the random number falls into different protocol types, such as setting the random number in the interval of [0,1), if the generated random number is [0,0.6), randomly taking one protocol data in the httpmap type protocol data, if the generated random number is [0.6,0.7), randomly taking one protocol data in the smtpmap type protocol data, if the generated random number is [0.7,0.8), randomly taking one protocol data in the imapmap type protocol data, and so on.
The quintuple judging method judges whether the quintuple information of the source IP address, the source port, the destination IP address, the destination port and the transport layer protocol is the same or not, and if the two groups of primary protocol data are all the same, the two groups of primary protocol data are placed in a data stream.
And S3, according to a preset data replacement principle, performing data replacement operation on the standard protocol data set to obtain a conversion protocol data set.
After the processing of S1 and S2, the obtained standard protocol data set comprises quintuple information and is stored in the pcap file storage format.
Further, the implementation steps of the data replacement operation are shown in fig. 3, and include the following steps:
and S31, performing byte reverse order operation on each standard protocol data in the standard protocol data set.
If the data header occupies 9 th to 16 th bytes, the bytes are inverted, for example, the 12 th byte is shifted to the 9 th byte.
And S32, judging whether the destination IP address in each standard protocol data is an intranet IP address.
And S33, if the standard protocol data is an external network IP address, no operation is needed, if the standard protocol data is an internal network IP address, the internal network IP address is replaced by the external network IP address, and two bytes of 0 and 1 are added at the beginning of the standard protocol data to complete the data replacement operation, so that the conversion protocol data set is obtained.
And S4, performing character string conversion on the conversion protocol data set to obtain a simulation protocol data set.
In detail, the character string conversion includes: and carrying out binary conversion on the conversion protocol data set, and carrying out character string conversion on the conversion protocol data set subjected to the binary conversion according to a pre-constructed character string conversion code to obtain an analog protocol data set.
Preferably, the protocol data is presented in decimal form, such as 192.168.1.110000, but because the protocol data involved in the present invention is huge in size, reaching the millions, it is preferable to convert the protocol data in decimal form into protocol data in hexadecimal form, i.e. to make the said binary conversion.
Preferably, the protocol data are all in integer data format (int), and the pre-constructed character string conversion code of the invention is run to convert the data format stored in integer (int) in the standard protocol data set into character string format (string), so that the storage pressure of data storage can be reduced, because the byte number of the character string is smaller than the byte number of the integer.
Further, as shown in fig. 4, in another embodiment of the present invention, on the basis of S1 to S4, the method may further include S5: carrying out encryption operation on the simulation protocol data set according to a pre-constructed encryption algorithm to obtain an encrypted protocol data set; and S6, carrying out byte group conversion operation on the encryption protocol data set to obtain an encryption protocol byte group, packaging and inputting the encryption protocol byte group to a pre-constructed performance test tool, and executing performance test.
Preferably, the encryption algorithm may adopt a currently published encryption algorithm, such as asymmetric encryption, one-way encryption, key exchange, etc., and may also adopt a customized encryption algorithm to perform an encryption operation on the string protocol data set.
Preferably, the performance test includes, but is not limited to, a gateway test, a user traffic test, a server and other background performance tests.
The byte group conversion operation is to convert the encryption protocol data set into a byte network transmission form, so that data interaction of backstage such as a server is facilitated. The packaging is to uniformly package a plurality of groups of encryption protocol tuples, so that faster data receiving of backstage such as a server is accelerated.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
The invention also provides a protocol data simulation device. Fig. 5 is a schematic diagram illustrating an internal structure of a protocol data simulation apparatus according to an embodiment of the present invention.
In this embodiment, the protocol data simulation apparatus 1 may be a PC (Personal Computer), a terminal device such as a smart phone, a tablet Computer, or a mobile Computer, or may be a server. The protocol data simulation apparatus 1 includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the protocol data emulation apparatus 1, for example a hard disk of the protocol data emulation apparatus 1. The memory 11 may also be an external storage device of the protocol data simulation apparatus 1 in other embodiments, such as a plug-in hard disk provided on the protocol data simulation apparatus 1, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 11 may also include both an internal storage unit of the protocol data simulation apparatus 1 and an external storage device. The memory 11 may be used not only to store application software installed in the protocol data simulation apparatus 1 and various types of data, such as codes of the protocol data simulation program 01, but also to temporarily store data that has been output or is to be output.
The processor 12 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data, such as executing the protocol data simulator 01.
The communication bus 13 is used to realize connection communication between these components.
The network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), typically used to establish a communication link between the apparatus 1 and other electronic devices.
Optionally, the apparatus 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the protocol data simulation device 1 and for displaying a visual user interface.
Fig. 5 shows only the protocol data simulation device 1 with the components 11-14 and the protocol data simulation program 01, and it will be understood by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the protocol data simulation device 1, and may comprise fewer or more components than shown, or combine certain components, or a different arrangement of components.
In the embodiment of the apparatus 1 shown in fig. 5, a protocol data simulation program 01 is stored in the memory 11; the processor 12 executes the protocol data simulation program 01 stored in the memory 11 to implement the following steps:
step one, capturing an original protocol data set from a network by using a pre-constructed packet capturing tool according to a protocol data acquisition request.
The invention mainly aims to simulate protocol data, particularly to simulate millions of protocol data so as to conveniently use the simulated protocol data to carry out performance test, gateway test and the like.
Preferably, the protocol data acquisition request may be an instruction or a click key, for example, a click key related to the protocol data acquisition request is pre-designed in the graphical interface, and the user can start to acquire the simulated protocol data by simply clicking the click key related to the protocol data acquisition request.
The packet capturing tool is a tool for sending a request to a network server and acquiring a result of the request. The invention can use the packet capturing tools such as wireshark, glidder, Httpwatch and the like to achieve the purpose of capturing and obtaining the original protocol data set from the network.
In particular, the original protocol data set may be an original gateway address of the user. Further, the original protocol data set is stored in a pcap file storage format, the pcap file storage format includes a file header, a data header and data content, wherein the file header, the data header and the data content all occupy a certain number of bytes, for example, the file header occupies 1-8 bytes, and the data header occupies 9-16 bytes.
And secondly, according to a preset quintuple judgment method, carrying out data division on the original protocol data set to obtain a standard protocol data set.
In detail, the data partitioning includes: cleaning the original protocol data set, carrying out proportion configuration on the cleaned original protocol data set according to a preset protocol type proportion to obtain a primary protocol data set, judging whether quintuple of primary protocol data in the primary protocol data set is the same according to the quintuple judging method, placing the same primary protocol data in a preset same data stream, and summarizing the data stream to obtain a standard protocol data set.
Furthermore, the cleaning is to filter the uplink and downlink data in the original protocol data and retain the quintuple information of the original protocol data, so that the protocol data can be more truly met. The quintuple information includes: the source IP address, source port, destination IP address, destination port, and transport layer protocol five sets of information, such as: 192.168.1.110000 TCP 121.14.88.7680 is protocol data only including quintuple information, and a terminal with a source IP address of 192.168.1.1 is connected with a terminal with a destination IP address of 121.14.88.76 and a destination port of 80 by using a TCP protocol through a source port 10000.
In detail, the proportional configuration comprises: extracting all protocol types from the protocol type proportion to obtain a required protocol type set, removing protocol type data different from the required protocol type set from the cleaned original protocol data set to obtain a required protocol data set, dividing the protocol type proportion of the required protocol data set according to the protocol type proportion, and completing the proportion configuration to obtain a primary protocol data set.
Furthermore, the protocol types include multiple types, such as the above-mentioned TCP, and other http, https, ftp, smtp, pop3, etc., so that the screening and proportion configuration can be performed according to the actual needs of the user, for example, the user a only needs three protocol types, namely https, ftp, and smtp, and the proportion of each protocol is 3:2: 5; or it may be configured by adopting the possibility that the random number falls into different protocol types, such as setting the random number in the interval of [0,1), if the generated random number is [0,0.6), randomly taking one protocol data in the httpmap type protocol data, if the generated random number is [0.6,0.7), randomly taking one protocol data in the smtpmap type protocol data, if the generated random number is [0.7,0.8), randomly taking one protocol data in the imapmap type protocol data, and so on.
The quintuple judging method judges whether the quintuple information of the source IP address, the source port, the destination IP address, the destination port and the transport layer protocol is the same or not, and if the two groups of primary protocol data are all the same, the two groups of primary protocol data are placed in a data stream.
And thirdly, carrying out data replacement operation on the standard protocol data set according to a preset data replacement principle to obtain a conversion protocol data set.
After the processing of the first step and the second step, the obtained standard protocol data set comprises quintuple information and is stored in the pcap file storage format. Further, the data replacement operation includes: and performing byte reverse order operation on each standard protocol data in the standard protocol data set, wherein if the data head occupies the 9 th-16 th byte, performing reverse order operation on the byte, if the 12 th byte is moved to the 9 th byte, judging whether a destination IP address in each standard protocol data is an intranet IP address, if the destination IP address is the intranet IP address, replacing the destination IP address with an extranet IP address, and adding two bytes, namely 0 and 1, at the beginning of each standard protocol data to complete the data replacement operation, thereby obtaining the conversion protocol data set.
And fourthly, performing character string conversion on the conversion protocol data set to obtain a simulation protocol data set.
In detail, the character string conversion includes: and carrying out binary conversion on the analog protocol data set, and carrying out character string conversion on the conversion protocol data set subjected to the binary conversion according to a pre-constructed character string conversion code to obtain the analog protocol data set.
Preferably, the protocol data is presented in decimal form, such as 192.168.1.110000, but because the protocol data involved in the present invention is huge in size, reaching the millions, it is preferable to convert the protocol data in decimal form into protocol data in hexadecimal form, i.e. to make the said binary conversion.
Preferably, the protocol data are all in integer data format (int), and the pre-constructed character string conversion code of the invention is run to convert the data format stored in integer (int) in the standard protocol data set into character string format (string), so that the storage pressure of data storage can be reduced, because the byte number of the character string is smaller than the byte number of the integer.
Further, the present invention also includes: and carrying out encryption operation on the simulation protocol data set according to a pre-constructed encryption algorithm to obtain an encrypted protocol data set.
Preferably, the encryption algorithm may adopt a currently published encryption algorithm, such as asymmetric encryption, one-way encryption, key exchange, etc., and may also adopt a customized encryption algorithm to perform an encryption operation on the string protocol data set.
Preferably, the encryption protocol data set can be used for various practical purposes, including but not limited to gateway test, user traffic test, performance test of a server and the like in the background, and the like.
Still further, the performance test includes: and carrying out byte group conversion operation on the encryption protocol data set to obtain an encryption protocol byte group, and packaging and inputting the encryption protocol byte group to a pre-constructed performance test tool to complete performance test.
The byte group conversion operation is to convert the encryption protocol data set into a byte network transmission form, so that data interaction of backstage such as a server is facilitated. The packaging is to uniformly package a plurality of groups of encryption protocol tuples, so that faster data receiving of backstage such as a server is accelerated.
Alternatively, in other embodiments, the protocol data simulation program may be divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by one or more processors (in this embodiment, the processor 12) to implement the present invention.
For example, referring to fig. 6, a schematic diagram of program modules of a protocol data simulation program in an embodiment of the protocol data simulation apparatus of the present invention is shown, in this embodiment, the protocol data simulation program may be divided into an original protocol data acquiring and dividing module 10, a data replacing module 20, and a simulation protocol data generating module 30, which exemplarily:
the raw protocol data acquisition and partitioning module 10 is configured to: and according to the protocol data acquisition request, capturing an original protocol data set from the network by using a pre-constructed packet capturing tool, and according to a preset quintuple judgment method, performing data division on the original protocol data set to obtain a standard protocol data set.
The data replacement module 20 is configured to: and carrying out data replacement operation on the standard protocol data set according to a preset data replacement principle to obtain a conversion protocol data set.
The simulation protocol data generation module 30 is configured to: and performing character string conversion on the conversion protocol data set to obtain an analog protocol data set.
The functions or operation steps of the original protocol data acquiring and dividing module 10, the data replacing module 20, the simulation protocol data generating module 30 and other program modules when executed are substantially the same as those of the above embodiments, and are not described herein again.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a protocol data simulation program is stored on the computer-readable storage medium, where the protocol data simulation program is executable by one or more processors to implement the following operations:
and according to the protocol data acquisition request, capturing an original protocol data set from the network by using a pre-constructed packet capturing tool, and according to a preset quintuple judgment method, performing data division on the original protocol data set to obtain a standard protocol data set.
And carrying out data replacement operation on the standard protocol data set according to a preset data replacement principle to obtain a conversion protocol data set.
And performing character string conversion on the conversion protocol data set to obtain an analog protocol data set.
Those skilled in the art will understand that all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware to complete, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method 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, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A method of protocol data emulation, the method comprising:
capturing an original protocol data set from a network by using a pre-constructed packet capturing tool according to a protocol data acquisition request;
according to a preset quintuple judgment method, carrying out data division on the original protocol data set to obtain a standard protocol data set;
according to a preset data replacement principle, performing data replacement operation on the standard protocol data set to obtain a conversion protocol data set; wherein the data replacement operation comprises: performing byte reverse order operation on each standard protocol data in the standard protocol data set; judging whether the target IP address in each standard protocol data is an intranet IP address or not, and replacing the target IP address with an extranet IP address if the target IP address is the intranet IP address; adding 0,1 byte at the beginning of the data of each standard protocol data to complete the data replacement operation to obtain the conversion protocol data set;
and performing character string conversion on the conversion protocol data set to obtain an analog protocol data set.
2. The method of protocol data simulation of claim 1, the method further comprising:
and carrying out encryption operation on the simulation protocol data set according to a pre-constructed encryption algorithm to obtain an encrypted protocol data set.
3. The method of protocol data emulation according to claim 2, further comprising:
and carrying out byte group conversion operation on the encryption protocol data set to obtain an encryption protocol byte group, packaging and inputting the encryption protocol byte group to a pre-constructed performance test tool, and executing performance test operation.
4. The method of protocol data emulation according to claim 1, wherein the data partitioning comprises:
cleaning the original protocol data set, and carrying out proportion configuration on the cleaned original protocol data set according to a protocol type proportion configured in advance to obtain a primary protocol data set;
and judging whether quintuple information among each primary protocol data in the primary protocol data set is the same or not according to the quintuple judging method, placing the same primary protocol data in the preset same data stream, and summarizing the data stream to obtain a standard protocol data set.
5. The method of protocol data simulation of claim 4, wherein the scaling configuration comprises:
extracting all protocol types from the protocol type proportion to obtain a required protocol type set;
removing protocol type data different from the required protocol type set from the cleaned original protocol data set to obtain a required protocol data set;
and dividing the protocol type proportion of the required protocol data set according to the protocol type proportion, and completing the proportion configuration to obtain a primary protocol data set.
6. The method of protocol data emulation according to claim 4, wherein the five-tuple information comprises: source IP address, source port, destination IP address, destination port, and transport layer protocol.
7. The method of protocol data emulation according to claim 1, wherein the string conversion comprises:
carrying out binary conversion on the conversion protocol data set;
and according to a pre-constructed character string conversion code, performing character string conversion on the conversion protocol data set which completes the binary conversion to obtain the simulation protocol data set.
8. An apparatus for protocol data emulation, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of protocol data simulation as claimed in any one of claims 1 to 7.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of protocol data simulation according to one of claims 1 to 7.
CN201911257628.9A 2019-12-10 2019-12-10 Protocol data simulation method, device and computer readable storage medium Active CN111181802B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911257628.9A CN111181802B (en) 2019-12-10 2019-12-10 Protocol data simulation method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911257628.9A CN111181802B (en) 2019-12-10 2019-12-10 Protocol data simulation method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111181802A CN111181802A (en) 2020-05-19
CN111181802B true CN111181802B (en) 2022-02-25

Family

ID=70650316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911257628.9A Active CN111181802B (en) 2019-12-10 2019-12-10 Protocol data simulation method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111181802B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187585B (en) * 2020-09-30 2023-10-27 腾讯科技(深圳)有限公司 Network protocol testing method and device
CN112019328B (en) * 2020-10-31 2021-01-26 北京华云安信息技术有限公司 Encryption method, device, equipment and storage medium of IP address

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1821456A1 (en) * 2006-02-21 2007-08-22 Nethawk Oyj Protocol analyser arrangement, analyser module and method of managing resources
CN101232410A (en) * 2005-10-14 2008-07-30 中国移动通信集团公司 System and method for testing WAP gateway performance
CN101841441A (en) * 2010-05-05 2010-09-22 北京星网锐捷网络技术有限公司 Test method and system for flow control device and data stream playback device
CN102045195A (en) * 2010-11-23 2011-05-04 清华大学 Traffic identification method and system based on relatedness command control information
CN108965300A (en) * 2018-07-21 2018-12-07 中国人民解放军战略支援部队信息工程大学 A kind of data packet generation method, device and computer readable storage medium
CN109587160A (en) * 2018-12-19 2019-04-05 广州联达信息科技有限公司 A kind of data transfer device, device, readable storage medium storing program for executing and industrial equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10122636B2 (en) * 2014-07-10 2018-11-06 Keysight Technologies Singapore (Holdings) Pte. Ltd. Processing data units

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101232410A (en) * 2005-10-14 2008-07-30 中国移动通信集团公司 System and method for testing WAP gateway performance
EP1821456A1 (en) * 2006-02-21 2007-08-22 Nethawk Oyj Protocol analyser arrangement, analyser module and method of managing resources
CN101841441A (en) * 2010-05-05 2010-09-22 北京星网锐捷网络技术有限公司 Test method and system for flow control device and data stream playback device
CN102045195A (en) * 2010-11-23 2011-05-04 清华大学 Traffic identification method and system based on relatedness command control information
CN108965300A (en) * 2018-07-21 2018-12-07 中国人民解放军战略支援部队信息工程大学 A kind of data packet generation method, device and computer readable storage medium
CN109587160A (en) * 2018-12-19 2019-04-05 广州联达信息科技有限公司 A kind of data transfer device, device, readable storage medium storing program for executing and industrial equipment

Also Published As

Publication number Publication date
CN111181802A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN106453766B (en) Data transmission method, apparatus and system based on virtual machine
CN111181802B (en) Protocol data simulation method, device and computer readable storage medium
CN104317749B (en) Information write-in method and device
CN104301139B (en) Router adaptation method, device and terminal device
CN105095367B (en) A kind of acquisition method and device of client data
CN105302885B (en) full-text data extraction method and device
CN105939284B (en) The matching process and device of message control strategy
CN107194250A (en) The integrity checking method and device of internal storage code
JP2019033312A5 (en)
CN104935639A (en) Intelligent terminal, and applied distributed exploitation system and method
US11249885B2 (en) Test case generator and user interface
CN105323115A (en) Data packet simulation method and data packet simulation device of network management test event
CN104639390A (en) Method and device for testing system
CN113194015A (en) Internet of things intelligent household equipment safety control method and system
CN105704207A (en) Method for generating unique identifier, terminal and network side
CN110990846B (en) Information storage method, device and computer readable storage medium
CN108170459A (en) Method for upgrading software, intelligent terminal and the device with store function
CN112311624A (en) Cloud host testing method and device, storage medium and electronic equipment
CN109656791A (en) A kind of gRPC performance test methods and device based on Jmeter
CN105204937B (en) Kernel function call method, apparatus and operating system
US11733971B2 (en) System and method of managing pseudo-random number generation in a multiprocessor environment
CN114268451A (en) Method, device, equipment and medium for constructing power monitoring network security buffer area
CN109240681A (en) A kind of model generating method, device and computer readable storage medium
CN116488931B (en) Information interaction method and device based on distributed networking equipment
CN110719260B (en) Intelligent network security analysis method and device and computer readable storage medium

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
GR01 Patent grant
GR01 Patent grant