CN117651008A - Method, system, device and storage medium for flow playback test - Google Patents

Method, system, device and storage medium for flow playback test Download PDF

Info

Publication number
CN117651008A
CN117651008A CN202311622217.1A CN202311622217A CN117651008A CN 117651008 A CN117651008 A CN 117651008A CN 202311622217 A CN202311622217 A CN 202311622217A CN 117651008 A CN117651008 A CN 117651008A
Authority
CN
China
Prior art keywords
playback
flow data
data set
flow
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311622217.1A
Other languages
Chinese (zh)
Inventor
孙皓
王冠
周祥伟
张如意
苏妹
曾宏霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Travelsky Technology Co Ltd
Original Assignee
China Travelsky Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Travelsky Technology Co Ltd filed Critical China Travelsky Technology Co Ltd
Priority to CN202311622217.1A priority Critical patent/CN117651008A/en
Publication of CN117651008A publication Critical patent/CN117651008A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0888Throughput
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a method, a system, a device and a storage medium for flow playback test, wherein the method comprises the following steps: slicing the original playback flow data set based on the obtained slice time granularity to obtain a plurality of slice data sets, sequentially determining each slice data set as a current slice data set according to the slice sequence priority of each slice data set, and performing the following processing on the current slice data set: the method comprises the steps of importing each playback flow data of a current slice data set into a preset message queue, and carrying out playback processing through a plurality of playback execution components in parallel, wherein the playback processing executed by each playback execution component comprises the following steps: and extracting the playback flow data from the preset message queue according to the import sequence of the playback flow data in the preset message queue, playing back the playback flow data to the tested system, and recording the playback result. The invention improves the testing efficiency of the flow playback test.

Description

