CN108965300A - A kind of data packet generation method, device and computer readable storage medium - Google Patents

A kind of data packet generation method, device and computer readable storage medium Download PDF

Info

Publication number
CN108965300A
CN108965300A CN201810806999.7A CN201810806999A CN108965300A CN 108965300 A CN108965300 A CN 108965300A CN 201810806999 A CN201810806999 A CN 201810806999A CN 108965300 A CN108965300 A CN 108965300A
Authority
CN
China
Prior art keywords
character string
target
value
data packet
cover
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.)
Granted
Application number
CN201810806999.7A
Other languages
Chinese (zh)
Other versions
CN108965300B (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.)
Information Technology Innovation Center Of Tianjin Binhai New Area
Information Engineering University of PLA Strategic Support Force
Original Assignee
Information Technology Innovation Center Of Tianjin Binhai New Area
Information Engineering University of PLA Strategic Support Force
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 Information Technology Innovation Center Of Tianjin Binhai New Area, Information Engineering University of PLA Strategic Support Force filed Critical Information Technology Innovation Center Of Tianjin Binhai New Area
Priority to CN201810806999.7A priority Critical patent/CN108965300B/en
Publication of CN108965300A publication Critical patent/CN108965300A/en
Application granted granted Critical
Publication of CN108965300B publication Critical patent/CN108965300B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/02Capturing of monitoring data
    • H04L43/026Capturing of monitoring data using flow identification
    • 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/03Protocol definition or specification 

Landscapes

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

Abstract

The invention belongs to data packet generation technique fields, more particularly to a kind of data packet generation method, device and computer readable storage medium, this method comprises: receiving the spacing value between two target bytes of the target value of the target byte in packet header to be generated where each critical field, mask and arbitrary neighborhood;For each target byte, the target value is added in the target byte on bit corresponding with the first preset value in the mask, the second preset value cover will be added on bit corresponding with the second preset value in the mask in the target byte, obtains target byte value;According to multiple target byte values and the cover text string generation packet header content corresponding with the target protocol type determined according to the spacing value;The packet header content and preset data field are packaged, the data packet to be generated is obtained.The present invention can be improved data packet generating process efficiency.

Description

