Traffic replay test method, system and apparatus, and storage medium
Through slice processing and concurrent playback processing technology, the problem of inefficiency in traffic playback testing is solved, and a more efficient test process is achieved.
Patent Information
- Application Number
- PCT/CN2024/136148
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-30
- Filing Date
- 2024-12-02
- Publication Date
- 2025-06-05
AI Technical Summary
In traffic playback testing, it is difficult for the prior art to effectively improve the testing efficiency, especially when processing large amounts of playback traffic data, the test effect is easily affected by the playback cycle and response time, resulting in reduced efficiency.
By configuring the slice time granularity, the original playback traffic data set is sliced, the number of playback traffic data in each slice data set is reduced, and the concurrent playback processing of multiple playback execution components is performed through multiple playback execution components, so as to realize concurrent playback tests of multiple playback traffic data.
It improves the processing efficiency of a single slice data set, shortens the test cycle, avoids the data waiting problem caused by test-by-test, and significantly improves the overall efficiency of traffic playback tests.
Smart Images

Figure CN2024136148_05062025_PF_FP_ABST
Abstract
Description
A method, system, device and storage medium for traffic playback testing Technical Field
[0001] The present disclosure relates to the technical field of system testing, and in particular to a method, system, device and storage medium for traffic playback testing. Background Art
[0002] Traffic replay is a testing method that records and replays network traffic to test systems. With the diversification of business development, the number of business scenarios within business systems has also increased, which has also put forward new requirements for traffic replay. During the traffic replay process, the quantity and quality of traffic directly affect the effectiveness of business system testing. If the amount of test traffic is too small, it will not fully cover the numerous business scenarios within the business system, resulting in poor test results.
[0003] However, expanding the amount of replayed traffic data will result in a longer replay cycle due to the increased amount of replayed traffic data. Furthermore, the large amount of replayed traffic data will increase the response time of the system under test, making subsequent replayed traffic data unusable for testing, reducing the efficiency of traffic replay testing. Summary of the Invention
[0004] The purpose of the embodiments of the present disclosure is to provide a method, system, device, and storage medium for traffic replay testing to improve the efficiency of traffic replay testing. The specific technical solutions are as follows:
[0005] A method for traffic playback testing, the method comprising:
[0006] Obtaining an original playback traffic data set, and slicing the original playback traffic data set based on the obtained slicing time granularity to obtain multiple slice data sets, each of which includes multiple playback traffic data;
[0007] According to the slicing sequence priority of each of the slice data sets, each of the slice data sets is sequentially determined as a current slice data set, and the following processing is performed on the current slice data set:
[0008] Importing each playback traffic data of the current slice data set into a preset message queue;
[0009] After all the playback traffic data in the current slice data set are imported into the preset message queue, playback processing is performed concurrently by multiple playback execution components.
[0010] The process of each playback execution component performing the playback processing includes:
[0011] According to the import order of each replay traffic data in the preset message queue, the replay traffic data is extracted from the preset message queue and replayed to the system under test, and the replay results are recorded, wherein the replay traffic data extracted from the preset message queue by each replay execution component are the earliest imported replay traffic data in the preset message queue at the extraction moment.
[0012] Optionally, before performing playback processing concurrently through multiple playback components, the method further includes:
[0013] Storing the amount of the playback traffic data in the current slice data in a preset cache;
[0014] The following processing also includes:
[0015] After each of the playback execution components performs the playback process once, updating the quantity in the preset buffer based on the playback result;
[0016] The process of each playback execution component performing the playback processing further includes:
[0017] Determine whether the updated number in the preset cache is equal to 0. If not, execute the steps of: extracting the playback traffic data from the preset message queue and playing it back to the system under test according to the import order of each playback traffic data in the preset message queue, and recording the playback result;
[0018] If the updated number in the preset cache is equal to 0, it is determined that the current slice data has been tested, wherein the value range of the number includes zero and any positive integer.
[0019] Optionally, the obtaining of the original playback traffic dataset and slicing the original playback traffic dataset based on the obtained slicing time granularity to obtain multiple sliced datasets include:
[0020] In response to a traffic replay test request, obtaining the original replayed traffic data set from a preset database according to the data set number in the traffic replay test request;
[0021] According to the slicing time granularity in the traffic replay test request, the preset slicing script is called to perform the slicing processing on the original playback traffic data set to obtain multiple sliced data sets, wherein the total recording duration of each playback traffic data in each sliced data set is not greater than the duration of the slicing time granularity.
[0022] Optionally, after each playback execution component performs the playback process once, updating the quantity in the preset cache based on the playback result includes:
[0023] After each playback execution component performs the playback process once, parsing the playback result;
[0024] Determining whether the playback result carries a playback completion tag based on the parsing result, and if so, updating the quantity in the preset cache based on the playback result;
[0025] When the playback result does not carry the playback completion tag, the playback traffic data is extracted from the preset message queue and recorded in a preset error data list, and the quantity in the preset cache is updated based on the playback result.
[0026] A system for traffic playback testing, the system comprising:
[0027] a slicing module, configured to obtain an original playback traffic data set, and slice the original playback traffic data set based on the obtained slicing time granularity to obtain a plurality of sliced data sets, each of which includes a plurality of playback traffic data;
[0028] The testing module is configured to determine each of the slice data sets as a current slice data set in sequence according to the slice order priority of each of the slice data sets, and perform the following processing on the current slice data set:
[0029] Importing each playback traffic data of the current slice data set into a preset message queue;
[0030] After all the playback traffic data in the current slice data set are imported into the preset message queue, playback processing is performed concurrently by multiple playback execution components.
[0031] The process of each playback execution component performing the playback processing includes:
[0032] According to the import order of each replay traffic data in the preset message queue, the replay traffic data is extracted from the preset message queue and replayed to the system under test, and the replay results are recorded, wherein the replay traffic data extracted from the preset message queue by each replay execution component are the earliest imported replay traffic data in the preset message queue at the extraction moment.
[0033] Optionally, before the test module performs the playback processing concurrently through the multiple playback components, the test module is further configured to:
[0034] Storing the amount of the playback traffic data in the current slice data in a preset cache;
[0035] The following processing also includes:
[0036] After each of the playback execution components performs the playback process once, updating the quantity in the preset buffer based on the playback result;
[0037] The process of each playback execution component performing the playback processing further includes:
[0038] Determine whether the updated number in the preset cache is equal to 0. If not, execute the steps of: extracting the playback traffic data from the preset message queue and playing it back to the system under test according to the import order of each playback traffic data in the preset message queue, and recording the playback result;
[0039] If the updated number in the preset cache is equal to 0, it is determined that the current slice data has been tested, wherein the value range of the number includes zero and any positive integer.
[0040] Optionally, the slicing module is configured to:
[0041] In response to a traffic replay test request, obtaining the original replayed traffic data set from a preset database according to the data set number in the traffic replay test request;
[0042] According to the slicing time granularity in the traffic replay test request, the preset slicing script is called to perform the slicing processing on the original playback traffic data set to obtain multiple sliced data sets, wherein the total recording duration of each playback traffic data in each sliced data set is not greater than the duration of the slicing time granularity.
[0043] Optionally, after each playback execution component performs the playback process once, the test module is configured to update the quantity in the preset cache based on the playback result:
[0044] After each playback execution component performs the playback process once, parsing the playback result;
[0045] Determining whether the playback result carries a playback completion tag based on the parsing result, and if so, updating the quantity in the preset cache based on the playback result;
[0046] When the playback result does not carry the playback completion tag, the playback traffic data is extracted from the preset message queue and recorded in a preset error data list, and the quantity in the preset cache is updated based on the playback result.
[0047] A device for traffic playback testing, comprising:
[0048] processor;
[0049] a memory for storing instructions executable by the processor;
[0050] The processor is configured to execute the instructions to implement any of the traffic replay test methods described above.
[0051] A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by the processor of a traffic replay test device, enables the traffic replay test device to perform any of the traffic replay test methods described above.
[0052] The embodiments of the present disclosure provide a method, system, device and storage medium for traffic replay testing. By configuring the slice time granularity and slicing the original replay traffic data set based on the slice time granularity, the amount of replay traffic data used for subsequent testing in each slice data set is reduced, the processing efficiency of subsequent testing of a single slice data set is improved, and the processing efficiency of the entire process of the traffic replay test is improved. In addition, by configuring each execution component to perform replay processing concurrently, it is possible to perform concurrent replay tests on multiple replay traffic data in the current slice data set, so that when the playback time of a single replay traffic data is too long, it does not affect the replay tests of other replay traffic data, avoids the data waiting problem caused by testing one by one, and improves the test efficiency of the traffic replay test. It can be seen that the present disclosure improves the test efficiency of the traffic replay test.
[0053] Of course, it is not necessary to achieve all of the advantages described above at the same time when implementing any product or method disclosed herein. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0055] FIG1 is a flow chart of a method for traffic replay testing provided by an embodiment of the present disclosure;
[0056] FIG2 is a flow chart of a single playback execution component updating a quantity in a preset buffer based on a playback result, provided by an optional embodiment of the present disclosure;
[0057] FIG3 is a flow chart of a method for traffic replay testing provided by another optional embodiment of the present disclosure;
[0058] FIG4 is a block diagram of a system for traffic replay testing provided by another optional embodiment of the present disclosure;
[0059] FIG5 is a block diagram of a device for traffic replay testing provided by another optional embodiment of the present disclosure;
[0060] FIG6 is a system diagram of a traffic replay test device according to an optional embodiment of the present disclosure. DETAILED DESCRIPTION
[0061] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0062] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0063] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0064] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0065] The present disclosure provides a method for traffic replay testing, as shown in FIG1 , which includes:
[0066] S101: Obtain an original playback traffic data set, and slice the original playback traffic data set based on the obtained slice time granularity to obtain multiple slice data sets, where the slice data sets include multiple playback traffic data.
[0067] It should be noted that, in actual application scenarios, the replayed traffic data in the aforementioned raw replayed traffic dataset may be data recorded using a traffic recording tool during normal or simulated operation of the system under test and stored in a pre-set database. Such traffic recording tools include, but are not limited to, general traffic recording and playback tools (Sandbox Repeater), network data collection and analysis tools (TCPDUMP), request copying tools (Tcpcopy), configured network packet analysis software (Wireshark), and protocol debugging proxy tools (Fiddler).
[0068] It should be noted that in actual application scenarios, the above-mentioned slicing time granularity can be a slicing granularity set according to the recording duration of the playback traffic data. By configuring the above-mentioned slicing time granularity and slicing the original playback traffic data set based on the slicing time granularity, the present disclosure reduces the amount of playback traffic data used for subsequent testing in each slice data set, improves the processing efficiency of subsequent testing of a single slice data set, and thus improves the processing efficiency of the entire traffic playback test process.
[0069] Optionally, in another optional embodiment of the present disclosure, the above-mentioned slicing time granularity can also be switched to slicing granularity of other dimensions according to the actual application scenario, for example, the data volume size is used as the slicing dimension.
[0070] S102: According to the slicing order priority of each slice data set, each slice data set is sequentially determined as the current slice data set, and the following processing is performed on the current slice data set:
[0071] Import the playback traffic data of the current slice data set into the preset message queue;
[0072] After all playback traffic data in the current slice data set are imported into the preset message queue, playback processing is performed concurrently through multiple playback execution components.
[0073] The process of each playback execution component performing playback processing includes:
[0074] According to the import order of each playback traffic data in the preset message queue, the playback traffic data is extracted from the preset message queue and replayed to the system under test, and the playback results are recorded. Among them, the playback traffic data extracted by each playback execution component from the preset message queue are the earliest imported playback traffic data in the preset message queue at the extraction time.
[0075] It should be noted that in actual application scenarios, the specific types of the above-mentioned preset message queues (Message Queues) can be various, such as RocketMQ, RabbitMQ, Kafka, etc. Among them, RocketMQ, as a distributed message middleware, has the advantages of low latency, high concurrency, and strict message ordering, which can meet the needs of high-concurrency environment testing of the system under test.
[0076] It should be noted that, in actual application scenarios, by importing each playback traffic data into the above-mentioned preset message queue, the preset message queue can be used to automatically assign an import order to the imported data, thereby facilitating the implementation of subsequent concurrent processes.
[0077] It should be noted that, in actual application scenarios, the above-mentioned replay execution component can be a traffic replay tool deployed in the same cluster.
[0078] It should be noted that the present disclosure configures each execution component to perform playback processing concurrently, which can realize concurrent playback testing of multiple playback traffic data in the current slice data set. Therefore, when the playback time of a single playback traffic data is too long, it will not affect the playback test of other playback traffic data, avoiding the data waiting problem caused by testing one by one, and improving the test efficiency of the traffic playback test.
[0079] It should be noted that in actual application scenarios, by configuring each playback execution component to extract the playback traffic data from the preset message queue, the playback traffic data are all the earliest imported playback traffic data in the preset message queue at the time of extraction, avoiding the risk of missing playback traffic data due to the playback execution component extracting the playback traffic data out of order from the preset message queue.
[0080] The present disclosure reduces the amount of replay traffic data used for subsequent testing in each slice data set by configuring the slice time granularity and slicing the original replay traffic data set based on the slice time granularity, thereby improving the processing efficiency of subsequent testing of a single slice data set, and further improving the processing efficiency of the entire flow replay test process. In addition, by configuring each execution component to perform replay processing concurrently, it is possible to perform concurrent replay tests on multiple replay traffic data in the current slice data set, so that when the playback time of a single replay traffic data is too long, it does not affect the replay tests of other replay traffic data, thus avoiding the data waiting problem caused by testing one by one, and improving the test efficiency of the flow replay test.
[0081] Optionally, before performing playback processing concurrently through multiple playback components, the method shown in FIG1 further includes:
[0082] The number of playback traffic data in the current slice data stored in the preset cache;
[0083] The following processing also includes:
[0084] After each playback execution component performs a playback process, the quantity in the preset cache is updated based on the playback result;
[0085] The process of each playback execution component performing playback processing also includes:
[0086] Determine whether the updated number in the preset cache is equal to 0. If not, execute the following steps: extract the playback traffic data from the preset message queue and play it back to the system under test according to the import order of each playback traffic data in the preset message queue, and record the playback result;
[0087] If the updated number in the preset cache is equal to 0, it is determined that the current slice data has been tested, wherein the value range of the number includes zero and any positive integer.
[0088] Optionally, in an optional embodiment of the present disclosure, the preset cache may be a database constructed based on a remote dictionary service (Remote Dictionary Server, Redis).
[0089] Optionally, in another optional embodiment of the present disclosure, in the scenario where traffic replay tests are performed on different systems at the same time, in order to distinguish the replayed traffic data of different systems, the above-mentioned quantities can be stored in the above-mentioned preset cache in the form of key-value pairs. For example: suppose that the above-mentioned processing is performed on two systems A and B at the same time. Among them, the number of system A is B001, and the number of system B is B002. System A is tested using the slice data set No. 1 of system A, and the slice data set No. 1 includes 20 pieces of replayed traffic data. System B is tested using the slice data set No. 3 of system B, and the slice data set No. 3 includes 15 pieces of replayed traffic data. When executing the above-mentioned "storing the number of replayed traffic data in the current slice data in the preset cache", the stored key-value pairs are: B001-1: 20, B002-3: 15.
[0090] It should be noted that in actual application scenarios, there are many specific implementation methods for updating the quantity in the preset cache based on the playback result after each playback execution component performs a playback process. Here is an exemplary implementation method:
[0091] FIG2 is a flowchart showing a single playback execution component updating the quantity in a preset buffer based on playback results, provided in an optional embodiment of the present disclosure. The specific steps are as follows:
[0092] In step S201, a single playback traffic data is extracted from a preset message queue and played back to the system under test, thereby triggering step S202.
[0093] Step S202: Receive the playback result fed back by the system under test, and trigger step S203.
[0094] Step S203: deduct the number of current slice data in the preset buffer according to the number of playback results, and trigger step S204.
[0095] Step S204: Determine whether the amount of the current slice data after deduction is 0. If not, return to step S201. If yes, trigger step S205.
[0096] Step S205: Generate a notification indicating that the current slice data has been tested.
[0097] Optionally, an original playback traffic dataset is obtained, and the original playback traffic dataset is sliced based on the obtained slice time granularity to obtain multiple slice datasets, including:
[0098] In response to the traffic replay test request, obtaining the original replayed traffic data set from a preset database according to the data set number in the traffic replay test request;
[0099] According to the slicing time granularity in the traffic replay test request, the preset slicing script is called to slice the original replay traffic data set to obtain multiple slice data sets, where the total recording time of each replay traffic data in each slice data set is not greater than the time granularity of the slice time.
[0100] To facilitate understanding of the process of slicing the original playback traffic dataset based on the obtained slicing time granularity to obtain multiple slice datasets, an optional embodiment of the present disclosure is described below:
[0101] Assume that the total recording time of the original playback traffic data set is 5 seconds and contains 100 data items. If the slice time granularity is 1 second, then after the above slicing, five slice data sets will be obtained.
[0102] Optionally, after each playback execution component performs a playback process, updating the quantity in the preset cache based on the playback result includes:
[0103] After each playback execution component performs a playback process, the playback results are parsed;
[0104] Based on the parsing result, determine whether the playback result carries a playback completion tag. If so, update the quantity in the preset cache based on the playback result;
[0105] When the playback result does not carry a playback completion tag, the playback traffic data record is extracted from the preset message queue and put into the preset error data list, and the quantity in the preset cache is updated based on the playback result.
[0106] It should be noted that in actual application scenarios, the amount of replayed traffic data needed to correspond to different test scenarios is enormous. Furthermore, during testing, replay failures may occur due to factors such as incomplete system setup and data errors. Therefore, this disclosure configures a replay execution component to analyze the replay results, enabling accurate location of fault points during testing.
[0107] It should be noted that in actual application scenarios, there are many implementation methods of the traffic replay test method shown in Figure 1. Here, an exemplary implementation method is provided:
[0108] FIG3 is a flow chart of a method for traffic replay testing provided in an optional embodiment of the present disclosure, wherein the specific steps are as follows:
[0109] Step S301: In response to a traffic replay test request, the original replay traffic dataset is loaded according to the dataset number in the request, and the original replay traffic dataset is sliced based on the slice time granularity in the request to obtain multiple sliced datasets. This triggers step S302.
[0110] Step S302 , determining whether all slice data sets have been tested. If not, step S303 is triggered. If so, step S311 is triggered.
[0111] In step S303, a slice data set with the highest slice order priority and not yet fully tested is determined as the current slice data set, and step S304 is triggered.
[0112] In step S304, each playback traffic data of the current slice data set is imported into a preset message queue, and the number of playback traffic data of the current slice data set is stored in a preset cache, thereby triggering step S305.
[0113] Step S305: For each playback execution component, extract the earliest imported playback traffic data from the preset message queue, play it back to the system under test, and record the playback result, thereby triggering step S306.
[0114] Step S306: For each playback execution component, the playback result is parsed and it is determined whether the playback result carries a playback completion tag. If so, step S308 is triggered. If not, step S307 is triggered.
[0115] Step S307: For each playback execution component, the playback traffic data extracted from the preset message queue is recorded into a preset error data list, and step S308 is triggered.
[0116] Step S308: For each playback execution component, the number in the preset buffer is updated, and step S309 is triggered.
[0117] Step S309 , for each playback execution component: determine whether the updated number is equal to 0; if not, return to step S305 ; if so, trigger step S310 .
[0118] Step S310: Generate a notification indicating that the current slice data has been tested, and return to step S302.
[0119] It should be noted that in actual application scenarios, since the value range of the number in the preset cache includes 0 and any positive integer, and in step S308 shown in Figure 3, each update essentially deducts 1 from the original number. Therefore, for step S310 shown in Figure 3, only one playback execution component will execute this step.
[0120] Step S311, ending the traffic replay test of the current system under test.
[0121] It should be noted that, in actual application scenarios, step S301 shown in FIG3 is an optional embodiment of step S101 shown in FIG1 , and steps S302 to S305 shown in FIG3 are optional embodiments of step S102 shown in FIG1 .
[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0123] The names of the messages or information exchanged between the multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not intended to limit the scope of these messages or information.
[0124] Corresponding to the above method embodiment, the present disclosure further provides a system for traffic replay testing, as shown in FIG4 , the system for traffic replay testing includes:
[0125] Slicing module 401, used to obtain an original playback traffic data set, and slice the original playback traffic data set based on the obtained slice time granularity to obtain multiple slice data sets, each of which includes multiple playback traffic data;
[0126] The testing module 402 is configured to determine each slice data set as the current slice data set in sequence according to the slice order priority of each slice data set, and perform the following processing on the current slice data set:
[0127] Import the playback traffic data of the current slice data set into the preset message queue;
[0128] After all playback traffic data in the current slice data set are imported into the preset message queue, playback processing is performed concurrently through multiple playback execution components.
[0129] The process of each playback execution component performing playback processing includes:
[0130] According to the import order of each playback traffic data in the preset message queue, the playback traffic data is extracted from the preset message queue and replayed to the system under test, and the playback results are recorded. Among them, the playback traffic data extracted by each playback execution component from the preset message queue are the earliest imported playback traffic data in the preset message queue at the extraction time.
[0131] Optionally, before the test module 402 performs playback processing concurrently through multiple playback components, the test module 402 is further configured to:
[0132] The number of playback traffic data in the current slice data stored in the preset cache;
[0133] The following processing also includes:
[0134] After each playback execution component performs a playback process, the quantity in the preset cache is updated based on the playback result;
[0135] The process of each playback execution component performing playback processing also includes:
[0136] Determine whether the updated number in the preset cache is equal to 0. If not, execute the following steps: extract the playback traffic data from the preset message queue and play it back to the system under test according to the import order of each playback traffic data in the preset message queue, and record the playback result;
[0137] If the updated number in the preset cache is equal to 0, it is determined that the current slice data has been tested, wherein the value range of the number includes zero and any positive integer.
[0138] Optionally, the slicing module 401 is configured to:
[0139] In response to the traffic replay test request, obtaining the original replayed traffic data set from a preset database according to the data set number in the traffic replay test request;
[0140] According to the slicing time granularity in the traffic replay test request, the preset slicing script is called to slice the original replay traffic data set to obtain multiple slice data sets, where the total recording time of each replay traffic data in each slice data set is not greater than the time granularity of the slice time.
[0141] Optionally, after each playback execution component performs a playback process, the test module 402 is set to update the quantity in the preset cache based on the playback result:
[0142] After each playback execution component performs a playback process, the playback results are parsed;
[0143] Based on the parsing result, determine whether the playback result carries a playback completion tag. If so, update the quantity in the preset cache based on the playback result;
[0144] When the playback result does not carry a playback completion tag, the playback traffic data record is extracted from the preset message queue and put into the preset error data list, and the quantity in the preset cache is updated based on the playback result.
[0145] The present disclosure also provides a device for traffic playback testing, as shown in FIG5 , which includes:
[0146] Processor 501;
[0147] a memory 502 for storing instructions executable by the processor 501;
[0148] The processor 501 is configured to execute instructions to implement any of the above-mentioned traffic replay test methods.
[0149] An embodiment of the present disclosure also provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by the processor of the device for traffic replay testing, the device for traffic replay testing can perform any of the traffic replay testing methods described above.
[0150] The present application is described with reference to the flow chart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.
[0151] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interfaces, network interfaces, etc. The traffic replay test method disclosed herein can be executed in a processing device (such as a server) in a network system. FIG6 is a system diagram of an optional embodiment of the present disclosure containing a server that executes the traffic replay test method. The system may contain network device A and network device B connected via a wired network, and may also contain base stations, mobile terminals, etc. connected via a wireless network. The server can obtain the original replayed traffic data set from the wired network or wireless network through its interface, and can also obtain the slice time granularity from the wired network or wireless network, and then execute the traffic replay test method. It should be noted that the network and devices in FIG6 are schematic and are not limited to the system of FIG6. Any processor, server, etc. that can execute the method disclosed herein may be applicable to the present invention.
[0152] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip. Memory is an example of a computer-readable medium.
[0153] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0154] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0155] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0156] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
[0157] Although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0158] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
Claims
1. A method for traffic playback testing, characterized in that: The method comprises: Obtaining an original playback traffic data set, and slicing the original playback traffic data set based on the obtained slicing time granularity to obtain a plurality of slice data sets, wherein the slice data sets include a plurality of playback traffic data; According to the slicing sequence priority of each slicing data set, each slicing data set is determined as the current slicing data set in turn, and the following processing is performed on the current slicing data set: Importing each of the playback traffic data of the current slice data set into a preset message queue; After all the playback traffic data in the current slice data set are imported into the preset message queue, playback processing is performed concurrently through multiple playback execution components. The process of each playback execution component executing the playback processing includes: According to the import order of each playback traffic data in the preset message queue, the playback traffic data is extracted from the preset message queue and played back to the system under test, and the playback results are recorded, wherein the playback traffic data extracted from the preset message queue by each playback execution component are the earliest imported playback traffic data in the preset message queue at the extraction time.
2. The method according to claim 1, characterized in that Before the playback process is performed concurrently by multiple playback components, the method further includes: Storing the amount of the playback traffic data in the current slice data in a preset cache; The following processing also includes: After each of the playback execution components performs the playback process once, updating the quantity in the preset buffer based on the playback result; The process of each playback execution component performing the playback processing further includes: Determine whether the updated number in the preset cache is equal to 0. If not, execute the steps of: extracting the playback traffic data from the preset message queue and playing it back to the system under test according to the import order of each playback traffic data in the preset message queue, and recording the playback result; If the updated number in the preset cache is equal to 0, it is determined that the current slice data has been tested, wherein the value range of the number includes zero and any positive integer.
3. The method according to claim 1, characterized in that The obtaining of the original playback traffic data set, and slicing the original playback traffic data set based on the obtained slicing time granularity to obtain a plurality of slice data sets, includes: In response to the traffic replay test request, obtaining the original replayed traffic data set from a preset database according to the data set number in the traffic replay test request; According to the slicing time granularity in the traffic playback test request, call the preset slicing script to perform the slicing processing on the original playback traffic data set to obtain multiple sliced data sets, wherein the total recording duration of each playback traffic data in each sliced data set is not greater than the duration of the slicing time granularity.
4. The method according to claim 2, characterized in that: After each playback execution component performs the playback process once, updating the quantity in the preset cache based on the playback result includes: After each of the playback execution components executes the playback process once, parsing the playback result; Determine whether the playback result carries a playback completion tag based on the analysis result, and if so, update the quantity in the preset cache based on the playback result; When the playback result does not carry the playback completion tag, the playback traffic data is extracted from the preset message queue and recorded in a preset error data list, and the quantity in the preset cache is updated based on the playback result.
5. A system for traffic playback testing, characterized in that: The system comprises: A slicing module, used to obtain an original playback traffic data set, and slice the original playback traffic data set based on the obtained slice time granularity to obtain multiple slice data sets, wherein the slice data sets include multiple playback traffic data; The testing module is used to determine each of the slice data sets as the current slice data set in turn according to the slice order priority of each of the slice data sets, and perform the following processing on the current slice data set: Importing each of the playback traffic data of the current slice data set into a preset message queue; After all the playback traffic data in the current slice data set are imported into the preset message queue, playback processing is performed concurrently through multiple playback execution components. The process of each playback execution component executing the playback processing includes: According to the import order of each playback traffic data in the preset message queue, the playback traffic data is extracted from the preset message queue and played back to the system under test, and the playback results are recorded, wherein the playback traffic data extracted from the preset message queue by each playback execution component are the earliest imported playback traffic data in the preset message queue at the extraction time.
6. The system according to claim 5, characterized in that Before the test module performs playback processing concurrently through multiple playback components, the test module is further configured to: Storing the amount of the playback traffic data in the current slice data in a preset cache; The following processing also includes: After each of the playback execution components performs the playback process once, updating the quantity in the preset buffer based on the playback result; The process of each playback execution component performing the playback processing further includes: Determine whether the updated number in the preset cache is equal to 0. If not, execute the steps of: extracting the playback traffic data from the preset message queue and playing it back to the system under test according to the import order of each playback traffic data in the preset message queue, and recording the playback result; If the updated number in the preset cache is equal to 0, it is determined that the current slice data has been tested, wherein the value range of the number includes zero and any positive integer.
7. The system according to claim 5, characterized in that The slicing module is set up as: In response to the traffic replay test request, obtaining the original replayed traffic data set from a preset database according to the data set number in the traffic replay test request; According to the slicing time granularity in the traffic playback test request, call the preset slicing script to perform the slicing processing on the original playback traffic data set to obtain multiple sliced data sets, wherein the total recording duration of each playback traffic data in each sliced data set is not greater than the duration of the slicing time granularity.
8. The system according to claim 6, characterized in that The test module is set to update the quantity in the preset buffer based on the playback result after each playback execution component performs the playback process once: After each of the playback execution components executes the playback process once, parsing the playback result; Determine whether the playback result carries a playback completion tag based on the analysis result, and if so, update the quantity in the preset cache based on the playback result; When the playback result does not carry the playback completion tag, the playback traffic data is extracted from the preset message queue and recorded in a preset error data list, and the quantity in the preset cache is updated based on the playback result.
9. A device for flow playback testing, characterized in that: The device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method for traffic replay testing as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of a traffic replay test device, the traffic replay test device is enabled to perform the traffic replay test method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method for quickly positioning parallel storage high speed network flow
CN103259737A
Network background generation system and network background generation method based on multi-node traffic playback
CN108900360A
Database flow playback method and system
CN116089403A
Flow playback test method, system and device and storage medium
CN117651008A
Regression testing for web applications
US20230185701A1