Method, system, device and storage medium for flow playback test
Technical Field
The present invention relates to the field of system testing technologies, and in particular, to a method, a system, an apparatus, and a storage medium for flow playback testing.
Background
Traffic playback is a test method for testing a system by recording and replaying network traffic. With the diversification of business development, business scenes in business systems are increased, which also puts new demands on stream playback. In the process of flow recovery, the quantity and quality of the flow directly influence the effect of testing the service system. If the number of the traffic for testing is too small, numerous service scenes in the service system cannot be covered comprehensively, so that the testing effect is poor.
However, the number of playback traffic data streams is increased, and the playback period is prolonged due to the increased number of playback traffic data streams. Meanwhile, as the response time length of the tested system is increased due to the large data volume of the playback flow data, the subsequent playback flow data cannot be used for testing, and the efficiency of the flow playback test is reduced.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a system, a device and a storage medium for flow playback test, so as to improve the efficiency of the flow playback test. The specific technical scheme is as follows:
a method of traffic playback testing, the method comprising:
Obtaining an original playback flow data set, and slicing the original playback flow data set based on the obtained slicing time granularity to obtain a plurality of slice data sets, wherein the slice data sets comprise a plurality of playback flow data;
sequentially determining each slice data set as a current slice data set according to the slice sequence priority of each slice data set, and performing the following processing on the current slice data set:
importing each playback flow data of the current slice data set into a preset message queue;
after each playback flow data in the current slice data set is imported into the preset message queue, a plurality of playback execution components are used for carrying out playback processing in parallel,
each of the playback execution components performs the playback processing including:
and extracting the playback flow data from the preset message queue according to the importing sequence of the playback flow data in the preset message queue, replaying the playback flow data to a tested system, and recording a playback result, wherein the playback flow data extracted from the preset message queue by each playback execution component is the playback flow data imported earliest in the preset message queue at the time of extraction.
Optionally, before the playback processing is performed concurrently by the plurality of playback components, the method further includes:
storing the quantity of the playback flow data in the current slice data in a preset cache;
the following process also includes:
after each playback execution component executes the playback processing once, updating the quantity in the preset cache based on the playback result;
the process of each of the playback execution components executing the playback processing further includes:
judging whether the number updated in the preset cache is equal to 0, if not, executing the steps: extracting playback flow data from the preset message queue according to the importing sequence of the playback flow data in the preset message queue, playing back the playback flow data to a tested system, and recording a playback result;
and if the number updated in the preset cache is equal to 0, determining that the current slice data is tested, wherein the value range of the number comprises zero and any positive integer.
Optionally, the obtaining the original playback flow data set, performing slicing processing on the original playback flow data set based on the obtained slicing time granularity, to obtain a plurality of slice data sets, including:
Responding to a flow playback test request, and obtaining the original playback flow data set from a preset database according to the data set number in the flow playback test request;
and calling a preset slicing script to carry out slicing processing on the original playback flow data set according to the slicing time granularity in the flow playback test request to obtain a plurality of slice data sets, wherein the total recording duration of the playback flow data in each slice data set is not longer than the duration of the slicing time granularity.
Optionally, after each of the playback execution components performs the playback processing once, updating the number in the preset buffer based on the playback result includes:
after each playback execution component executes the playback processing once, analyzing a playback result;
judging whether the playback result carries a playback completion tag or not based on the analysis result, if so, updating the quantity in the preset cache based on the playback result;
and when the playback result does not carry the playback completion tag, extracting the playback flow data from the preset message queue and recording the playback flow data into a preset error data list, and updating the quantity in the preset cache based on the playback result.
A system for flow playback testing, the system comprising:
the slicing module is used for obtaining an original playback flow data set, slicing the original playback flow data set based on the obtained slicing time granularity, and obtaining a plurality of slice data sets, wherein the slice data sets comprise a plurality of playback flow data;
the test module is used for sequentially determining each slice data set as a current slice data set according to the slice sequence priority of each slice data set, and executing the following processing on the current slice data set:
importing each playback flow data of the current slice data set into a preset message queue;
after each playback flow data in the current slice data set is imported into the preset message queue, a plurality of playback execution components are used for carrying out playback processing in parallel,
each of the playback execution components performs the playback processing including:
and extracting the playback flow data from the preset message queue according to the importing sequence of the playback flow data in the preset message queue, replaying the playback flow data to a tested system, and recording a playback result, wherein the playback flow data extracted from the preset message queue by each playback execution component is the playback flow data imported earliest in the preset message queue at the time of extraction.
Optionally, before the concurrently playing back process by the plurality of playback components, the test module is further configured to:
storing the quantity of the playback flow data in the current slice data in a preset cache;
the following process also includes:
after each playback execution component executes the playback processing once, updating the quantity in the preset cache based on the playback result;
the process of each of the playback execution components executing the playback processing further includes:
judging whether the number updated in the preset cache is equal to 0, if not, executing the steps: extracting playback flow data from the preset message queue according to the importing sequence of the playback flow data in the preset message queue, playing back the playback flow data to a tested system, and recording a playback result;
and if the number updated in the preset cache is equal to 0, determining that the current slice data is tested, wherein the value range of the number comprises zero and any positive integer.
Optionally, the slicing module is configured to:
responding to a flow playback test request, and obtaining the original playback flow data set from a preset database according to the data set number in the flow playback test request;
And calling a preset slicing script to carry out slicing processing on the original playback flow data set according to the slicing time granularity in the flow playback test request to obtain a plurality of slice data sets, wherein the total recording duration of the playback flow data in each slice data set is not longer than the duration of the slicing time granularity.
Optionally, after each of the playback execution components performs the playback processing once, the test module is configured to:
after each playback execution component executes the playback processing once, analyzing a playback result;
judging whether the playback result carries a playback completion tag or not based on the analysis result, if so, updating the quantity in the preset cache based on the playback result;
and when the playback result does not carry the playback completion tag, extracting the playback flow data from the preset message queue and recording the playback flow data into a preset error data list, and updating the quantity in the preset cache based on the playback result.
An apparatus for flow playback testing, the apparatus comprising:
A processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a method of flow playback testing as described in any one of the above.
A computer readable storage medium, which when executed by a processor of a traffic playback testing apparatus, causes the traffic playback testing apparatus to perform a method of traffic playback testing as described in any one of the preceding claims.
According to the method, the system, the device and the storage medium for the flow playback test, provided by the embodiment of the invention, the original playback flow data set can be sliced based on the slicing time granularity by configuring the slicing time granularity, so that the number of playback flow data for subsequent tests in each slice data set is reduced, the processing efficiency of the subsequent tests of a single slice data set is improved, and the processing efficiency of the whole flow of the flow playback test is further improved. And by configuring each execution component to perform playback processing concurrently, concurrent playback testing on a plurality of playback flow data in the current slice data set can be realized, so that when single playback flow data playback time is overlong, playback testing of other playback flow data is not affected, the problem of data waiting caused by one-by-one testing is avoided, and the testing efficiency of the flow playback testing is improved. Therefore, the invention improves the testing efficiency of the flow playback test.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of a method for testing flow playback according to an embodiment of the present invention;
FIG. 2 is a flowchart of a single playback execution component updating a number in a preset buffer based on a playback result according to an alternative embodiment of the present invention;
FIG. 3 is a flow chart of a method of flow playback testing provided by another alternative embodiment of the present invention;
FIG. 4 is a block diagram of a system for flow playback testing provided by another alternative embodiment of the present invention;
fig. 5 is a block diagram of an apparatus for flow playback testing according to another alternative embodiment of the present invention.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but 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 illustration purposes only and are not intended to limit the scope of the present disclosure.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is 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"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The embodiment of the invention provides a method for flow playback test, which is shown in fig. 1 and comprises the following steps:
s101, obtaining an original playback flow data set, slicing the original playback flow data set based on the obtained slicing time granularity, and obtaining a plurality of slice data sets, wherein the slice data sets comprise a plurality of playback flow data.
It should be noted that, in an actual application scenario, the playback flow data in the original playback flow data set may be data that records, by using a flow recording tool, the flow of the tested system in a normal operation or an analog operation state, and stores the recorded flow in a preset database. Such flow recording tools include, but are not limited to: universal traffic record playback tool (Sandbox Repeater), network data collection analysis Tool (TCPDUMP), request replication tool (Tcpcopy), configuration network packet analysis software (Wireshark), and protocol debug agent (filer).
It should be noted that, in an actual application scenario, the slice time granularity may be a slice granularity set according to a recording duration of the playback flow data. According to the invention, by configuring the slicing time granularity and slicing the original playback flow data set based on the slicing time granularity, the number of playback flow data used for subsequent tests in each slicing data set is reduced, the processing efficiency of subsequent tests of a single slicing data set is improved, and the processing efficiency of the whole flow playback test flow is further improved.
Alternatively, in another optional embodiment of the present invention, the slice time granularity may be switched to a slice granularity of another dimension according to an actual application scenario, for example, the size of the data size is taken as the slice dimension.
S102, according to the slice sequence priority of each slice data set, determining each slice data set as the current slice data set in turn, and executing the following processing on the current slice data set:
importing each playback flow data of the current slice data set into a preset message queue;
after each playback flow data in the current slice data set is imported into a preset message queue, a plurality of playback execution components are used for carrying out playback processing in parallel,
each playback execution component performs a playback process including:
according to the import sequence of each playback flow data in the preset message queue, extracting the playback flow data from the preset message queue, playing back the playback flow data to the tested system, and recording the playback result, wherein the playback flow data extracted from the preset message queue by each playback execution component is the playback flow data which is imported earliest in the preset message queue at the time of extraction.
It should be noted that, in an actual application scenario, specific types of the preset Message Queue (Message Queue) may be various, for example RocketMQ, rabbitMQ, kafka. The RocketMQ is used as a distributed message middleware, has the advantages of low delay, high concurrency, strict message sequence and the like, and can meet the requirement of high concurrency environment test on a tested system.
It should be noted that, in an actual application scenario, by importing each playback flow data into the preset message queue, the import sequence of the imported data can be automatically given by using the preset message queue, so that a subsequent concurrence process is convenient to realize.
It should be noted that, in an actual application scenario, the playback execution component may be a traffic playback tool deployed under the same cluster.
It should be noted that, by configuring each execution component to perform playback processing concurrently, the invention can implement concurrent playback test on a plurality of playback flow data in the current slice data set, so that when single playback flow data has too long playback time, the playback test of other playback flow data is not affected, the problem of data waiting caused by test is avoided, and the test efficiency of the flow playback test is improved.
It should be noted that, in the actual application scenario, by configuring the playback flow data extracted from the preset message queue by each playback execution component to be the playback flow data that is the earliest to be imported in the preset message queue at the time of extraction, the risk of missing the playback flow data due to the playback flow data that is randomly extracted from the preset message queue by the playback execution component is avoided.
According to the invention, the slicing time granularity is configured, and the original playback flow data set is sliced based on the slicing time granularity, so that the number of playback flow data for subsequent testing in each slicing data set is reduced, the processing efficiency of the subsequent testing of a single slicing data set is improved, and the processing efficiency of the whole flow of the flow playback testing is further improved. And by configuring each execution component to perform playback processing concurrently, concurrent playback testing on a plurality of playback flow data in the current slice data set can be realized, so that when single playback flow data playback time is overlong, playback testing of other playback flow data is not affected, the problem of data waiting caused by one-by-one testing is avoided, and the testing efficiency of the flow playback testing is improved.
Optionally, before the playback processing is performed concurrently by the plurality of playback components, the method shown in fig. 1 further includes:
storing the quantity of playback flow data in the current slice data in a preset cache;
the following processing also comprises:
after each playback execution component executes one playback process, updating the quantity in the preset cache based on the playback result;
The process of each playback execution component executing the playback process further includes:
judging whether the updated quantity in the preset cache is equal to 0, if not, executing the steps: extracting playback flow data from a preset message queue according to the import sequence of each playback flow data in the preset message queue, playing back the playback flow data to a tested system, and recording a playback result;
and if the updated number in the preset cache is equal to 0, determining that the current slice data is tested, wherein the value range of the number comprises zero and any positive integer.
Alternatively, in an alternative embodiment of the present invention, the preset cache may be a database built based on a remote dictionary service (Remote Dictionary Server, dis).
Optionally, in another optional embodiment of the present invention, in a scenario where the playback test of the traffic is performed for different systems at the same time, in order to distinguish the playback traffic data of different systems, for the number, a key value pair may be stored in the preset buffer. For example: it is assumed that the above-described processing is now performed for both the first and second systems simultaneously. Wherein, the number of the A system is B001, and the number of the B system is B002. The nail system was tested using a slice 1 dataset of the nail system, which included 20 playback traffic data. The b system was tested using a slice data set No. 3 of the b system, which included 15 playback traffic data. When the above-described "number of playback flow data in current slice data is stored in the preset buffer", the stored key value pairs are respectively: b001-1:20 B002-3:15.
It should be noted that, in an actual application scenario, the specific embodiments for updating the number in the preset buffer based on the playback result after each playback execution component executes the playback process once are various, and an exemplary embodiment is provided herein:
as shown in fig. 2, a flowchart of updating a number in a preset buffer by a single playback execution component according to an alternative embodiment of the present invention based on a playback result is provided, which specifically includes the following steps:
step S201, extracting single playback flow data from the preset message queue, and playing back the single playback flow data to the tested system. And triggers step S202.
Step S202, receiving a playback result fed back by the tested system. And triggers step S203.
Step S203, deducting is performed on the basis of the number of the current slice data in the preset buffer according to the number of the playback results. And triggers step S204.
Step S204, judging whether the number of the subtracted current slice data is 0. If not, the process returns to step S201. If yes, step S205 is triggered.
In step S205, a notification is generated that characterizes the current slice data has been tested.
Optionally, obtaining an original playback flow data set, slicing the original playback flow data set based on the obtained slicing time granularity, obtaining a plurality of slice data sets, including:
Responding to the flow playback test request, and obtaining an original playback flow data set from a preset database according to the data set number in the flow playback test request;
and calling a preset slice script to carry out slice processing on the original playback flow data set according to the slice time granularity in the flow playback test request to obtain a plurality of slice data sets, wherein the total recording duration of each playback flow data in each slice data set is not longer than the duration of the slice time granularity.
To facilitate an understanding of the above-described process of slicing an original playback flow data set based on an obtained slicing time granularity to obtain a plurality of sliced data sets, an alternative embodiment of the present invention is described herein in particular:
assume that the total recording time of playback flow data in the original playback flow data set is 5 seconds, and 100 pieces of data are contained in total. If the time granularity of the obtained slice is 1 second, five slice data sets are obtained after the slicing.
Optionally, after each playback execution component performs the playback processing once, updating the number in the preset buffer based on the playback result includes:
after each playback execution component executes one playback process, analyzing a playback result;
Judging whether the playback result carries a playback completion tag or not based on the analysis result, if so, updating the quantity in the preset cache based on the playback result;
and when the playback result does not carry the playback completion tag, extracting playback flow data from a preset message queue, recording the playback flow data into a preset error data list, and updating the quantity in a preset cache based on the playback result.
It should be noted that, in an actual application scenario, the playback flow data needs to correspond to different test scenarios, which results in a huge number of playback flow data. In the testing process, playback failure can be caused by imperfect system construction, data errors and other reasons. Therefore, the invention can realize the accurate positioning of the fault point in the test process by configuring the playback execution assembly to analyze the playback result.
It should be noted that, in a practical application scenario, there are various embodiments of a method for testing a flow playback as shown in fig. 1, and an exemplary method is provided herein:
as shown in fig. 3, a flowchart of a method for testing playback of a flow according to an alternative embodiment of the present invention is provided, which specifically includes the following steps:
step S301, in response to the flow playback test request, loading an original playback flow data set according to the data set number in the request, and slicing the original playback flow data set based on the slicing time granularity in the request, to obtain a plurality of slice data sets. And triggers step S302.
Step S302, judging whether each slice data set is tested, if not, triggering step S303, and if so, triggering step S311.
In step S303, the slice data set that has the highest priority and has not been tested is determined as the current slice data set. And triggers step S304.
Step S304, each playback flow data of the current slice data set is imported into a preset message queue, and the number of the playback flow data of the current slice data set is stored into a preset buffer. And triggers step S305.
Step S305, for each playback execution component: and extracting the earliest imported playback flow data from the preset message queue, playing back the playback flow data to the tested system, and recording the playback result. And triggers step S306.
Step S306, for each playback execution component: and analyzing the playback result, judging whether the playback result carries a playback completion label, and if so, triggering step S308. If not, step S307 is triggered.
Step S307, for each playback execution component: recording playback flow data extracted from a preset message queue to a preset error data list. And triggers step S308.
Step S308, for each playback execution component: and updating the quantity in the preset cache. And triggers step S309.
Step S309, for each playback execution component: whether the updated number is equal to 0 is determined, if not, the process returns to step S305, and if yes, step S310 is triggered.
In step S310, a notification is generated that characterizes the current slice data as having been tested. And returns to step S302.
It should be noted that, in the practical application scenario, since the value range of the number in the preset buffer includes 0 and any positive integer, and in step S308 shown in fig. 3, the essence of each update is to deduct 1 from the original number. Thus, for step S310 shown in fig. 3, there is and only one playback execution component will execute the step.
Step S311, the flow playback test of the current tested system is ended.
It should be noted that, in the practical application scenario, the step S301 shown in fig. 3 is an alternative embodiment of the step S101 shown in fig. 1, and the steps S302 to S305 shown in fig. 3 are alternative embodiments of the step S102 shown in fig. 1.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The names of messages or information interacted between the plurality of devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information
Corresponding to the above method embodiment, the present invention further provides a system for flow playback testing, as shown in fig. 4, where the system for flow playback testing includes:
a slicing module 401, configured to obtain an original playback flow data set, perform slicing processing on the original playback flow data set based on the obtained slicing time granularity, and obtain a plurality of slice data sets, where the slice data sets include a plurality of playback flow data;
a test module 402, configured to sequentially determine each slice data set as a current slice data set according to the slice order priority of each slice data set, and perform the following processing on the current slice data set:
importing each playback flow data of the current slice data set into a preset message queue;
after each playback flow data in the current slice data set is imported into a preset message queue, a plurality of playback execution components are used for carrying out playback processing in parallel,
each playback execution component performs a playback process including:
According to the import sequence of each playback flow data in the preset message queue, extracting the playback flow data from the preset message queue, playing back the playback flow data to the tested system, and recording the playback result, wherein the playback flow data extracted from the preset message queue by each playback execution component is the playback flow data which is imported earliest in the preset message queue at the time of extraction.
Optionally, before the playback processing is performed concurrently by the plurality of playback components, the test module 402 is further configured to:
storing the quantity of playback flow data in the current slice data in a preset cache;
the following processing also comprises:
after each playback execution component executes one playback process, updating the quantity in the preset cache based on the playback result;
the process of each playback execution component executing the playback process further includes:
judging whether the updated quantity in the preset cache is equal to 0, if not, executing the steps: extracting playback flow data from a preset message queue according to the import sequence of each playback flow data in the preset message queue, playing back the playback flow data to a tested system, and recording a playback result;
and if the updated number in the preset cache is equal to 0, determining that the current slice data is tested, wherein the value range of the number comprises zero and any positive integer.
Optionally, the slicing module 401 is configured to:
responding to the flow playback test request, and obtaining an original playback flow data set from a preset database according to the data set number in the flow playback test request;
and calling a preset slice script to carry out slice processing on the original playback flow data set according to the slice time granularity in the flow playback test request to obtain a plurality of slice data sets, wherein the total recording duration of each playback flow data in each slice data set is not longer than the duration of the slice time granularity.
Optionally, after each playback execution component performs one playback process, the test module 402 is configured to:
after each playback execution component executes one playback process, analyzing a playback result;
judging whether the playback result carries a playback completion tag or not based on the analysis result, if so, updating the quantity in the preset cache based on the playback result;
and when the playback result does not carry the playback completion tag, extracting playback flow data from a preset message queue, recording the playback flow data into a preset error data list, and updating the quantity in a preset cache based on the playback result.
The embodiment of the invention also provides a device for flow playback test, as shown in fig. 5, the device comprises:
a processor 501;
a memory 502 for storing instructions executable by the processor 501;
wherein the processor 501 is configured to execute instructions to implement a method of traffic playback testing as described above.
The embodiments of the present invention also provide a computer-readable storage medium, which when executed by a processor of an apparatus for flow playback testing, causes the apparatus for flow playback testing to perform a method for flow playback testing as described above.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, the device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip. Memory is an example of a computer-readable medium.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to 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 example forms of implementing the claims.
While several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).