A kind of data packet generation method, device and computer readable storage medium
Technical field
The invention belongs to data packet generation technique fields, more particularly to a kind of data packet generation method, device and calculating Machine readable storage medium storing program for executing.
Background technique
Data packet generator is a kind of tool of data packet that can produce specific type, specific length and special speed. The major function of data packet generator is exactly the simulation to true packet incentive environment, by the construction to data packet, generates number According to stream, achieve the purpose that test bag processing equipment.Test and agreement of the data packet generator in the products such as interchanger and router Exploitation in, play the role of very important.Tester only need to build a simple test environment for tested object can To be tested, without putting it into the environment of actual motion, meanwhile, reduce the risk and cost of test.
Presently, there are data packet generator be mainly software realization, existing data packet generator is generally merely able to generate A kind of data packet of specific protocol type.When test job needs to convert data pack protocol type, inconvenient or nothing Method provides the data packet for testing required protocol type.Therefore, data packet generating process efficiency existing in the prior art is resulted in Low problem.
Summary of the invention
Aiming at the problems existing in the prior art, the present invention a kind of data packet generation method, device and computer are provided can Storage medium is read, solves the technical issues of data packet generating process inefficiency existing in the prior art.
To achieve the goals above, the following technical solution is employed by the present invention:
The present invention provides a kind of data packet generation method, this method comprises:
Receive the target value of the target byte in packet header to be generated where each critical field, mask and arbitrary neighborhood Spacing value between two target bytes, wherein the mask and the spacing value are propped up according to data packet to be generated The corresponding package head format of the target protocol type held determines;
For each target byte, the target value is added in the target byte and is preset in the mask first It is worth on corresponding bit, second will be added on bit corresponding with the second preset value in the mask in the target byte Preset value cover obtains target byte value;
According to multiple target byte values and according to the determining cover text string generation of the spacing value and the target protocol The corresponding packet header content of type;
The packet header content and preset data field are packaged, the data packet to be generated is obtained.
Preferably, described according to multiple target byte values and according to the cover text string generation of spacing value determination Packet header corresponding with target protocol type content, specifically includes:
Multiple target byte values are subjected to head and the tail splicing according to the reception sequence of the target value, obtain character string;
The cover character string that the corresponding position insertion of each spacing value is determined according to the spacing value in the character string, Obtain packet header corresponding with target protocol type content.
Preferably, the corresponding position insertion of the spacing value each in the character string is true according to the spacing value Fixed cover character string, specifically includes:
Multiple cover character strings determined according to the spacing value are inserted into the correspondence position in the character string several times It sets, obtains an expansion character string after being inserted into the spacing value every time;
It is iteratively substituted to carry out repeatedly the expansions character string, until the corresponding position of each spacing value is slotting in the character string Enter the cover character string determined according to the spacing value.
Preferably, the expansion character string is iteratively substituted, specifically includes:
Utilize the mesh adjacent after the cover character string and the cover character string in expansion character string described in the latter Byte value is marked, previous second target byte value after expanding the cover character string in character string is replaced;
Obtained new expansion character string is stored in the latter expansion character string and is expanded character string next time again Between previous expansion character string when iteratively substituted.
The present invention also provides a kind of data packet generating device, which includes:
Receiving module, for receiving the target value of the target byte in packet header to be generated where each critical field, covering Spacing value between code and two target bytes of arbitrary neighborhood, wherein the mask and the spacing value be according to Generate what the corresponding package head format of target protocol type that data packet is supported determined;
Adding module, for be directed to each target byte, by the target value be added in the target byte with it is described In mask on the corresponding bit of the first preset value, by ratio corresponding with the second preset value in the mask in the target byte The second preset value cover is added on special position, obtains target byte value;
Generation module, for according to multiple target byte values and according to the spacing value determine cover text string generation with The corresponding packet header content of the target protocol type;
Package module obtains the data packet to be generated for the packet header content and preset data field to be packaged.
Preferably, the generation module includes:
Splice submodule, for multiple target byte values to be carried out head and the tail splicing according to the reception sequence of the target value, Obtain character string;
It is inserted into submodule, it is true according to the spacing value for the corresponding position insertion of the spacing value each in the character string Fixed cover character string obtains packet header corresponding with target protocol type content.
Preferably, the insertion submodule includes:
It is inserted into unit, for multiple cover character strings determined according to the spacing value to be inserted into the character several times Corresponding position in string obtains an expansion character string after being inserted into the spacing value every time;
Replacement unit, it is iteratively substituted for carrying out the multiple expansion character string, until each spacing value in the character string The cover character string determined according to the spacing value is inserted into corresponding position.
Preferably, the replacement unit includes:
Subelement is replaced, for utilizing the cover character string and the cover character string in expansion character string described in the latter The adjacent target byte value afterwards replaces previous described expand after the cover character string in character string described in second Target byte value;
Storing sub-units are expanded character string and are carried out down again for obtained new expansion character string to be stored in described the latter Between previous expansion character string when once expansion character string is iteratively substituted.
The present invention also provides a kind of computer readable storage medium, which has processing The executable non-volatile program code of device, said program code make the processor execute a kind of above-mentioned data packet generation side Method.
Compared with prior art, the invention has the following advantages that
It, can be previously according to the corresponding packet of the target protocol type when user needs support the data packet of target protocol type Head format determines the mask and the spacing value, while determining the target value of the target byte where critical field, then sharp Data packet to be generated is obtained with data packet generation method of the invention, firstly, receiving each key in packet header to be generated Spacing value between the target value of target byte where field, mask and two target bytes of arbitrary neighborhood;For The target value is added in the target byte corresponding with the first preset value in the mask by each target byte On bit, the second default value complement will be added on bit corresponding with the second preset value in the mask in the target byte Position, obtains target byte value;According to multiple target byte values and the cover text string generation determined according to the spacing value Packet header corresponding with target protocol type content;The packet header content and preset data field are packaged, obtained The data packet to be generated.In this way, obtained data packet is exactly the data packet that user needs support target protocol type, at this point, It, can be corresponding previously according to another target protocol type when the data packet for needing support another target protocol type Package head format determine mask and spacing value, while determining the target value of the target byte where critical field, it is then sharp again The data packet with another target protocol type is obtained with data packet generation method, is avoided due to existing data packet generator one As be merely able to generate a kind of data packet of specific protocol type, it is existing when test job needs to convert data pack protocol type The problem of technology is inconvenient or can not provide the data packet for testing required protocol type, therefore, solves the prior art Present in data packet generating process inefficiency the technical issues of, reached improve data packet generating process efficiency technology effect Fruit.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of data packet generation method provided in an embodiment of the present invention;
Fig. 2 is the flow chart for generating packet header corresponding with target protocol type content and method;
Fig. 3 is the flow chart that the cover character string method determined according to spacing value is inserted into character string;
Fig. 4 is the flow chart for expanding the iteratively substituted method of character string;
Fig. 5 is to expand the iteratively substituted precedence diagram of character string;
Fig. 6 is a kind of structural block diagram of data packet generating device provided by the embodiment of the present invention;
Fig. 7 is the structural block diagram of generation module in a kind of data packet generating device provided by the embodiment of the present invention;
Fig. 8 is the structural block diagram that submodule is inserted into a kind of data packet generating device provided by the embodiment of the present invention;
Fig. 9 is the structural block diagram of replacement unit in a kind of data packet generating device provided by the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Core of the invention is to provide a kind of data packet generation method, device and computer readable storage medium, to improve Data packet generating process efficiency.
In order to make those skilled in the art more fully understand the present invention program, with reference to the accompanying drawings and detailed description The present invention is described in further detail.
As shown in Figure 1, Fig. 1 shows a kind of flow chart of data packet generation method provided in an embodiment of the present invention, the number It can specifically include following steps according to packet generation method:
Step S101, receive the target value of the target byte in packet header to be generated where each critical field, mask and Spacing value between two target bytes of arbitrary neighborhood, wherein the mask and the spacing value are according to be generated The corresponding package head format of the target protocol type that data packet is supported determines.
Specifically, the packet header of the data packet to be generated is divided as unit of byte, and data can be improved in this way Control efficiency.Include many fields inside packet header, in these fields, the field that user is concerned about is called critical field.It is wrapping Face in front may include multiple target bytes in byte where one critical field.The target value and the mask are 8 Position.The spacing value is 4, and the unit of the spacing value is byte, for example, target byte and mesh where target value A The spacing value between target byte where scale value B is 5, i.e. target byte where target value A and the target where target value B 5 bytes are divided between byte.A mask, the bit of target byte and the ratio of mask are distributed for each target byte Special position is one-to-one.
Step S102, for each target byte, by the target value be added in the target byte with it is described In mask on the corresponding bit of the first preset value, by ratio corresponding with the second preset value in the mask in the target byte The second preset value cover is added on special position, obtains target byte value.
Specifically, first preset value can be number 1, and second preset value can be number 0.For each institute Target byte is stated, the target value is added in the target byte on 1 corresponding bit digital in the mask, is incited somebody to action Digital 0 cover is added on 0 corresponding bit digital in the mask in the target byte, obtains target byte value.It lifts Example illustrates that the target value A on target byte A is 1011, and mask A corresponding with target byte A is 11110000, so, by mesh Scale value A(1011) be added in target byte A on 1 corresponding bit digital in mask A, by target byte A with mask A Digital 0 cover is added on middle digital 0 corresponding bit, obtains target byte value 10110000.
Step S103, according to multiple target byte values and according to the spacing value determine cover text string generation with The corresponding packet header content of the target protocol type.
As shown in Fig. 2, step S103 may comprise steps of:
Multiple target byte values are carried out head and the tail splicing according to the reception sequence of the target value, obtain word by step S201 Symbol string.
Specifically, it was known that the reception sequence of target value are as follows: target value A, target value B, target value C, then, it will be with target value The tail portion of the corresponding target byte value of A and the stem of the corresponding target byte of target value B are spliced, will be corresponding with target value B The tail portion of target byte value and the stem of the corresponding target byte value of target value C spliced, obtain character string.
Step S202, the corresponding position insertion of each spacing value is determined according to the spacing value in the character string Cover character string, obtain packet header corresponding with target protocol type content.
As shown in figure 3, step S202 may comprise steps of:
Multiple cover character strings determined according to the spacing value are inserted into the character string by step S301 several times Corresponding position, obtain an expansion character string after being inserted into the spacing value every time.
Specifically, it was known that target byte A corresponds to spacing value A and target value A, target byte B corresponds to spacing value B and target value B, target byte C correspond to spacing value C and target value C.The reception sequence of known target value are as follows: target value A, target value B and target Value C.Firstly, cover character string is determined according to spacing value, for example, can determine and A pairs of spacing value when spacing value A is 5 The cover character string A answered is equal to 40 bits multiplied by 8 bits for 40(5) bit, and the value on each bit is number 0.Then, cover character string A is inserted into the character string, the position of insertion is to obtain an expansion before target value A Character string A.Cover character string B is inserted into the character string, the position of insertion is obtained between target value A and target value B One expansion character string B.Cover character string C is inserted into the character string, the position of insertion is target value B and target value C Between, obtain an expansion character string C.
Step S302, repeatedly the expansion character string is iteratively substituted for progress, until each spacing value in the character string The cover character string determined according to the spacing value is inserted into corresponding position.
As shown in figure 4, step S302 may comprise steps of:
Step S401, using described in the latter expansion character string in the cover character string and the cover character string after it is adjacent The target byte value, replace it is previous it is described expand character string in the cover character string after second target word Section value.
Step S402, by obtained new expansion character string be stored in described the latter expand character string with carry out again it is next It is secondary expand character string it is iteratively substituted when previous expansion character string between.
Specifically, as shown in Figure 5, it is known that with successive genesis sequence expansion character string A51, expand character string B52 and Expand character string C53.Firstly, utilizing the cover character string B and the target adjacent with cover character string B that expand in character string B52 The target byte value B in character string A51 is expanded in byte value B replacement, obtains the first expansion character string 54, expands word for described first Symbol string 54, which is stored in, to be expanded character string B52 and expands between character string C53.Then the replacement of next round is carried out.Character will be expanded Cover character string C and the target byte value C replacement first adjacent with cover character string C in string C53 are expanded in character string 54 Target byte value C obtains the second expansion character string 55.Since the corresponding position of spacing value each in the second expansion character string 55 is inserted Enter the cover character string determined according to the spacing value, so, the second expansion character string 55 is exactly and the target protocol type Corresponding packet header content.
The packet header content and preset data field are packaged by step S104, obtain the data packet to be generated.
It is understood that the data field can be the fixed numbers that user specifies, it is also possible to random value.Finally The obtained data packet to be generated is exactly data packet corresponding with target protocol type, this data packet is exactly user's needs 's.
When test job needs to convert data pack protocol type, the prior art is inconvenient or can not provide test Therefore the problem of data packet of required protocol type, solves data packet generating process inefficiency existing in the prior art The technical issues of, reach the technical effect for improving data packet generating process efficiency.
With above method embodiment correspondingly, the present invention also provides a kind of data packet generating devices, as shown in fig. 6, Fig. 6 is a kind of structural block diagram of data packet generating device provided by the embodiment of the present invention, which includes:
Receiving module 601, for receive the target byte in packet header to be generated where each critical field target value, Spacing value between mask and two target bytes of arbitrary neighborhood, wherein the mask and the spacing value are bases The corresponding package head format of the target protocol type that data packet to be generated is supported determines.
The target value is added in the target byte by adding module 602 for being directed to each target byte On bit corresponding with the first preset value in the mask, by the target byte with the second preset value pair in the mask The second preset value cover is added on the bit answered, and obtains target byte value.
Generation module 603, for according to multiple target byte values and the cover character determined according to the spacing value Concatenate into packet header corresponding with target protocol type content.
Further, as shown in fig. 7, the generation module includes splicing submodule and insertion submodule.
Splice submodule 701, it is first for carrying out multiple target byte values according to the reception sequence of the target value Tail splicing, obtains character string.
It is inserted into submodule 702, for the corresponding position insertion of the spacing value each in the character string according to The cover character string that spacing value determines, obtains packet header corresponding with target protocol type content.
Further, as shown in figure 8, the insertion submodule includes insertion unit and replacement unit.
It is inserted into unit 801, for being inserted into multiple cover character strings determined according to the spacing value several times Corresponding position in the character string obtains an expansion character string after being inserted into the spacing value every time.
Replacement unit 802, it is iteratively substituted for carrying out the multiple expansion character string, until each described in the character string The cover character string determined according to the spacing value is inserted into the corresponding position of spacing value.
Further, as shown in figure 9, the replacement unit includes replacement subelement and storing sub-units.
Subelement 901 is replaced, for utilizing the cover character string and the benefit in expansion character string described in the latter The adjacent target byte value after the character string of position replaces and previous described expands after the cover character string in character string the Two target byte values.
Storing sub-units 902, for by obtained new expansion character string be stored in described the latter expand character string with Expanded next time again character string it is iteratively substituted when previous expansion character string between.
Package module 604 obtains described to be generated for the packet header content and preset data field to be packaged Data packet.
With above method embodiment correspondingly, the present invention also provides a kind of computer readable storage medium, the calculating The non-volatile program code that there is the storage of machine readable storage medium storing program for executing processor can be performed, said program code make the processor Execute a kind of above-mentioned data packet generation method.
The computer program product of data packet generation method is carried out provided by the embodiment of the present invention, including stores processing The computer readable storage medium of the executable non-volatile program code of device, the instruction that said program code includes can be used for holding Row previous methods method as described in the examples, specific implementation can be found in embodiment of the method, and details are not described herein.
Unless specifically stated otherwise, the opposite step of the component and step that otherwise illustrate in these embodiments, digital table It is not limit the scope of the invention up to formula and numerical value.
The technical effect and preceding method embodiment phase of device provided by the embodiment of the present invention, realization principle and generation Together, to briefly describe, Installation practice part does not refer to place, can refer to corresponding contents in preceding method embodiment.
In all examples being illustrated and described herein, any occurrence should be construed as merely illustratively, without It is as limitation, therefore, other examples of exemplary embodiment can have different values.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in the executable non-volatile computer-readable storage medium of a processor.Based on this understanding, of the invention Technical solution substantially the part of the part that contributes to existing technology or the technical solution can be with software in other words The form of product embodies, which is stored in a storage medium, including some instructions use so that One computer equipment (can be personal computer, server or the network equipment etc.) executes each embodiment institute of the present invention State all or part of the steps of method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read- Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can be with Store the medium of program code.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. a kind of data packet generation method, which is characterized in that this method comprises:
Receive the target value of the target byte in packet header to be generated where each critical field, mask and arbitrary neighborhood Spacing value between two target bytes, wherein the mask and the spacing value are propped up according to data packet to be generated The corresponding package head format of the target protocol type held determines;
For each target byte, the target value is added in the target byte and is preset in the mask first It is worth on corresponding bit, second will be added on bit corresponding with the second preset value in the mask in the target byte Preset value cover obtains target byte value;
According to multiple target byte values and according to the determining cover text string generation of the spacing value and the target protocol The corresponding packet header content of type;
The packet header content and preset data field are packaged, the data packet to be generated is obtained.
2. data packet generation method according to claim 1, which is characterized in that described according to multiple target byte values And the cover text string generation packet header content corresponding with the target protocol type determined according to the spacing value, it is specific to wrap It includes:
Multiple target byte values are subjected to head and the tail splicing according to the reception sequence of the target value, obtain character string;
The cover character string that the corresponding position insertion of each spacing value is determined according to the spacing value in the character string, Obtain packet header corresponding with target protocol type content.
3. data packet generation method according to claim 2, which is characterized in that described each described in the character string The cover character string that the corresponding position insertion of spacing value is determined according to the spacing value, specifically includes:
Multiple cover character strings determined according to the spacing value are inserted into the correspondence position in the character string several times It sets, obtains an expansion character string after being inserted into the spacing value every time;
It is iteratively substituted to carry out repeatedly the expansions character string, until the corresponding position of each spacing value is slotting in the character string Enter the cover character string determined according to the spacing value.
4. data packet generation method according to claim 3, which is characterized in that the expansion character string is iteratively substituted, tool Body includes:
Utilize the mesh adjacent after the cover character string and the cover character string in expansion character string described in the latter Byte value is marked, previous second target byte value after expanding the cover character string in character string is replaced;
Obtained new expansion character string is stored in the latter expansion character string and is expanded character string next time again Between previous expansion character string when iteratively substituted.
5. a kind of data packet generating device, which is characterized in that the device includes:
Receiving module, for receiving the target value of the target byte in packet header to be generated where each critical field, covering Spacing value between code and two target bytes of arbitrary neighborhood, wherein the mask and the spacing value be according to Generate what the corresponding package head format of target protocol type that data packet is supported determined;
Adding module, for be directed to each target byte, by the target value be added in the target byte with it is described In mask on the corresponding bit of the first preset value, by ratio corresponding with the second preset value in the mask in the target byte The second preset value cover is added on special position, obtains target byte value;
Generation module, for according to multiple target byte values and according to the spacing value determine cover text string generation with The corresponding packet header content of the target protocol type;
Package module obtains the data packet to be generated for the packet header content and preset data field to be packaged.
6. a kind of data packet generating device according to claim 5, which is characterized in that the generation module includes:
Splice submodule, for multiple target byte values to be carried out head and the tail splicing according to the reception sequence of the target value, Obtain character string;
It is inserted into submodule, it is true according to the spacing value for the corresponding position insertion of the spacing value each in the character string Fixed cover character string obtains packet header corresponding with target protocol type content.
7. a kind of data packet generating device according to claim 6, which is characterized in that the insertion submodule includes:
It is inserted into unit, for multiple cover character strings determined according to the spacing value to be inserted into the character several times Corresponding position in string obtains an expansion character string after being inserted into the spacing value every time;
Replacement unit, it is iteratively substituted for carrying out the multiple expansion character string, until each spacing value in the character string The cover character string determined according to the spacing value is inserted into corresponding position.
8. a kind of data packet generating device according to claim 7, which is characterized in that the replacement unit includes:
Subelement is replaced, for utilizing the cover character string and the cover character string in expansion character string described in the latter The adjacent target byte value afterwards replaces previous described expand after the cover character string in character string described in second Target byte value;
Storing sub-units are expanded character string and are carried out down again for obtained new expansion character string to be stored in described the latter Between previous expansion character string when once expansion character string is iteratively substituted.
9. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has processor can The non-volatile program code executed, said program code make the processor perform claim require 1 to 4 described in any item one Kind data packet generation method.
CN201810806999.7A 2018-07-21 2018-07-21 Data packet generation method and device and computer readable storage medium Active CN108965300B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810806999.7A CN108965300B (en) 2018-07-21 2018-07-21 Data packet generation method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810806999.7A CN108965300B (en) 2018-07-21 2018-07-21 Data packet generation method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108965300A true CN108965300A (en) 2018-12-07
CN108965300B CN108965300B (en) 2021-06-18

