Simulation network data packet generation method and system based on large language generation model

By constructing a network packet generation method using a large language generation model, the problems of insufficient simulation and randomness and high testing costs of existing traffic simulation methods are solved, realizing low-cost, highly realistic and flexible intelligent operation and maintenance system testing.

CN118694670BActive Publication Date: 2024-11-05北京天旦网络科技发展有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411170718.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-11-05
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

Existing traffic simulation methods lack sufficient simulation and randomness, have high testing costs, and are difficult to effectively verify the effectiveness of intelligent operation and maintenance systems.

Method used

A network data packet generation method is constructed using a large language generation model. By building a large language model of the original description information of the data packets, network description data packets are generated. Tshark and Scapy are used for data packet file analysis and generation, which reduces testing costs and improves simulation and randomness.

Benefits of technology

It reduces the testing cost of intelligent operation and maintenance systems, enriches test cases, improves simulation and randomness, and provides convenient testing for various network systems at low cost and with flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694670B_ABST
    Figure CN118694670B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for generating simulated network data packets based on a large language generation model, including: constructing a large language model for generating original description information of data packets; constructing a program library for generating network data packets based on the original description information; generating network description data packets based on the large language model and the program library. The present invention generates network data packets (such as pcap files) from natural language, reduces the test cost of the intelligent operation and maintenance system, and enriches the test cases of the intelligent operation and maintenance system. The generation of the original description information of the datagram containing complex network conditions is completed by the tshark large language model, which is easy to use using natural language, and the "large language model" has the advantage of generating complex sequence patterns, and has good simulation and randomness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for generating a simulation network data packet based on a large language generation model. Background Art

[0002] Intelligent operation and maintenance systems have now been widely used in the monitoring and diagnosis of various complex systems. However, it is difficult to verify the effectiveness of such systems.

[0003] Patent document CN116346681A discloses a traffic simulation method, device, electronic device and storage medium, including: listening to the traffic in the current network, obtaining the corresponding relationship between multiple message lengths and message quantities that match the traffic; dividing the length intervals to which the multiple message lengths belong into multiple target length intervals, the weight of each target length interval is the sum of the number of messages corresponding to all message lengths included in each target length interval, and each target length interval corresponds to an instruction; according to the weight and instruction of each target length interval, sending messages whose lengths are in each target length interval. This patent is based on modifying the real traffic after listening to obtain simulated traffic, which is completely different from the method of the present invention that uses a large language model based on probability generation.

[0004] Patent document CN115842766A discloses a traffic simulation method and device, which simulates the SRv6 link traffic corresponding to the new SRv6 service based on IPv6 link data, predicts the SRv6 link traffic corresponding to the historical service based on SRv6 link data, and accurately simulates the future SRv6 link traffic according to the SRv6 link traffic corresponding to the new SRv6 service and the historical service, thereby providing support for the routing decision of the SDN controller or IP network controller. However, this patent uses real physical equipment to simulate traffic, the testing cost is high, and the technical route is completely different from the present invention.

[0005] In summary, there is still room for improvement in the simulation and randomness of the traffic simulation methods currently on the market, and there is still room for reduction in testing costs. Summary of the invention

[0006] In view of the defects in the prior art, the object of the present invention is to provide a method and system for generating simulated network data packets based on a large language generation model.

[0007] A method for generating a simulation network data packet based on a large language generation model provided by the present invention comprises:

[0008] Step S1: construct a large language model to generate original description information of the data packet;

[0009] Step S2: constructing a program library for generating network data packets based on the original description information;

[0010] Step S3: Generate a network description data packet based on the large language model and the program library.

[0011] Preferably, the step S1 comprises:

[0012] Step S1.1: constructing a set of original description information of a data packet file;

[0013] Step S1.2: constructing a single data stream training data set through the original description information set of the data packet file;

[0014] Step S1.3: constructing a mixed data stream training data set through the original description information set of the data packet file;

[0015] Step S1.4: Use the single data stream training dataset and the mixed data stream training dataset as samples, and perform fine-tuning on the selected open source large language model to obtain a single-stream-mixed two-step fine-tuning large model.