Claims (10)

1. A method of traffic playback testing, the method comprising:
obtaining an original playback flow data set, and slicing the original playback flow data set based on the obtained slicing time granularity to obtain a plurality of slice data sets, wherein the slice data sets comprise a plurality of playback flow data;
sequentially determining each slice data set as a current slice data set according to the slice sequence priority of each slice data set, and performing the following processing on the current slice data set:
importing each playback flow data of the current slice data set into a preset message queue;
after each playback flow data in the current slice data set is imported into the preset message queue, a plurality of playback execution components are used for carrying out playback processing in parallel,
each of the playback execution components performs the playback processing including:
and extracting the playback flow data from the preset message queue according to the importing sequence of the playback flow data in the preset message queue, replaying the playback flow data to a tested system, and recording a playback result, wherein the playback flow data extracted from the preset message queue by each playback execution component is the playback flow data imported earliest in the preset message queue at the time of extraction.
2. The method of claim 1, wherein prior to the concurrently playing back process by the plurality of playback components, the method further comprises:
storing the quantity of the playback flow data in the current slice data in a preset cache;
the following process also includes:
after each playback execution component executes the playback processing once, updating the quantity in the preset cache based on the playback result;
the process of each of the playback execution components executing the playback processing further includes:
judging whether the number updated in the preset cache is equal to 0, if not, executing the steps: extracting playback flow data from the preset message queue according to the importing sequence of the playback flow data in the preset message queue, playing back the playback flow data to a tested system, and recording a playback result;
and if the number updated in the preset cache is equal to 0, determining that the current slice data is tested, wherein the value range of the number comprises zero and any positive integer.
3. The method of claim 1, wherein the obtaining the original playback flow data set, slicing the original playback flow data set based on the obtained slicing time granularity, obtaining a plurality of slice data sets, comprises:
Responding to a flow playback test request, and obtaining the original playback flow data set from a preset database according to the data set number in the flow playback test request;
and calling a preset slicing script to carry out slicing processing on the original playback flow data set according to the slicing time granularity in the flow playback test request to obtain a plurality of slice data sets, wherein the total recording duration of the playback flow data in each slice data set is not longer than the duration of the slicing time granularity.
4. The method of claim 2, wherein updating the number in the preset cache based on the playback result after each of the playback execution components performs the playback processing once comprises:
after each playback execution component executes the playback processing once, analyzing a playback result;
judging whether the playback result carries a playback completion tag or not based on the analysis result, if so, updating the quantity in the preset cache based on the playback result;
and when the playback result does not carry the playback completion tag, extracting the playback flow data from the preset message queue and recording the playback flow data into a preset error data list, and updating the quantity in the preset cache based on the playback result.
5. A system for flow playback testing, the system comprising:
the slicing module is used for obtaining an original playback flow data set, slicing the original playback flow data set based on the obtained slicing time granularity, and obtaining a plurality of slice data sets, wherein the slice data sets comprise a plurality of playback flow data;
the test module is used for sequentially determining each slice data set as a current slice data set according to the slice sequence priority of each slice data set, and executing the following processing on the current slice data set:
importing each playback flow data of the current slice data set into a preset message queue;
after each playback flow data in the current slice data set is imported into the preset message queue, a plurality of playback execution components are used for carrying out playback processing in parallel,
each of the playback execution components performs the playback processing including:
and extracting the playback flow data from the preset message queue according to the importing sequence of the playback flow data in the preset message queue, replaying the playback flow data to a tested system, and recording a playback result, wherein the playback flow data extracted from the preset message queue by each playback execution component is the playback flow data imported earliest in the preset message queue at the time of extraction.
6. The system of claim 5, wherein the test module is further configured to, prior to the concurrently playing back process by the plurality of playback components:
storing the quantity of the playback flow data in the current slice data in a preset cache;
the following process also includes:
after each playback execution component executes the playback processing once, updating the quantity in the preset cache based on the playback result;
the process of each of the playback execution components executing the playback processing further includes:
judging whether the number updated in the preset cache is equal to 0, if not, executing the steps: extracting playback flow data from the preset message queue according to the importing sequence of the playback flow data in the preset message queue, playing back the playback flow data to a tested system, and recording a playback result;
and if the number updated in the preset cache is equal to 0, determining that the current slice data is tested, wherein the value range of the number comprises zero and any positive integer.
7. The system of claim 5, wherein the slicing module is configured to:
Responding to a flow playback test request, and obtaining the original playback flow data set from a preset database according to the data set number in the flow playback test request;
and calling a preset slicing script to carry out slicing processing on the original playback flow data set according to the slicing time granularity in the flow playback test request to obtain a plurality of slice data sets, wherein the total recording duration of the playback flow data in each slice data set is not longer than the duration of the slicing time granularity.
8. The system of claim 6, wherein the test module, after each of the playback execution components performs the playback processing once, is configured to:
after each playback execution component executes the playback processing once, analyzing a playback result;
judging whether the playback result carries a playback completion tag or not based on the analysis result, if so, updating the quantity in the preset cache based on the playback result;
and when the playback result does not carry the playback completion tag, extracting the playback flow data from the preset message queue and recording the playback flow data into a preset error data list, and updating the quantity in the preset cache based on the playback result.
9. An apparatus for flow playback testing, the apparatus comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of flow playback testing of any one of claims 1 to 4.
10. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of a device for a traffic playback test, enable the device for a traffic playback test to perform the method of a traffic playback test as claimed in any one of claims 1 to 4.
CN202311622217.1A 2023-11-30 2023-11-30 Method, system, device and storage medium for flow playback test Pending CN117651008A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311622217.1A CN117651008A (en) 2023-11-30 2023-11-30 Method, system, device and storage medium for flow playback test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311622217.1A CN117651008A (en) 2023-11-30 2023-11-30 Method, system, device and storage medium for flow playback test

