Traffic replay testing method, system and device, and storage medium
By using plug-in management components and format conversion plug-ins in traffic playback tests, concurrent format conversion of initial playback traffic data is solved, and the problem of inefficient manual conversion of packet formats in the existing technology is solved, automatic conversion is realized, and testing efficiency is improved.
Patent Information
- Application Number
- PCT/CN2024/136146
- 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
When performing traffic playback test, since the message data of the host system is in an unstructured string format, and the message data of the open system is in a structured JSON format, it is necessary to manually convert the message format one by one, which is inefficient.
The plug-in management component performs concurrent format conversion processing on multiple data in the initial playback traffic dataset. The format conversion plug-in is used to automatically complete the data format conversion and playback the converted data to the system under test.
The automated format conversion process is realized, which improves the efficiency of traffic playback testing and reduces the risk of manual intervention and errors.
Smart Images

Figure CN2024136146_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] In order to reduce the complexity and cost of the civil aviation Passenger Service System (PSS) during business expansion, it has become a trend to replace the host system currently used by the PSS system with an open system.
[0003] Since the PSS system often faces high concurrency and network congestion scenarios, in order to ensure the operational reliability of the open system after functional migration, a traffic replay test can be used to test the open system. However, since the message data of the original host system is usually in an unstructured string format, the message data of the open system is in a structured JSON format. In addition, the host system works based on an instruction set, which involves a large number of message formats for different services. This requires that before conducting a traffic replay test, the message format of the host system needs to be converted one by one into a format that can be recognized by the corresponding interface of the open system. Since the message formats involved in the large number of interfaces of the open system are also different, they need to be converted one by one manually. Once the test fails due to missing interfaces, they also need to be manually checked one by one, which reduces the test efficiency. 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 achieve the disclosed purpose of improving 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 identifier of an initial playback traffic data set, a name of a tested system, an address of a tested system, and a name of at least one tested interface, and obtaining the initial playback traffic data set according to the identifier, wherein the initial playback traffic data set includes a plurality of initial playback traffic data, wherein the name of the tested interface corresponds to the name of the tested system, the identifier corresponds to the name of the tested system, and the initial playback traffic data corresponds to the name of the tested interface;
[0007] Perform concurrent format conversion processing on multiple pieces of the initial playback traffic data set through the plug-in management component,
[0008] The process of performing the format conversion process on each of the initial playback traffic data includes:
[0009] Determine whether the plug-in management component has a format conversion plug-in corresponding to the measured system name corresponding to the initial playback traffic data; if so, determine whether the format conversion plug-in stores a format conversion method corresponding to the target measured interface name, where the target measured interface name is the measured interface name corresponding to the initial playback traffic data;
[0010] In the case where the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, the format conversion method of the format conversion plug-in is called to perform format conversion on the initial playback traffic data. If the conversion is successful, the playback traffic data is obtained, and the playback traffic data is played back to the system under test according to the address of the system under test, and the playback result is recorded.
[0011] Optionally, the process of performing the format conversion process on each of the initial playback traffic data further includes:
[0012] If the plug-in management component does not have a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data, obtaining a first format definition document corresponding to the identifier, and obtaining a second format definition document and an initial plug-in template corresponding to the name of the system under test respectively;
[0013] Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in;
[0014] Setting the name of the system under test as the unique identifier of the initial format conversion plug-in, initializing the version number of the initial format conversion plug-in, and obtaining a format conversion plug-in corresponding to the name of the system under test;
[0015] The format conversion plug-in is added to the plug-in management component and its state is set to be loaded and enabled, and then the step of determining whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
[0016] Optionally, the process of performing the format conversion process on each of the initial playback traffic data further includes:
[0017] If the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, obtaining a first format definition document corresponding to the identifier, obtaining a second format definition document and an initial plug-in template corresponding to the names of the systems under test, and obtaining a version number of the format conversion plug-in;
[0018] Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in;
[0019] Setting the name of the system under test as the unique identifier of the initial format conversion plug-in, updating the version number of the initial format conversion plug-in based on the version number, and obtaining the format conversion plug-in with the updated name of the system under test;
[0020] Using the updated format conversion plug-in, the format conversion plug-in corresponding to the name of the system under test in the plug-in management component is overwritten and updated, the status of the updated format conversion plug-in is set to loaded and enabled, and then the step is executed: determine whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
[0021] Optionally, the method further includes:
[0022] In the case of conversion failure, the initial playback traffic data, the name of the system under test, the name of the interface under test, and the address of the system under test are correspondingly stored in a preset error information table.
[0023] A system for traffic playback testing, the system comprising:
[0024] a data acquisition module, configured to obtain an identifier of an initial playback traffic data set, a name of a tested system, an address of a tested system, and a name of at least one tested interface, and obtain the initial playback traffic data set according to the identifier, wherein the initial playback traffic data set includes a plurality of initial playback traffic data, wherein the name of the tested interface corresponds to the name of the tested system, the identifier corresponds to the name of the tested system, and the initial playback traffic data corresponds to the name of the tested interface;
[0025] A test module is used to perform concurrent format conversion processing on multiple initial playback traffic data sets through a plug-in management component,
[0026] The process of performing the format conversion process on each of the initial playback traffic data includes:
[0027] Determine whether the plug-in management component has a format conversion plug-in corresponding to the measured system name corresponding to the initial playback traffic data; if so, determine whether the format conversion plug-in stores a format conversion method corresponding to the target measured interface name, where the target measured interface name is the measured interface name corresponding to the initial playback traffic data;
[0028] In the case where the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, the format conversion method of the format conversion plug-in is called to perform format conversion on the initial playback traffic data. If the conversion is successful, the playback traffic data is obtained, and the playback traffic data is played back to the system under test according to the address of the system under test, and the playback result is recorded.
[0029] Optionally, when the test module performs the format conversion process on each of the initial playback traffic data, it is further configured to:
[0030] If the plug-in management component does not have a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data, obtaining a first format definition document corresponding to the identifier, and obtaining a second format definition document and an initial plug-in template corresponding to the name of the system under test respectively;
[0031] Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in;
[0032] Setting the name of the system under test as the unique identifier of the initial format conversion plug-in, initializing the version number of the initial format conversion plug-in, and obtaining a format conversion plug-in corresponding to the name of the system under test;
[0033] The format conversion plug-in is added to the plug-in management component and its state is set to be loaded and enabled, and then the step of determining whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
[0034] Optionally, when the test module performs the format conversion process on each of the initial playback traffic data, it is further configured to:
[0035] If the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, obtaining a first format definition document corresponding to the identifier, obtaining a second format definition document and an initial plug-in template corresponding to the names of the systems under test, and obtaining a version number of the format conversion plug-in;
[0036] Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in;
[0037] Setting the name of the system under test as the unique identifier of the initial format conversion plug-in, updating the version number of the initial format conversion plug-in based on the version number, and obtaining the format conversion plug-in with the updated name of the system under test;
[0038] Using the updated format conversion plug-in, the format conversion plug-in corresponding to the name of the system under test in the plug-in management component is overwritten and updated, the status of the updated format conversion plug-in is set to loaded and enabled, and then the step is executed: determine whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
[0039] Optionally, the test module is further configured to:
[0040] In the case of conversion failure, the initial playback traffic data, the name of the system under test, the name of the interface under test, and the address of the system under test are correspondingly stored in a preset error information table.
[0041] A device for traffic playback testing, comprising:
[0042] processor;
[0043] a memory for storing instructions executable by the processor;
[0044] The processor is configured to execute the instructions to implement any of the traffic replay test methods described above.
[0045] 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.
[0046] The embodiment of the present disclosure provides a method, system, device and storage medium for traffic replay testing. By configuring the name of the tested interface, the name of the tested system, the identifier of the initial replay traffic data set, and the corresponding relationship between the initial replay traffic data, the automatic execution and calling of subsequent steps can be realized, so that the present disclosure shortens the data preparation time compared with the existing manual search method. At the same time, by configuring the plug-in management component to perform concurrent format conversion processing on multiple initial replay traffic data, the present disclosure avoids the risk of reduced efficiency of the traffic replay test due to a single conversion time being too long or conversion failure compared with the manual one-by-one conversion method of the prior art. Finally, by configuring the format conversion plug-in and the format conversion method, the format conversion of the initial replay traffic data is realized, so that the present disclosure realizes automatic conversion compared with the existing manual format conversion method, improves the format conversion efficiency, and thus improves the efficiency of the traffic replay test. It can be seen that the present disclosure improves the efficiency of the traffic replay test.
[0047] 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
[0048] 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.
[0049] FIG1 is a flow chart of a method for traffic replay testing provided by an embodiment of the present disclosure;
[0050] FIG2 is a signaling diagram for obtaining an initial playback traffic data set provided by an optional embodiment of the present disclosure;
[0051] FIG3 is a flow chart of a method for traffic replay testing provided by another optional embodiment of the present disclosure;
[0052] FIG4 is a block diagram of a system for traffic replay testing provided by an embodiment of the present disclosure;
[0053] FIG5 is a block diagram of a device for traffic replay testing provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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".
[0058] The present disclosure provides a method for traffic replay testing, as shown in FIG1 , which includes:
[0059] S101. Obtain an identifier of an initial playback traffic data set, a name of a tested system, an address of a tested system, and a name of at least one tested interface, and obtain an initial playback traffic data set based on the identifier. The initial playback traffic data set includes multiple pieces of initial playback traffic data, wherein the name of the tested interface corresponds to the name of the tested system, the identifier corresponds to the name of the tested system, and the initial playback traffic data corresponds to the name of the tested interface.
[0060] It should be noted that, in actual application scenarios, there may be multiple implementations of step S101 shown in FIG1 , and an exemplary implementation is provided here:
[0061] Figure 2 shows the signaling diagram for obtaining the initial playback traffic data set. The components involved in this process may include the human-computer interface, the traffic data management component, and the preset database. The specific steps are as follows:
[0062] In step S201, the traffic data management component sends a display information acquisition request to a preset database, and triggers step S202.
[0063] It should be noted that in actual application scenarios, there are various ways to construct the preset database for storing the initial playback traffic data sets, such as based on a relational database management system (MySQL), a relational database system (SqlServer), a remote dictionary service (Redis), etc. This disclosure does not impose any restrictions on the specific type of the preset database.
[0064] In step S202, the preset database sends the display information to the human-computer interaction interface in response to the display information acquisition request, and triggers step S203.
[0065] In step S203, the human-computer interaction interface displays the display information and records the user's selection operation result, thereby triggering step S204.
[0066] In step S204, the human-computer interaction interface sends the selection operation result to the traffic data management component, and triggers step S205.
[0067] In step S205, the traffic management component parses the selection result to obtain the identifier of the initial playback traffic dataset, the name of the system under test, the address of the system under test, and the name of at least one interface under test. Based on the identifier of the initial playback traffic dataset, the traffic management component generates a dataset load request, triggering step S206.
[0068] It should be noted that in actual application scenarios, the name of the system under test can correspond to at least one name of the interface under test, and the name of the interface under test can correspond to multiple pieces of initial playback traffic data. This correspondence can be established based on the text extraction results of the development documents of the system under test and the source system, and stored in a preset database.
[0069] In step S206, the traffic management component sends a data set loading request to the preset database, and triggers step S207.
[0070] In step S207, the preset database responds to the dataset loading request and searches for the corresponding initial playback traffic dataset according to the identifier, and triggers step S208.
[0071] In step S208, the preset database sends the initial playback traffic data set to the traffic management component, and triggers step S209.
[0072] Step S209: The traffic management component stores the initial playback traffic data set.
[0073] It should be noted that in actual application scenarios, the host system works based on an instruction set, and the number of message formats involved is huge, and each corresponds to a different interface in the open system. This requires testers to search and determine the correspondence between instructions and interfaces one by one based on the development documents of both systems, so as to perform subsequent format conversion and traffic playback testing. By configuring the above correspondence and obtaining an initial playback traffic data set, the present disclosure realizes the automated execution and calling of subsequent steps. Compared with the existing manual search method, the present disclosure shortens data preparation time and improves the efficiency of traffic playback testing.
[0074] S102, performing concurrent format conversion processing on multiple initial playback traffic data in the initial playback traffic data set through the plug-in management component,
[0075] The process of performing format conversion processing on each initial playback traffic data includes:
[0076] Determine whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data. If so, determine whether the format conversion plug-in stores a format conversion method corresponding to the target interface under test name, and the target interface under test name is the name of the interface under test corresponding to the initial playback traffic data.
[0077] It should be noted that, in actual application scenarios, the above-mentioned plug-in management component can be built based on PF4J. The above-mentioned PF4J is a lightweight Java plug-in framework, which can realize the dynamic loading, execution and unloading of plug-ins, and provide a channel for application expansion for third parties. The present disclosure configures the above-mentioned plug-in management component to perform concurrent format conversion processing on multiple initial playback traffic data, so that compared with the manual one-by-one conversion method of the prior art, the present disclosure avoids the risk of reduced efficiency of traffic playback testing due to a single conversion time being too long or conversion failure. At the same time, based on the above-mentioned PF4J, plug-ins with different task functions can be compatible, which improves the adaptability and scalability to different systems.
[0078] Optionally, in an optional embodiment of the present disclosure, since the above-mentioned plug-in management component can simultaneously load multiple format conversion plug-ins corresponding to the names of multiple systems under test, this makes it possible to perform traffic replay testing on a new set of systems under test without reconstructing the entire process. It is only necessary to replace the corresponding format conversion plug-in to implement traffic replay testing on the new system under test, thereby improving test efficiency.
[0079] It should be noted that in actual application scenarios, the above-mentioned format conversion plug-in can be obtained by encapsulating and compiling the format conversion method built based on the type conversion function (Convert). The above-mentioned type conversion function can realize the conversion of data types. The present disclosure realizes the format conversion of the initial playback traffic data by configuring the above-mentioned format conversion plug-in and format conversion method. Compared with the existing manual format conversion method, the present disclosure realizes automatic conversion, improves the format conversion efficiency, and thus improves the efficiency of traffic playback testing.
[0080] It should be noted that in actual application scenarios, when performing format conversion processing on each initial playback traffic data, the name of the tested system, the address of the tested system and the name of the tested interface corresponding to the initial playback traffic data can be packaged together with the initial playback traffic data, and format conversion processing can be performed based on the packaged data, thereby reducing the interference of adjacent data when the format conversion processing is performed concurrently.
[0081] It should be noted that, in actual application scenarios, the above-mentioned method of determining whether the format conversion plug-in stores a format conversion method corresponding to the target interface under test name can be implemented by, when constructing the format conversion plug-in, performing point tracking processing on the interface under test name recorded in the format conversion method, so that the point tracking responds to the triggering of the above-mentioned judgment process. The present disclosure does not make many restrictions or elaborate on the specific process of the above-mentioned point tracking processing.
[0082] When the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, the format conversion method of the format conversion plug-in is called to perform format conversion on the initial playback traffic data. If the conversion is successful, the playback traffic data is obtained, and the playback traffic data is played back to the system under test according to the address of the system under test, and the playback results are recorded.
[0083] The present disclosure realizes the automatic execution and calling of subsequent steps by configuring the name of the interface under test, the name of the system under test, the identifier of the initial playback traffic data set, and the corresponding relationship between the initial playback traffic data, so that the present disclosure shortens the data preparation time compared to the existing manual search method. At the same time, by configuring the plug-in management component to perform concurrent format conversion processing on multiple initial playback traffic data, the present disclosure avoids the risk of reduced efficiency of the traffic replay test due to a single conversion time being too long or conversion failure compared to the manual one-by-one conversion method of the prior art. Finally, by configuring the format conversion plug-in and the format conversion method, the format conversion of the initial playback traffic data is realized, so that the present disclosure realizes automatic conversion compared to the existing manual format conversion method, improves the format conversion efficiency, and thus improves the efficiency of the traffic replay test. It can be seen that the present disclosure improves the efficiency of the traffic replay test.
[0084] Optionally, the process of performing format conversion processing on each initial playback traffic data further includes:
[0085] If the plug-in management component does not have a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data, obtain a first format definition document corresponding to the identifier, and obtain a second format definition document and an initial plug-in template corresponding to the name of the system under test respectively;
[0086] Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in;
[0087] The name of the system under test is set as the unique identifier of the initial format conversion plug-in, the version number of the initial format conversion plug-in is initialized, and the format conversion plug-in corresponding to the name of the system under test is obtained;
[0088] Add the format conversion plug-in to the plug-in management component and set its state to be loaded and enabled, and then perform the step of determining whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
[0089] It should be noted that, in actual application scenarios, the above-mentioned first format definition document and the above-mentioned second format definition document can be development text documents of the host system and the open system, which are documents obtained after character parsing. Since the development text document stores the definition information of each interface of the system, as well as the parsed text of each message format. By importing the parsed first format definition document and the above-mentioned second format definition document into the initial plug-in template, the initial plug-in template can recognize the message format of the host system stored in the first format definition document, as well as the message format recognizable by the tested interface recorded in the second format definition document, and perform format conversion based on the preset configuration of the initial plug-in template.
[0090] Those skilled in the art will appreciate that, in practical application scenarios, there are various ways to obtain the first format definition document and the second format definition document, such as by parsing the development text document using a statistical method algorithm (term frequency-inverse document frequency, TF-IDF), a text summarization algorithm (TextRank), a named entity recognition (NER), or other algorithms. The present disclosure does not elaborate on the specific construction process of the above-mentioned algorithms.
[0091] Those skilled in the art will appreciate that, in actual application scenarios, the above-mentioned automatic compilation can be implemented by configuring an automated compilation tool. There are many types of such automated compilation tools, such as SCons, CMake, Autotools, Maven, Gradle, Apache Ant, etc. The specific configuration process of the above-mentioned automated compilation tools is not limited or elaborated in detail in this disclosure.
[0092] This disclosure implements automatic activation of the format conversion plug-in by configuring the automatic generation process of the aforementioned format conversion plug-in and leveraging the extensible nature of plug-ins built on the PF4J framework. This allows for automatic generation of a plug-in to perform format conversion when format conversion fails, eliminating the need for manual intervention. This fully automates traffic playback testing and improves test efficiency. It also enhances the platform's scalability and enables flexible adaptation to diverse systems.
[0093] Optionally, the process of performing format conversion processing on each initial playback traffic data further includes:
[0094] In the case where the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, obtaining a first format definition document corresponding to the identifier, obtaining a second format definition document and an initial plug-in template corresponding to the names of the systems under test, and obtaining a version number of the format conversion plug-in;
[0095] Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in;
[0096] The name of the system under test is set as the unique identifier of the initial format conversion plug-in, and the version number of the initial format conversion plug-in is updated based on the version number to obtain the format conversion plug-in with the updated name of the system under test;
[0097] Use the updated format conversion plug-in to overwrite and update the format conversion plug-in corresponding to the name of the system under test in the plug-in management component, set the status of the updated format conversion plug-in to load and enable, and then execute the steps: determine whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
[0098] It should be noted that in actual application scenarios, since the open system used for traffic playback testing has not yet been put into actual use, there is a real possibility of redefining or changing the open system interface. Therefore, this disclosure configures a version number for the format conversion plug-in and updates the plug-in in the plug-in management component based on this configuration version number, thereby avoiding the risk of format conversion errors caused by the coexistence of two versions of the plug-in management component, which in turn leads to test failure or reduced test efficiency.
[0099] Optionally, the method further includes:
[0100] In the event of a conversion failure, the initial playback traffic data, the name of the system under test, the name of the interface under test, and the address of the system under test are correspondingly stored in a preset error information table.
[0101] It should be noted that in actual application scenarios, occasional reasons such as automatic compilation tool configuration errors, development document editing errors, system delays, etc. may cause conversion failure. Therefore, in order to facilitate testers to accurately locate the fault point, in the event of conversion failure, the initial playback traffic data, the name of the system under test, the name of the interface under test, and the address of the system under test can be stored in the preset error information table, so that testers can conduct corresponding troubleshooting and corrections based on the above information.
[0102] To facilitate understanding of the traffic replay test method shown in FIG1 , an optional embodiment of the present disclosure is provided for explanation.
[0103] FIG3 is a flow chart of a method for traffic replay testing provided by an optional embodiment of the present disclosure. The specific steps are as follows:
[0104] Step S301: Obtain the identifier of the initial playback traffic data set, the name of the system under test, the address of the system under test, and the name of at least one interface under test, and load the initial playback traffic data set according to the identifier of the initial playback traffic data set, thereby triggering step S302.
[0105] Step S302: Determine whether the initial playback traffic data set is empty. If not, step S303 is triggered. If yes, the test ends.
[0106] Optionally, in an optional embodiment of the present disclosure, if step S302 is performed for the first time after step S301 is completed, and if the initial playback traffic data set is empty, indicating a loading error, an alarm indicating a loading error is output at the end of the process.
[0107] Optionally, in another optional embodiment of the present disclosure, if after completing step S301 as shown in FIG3 , step S302 as shown in FIG3 is executed for no less than once, the normal technical process is followed, and a preset error information table is output.
[0108] In step S303, at least one initial playback traffic data in the initial playback traffic data set is determined as current initial playback traffic data, and format conversion processing is concurrently performed based on each data packet containing one current initial playback traffic data, thereby triggering step S304.
[0109] It should be noted that in actual application scenarios, the above-mentioned data packet includes: the current initial playback traffic data, the name of the tested interface corresponding to the current initial playback traffic data, the name of the tested system corresponding to the identifier of the initial playback traffic data set where the current initial playback traffic data is located, and the address of the tested system corresponding to the name of the tested system corresponding to the identifier of the initial playback traffic data set where the current initial playback traffic data is located.
[0110] Step S304: Determine whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the current initial playback traffic data. If yes, step S305 is triggered. If not, step S310 is triggered.
[0111] Step S305: Determine whether the format conversion plug-in stores a format conversion method corresponding to the target interface name. If yes, step S306 is triggered; if not, step S311 is triggered.
[0112] Optionally, in an optional embodiment of the present disclosure, the target measured interface name in step S305 shown in FIG3 is the measured interface name corresponding to the current initial playback traffic data.
[0113] Step S306: Call the format conversion method corresponding to the target tested interface name in the format conversion plug-in to perform format conversion on the current initial playback traffic data, and trigger step S307.
[0114] Step S307: Determine whether the format conversion of the current initial playback traffic data is successful. If yes, step S308 is triggered; if no, step S312 is triggered.
[0115] Step S308: replay the converted playback traffic data to the system under test corresponding to the system under test address corresponding to the current initial playback traffic data, and record the playback result, thereby triggering step S309.
[0116] It should be noted that in actual application scenarios, since the initial playback traffic data set corresponds to multiple initial playback traffic data, and the identifier of the initial playback traffic data set has a corresponding relationship with the name of the system under test, the name of the system under test and the initial playback traffic data in the corresponding initial playback traffic data set also have a corresponding relationship.
[0117] Step S309: Delete the current initial playback traffic data from the initial playback traffic data set, and return to step S302.
[0118] In step S310, based on the identifier in the data packet and the name of the interface under test, the first format definition document, the second format definition document, and the initial plug-in template are obtained. An updated format conversion plug-in is generated based on the obtained data. The format conversion plug-in corresponding to the name of the system under test in the data packet is overwritten and updated in the plug-in management component. The process then returns to step S304.
[0119] In step S311, based on the identifier in the data packet and the name of the interface under test, the first format definition document, the second format definition document, and the initial plug-in template are obtained. Based on the obtained data and the version number of the format conversion plug-in corresponding to the current initial playback traffic, an updated format conversion plug-in is generated. The format conversion plug-in corresponding to the name of the system under test in the data packet, in the plug-in management component, is overwritten and updated. The process then returns to step S305.
[0120] Step S312: Store the data in the data packet containing the current initial playback traffic data into a preset error information table, and then execute step S309.
[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 S309 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] 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:
[0124] The data acquisition module 401 is configured to obtain an identifier of an initial playback traffic data set, a name of a tested system, an address of the tested system, and a name of at least one tested interface, and obtain the initial playback traffic data set according to the identifier, wherein the initial playback traffic data set includes a plurality of initial playback traffic data, wherein the name of the tested interface corresponds to the name of the tested system, the identifier corresponds to the name of the tested system, and the initial playback traffic data corresponds to the name of the tested interface;
[0125] The test module 402 is used to perform concurrent format conversion processing on multiple initial playback traffic data in the initial playback traffic data set through the plug-in management component.
[0126] The process of performing format conversion processing on each initial playback traffic data includes:
[0127] Determine whether the plug-in management component has a format conversion plug-in corresponding to the name of the tested system corresponding to the initial playback traffic data; if so, determine whether the format conversion plug-in stores a format conversion method corresponding to the target tested interface name, where the target tested interface name is the tested interface name corresponding to the initial playback traffic data;
[0128] When the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, the format conversion method of the format conversion plug-in is called to perform format conversion on the initial playback traffic data. If the conversion is successful, the playback traffic data is obtained, and the playback traffic data is played back to the system under test according to the address of the system under test, and the playback results are recorded.
[0129] Optionally, the test module 402 is further configured to perform the format conversion process on each initial playback traffic data:
[0130] If the plug-in management component does not have a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data, obtain a first format definition document corresponding to the identifier, and obtain a second format definition document and an initial plug-in template corresponding to the name of the system under test respectively;
[0131] Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in;
[0132] The name of the system under test is set as the unique identifier of the initial format conversion plug-in, the version number of the initial format conversion plug-in is initialized, and the format conversion plug-in corresponding to the name of the system under test is obtained;
[0133] Add the format conversion plug-in to the plug-in management component and set its state to be loaded and enabled, and then perform the step of determining whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
[0134] Optionally, the test module 402 is further configured to perform the format conversion process on each initial playback traffic data:
[0135] In the case where the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, obtaining a first format definition document corresponding to the identifier, obtaining a second format definition document and an initial plug-in template corresponding to the names of the systems under test, and obtaining a version number of the format conversion plug-in;
[0136] Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in;
[0137] The name of the system under test is set as the unique identifier of the initial format conversion plug-in, and the version number of the initial format conversion plug-in is updated based on the version number to obtain the format conversion plug-in with the updated name of the system under test;
[0138] Use the updated format conversion plug-in to overwrite and update the format conversion plug-in corresponding to the name of the system under test in the plug-in management component, set the status of the updated format conversion plug-in to load and enable, and then execute the steps: determine whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
[0139] Optionally, the test module 402 is further configured to:
[0140] In the event of a conversion failure, the initial playback traffic data, the name of the system under test, the name of the interface under test, and the address of the system under test are correspondingly stored in a preset error information table.
[0141] The modules described in the embodiments of the present disclosure may be implemented in software or hardware. In some cases, the name of a module does not limit the module itself. For example, the first acquisition module may also be described as a "module for acquiring at least two Internet Protocol addresses."
[0142] The present disclosure also provides a device for traffic replay testing, as shown in FIG5 . The device for traffic replay testing includes:
[0143] Processor 501;
[0144] a memory 502 for storing instructions executable by the processor 501;
[0145] The processor 501 is configured to execute instructions to implement any of the above-mentioned traffic replay test methods.
[0146] 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 a device for traffic replay testing, the device for traffic replay testing can perform any of the traffic replay testing methods described above.
[0147] 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.
[0148] It should be noted that the computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The 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 thereof. 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 thereof.
[0149] 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, apparatus, or device. 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. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit 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 of the foregoing.
[0150] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0151] 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.
[0152] 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.
[0153] 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 identifier of an initial playback traffic data set, a name of a tested system, an address of a tested system, and at least one name of a tested interface, and obtaining the initial playback traffic data set according to the identifier, wherein the initial playback traffic data set includes a plurality of initial playback traffic data, wherein the name of the tested interface has a corresponding relationship with the name of the tested system, the identifier has a corresponding relationship with the name of the tested system, and the initial playback traffic data has a corresponding relationship with the name of the tested interface; Perform concurrent format conversion processing on multiple initial playback traffic data in the initial playback traffic data set through a plug-in management component, The process of performing the format conversion process on each of the initial playback traffic data includes: Determine whether the plug-in management component has a format conversion plug-in corresponding to the measured system name corresponding to the initial playback traffic data, and if so, determine whether the format conversion plug-in stores a format conversion method corresponding to the target measured interface name, where the target measured interface name is the measured interface name corresponding to the initial playback traffic data; In the case where the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, the format conversion method of the format conversion plug-in is called to perform format conversion on the initial playback traffic data. If the conversion is successful, the playback traffic data is obtained, and the playback traffic data is played back to the system under test according to the address of the system under test, and the playback result is recorded.
2. The method according to claim 1, characterized in that The process of performing the format conversion process on each of the initial playback traffic data further includes: In the case that the plug-in management component does not have a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data, obtaining a first format definition document corresponding to the identifier, and obtaining a second format definition document and an initial plug-in template respectively corresponding to the name of the system under test; Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in; The name of the system under test is set as the unique identifier of the initial format conversion plug-in, the version number of the initial format conversion plug-in is initialized, and the format conversion plug-in corresponding to the name of the system under test is obtained; The format conversion plug-in is added to the plug-in management component and its state is set to be loaded and enabled, and then the step of determining whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
3. The method according to claim 1, characterized in that The process of performing the format conversion process on each of the initial playback traffic data further includes: In the case where the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, obtaining a first format definition document corresponding to the identifier, obtaining a second format definition document and an initial plug-in template respectively corresponding to the name of the system under test, and obtaining a version number of the format conversion plug-in; Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in; The name of the system under test is set as the unique identifier of the initial format conversion plug-in, and the version number of the initial format conversion plug-in is updated based on the version number to obtain the format conversion plug-in after the name of the system under test is updated; Utilize the updated format conversion plug-in to overwrite and update the format conversion plug-in corresponding to the name of the system under test in the plug-in management component, set the status of the updated format conversion plug-in to load and enable, and then execute the step of determining whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
4. The method according to claim 1, characterized in that: The method further comprises: In the case of conversion failure, the initial playback traffic data, the name of the system under test, the name of the interface under test, and the address of the system under test are correspondingly stored in a preset error information table.
5. A system for traffic playback testing, characterized in that: The system comprises: A data acquisition module, used to obtain an identifier of an initial playback traffic data set, a name of a tested system, an address of a tested system, and a name of at least one tested interface, and obtain the initial playback traffic data set according to the identifier, wherein the initial playback traffic data set includes a plurality of initial playback traffic data, wherein the name of the tested interface has a corresponding relationship with the name of the tested system, the identifier has a corresponding relationship with the name of the tested system, and the initial playback traffic data has a corresponding relationship with the name of the tested interface; A test module is used to perform concurrent format conversion processing on multiple initial playback traffic data sets in the initial playback traffic data set through a plug-in management component, The process of performing the format conversion process on each of the initial playback traffic data includes: Determine whether the plug-in management component has a format conversion plug-in corresponding to the measured system name corresponding to the initial playback traffic data, and if so, determine whether the format conversion plug-in stores a format conversion method corresponding to the target measured interface name, where the target measured interface name is the measured interface name corresponding to the initial playback traffic data; In the case where the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, the format conversion method of the format conversion plug-in is called to perform format conversion on the initial playback traffic data. If the conversion is successful, the playback traffic data is obtained, and the playback traffic data is played back to the system under test according to the address of the system under test, and the playback result is recorded.
6. The system according to claim 5, characterized in that When the test module performs the format conversion process on each of the initial playback traffic data, it is also configured to: In the case that the plug-in management component does not have a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data, obtaining a first format definition document corresponding to the identifier, and obtaining a second format definition document and an initial plug-in template respectively corresponding to the name of the system under test; Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in; The name of the system under test is set as the unique identifier of the initial format conversion plug-in, the version number of the initial format conversion plug-in is initialized, and the format conversion plug-in corresponding to the name of the system under test is obtained; The format conversion plug-in is added to the plug-in management component and its state is set to be loaded and enabled, and then the step of determining whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
7. The system according to claim 5, characterized in that When the test module performs the format conversion process on each of the initial playback traffic data, it is also configured to: In the case where the format conversion plug-in stores a format conversion method corresponding to the name of the interface under test, obtaining a first format definition document corresponding to the identifier, obtaining a second format definition document and an initial plug-in template respectively corresponding to the name of the system under test, and obtaining a version number of the format conversion plug-in; Importing the first format definition document and the second format definition document into the initial plug-in template respectively, and automatically compiling the imported initial plug-in template to obtain an initial format conversion plug-in; The name of the system under test is set as the unique identifier of the initial format conversion plug-in, and the version number of the initial format conversion plug-in is updated based on the version number to obtain the format conversion plug-in after the name of the system under test is updated; Utilize the updated format conversion plug-in to overwrite and update the format conversion plug-in corresponding to the name of the system under test in the plug-in management component, set the status of the updated format conversion plug-in to load and enable, and then execute the step of determining whether the plug-in management component has a format conversion plug-in corresponding to the name of the system under test corresponding to the initial playback traffic data.
8. The system according to claim 5, characterized in that The test module is also configured to: In the case of conversion failure, the initial playback traffic data, the name of the system under test, the name of the interface under test, and the address of the system under test are correspondingly stored in a preset error information table.
9. A device for traffic 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
Flow playback method, device and system
CN111010316A
Program interface testing method and device, computer equipment and storage medium
CN117093481A
Traffic playback test method, system and device, and storage medium
CN117675635A
Data distribution system and data distribution method
US20220350685A1
Testing device, testing method, and testing program
US20230318956A1