[0016] Preferably, the step S1.1 includes obtaining a data packet file of a real production environment, and extracting corresponding relevant information from the data packet file;

[0017] The relevant information includes relative time, protocol, source IP, source port, destination IP, destination port, expert information and behavior information.

[0018] Preferably, the step S1.2 comprises:

[0019] Step S1.2.1: cutting the original description information of the data packet file into original description information of a single data stream;

[0020] Step S1.2.2: formatting the original description information of the single data stream and extracting summary information of the single data stream;

[0021] Step S1.2.3: Generate a single TCP information flow according to the original description information and summary information of the single data flow, and then obtain a single data flow training data set.

[0022] Preferably, the step S1.3 comprises:

[0023] Step S1.3.1: construct the original description information of the mixed data, select the description information of each single data stream in the mixed data stream, and obtain the original description information of the mixed data;

[0024] Step S1.3.2: extract the protocol type and count of the original description information of the mixed data, the expert information type and technology contained in different information flows, the number of nodes, and the time span, and merge them to obtain the summary information of the mixed flow;

[0025] Step S1.3.3: Generate a mixed information stream containing multiple protocols based on the original description information of the mixed data and the summary information of the mixed stream, and obtain a mixed data stream training data set.

[0026] Preferably, the step S1.4 comprises:

[0027] Step S1.4.1: Select an open source large language model that conforms to the transformer architecture;

[0028] Step S1.4.2: Using the single data stream training data set as a sample, fine-tuning is performed on the open source large language model so that the model acquires the ability to generate single data stream original description information;

[0029] Step S1.4.3: Sample part of the data from the single data stream training data set, and mix it into the mixed data stream training data set in proportion, and fine-tune the open source large language model based on the mixed data, so that the model can obtain the ability to generate original description information of the mixed data stream.

[0030] Preferably, the step S2 comprises constructing a data packet description feature set and constructing a generation function based on the description feature set;

[0031] The constructing of the data packet description feature set extracts feature information of expert information in the information through the original description information of the acquired data packet file;

[0032] The generating function constructed based on the descriptive feature set constructs a generating function for each feature information, and also constructs a generating function for a general single communication, to form a data packet generating function set together.

[0033] Preferably, step S3 includes the following sub-steps:

[0034] Step S3.1: Obtain user input information as input of the single-stream-hybrid two-step fine-tuning large model to obtain the original information of the hybrid information stream;

[0035] Step S3.2: interpreting the items in the original information of the mixed information flow one by one, and calling the generation function generated in step S2 to convert them into data packets one by one, and saving the data packets at the same time.

[0036] A simulation network data packet generation system based on a large language generation model provided by the present invention includes:

[0037] Module M1: Build a large language model to generate the original description information of the data packet;

[0038] Module M2: Build a library for generating network data packets based on original description information;

[0039] Module M3: Generate a network description data packet based on the large language model and the program library.

[0040] Preferably, the module M1 comprises:

[0041] Module M1.1: Construct the original description information set of the data packet file;

[0042] Module M1.2: constructing a single data stream training data set through the original description information set of the data packet file;

[0043] Module M1.3: constructing a mixed data stream training data set through the original description information set of the data packet file;

[0044] Module M1.4: Use the single data stream training dataset and the mixed data stream training dataset as samples, perform fine-tuning on the selected open source large language model, and obtain a single-stream-mixed two-step fine-tuning large model.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] 1. The present invention generates network data packets (such as pcap files) from natural language, reduces the testing cost of the intelligent operation and maintenance system, and enriches the test cases of the intelligent operation and maintenance system.

[0047] 2. This paper uses the tshark enlarged language model to complete the generation of datagram original description information containing complex network conditions. It uses natural language and is easy to use. The "large language model" has the advantage of generating complex sequence patterns and has good simulation and randomness.

[0048] 3. The present invention interprets the original description information and then uses scapy to convert the original description information into a datagram, thereby completing the packetization of the simulation data, thereby providing convenience for the testing of various network systems.