Publications (1)

Publication Number Publication Date
CN117651008A true CN117651008A (en) 2024-03-05

Family

ID=90042822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311622217.1A Pending CN117651008A (en) 2023-11-30 2023-11-30 Method, system, device and storage medium for flow playback test

Country Status (1)

Country Link
CN (1) CN117651008A (en)

Similar Documents

Publication Publication Date Title
CN109034993B (en) Account checking method, account checking equipment, account checking system and computer readable storage medium
CN109388556B (en) Method and device for analyzing test process
CN111611100B (en) Transaction fault detection method, device, computing equipment and medium
US11409704B2 (en) Method, device and computer program product for managing storage system
CN113392005B (en) Large file processing test method and system
CN110851471A (en) Distributed log data processing method, device and system
CN109408361A (en) Monkey tests restored method, device, electronic equipment and computer readable storage medium
CN115757150A (en) Production environment testing method, device, equipment and storage medium
CN111464384A (en) Consistency test method and device for asynchronous messages
CN113556480B (en) Vehicle continuous motion video generation method, device, equipment and medium
CN111400117B (en) Method for automatically testing Ceph cluster
CN107544894B (en) Log processing method and device and server
CN111240923A (en) Automatic test method and device for recurring problems of vehicle navigation system and storage medium
CN117651008A (en) Method, system, device and storage medium for flow playback test
CN109658940B (en) Method and system for updating voice recognition resources
CN114500348B (en) CDN gateway testing method and system
CN107342917B (en) Method and apparatus for detecting network device performance
CN113296996B (en) Service request processing method, related device and storage medium
CN112131611B (en) Data correctness verification method, device, equipment, system and storage medium
CN113342632A (en) Simulation data automatic processing method and device, electronic equipment and storage medium
CN115484200B (en) Buried point testing method, buried point testing device, server, storage medium and buried point testing system
CN118041804B (en) Communication equipment networking data detection method and device, electronic equipment and readable medium
CN115629950B (en) Extraction method of performance test asynchronous request processing time point
CN117675635A (en) Method, system, equipment and storage medium for flow playback test
CN113641585A (en) Test data generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination