Construction method and device of test traffic, computer equipment and readable storage medium
By constructing a target number of data packets that satisfy the correlation relationship and dynamically adjusting the test traffic, the problem that the test traffic in the existing technology cannot accurately reflect the real network situation is solved, and the dynamic adaptation of the test traffic and the reliable testing of deep packet inspection equipment are realized.
Patent Information
- Application Number
- CN202511634157.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-10
AI Technical Summary
In the existing technology, the test traffic constructed by network traffic simulation instruments is difficult to accurately reflect the real situation of the network, and the composition of the test traffic is difficult to modify once it is set, making it unable to adapt to changes in network traffic.
By determining the traffic rate and packet information of the target application in the network, the number of target packets that satisfy multiple correlations is constructed, and test traffic is dynamically generated to reflect the real situation of the network.
It enables dynamic adjustment of test traffic, accurately reflects the real network situation, adapts to traffic changes, and improves the testing reliability of deep packet inspection equipment.
Smart Images

Figure CN121509271A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network testing technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for testing traffic. Background Technology
[0002] Test traffic is an important part of network testing. It refers to the network traffic generated during network testing and used to evaluate the performance of devices, protocols, or topologies. For example, in order to better understand the network status and meet the network quality requirements of various applications in the network, operators usually deploy deep packet inspection (DPI) devices on critical network links to monitor and analyze the traffic of applications in the network. This provides a basis for network planning and application service assurance. To better select suitable DPI devices, operators usually conduct tests on DPI devices based on test traffic.
[0003] In related technologies, test traffic is usually constructed based on network traffic simulation instruments. However, when constructing test traffic, network traffic simulation instruments often set the composition of the test traffic based on empirical values, and once the composition of the test traffic is set, it is inconvenient to modify it. In reality, the composition of network traffic varies greatly, which makes it difficult for the test traffic constructed based on network traffic simulation instruments to accurately reflect the real situation of the network. Summary of the Invention
[0004] Therefore, it is necessary to address the technical problem that test traffic cannot accurately reflect the real situation of the network by providing a method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can accurately reflect the real situation of the network.
[0005] Firstly, this application provides a method for constructing test traffic, including:
[0006] Identify the target application in the network, and obtain the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators; the target application is a part of all applications in the network.
[0007] Based on the traffic rate information and the data packet information, the number of target data packets that can simultaneously satisfy multiple association relationships of the target application is determined; each association relationship is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets;
[0008] Based on the data packet information and the number of target data packets, construct the test traffic corresponding to the target application.
[0009] In one embodiment, the target application corresponds to at least one target data packet, and the target data packet is a part of all data packets of the target application; the data packet information of the target application includes the data packet information of each target data packet, and the number of target data packets of the target application includes the number of target data packets of each target data packet;
[0010] The step of determining the number of target data packets that can simultaneously satisfy multiple association relationships for the target application based on the traffic rate information and the data packet information includes:
[0011] Based on the traffic rate information of the target application and the data packet information of each target data packet of the target application, determine the number of target data packets that can simultaneously satisfy each of the association relationships.
[0012] In one embodiment, each of the traffic rate indicators includes data rate and data packet rate. The data rate is used to characterize the amount of data transmitted by the target application per unit time, and the data packet rate is used to characterize the number of data packets transmitted by the target application per unit time. Each of the data packet indicators includes data packet size, data packet duration, and number of data packet messages.
[0013] The step of determining the number of target data packets that can simultaneously satisfy each of the association relationships based on the traffic rate information of the target application and the data packet information of each target data packet of the target application includes:
[0014] Based on the data rate information of the target application at the data rate, the data size information of each target data packet at the data packet size and the data packet duration information at the data packet duration, and the data packet rate information of the target application at the data packet rate, the data packet duration information of each target data packet at the data packet duration and the data packet number information at the data packet number, determine the number of target data packets that can simultaneously satisfy the first association relationship and the second association relationship;
[0015] Wherein, the first association relationship is used to characterize the relationship between the data rate, the data packet size, the data packet duration and the number of data packets, and the second association relationship is used to characterize the relationship between the data packet rate, the data packet duration, the number of data packet messages and the number of data packets.
[0016] In one embodiment, the target application corresponds to at least one target data packet, and the target data packet is a part of all data packets of the target application; the data packet information of the target application includes the data packet information of each target data packet, and the number of target data packets of the target application includes the number of target data packets of each target data packet;
[0017] The step of constructing the test traffic corresponding to the target application based on the data packet information and the number of target data packets includes:
[0018] Based on the data packet information of each target data packet of the target application, construct a simulated data packet for each target data packet;
[0019] Based on the number of target data packets in each target data packet, the simulated data packets of each target data packet are combined to obtain the test traffic corresponding to the target application; in the test traffic, the number of each simulated data packet is the number of target data packets in the corresponding target data packet.
[0020] In one embodiment, after constructing the test traffic corresponding to the target application, the method further includes:
[0021] When the preset test traffic reconstruction conditions are triggered, the traffic rate information and the data packet information are reacquired.
[0022] Based on the reacquired traffic rate information and data packet information, a new test traffic is constructed.
[0023] In one embodiment, after constructing the test traffic corresponding to each of the target applications, the method further includes:
[0024] Send the test traffic to the deep packet inspection devices in the network;
[0025] The test result of the deep packet inspection device is determined based on the processing performed by the deep packet inspection device in response to the test traffic.
[0026] Secondly, this application also provides a device for constructing a test flow rate, comprising:
[0027] The indicator information acquisition module is used to identify the target application in the network and acquire the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators; the target application is a part of all applications in the network.
[0028] The data packet number determination module is used to determine the target data packet number of the target application that can simultaneously satisfy multiple association relationships based on the traffic rate information and the data packet information; each of the association relationships is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets;
[0029] The test traffic dynamic construction module is used to construct the test traffic corresponding to the target application based on the data packet information and the number of target data packets.
[0030] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0031] Identify the target application in the network, and obtain the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators; the target application is a part of all applications in the network.
[0032] Based on the traffic rate information and the data packet information, the number of target data packets that can simultaneously satisfy multiple association relationships of the target application is determined; each association relationship is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets;
[0033] Based on the data packet information and the number of target data packets, construct the test traffic corresponding to the target application.
[0034] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0035] Identify the target application in the network, and obtain the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators; the target application is a part of all applications in the network.
[0036] Based on the traffic rate information and the data packet information, the number of target data packets that can simultaneously satisfy multiple association relationships of the target application is determined; each association relationship is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets;
[0037] Based on the data packet information and the number of target data packets, construct the test traffic corresponding to the target application.
[0038] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0039] Identify the target application in the network, and obtain the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators; the target application is a part of all applications in the network.
[0040] Based on the traffic rate information and the data packet information, the number of target data packets of the target application that can simultaneously satisfy multiple association relationships is determined; each association relationship is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets;
[0041] Based on the data packet information and the number of target data packets, construct the test traffic corresponding to the target application.
[0042] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for constructing test traffic can determine the number of target data packets corresponding to the target application in the test traffic to be constructed by using the traffic rate information and data packet information of the target application in the network. Furthermore, it can construct test traffic that conforms to the actual network conditions based on the data packet information and the number of target data packets of the target application. When the traffic in the network changes, the new number of target data packets can be determined based on the new traffic rate information and the new data packet information, and test traffic that conforms to the actual network conditions can be constructed again. Therefore, the test traffic constructed by the method based on the above process can dynamically and accurately reflect the actual network conditions. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart illustrating a method for constructing test traffic in one embodiment;
[0045] Figure 2 This is a flowchart illustrating the steps of dynamically constructing new test traffic in one embodiment;
[0046] Figure 3 This is a flowchart illustrating the steps of testing a deep packet inspection device in a network in one embodiment;
[0047] Figure 4 This is a flowchart illustrating a dynamic simulation method for applying traffic in one embodiment.
[0048] Figure 5 This is a structural block diagram of a device for constructing a test flow rate in one embodiment;
[0049] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0051] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0052] In one exemplary embodiment, such as Figure 1 As shown, a method for constructing test traffic is provided. This embodiment illustrates the method by applying it to a server. It is understood that this method can also be applied to a terminal, or to a system including both a server and a terminal, and is implemented through interaction between the server and the terminal. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. In this embodiment, the method includes the following steps:
[0053] Step S102: Determine the target application in the network, and obtain the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators.
[0054] Here, "network" refers to the Internet; "network" includes multiple applications, which can be software applications, mini-programs, web pages, etc.; "target application" is a subset of all applications in the network.
[0055] There are multiple metrics for both traffic rate and data packets.
[0056] Each application corresponds to multiple data packets, and each application's data packets are the data packets transmitted by that application; each target application corresponds to at least one target data packet, and each target application's target data packet is a part of all the data packets of that target application; in specific applications, different target applications have the same number of target data packets.
[0057] The data packet information for each target application includes the data packet information for each target data packet of that target application.
[0058] Specifically, the server identifies a portion of the applications in all applications on the network as target applications; for each target application, the server identifies a portion of the data packets in all data packets of the target application as the target data packets of the target application; then, the server obtains the index values of the target application under various traffic rate indicators as the traffic rate information of the target application under various traffic rate indicators; and the server obtains the index values of each target data packet under various data packet indicators as the data packet information of each target data packet under various data packet indicators.
[0059] In practical applications, when constructing test traffic each time, the server selects applications with high traffic as the target applications for this test traffic construction. For example, it selects the top 100 traffic applications as the target applications. Then, within a target time interval starting from the current moment, the server counts the traffic rate information of each target application and captures data packets for each target application to obtain the target data packets under this test traffic construction, and obtains the data packet information of each target data packet. In practical applications, the server can capture the pcap (PacketCapture) packets of the target applications and determine the data packet information based on the pcap packets.
[0060] Step S104: Based on the traffic rate information and data packet information, determine the number of target data packets that can simultaneously satisfy multiple association relationships of the target application.
[0061] Each correlation is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets.
[0062] The number of target data packets for each target application includes the number of target data packets for each target data packet of that target application.
[0063] The target data packet count for each target data packet represents the number of data packets in the test traffic to be constructed for that target data packet, that is, the number of times that target data packet should be dialed in the test traffic to be constructed.
[0064] Specifically, for each target application, the server determines the number of data packets that can simultaneously satisfy each association relationship based on the traffic rate information of the target application and the data packet information of each target data packet of the target application, thus obtaining the number of target data packets of each target data packet of the target application under the traffic construction in this test.
[0065] In practical applications, each relationship can be expressed by a corresponding mathematical expression. Therefore, the server combines the mathematical expressions corresponding to each relationship, and for each target application, substitutes the traffic rate information and data packet information of the target application into the combined mathematical expression. By solving the mathematical expression, the number of target data packets for each target data packet (of the target application) is obtained.
[0066] Step S106: Based on the data packet information and the number of target data packets, construct the test traffic corresponding to the target application.
[0067] Specifically, for each target application, the server first constructs a simulated data packet for each target data packet of the target application based on the data packet information of the target data packet; then, the server combines the simulated data packets of each target data packet according to the number of data packets of each target data packet of the target application to obtain the test traffic corresponding to the target application under this test traffic construction; wherein, in the test traffic of the target application, the number of each simulated data packet is the number of target data packets of the corresponding target data packet.
[0068] In practical applications, based on the current test traffic of each target application, the server can test the performance of devices, protocols, or network topology in the network.
[0069] In the above method for constructing test traffic, the server can determine the number of target data packets corresponding to the target application in the test traffic to be constructed by using the traffic rate information and data packet information of the target application in the network. Then, it can construct test traffic that conforms to the actual network situation based on the data packet information of the target application and the number of target data packets. When the traffic in the network changes, the server only needs to determine the new number of target data packets based on the new traffic rate information and the new data packet information, and then it can construct a new test traffic that conforms to the actual network situation again. Therefore, the test traffic constructed by the test traffic construction method based on the above process can dynamically and accurately reflect the actual network situation.
[0070] In an exemplary embodiment, the target application corresponds to at least one target data packet, and the target data packet is a part of all data packets of the target application; the data packet information of the target application includes the data packet information of each target data packet, and the number of target data packets of the target application includes the number of target data packets of each target data packet.
[0071] Step S104 above, which determines the number of target data packets that can simultaneously satisfy multiple association relationships of target applications based on traffic rate information and data packet information, specifically includes the following steps: determining the number of target data packets that can simultaneously satisfy each association relationship of each target data packet based on the traffic rate information of the target application and the data packet information of each target data packet of the target application.
[0072] Specifically, for each target application, the server determines the number of data packets of each target data packet of the target application that can simultaneously satisfy each association relationship based on the traffic rate information of the target application and the data packet information of each target data packet of the target application, and obtains the number of target data packets of each target data packet of the target application.
[0073] In this embodiment, the server can determine the number of target data packets corresponding to the target application in the test traffic to be constructed by using the traffic rate information and data packet information of the target application in the network. This ensures that the test traffic constructed based on the data packet information and the number of target data packets can highly match the real situation of the network.
[0074] In an exemplary embodiment, each traffic rate metric includes a data rate and a data packet rate; the data rate characterizes the amount of data transmitted by the corresponding target application per unit time; the data packet rate characterizes the number of data packets transmitted by the corresponding target application per unit time. The traffic rate information of the target application under the traffic rate metric "data rate" is data rate information, and the traffic rate information of the target application under the traffic rate metric "data packet rate" is data packet rate information.
[0075] In this embodiment, each data packet indicator includes data packet size, data packet duration, and data packet number. Data packet size represents the size of the corresponding target data packet; data packet duration represents the time consumed from the start of transmission to the complete end of transmission for the corresponding target data packet; and data packet number represents the number of packets in the corresponding target data packet. The data packet information under the "data packet size" indicator is the data packet size information; the data packet information under the "data packet duration" indicator is the data packet duration; and the data packet information under the "data packet number" indicator is the data packet number information.
[0076] In this embodiment, the first association relationship is used to characterize the relationship between data rate, data packet size, data packet duration and number of data packets, and the second association relationship is used to characterize the relationship between data packet rate, data packet duration, number of data packet segments and number of data packets.
[0077] In this embodiment, the above steps, based on the traffic rate information of the target application and the data packet information of each target data packet of the target application, determine the number of data packets that can simultaneously satisfy each association relationship, specifically including the following steps: based on the data rate information of the target application under the data rate, the data packet size information of each target data packet under the data packet size, and the data packet duration information under the data packet duration, as well as the data packet rate information of the target application under the data packet rate, the data packet duration information of each target data packet under the data packet duration, and the data packet number information under the data packet number, determine the number of data packets that can simultaneously satisfy the first association relationship and the second association relationship.
[0078] Specifically, the number of target applications is denoted as N, and the data rate information of the nth target application is denoted as F. n The data packet rate information of the nth target application is denoted as PPS. n (n∈N); the number of target data packets for each target application is denoted as M, and the data packet size information of the m-th target data packet of the n-th target application is denoted as D. n,m The duration information of the data packet of the m-th target application of the n-th target is denoted as T. n,m The number of data packets in the m-th target data packet of the n-th target application is denoted as S. n,m (m∈M); the number of target data packets of the m-th target data packet applied to the n-th target is denoted as a. n,m Then there are the first association relationship as shown in Formula 1 and the second association relationship as shown in Formula 2:
[0079] (Formula 1)
[0080] (Formula 2)
[0081] For each target application, the server will store the data rate information F of that target application. n And the packet size information D of each target data packet of the target application. n,m and packet duration information T n,m Substituting into Formula 1 above, the packet rate information (PPS) of the target application is obtained. n And the packet count information S of each target data packet of the target application. n,m and packet duration information T n,m Substituting into Formula 2 above, and combining Formulas 1 and 2, we can solve for the number 'a' of target data packets for each target data packet in this target application. n,m .
[0082] In this embodiment, the server can determine the number of target data packets corresponding to the target application in the test traffic to be constructed by using the data rate of the target application in the network, the data packet rate, and the data packet size, data packet duration, and data packet number of each target data packet of the target application. This allows the test traffic constructed based on the data packet information and the number of target data packets to highly conform to the real network situation.
[0083] In an exemplary embodiment, the target application corresponds to at least one target data packet, and the target data packet is a part of all data packets of the target application; the data packet information of the target application includes the data packet information of each target data packet, and the number of target data packets of the target application includes the number of target data packets of each target data packet.
[0084] Step S106 above, which constructs the test traffic corresponding to the target application based on the data packet information and the number of target data packets, specifically includes the following steps: constructing simulated data packets for each target data packet based on the data packet information of each target data packet of the target application; combining the simulated data packets of each target data packet based on the number of target data packets of each target data packet to obtain the test traffic corresponding to the target application; in the test traffic, the number of each simulated data packet is the number of target data packets of the corresponding target data packet.
[0085] Specifically, for each target application, the server first constructs a simulated data packet for each target data packet of the target application based on the data packet information of the target data packet; then, the server combines the simulated data packets of each target data packet according to the number of data packets of each target data packet of the target application to obtain the test traffic corresponding to the target application; wherein, in the test traffic of the target application, the number of each simulated data packet is the number of target data packets of the corresponding target data packet.
[0086] In this embodiment, the server can quickly and easily construct test traffic that conforms to the real network situation based on the data packet information of the target application and the number of target data packets.
[0087] In one exemplary embodiment, such as Figure 2 As shown, after constructing the test traffic corresponding to the target application in step S106 above, the following steps are also included to dynamically construct new test traffic:
[0088] Step S202: When the preset test traffic reconstruction conditions are triggered, reacquire the traffic rate information and data packet information.
[0089] Step S204: Based on the reacquired traffic rate information and data packet information, construct new test traffic.
[0090] The test traffic reconstruction condition can be receiving a test traffic reconstruction instruction, or the time interval between the current time and the last time the test traffic was constructed reaching a preset duration. For example, the server constructs test traffic once every preset time interval, such as five minutes.
[0091] Specifically, when the server receives a test traffic reconstruction instruction, or when the time interval between the current moment and the previous historical moment of constructing test traffic reaches a preset duration, it repeats the above steps S102 to S106, that is, determining the new target application, obtaining new traffic rate information and data packet information, calculating the number of new target data packets, and then constructing new test traffic.
[0092] In this embodiment, as the traffic in the network changes, the server only needs to determine the new target number of data packets based on the new traffic rate information and the new data packet information, and then it can reconstruct test traffic that conforms to the actual network situation. Therefore, the test traffic constructed by the test traffic construction method based on the above process can dynamically and accurately reflect the actual network situation.
[0093] In one exemplary embodiment, such as Figure 3As shown, in step S106 above, after constructing the test traffic corresponding to the target application, the following steps are also included for testing the deep packet inspection device in the network:
[0094] Step S302: Send test traffic to the deep packet inspection device in the network.
[0095] Step S304: Determine the test result of the deep packet inspection device based on the processing performed by the deep packet inspection device in response to the test traffic.
[0096] Deep packet inspection (DPI) equipment refers to network traffic inspection devices. In practical applications, to better understand the network status and meet the network quality requirements of various applications, deep packet inspection devices are typically deployed on critical network links to monitor and analyze application traffic. This provides a basis for application service assurance and network planning. To better select DPI devices with better functionality and performance, testing of the DPI devices is usually conducted.
[0097] Specifically, the server sends test traffic constructed by each target application to the deep packet inspection device in the network; then, based on the actions and processing performed by the deep packet inspection device in response to each test traffic, the test results of the deep packet inspection device are determined, and the test of the deep packet inspection device is completed.
[0098] In practical applications, the server can continuously and dynamically construct test traffic based on the test traffic reconstruction conditions, and continuously send the constructed test traffic to the deep packet inspection device, thereby achieving reliable and continuous testing of the deep packet inspection device.
[0099] In this embodiment, based on the constructed test traffic that closely matches the actual network conditions, more reliable testing of deep packet inspection devices can be performed, thereby selecting more suitable deep packet inspection devices.
[0100] To more clearly illustrate the method for constructing test traffic provided in the embodiments of this application, a specific embodiment is given below for detailed description of the method. However, it should be understood that the embodiments of this application are not limited thereto. Figure 4 As shown, in one exemplary embodiment, this application also provides a method for dynamically simulating application traffic, specifically including the following steps:
[0101] Step S402: Identify each target application in the network and capture each target data packet of each target application.
[0102] Step S404: Determine the data rate and data packet rate for each target application, and determine the data packet size, data packet duration, and number of data packet segments for each target data packet.
[0103] Step S406: For each target application, based on the data rate of the target application, the data packet size and duration of each target data packet of the target application, and the data packet rate, duration and number of data packets of the target application, solve the simultaneous first formula and second formula to obtain the number of simulated data packets for each target data packet of the target application; the first formula is used to characterize the relationship between data rate, data packet size, data packet duration and number of data packets, and the second formula is used to characterize the relationship between data packet rate, data packet duration, number of data packets and number of data packets.
[0104] Step S408: For each target application, construct a simulated data packet for each target data packet based on the data packet information of each target data packet of the target application. Combine the simulated data packets of each target data packet of the target application based on the number of simulated data packets of each target data packet of the target application to obtain the simulated traffic corresponding to the target application. In the simulated traffic, the number of each simulated data packet is the number of simulated data packets of the corresponding target data packet.
[0105] In step S410, if the preset test traffic reconstruction conditions are triggered, return to step S402 above.
[0106] In this embodiment, simulated traffic can be used for testing, such as testing deep packet inspection devices in a network.
[0107] In this embodiment, on the one hand, the server captures various data packets from each application, obtaining rate characteristics such as data rate and data packet rate for each application. Then, based on the application's traffic rate and data packet characteristics such as data packet size, data packet duration, and number of data packets, it determines the number of simulated data packets for each type of application based on construction rules. This allows for the simulation of the application's actual traffic, making the simulated traffic more consistent with the actual traffic situation of the application in the live network. On the other hand, the number of simulated data packets is dynamically adjusted periodically based on the rate characteristics of each application and the data packet characteristics, allowing the simulated traffic to change in real time according to the actual traffic situation in the live network. This ensures that the test results based on simulated traffic are closer to the actual network conditions.
[0108] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0109] Based on the same inventive concept, this application also provides a test traffic construction apparatus for implementing the test traffic construction method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more test traffic construction apparatus embodiments provided below can be found in the limitations of the test traffic construction method described above, and will not be repeated here.
[0110] In one exemplary embodiment, such as Figure 5 As shown, a test traffic construction device is provided, including: an indicator information acquisition module 502, a data packet number determination module 504, and a test traffic dynamic construction module 506, wherein:
[0111] The indicator information acquisition module 502 is used to determine the target application in the network and acquire the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators; the target application is a part of all applications in the network.
[0112] The data packet number determination module 504 is used to determine the target data packet number of the target application that can simultaneously satisfy multiple association relationships based on the traffic rate information and the data packet information; each of the association relationships is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets.
[0113] The test traffic dynamic construction module 506 is used to construct the test traffic corresponding to the target application based on the data packet information and the number of target data packets.
[0114] In an exemplary embodiment, the target application corresponds to at least one target data packet, and the target data packet is a part of all data packets of the target application; the data packet information of the target application includes the data packet information of each target data packet, and the number of target data packets of the target application includes the number of target data packets of each target data packet.
[0115] The data packet number determination module 504 is also used to determine the number of target data packets that can simultaneously satisfy each association relationship based on the traffic rate information of the target application and the data packet information of each target data packet of the target application.
[0116] In an exemplary embodiment, each traffic rate metric includes data rate and data packet rate. Data rate is used to characterize the amount of data transmitted by the target application per unit time, and data packet rate is used to characterize the number of data packets transmitted by the target application per unit time. Each data packet metric includes data packet size, data packet duration, and number of data packet segments.
[0117] The packet count determination module 504 is further configured to determine the number of target packets that can simultaneously satisfy the first correlation relationship and the second correlation relationship based on the data rate information of the target application under the data rate, the packet size information of each target packet under the packet size, and the packet duration information under the packet duration, as well as the packet rate information of the target application under the packet rate, the packet duration information of each target packet under the packet duration, and the packet number information under the packet number; wherein, the first correlation relationship is used to characterize the relationship between the data rate, packet size, packet duration, and packet count, and the second correlation relationship is used to characterize the relationship between the packet rate, packet duration, packet number, and packet count.
[0118] In an exemplary embodiment, the target application corresponds to at least one target data packet, and the target data packet is a part of all data packets of the target application; the data packet information of the target application includes the data packet information of each target data packet, and the number of target data packets of the target application includes the number of target data packets of each target data packet.
[0119] The test traffic dynamic construction module 506 is also used to construct simulated data packets for each target data packet based on the data packet information of each target data packet of the target application; and to combine the simulated data packets of each target data packet according to the number of target data packets of each target data packet to obtain the test traffic corresponding to the target application; in the test traffic, the number of each simulated data packet is the number of target data packets of the corresponding target data packet.
[0120] In an exemplary embodiment, the test traffic dynamic construction module 506 is further configured to reacquire traffic rate information and data packet information when a preset test traffic reconstruction condition is triggered; and to construct new test traffic based on the reacquired traffic rate information and data packet information.
[0121] In one exemplary embodiment, the test traffic construction apparatus further includes a test module for a deep packet inspection device, configured to send test traffic to a deep packet inspection device in the network and determine the test result of the deep packet inspection device based on the processing performed by the deep packet inspection device in response to the test traffic.
[0122] Each module in the aforementioned test flow construction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0123] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as application traffic rate information and data packet information. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a method for constructing test traffic.
[0124] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device on which the present application is intended to be applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0125] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0126] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.
[0127] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0128] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0129] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0130] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for constructing test traffic, characterized in that, The method includes: Identify the target application in the network, and obtain the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators; the target application is a part of all applications in the network. Based on the traffic rate information and the data packet information, the number of target data packets of the target application that can simultaneously satisfy multiple association relationships is determined; each association relationship is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets; Based on the data packet information and the number of target data packets, construct the test traffic corresponding to the target application.
2. The method according to claim 1, characterized in that, The target application corresponds to at least one target data packet, and the target data packet is a part of all data packets of the target application; the data packet information of the target application includes the data packet information of each target data packet, and the number of target data packets of the target application includes the number of target data packets of each target data packet; The step of determining the number of target data packets that can simultaneously satisfy multiple association relationships for the target application based on the traffic rate information and the data packet information includes: Based on the traffic rate information of the target application and the data packet information of each target data packet of the target application, determine the number of target data packets that can simultaneously satisfy each of the association relationships.
3. The method according to claim 2, characterized in that, Each of the aforementioned traffic rate indicators includes data rate and data packet rate. The data rate is used to characterize the amount of data transmitted by the target application per unit time, and the data packet rate is used to characterize the number of data packets transmitted by the target application per unit time. Each of the aforementioned data packet metrics includes data packet size, data packet duration, and number of data packet segments; The step of determining the number of target data packets that can simultaneously satisfy each of the association relationships based on the traffic rate information of the target application and the data packet information of each target data packet of the target application includes: Based on the data rate information of the target application at the data rate, the data size information of each target data packet at the data packet size and the data packet duration information at the data packet duration, and the data packet rate information of the target application at the data packet rate, the data packet duration information of each target data packet at the data packet duration and the data packet number information at the data packet number, determine the number of target data packets that can simultaneously satisfy the first association relationship and the second association relationship; Wherein, the first association relationship is used to characterize the relationship between the data rate, the data packet size, the data packet duration and the number of data packets, and the second association relationship is used to characterize the relationship between the data packet rate, the data packet duration, the number of data packet messages and the number of data packets.
4. The method according to any one of claims 1 to 3, characterized in that, The target application corresponds to at least one target data packet, and the target data packet is a part of all data packets of the target application; the data packet information of the target application includes the data packet information of each target data packet, and the number of target data packets of the target application includes the number of target data packets of each target data packet; The step of constructing the test traffic corresponding to the target application based on the data packet information and the number of target data packets includes: Based on the data packet information of each target data packet of the target application, construct a simulated data packet for each target data packet; Based on the number of target data packets in each target data packet, the simulated data packets of each target data packet are combined to obtain the test traffic corresponding to the target application; in the test traffic, the number of each simulated data packet is the number of target data packets in the corresponding target data packet.
5. The method according to any one of claims 1 to 3, characterized in that, After constructing the test traffic corresponding to the target application, the following is also included: When the preset test traffic reconstruction conditions are triggered, the traffic rate information and the data packet information are reacquired. Based on the reacquired traffic rate information and data packet information, a new test traffic is constructed.
6. The method according to any one of claims 1 to 3, characterized in that, After constructing the test traffic corresponding to each of the target applications, the following is also included: Send the test traffic to the deep packet inspection devices in the network; The test result of the deep packet inspection device is determined based on the processing performed by the deep packet inspection device in response to the test traffic.
7. A device for testing flow rate, characterized in that, The device includes: The indicator information acquisition module is used to identify the target application in the network and acquire the traffic rate information of the target application under different traffic rate indicators and the data packet information under different data packet indicators; the target application is a part of all applications in the network. The data packet number determination module is used to determine the target data packet number of the target application that can simultaneously satisfy multiple association relationships based on the traffic rate information and the data packet information; each of the association relationships is used to characterize the relationship between different traffic rate indicators, different data packet indicators and the number of data packets; The test traffic dynamic construction module is used to construct the test traffic corresponding to the target application based on the data packet information and the number of target data packets.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.