[0049] 4. The present invention completely uses software to implement simulation, which is lower in cost, more flexible and easier to implement than traditional simulation methods that require hardware intervention. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0051] Figure 1 It is a schematic diagram of the workflow of the present invention;

[0052] Figure 2 A schematic diagram of the process of building a large language model that generates raw description information;

[0053] Figure 3A flowchart for building a library for generating data packets based on raw information;

[0054] Figure 4 A flowchart for generating network description packets based on natural language. DETAILED DESCRIPTION

[0055] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0056] The data packet in the method for generating a network simulation data packet based on a large language model of the present invention, such as a PCAP file. The present invention constructs a large language model of the network description intermediate language; describes the network fault characteristics by natural language; then generates a corresponding packet sequence described in the intermediate language from the network fault described in the natural language based on the large language model; and generates a network data packet based on the packet sequence and the scapy library.

[0057] According to a simulation network data packet generation method based on a large language generation model provided by the present invention, Figure 1 As shown, including:

[0058] Step S1: construct a large language model to generate the original information of the data packet description. Figure 2 As shown, it includes: constructing a data packet file description information set; constructing a single data stream training data set; constructing a mixed data stream training data set; and fine-tuning a large language model using a single stream-mixed two-step training. Step S1 includes:

[0059] Step S1.1: Construct the original description information set of the data packet file. Prepare the data packet file of the real production environment, and use tshark to extract "relative time, protocol, source IP, source port, destination IP, destination port, expert information, and behavior information". For example, if the data packet file is named dump.pcapng, the extraction method using the tshark command is:

[0060] tshark -r dump.pcapng -T fields -e frame.time_relative -e _ws.col.Protocol -e ip.src -e tcp.srcport -e ip.dst -e tcp.dstport -e _ws.col.Info -e _ws.expert

[0061] Among them, "-r dump.pcapng" means dump.pcapng is the packet file to be analyzed, -T fields means outputting the results in the form of fields, "-e frame.time_relative" means outputting relative frame time, "-e _ws.col.Protocol" means extracting the protocol used by each data packet, "-e ip.src" means extracting the source IP address, "-etcp.srcport" means extracting the TCP source port number, "-e ip.dst" means extracting the destination IP address, "-etcp.dstport" means extracting the TCP destination port number, "-e _ws.col.Info" means extracting the information column of the data packet, and "-e_ws.expert" means extracting expert information related to data packet security or errors, such as potential problems or abnormal conditions. It should be noted that the above example is a way of writing to use tshark (the command line version of wireshark analysis software) to analyze the content of data packets.

[0062] The returned result, i.e. the original description information, is:

[0063] 0.241568000TCP61.8.0.178010.0.52.164255080 → 2550 [ACK] Seq=26281Ack=1 Win=50 Len=1460 Expert Info (Warning / Protocol): Illegal characters found in header name

[0064] 0.247779000TCP61.8.0.178010.0.52.164255080 → 2550 [ACK] Seq=27741Ack=1 Win=50 Len=1460

[0065] 0.247820000TCP10.0.52.164255061.8.0.1780[TCP ZeroWindow] 2550 → 80[ACK]Seq=1 Ack=29201 Win=0 Len=0Expert Info (Comment / Comment): This zerowindow condition is death on a network. Check out the delay caused by thiscondition - make an IO graph.,Expert Info (Warning / Sequence): TCP Zero Windowsegment

[0066] 0.914903000TCP61.8.0.178010.0.52.1642550[TCP Keep-Alive] 80 → 2550[ACK]Seq=29200 Ack=1 Win=50 Len=0Expert Info (Note / Sequence): TCP keep-alivesegment

[0067] 0.914939000TCP10.0.52.164255061.8.0.1780[TCP ZeroWindow] 2550 → 80[ACK]Seq=1 Ack=29201 Win=0 Len=0Expert Info (Warning / Sequence): TCP ZeroWindow segment

[0068] 2.048447000TCP61.8.0.178010.0.52.1642550[TCP Keep-Alive] 80 → 2550[ACK]Seq=29200 Ack=1 Win=50 Len=0Expert Info (Note / Sequence): TCP keep-alivesegment …