Family

ID=64495516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810806999.7A Active CN108965300B (en) 2018-07-21 2018-07-21 Data packet generation method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108965300B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181802A (en) * 2019-12-10 2020-05-19 中移(杭州)信息技术有限公司 Protocol data simulation method, device and computer readable storage medium
CN112948235A (en) * 2021-01-28 2021-06-11 维沃移动通信有限公司 Data packet generation method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030043735A1 (en) * 2001-08-31 2003-03-06 Hitachi, Ltd. Packet transmission method
CN101841437A (en) * 2010-03-23 2010-09-22 华为技术有限公司 Method and device for testing equipment
CN102420713A (en) * 2010-09-28 2012-04-18 大唐移动通信设备有限公司 Test data packet packaging method and equipment
CN102918793A (en) * 2010-09-30 2013-02-06 Lg电子株式会社 Method and apparatus for transmitting control information
CN105634684A (en) * 2014-11-19 2016-06-01 中国移动通信集团广东有限公司 Method, apparatus and server for processing data packet
CN106209830A (en) * 2016-07-08 2016-12-07 中国人民解放军国防科学技术大学 A kind of message building method represented based on XML procotol

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030043735A1 (en) * 2001-08-31 2003-03-06 Hitachi, Ltd. Packet transmission method
CN101841437A (en) * 2010-03-23 2010-09-22 华为技术有限公司 Method and device for testing equipment
CN102420713A (en) * 2010-09-28 2012-04-18 大唐移动通信设备有限公司 Test data packet packaging method and equipment
CN102918793A (en) * 2010-09-30 2013-02-06 Lg电子株式会社 Method and apparatus for transmitting control information
CN105634684A (en) * 2014-11-19 2016-06-01 中国移动通信集团广东有限公司 Method, apparatus and server for processing data packet
CN106209830A (en) * 2016-07-08 2016-12-07 中国人民解放军国防科学技术大学 A kind of message building method represented based on XML procotol

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181802A (en) * 2019-12-10 2020-05-19 中移(杭州)信息技术有限公司 Protocol data simulation method, device and computer readable storage medium
CN111181802B (en) * 2019-12-10 2022-02-25 中移(杭州)信息技术有限公司 Protocol data simulation method, device and computer readable storage medium
CN112948235A (en) * 2021-01-28 2021-06-11 维沃移动通信有限公司 Data packet generation method and device and electronic equipment
CN112948235B (en) * 2021-01-28 2024-03-22 维沃移动通信有限公司 Data packet generation method and device and electronic equipment

Also Published As

Publication number Publication date
CN108965300B (en) 2021-06-18

Similar Documents

Publication Publication Date Title
Reijers et al. Efficient code distribution in wireless sensor networks
CN110471666A (en) Code automatic switching method and device, code converter and medium
CN106897103B (en) Method for quickly and thermally updating version of mobile terminal network game
CN108965300A (en) A kind of data packet generation method, device and computer readable storage medium
CN106547520B (en) Code path analysis method and device
CN110083746B (en) Quick matching identification method and device based on character strings
US20210318947A1 (en) Methods and apparatuses for generating smart contract test case
CN106970280B (en) A kind of method and device of smart card power failure test
CN104954415B (en) Handle the method and device of HTTP request
CN106034119B (en) Method and device is obscured in the encryption of application installation package
CN108092942B (en) Message processing method and device
CN103957070B (en) The localization method of a kind of Frame and device
CN105471726B (en) The method and apparatus of retransmitting paramater transmitting
EP3349405B1 (en) Method and apparatus for generating user traffic
KR20100056337A (en) Device for generating a script for menu test, menu test automatic system having the same, and method thereof
CN100382516C (en) Method and method of consistency testing for IPv6 main protocol
CN109492239A (en) A kind of device for realizing simulation waveform data Real-time segmentation
CN107977440A (en) A kind of methods, devices and systems for parsing data file
CN104866292A (en) Method and device for extending software function
EP3012648A1 (en) Deriving hardware acceleration of decoding from a declarative protocol description
CN110472204A (en) A kind of method, apparatus and equipment based on json transmission binary data
CN110162467A (en) Method for testing software, device, computer equipment and readable storage medium storing program for executing
US9477800B1 (en) System, method, and computer program product for automatically selecting a constraint solver algorithm in a design verification environment
CN109726980A (en) The process method of inspection, device, storage medium and electronic equipment
JP7307784B2 (en) Automata Processing Apparatus and Method for Regular Expression Engine Utilizing Glushkov Automata Generation and Hybrid Matching

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