[0069] Step S1.2: Construct a single data stream training data set. Step S1.2 includes the following steps:

[0070] Step S1.2.1: Cut the original description information of the data packet file into the original description information of a single data stream. For TCP packets, all data packets in a single cycle from establishing a connection to disconnecting a connection / failed connection between two network units are merged into one data stream; for packets of other protocols, the communication between the same IP and PORT pairs is merged into one data stream.

[0071] Step S1.2.2: Format the original description information of a single data stream. Select the maximum window length (such as 512, 1024, etc.). When the length of a single information stream exceeds the maximum window length, use the maximum window length as a sliding window to slide on the description information. The number of rows of expert information contained in each sliding window is recorded as expert_cnt. The window containing the maximum expert_cnt in the sliding window is selected as the description information of the single data stream.

[0072] Step S1.2.3: Extract summary information of a single data flow. Extract expert information (such as TCP Zero Windowsegment, TCP keep-alive segment, etc.), count all expert information (such as TCP Zero Windowsegment: 5 times, TCP keep-alive segment: 7 times, etc.); extract average, maximum, and minimum time intervals, extract total packet counts, IP, and port information; extract protocol names. Combine the above information to generate summary information for a single flow, for example:

[0073] TCP, node information 10.0.52.164:2550, 61.8.0.17:80, maximum time interval 2.3s, minimum time interval 0.001s, average time interval 0.012s, total number of packets 2312, TCP Zero Window segment: 5 times, TCP keep-alive segment: 7 times.

[0074] Step S1.2.4: Construct a training sample for a single data stream. Each sample has two parts: input and output. The input is the string formed by concatenating the summary information generated in step 1.2.3 with the "instruction description", and the output is the original description information generated in step 1.2.2. The input concatenated with the "instruction description" information is as follows:

[0075] Please play the role of data stream generation engine and generate a single data stream sample. The single data stream sample to be generated is as follows:

[0076] 0.241568000TCP61.8.0.178010.0.52.164255080 → 2550 [ACK] Seq=26281Ack=1 Win=50 Len=1460 Expert Info (Warning / Protocol): Illegal characters found in header name

[0077] 0.247779000TCP61.8.0.178010.0.52.164255080 → 2550 [ACK] Seq=27741Ack=1 Win=50 Len=1460

[0078] 0.247820000TCP10.0.52.164255061.8.0.1780[TCP ZeroWindow] 2550 → 80[ACK]Seq=1 Ack=29201 Win=0 Len=0Expert Info (Comment / Comment): This zerowindow condition is death on a network. Check out the delay caused by thiscondition - make an IO graph.,Expert Info (Warning / Sequence): TCP Zero Windowsegment.

[0079] Next, generate a single data stream according to the following requirements:

[0080] TCP, node information 10.0.52.164:2550, 61.8.0.17:80, maximum time interval 2.3s, minimum time interval 0.001s, average time interval 0.012s, total number of packets 2312, TCP Zero Window segment: 5 times, TCP keep-alive segment: 7 times.

[0081] TCP, node information 10.0.52.164:2550, 61.8.0.17:80, maximum time interval 2.3s, minimum time interval 0.001s, average time interval 0.012s, total number of packets 2312, TCP Zero Window segment: 5 times, TCP keep-alive segment: 7 times.

[0082] Step S1.3: Construct a mixed data stream training data set. A sample containing multiple single data streams is called a mixed data stream sample. The construction process includes the following steps:

[0083] Step S1.3.1: Construct the original description information of the mixed data. Select the maximum window length (such as 2048, 4096, etc.). In the mixed data stream, for each single data stream, when the information stream length exceeds the maximum window length, use the maximum window length as the sliding window, slide on the description information, record the number of rows of expert information contained in each sliding window as expert_cnt, and select the window containing the maximum expert_cnt in the sliding window as the description information of the single data stream. Use this method to process each single data stream in the mixed data to obtain the original description information of the mixed data.

[0084] Step S1.3.2: Construct summary information of mixed data flows. Based on the results of the previous step, extract the protocol type and count of the information flow, the type and technology of expert information contained in different information flows, the number of nodes, and the time span. Combine the above information to generate summary information of the mixed flow, for example:

[0085] Contains: TCP streams: 3, UDP streams: 2, number of nodes: 8, time span: 12s, TCP Zero Windows segment: 21 times, TCP keep-alive segment: 7 times.

[0086] Step S1.3.3: Construct a training sample of the mixed data stream. Each sample has two parts: input and output. The input is the string formed by splicing the summary information generated in step S1.3.2 with the "instruction description", and the output is the original description information generated in the corresponding step S1.3.1. The input spliced ​​into the "instruction description" information is as follows:

[0087] "Please play the role of data stream generation engine and generate mixed data stream samples. The mixed data stream samples to be generated are as follows:

[0088] 0.241568000TCP61.8.0.178010.0.52.164255080 → 2550 [ACK] Seq=26281Ack=1 Win=50 Len=1460 Expert Info (Warning / Protocol): Illegal characters found in header name

[0089] 0.256626000TCP61.8.0.18808010.0.52.16580818080 → 8081 [ACK] Seq=25378 Ack=1 Win=50 Len=1000

[0090] 0.267820000TCP10.0.52.164255061.8.0.1780[TCP ZeroWindow] 2550 → 80[ACK]Seq=1 Ack=29201 Win=0 Len=0Expert Info (Comment / Comment): This zerowindow condition is death on a network. Check out the delay caused by thiscondition - make an IO graph.,Expert Info (Warning / Sequence): TCP Zero Windowsegment.

[0091] Next, generate a hybrid data flow according to the following requirements:

[0092] TCP streams: 3, UDP streams: 2, number of nodes: 8, time span: 12s, TCP Zero Window segment: 21 times, TCP keep-alive segment: 7 times.

[0093] Step S1.4: Use the single-stream-mixed two-step fine-tuning large model. Specifically includes the following steps:

[0094] Step S1.4.1: Select an open source large language model that conforms to the transformer architecture. Specifically, the open source large language model that conforms to the transformer architecture refers to the neural network architecture of the same name proposed in the paper "Attention Is All You Need", which was published at the 2017 NIPS (Conference and Workshop on Neural Information Processing Systems) conference. The construction method of this architecture is described in detail in this paper.

[0095] Step S1.4.2: Fine-tune the ability to generate raw information for a single stream. Use the Lora method to fine-tune the selected open source large language model, with the sample being the data generated in step S1.2, so that the model can generate raw description information for a single data stream.

[0096] Step S1.4.3: Fine-tune the ability to generate original information of the mixed stream. A small portion of the data sampled from step S1.2 is mixed into the data generated by step S1.3, and the proportion of the former is kept significantly smaller than the latter, for example, 1:10, 1:20, etc. Based on the mixed data, the Lora method is used to fine-tune the selected open source large language model, so that the model has the ability to generate original description information of the mixed data stream.

[0097] Step S2: Construct a library for generating network data packets based on the original description information. Figure 3 As shown, it includes: constructing a data packet description feature set; constructing a generation function based on the description feature set. Step S2.1: Constructing a data packet description feature set. Based on the data generated in step S1.1, extract the feature information (such as TCP ZeroWindow segment, TCP keep-alive segment, etc.) in the expert information to form a feature information set.

[0098] Step S2.2: Construct a generation function based on the set of descriptive feature information. Use scapy to construct a generation function for each feature information, and also construct a generation function for a general single communication, together forming a set of data packet generation functions. For example, for the generation function of the TCP Zero Window segment, this function is used to generate a TCP data packet with a window size of zero, as follows:

[0099] from scapy.all import IP, TCP

[0100] def generate_zero_window_packet(src_ip, dst_ip, relative_time, ack=None, seq=None): A function named generate_zero_window_packet defined based on Scapy (a Python library for creating and analyzing data packets), which can accept at least five parameters: src_ip represents the source IP address of the data packet, dst_ip represents the destination IP address of the data packet, relative_time represents time-related parameters (not used inside the function), ack represents the confirmation number of the TCP data packet, and seq represents the sequence number of the TCP data packet.

[0101] packet = IP(src=src_ip, dst=dst_ip) / TCP(window=0, ack=ack, seq=seq) constructs a TCP data packet with a window size of zero.

[0102] return packet returns the generated data packet.

[0103] For example, for a normal TCP communication generation function, this function provides convenient generation of TCP packets with specified parameters, such as source / destination IP addresses, source / destination ports, payload data, acknowledgment number, and sequence number, as follows:

[0104] from scapy.all import IP, TCP

[0105] def generate_tcp_packet(src_ip, dst_ip, src_port, dst_port, data, ack=None, seq=None): defines a function named generate_tcp_packet, which accepts at least seven parameters, namely src_ip represents the source IP address of the data packet, dst_ip represents the destination IP address of the data packet, src_port represents the source port of the TCP data packet, dst_port represents the destination port of the TCP data packet, data represents the payload data of the TCP data packet, ack represents the confirmation number of the TCP data packet, the default is None, seq represents the sequence number of the TCP data packet, the default is None, among which the confirmation number of the TCP data packet and the sequence number of the TCP data packet are optional.

[0106] # Create TCP packet

[0107] packet = IP(src=src_ip, dst=dst_ip) / TCP(sport=src_port, dport=dst_port, ack=ack, seq=seq) / data creates a TCP packet using scapy. The packet is constructed by combining the IP layer (IP) and the TCP layer (TCP). The src and dst parameters of the IP layer specify the source and destination IP addresses, respectively. The sport and dport parameters of the TCP layer specify the source and destination ports, respectively. The ack and seq parameters are optional and are used to specify the acknowledgment number and sequence number of the TCP packet. Finally, the data parameter represents the payload data of the TCP packet.

[0108] return packet returns the constructed TCP data packet

[0109] Step S3: Generate a network description data packet based on natural language. Figure 4As shown, step S3.1: Generate data packet description information based on user description. Accept user input and use the user input as the input of the model obtained in step 1.4.3 to obtain the original information of the mixed information flow. For example, user input: Please generate a mixed information flow: TCP flow: 5, UDP flow: 1, number of nodes 3, time span 21s, TCP Zero Window segment: 2 times.

[0110] Step S3.2: Generate a data packet file based on the original information of the information flow. Interpret the items in the original information flow one by one, and call the function generated in step S2.2 to convert them into data packets one by one. And combine the data packets into a pcap file and save it. For example, if a line does not have expert information, it is ordinary TCP communication, and generate_tcp_packet is called to generate a datagram; if a line contains a TCP Zero Window segment, generate_zero_window_packet is called to generate a datagram.

[0111] The present invention also provides a simulated network data packet generation system based on a large language generation model. The simulated network data packet generation system based on a large language generation model can be implemented by executing the process steps of the simulated network data packet generation method based on a large language generation model, that is, those skilled in the art can understand the simulated network data packet generation method based on a large language generation model as a preferred implementation of the simulated network data packet generation system based on a large language generation model.

[0112] According to the present invention, a simulation network data packet generation system based on a large language generation model includes:

[0113] Module M1: Build a large language model to generate the original description information of the data packet. Module M1 includes:

[0114] Module M1.1: Construct the original description information set of the data packet file. Module M1.1 includes obtaining the data packet file of the real production environment and extracting the corresponding relevant information from the data packet file; the relevant information includes relative time, protocol, source IP, source port, destination IP, destination port, expert information and behavior information.

[0115] Module M1.2: Construct a single data stream training data set through the original description information set of the data packet file. Module M1.2 includes: Module M1.2.1: Cut the original description information of the data packet file into the original description information of a single data stream; Module M1.2.2: Format the original description information of a single data stream and extract the summary information of a single data stream; Module M1.2.3: Generate a single TCP information stream based on the original description information and summary information of a single data stream, and then obtain a single data stream training data set.

[0116] Module M1.3: Construct a mixed data stream training data set through the original description information set of the data packet file. Module M1.3 includes: Module M1.3.1: Construct the original description information of the mixed data, select the description information of each single data stream in the mixed data stream, and obtain the original description information of the mixed data; Module M1.3.2: Extract the protocol type and count of the original description information of the mixed data, the expert information type and technology contained in different information streams, the number of nodes, and the time span, and merge them to obtain the summary information of the mixed stream; Module M1.3.3: Generate a mixed information stream containing multiple protocols based on the original description information of the mixed data and the summary information of the mixed stream, and obtain the mixed data stream training data set.

[0117] Module M1.4: Take the single data stream training dataset and the mixed data stream training dataset as samples, and fine-tune them on the selected open source large language model to obtain a single-stream-mixed two-step fine-tuning large model. Module M1.4 includes: Module M1.4.1: Select an open source large language model that conforms to the transformer architecture; Module M1.4.2: Take the single data stream training dataset as a sample, and fine-tune it on the open source large language model so that the model can generate the original description information of the single data stream; Module M1.4.3: Sample part of the data from the single data stream training dataset, and mix it into the mixed data stream training dataset in proportion, and fine-tune it on the open source large language model based on the mixed data, so that the model can generate the original description information of the mixed data stream.

[0118] Module M2: Construct a library for generating network data packets based on original description information. Module M2 includes constructing a data packet description feature set and constructing a generation function based on the description feature set; constructing a data packet description feature set extracts the feature information of expert information in the information through the original description information of the acquired data packet file; constructing a generation function based on the description feature set constructs a generation function for each feature information, and also constructs a general single communication generation function to form a data packet generation function set.

[0119] Module M3: Generate network description data packets based on the large language model and program library. Module M3 includes the following submodules: Module M3.1: Obtain user input information as input of the single-stream-hybrid two-step fine-tuning large model to obtain the original information of the hybrid information flow; Module M3.2: Interpret the items in the original information of the hybrid information flow one by one, and call the generation function generated in module M to convert them into data packets one by one, and save the data packets at the same time.

[0120] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0121] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A method for generating simulated network data packets based on a large language generation model, characterized in that: include: Step S1: constructing a large language model to generate original description information of a data packet; the step S1 comprises: Step S1.1: constructing a set of original description information of a data packet file; Step S1.2: constructing a single data stream training data set through the original description information set of the data packet file; Step S1.3: constructing a mixed data stream training data set through the original description information set of the data packet file; Step S1.4: taking the single data stream training data set and the mixed data stream training data set as samples, fine-tuning the selected open source large language model to obtain a single stream-mixed two-step fine-tuning large model; the step S1.4 comprises: Step S1.4.1: Select an open source large language model that conforms to the transformer architecture; Step S1.4.2: Using the single data stream training data set as a sample, fine-tuning is performed on the open source large language model so that the model acquires the ability to generate single data stream original description information; Step S1.4.3: sampling some data from the single data stream training data set, and mixing it into the mixed data stream training data set in proportion, and fine-tuning the open source large language model based on the mixed data, so that the model can obtain the ability to generate original description information of the mixed data stream; Step S2: constructing a program library for generating network data packets based on the original description information; said step S2 includes constructing a data packet description feature set and constructing a generation function based on said description feature set; The constructing of the data packet description feature set includes extracting feature information of expert information in the acquired original description information of the data packet file; The description feature set includes constructing a generation function for each feature information, and also constructing a general single communication generation function to form a data packet generation function set; Step S3: Generate a network description data packet based on the large language model and the program library; Step S3 includes the following sub-steps: Step S3.1: Obtain user input information as input of the single-stream-hybrid two-step fine-tuning large model to obtain the original information of the hybrid information stream; Step S3.2: interpreting the items in the original information of the mixed information flow one by one, and calling the generation function generated in step S2 to convert them into data packets one by one, and saving the data packets at the same time.

2. The method for generating a simulated network data packet based on a large language generation model according to claim 1, characterized in that: The step S1.1 includes obtaining a data packet file of a real production environment, and extracting corresponding relevant information from the data packet file; The relevant information includes relative time, protocol, source IP, source port, destination IP, destination port, expert information and behavior information.

3. The method for generating a simulated network data packet based on a large language generation model according to claim 1, characterized in that: The step S1.2 comprises: Step S1.2.1: cutting the original description information of the data packet file into original description information of a single data stream; Step S1.2.2: formatting the original description information of the single data stream and extracting summary information of the single data stream; Step S1.2.3: Generate a single TCP information flow according to the original description information and summary information of the single data flow, and then obtain a single data flow training data set.

4. The method for generating a simulated network data packet based on a large language generation model according to claim 1, characterized in that: The step S1.3 comprises: Step S1.3.1: construct the original description information of the mixed data, select the description information of each single data stream in the mixed data stream, and obtain the original description information of the mixed data; Step S1.3.2: extract the protocol type and count of the original description information of the mixed data, the expert information type and technology contained in different information flows, the number of nodes, and the time span, and merge them to obtain the summary information of the mixed flow; Step S1.3.3: Generate a mixed information stream containing multiple protocols based on the original description information of the mixed data and the summary information of the mixed stream, and obtain a mixed data stream training data set.

5. A simulation network data packet generation system based on a large language generation model, characterized in that: include: Module M1: constructs a large language model for generating original description information of a data packet; the module M1 includes: Module M1.1: Construct the original description information set of the data packet file; Module M1.2: constructing a single data stream training data set through the original description information set of the data packet file; Module M1.3: constructing a mixed data stream training data set through the original description information set of the data packet file; Module M1.4: taking the single data stream training data set and the mixed data stream training data set as samples, fine-tuning is performed on the selected open source large language model to obtain a single stream-mixed two-step fine-tuning large model; the module M1.4 includes: Module M1.4.1: Select an open source large language model that conforms to the transformer architecture; Module M1.4.2: Using a single data stream training data set as a sample, fine-tune the open source large language model so that the model can generate single data stream original description information; Module M1.4.3: Sample some data from the single data stream training data set and mix it into the mixed data stream training data set in proportion, and fine-tune the open source large language model based on the mixed data, so that the model can obtain the ability to generate original description information of the mixed data stream; Module M2: constructing a program library for generating network data packets based on original description information; the module M2 includes constructing a data packet description feature set and constructing a generation function based on the description feature set; The constructing of the data packet description feature set includes extracting feature information of expert information in the acquired original description information of the data packet file; The description feature set includes constructing a generation function for each feature information, and also constructing a general single communication generation function to form a data packet generation function set; Module M3: Generate a network description data packet based on the large language model and the program library; Module M3 includes the following sub-steps: Module M3.1: Obtain user input information as the input of the single-stream-hybrid two-step fine-tuning large model to obtain the original information of the hybrid information stream; Module M3.2: interprets the items in the original information of the mixed information flow one by one, and calls the generation function generated in module M2 to convert them into data packets one by one, and saves the data packets at the same time.

6. The simulation network data packet generation system based on the large language generation model according to claim 5 is characterized in that: The module M1.1 includes obtaining a data packet file of a real production environment and extracting corresponding relevant information from the data packet file; The relevant information includes relative time, protocol, source IP, source port, destination IP, destination port, expert information and behavior information.

7. The simulation network data packet generation system based on the large language generation model according to claim 5 is characterized in that: The module M1.2 includes: Module M1.2.1: Cut the original description information of the data packet file into the original description information of a single data stream; Module M1.2.2: formatting the original description information of the single data stream and extracting summary information of the single data stream; Module M1.2.3: Generate a single TCP information flow according to the original description information and summary information of the single data flow, and then obtain a single data flow training data set.

8. The simulation network data packet generation system based on the large language generation model according to claim 5, characterized in that: The module M1.3 includes: Module M1.3.1: construct the original description information of the mixed data, select the description information of each single data stream in the mixed data stream, and obtain the original description information of the mixed data; Module M1.3.2: extract the protocol type and count of the original description information of the mixed data, the expert information type and technology contained in different information flows, the number of nodes, and the time span, and merge them to obtain the summary information of the mixed flow; Module M1.3.3: Generate a mixed information stream containing multiple protocols based on the original description information of the mixed data and the summary information of the mixed stream, and obtain a mixed data stream training data set.