CN117675635A - Method, system, equipment and storage medium for flow playback test - Google Patents

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

Info

Publication number
CN117675635A
CN117675635A CN202311622403.5A CN202311622403A CN117675635A CN 117675635 A CN117675635 A CN 117675635A CN 202311622403 A CN202311622403 A CN 202311622403A CN 117675635 A CN117675635 A CN 117675635A
Authority
CN
China
Prior art keywords
format conversion
initial
plug
name
flow data
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
CN202311622403.5A
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 CN202311622403.5A priority Critical patent/CN117675635A/en
Publication of CN117675635A publication Critical patent/CN117675635A/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/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a method, a system, equipment and a storage medium for flow playback test, wherein the method comprises the following steps: obtaining an initial playback flow data set, a tested system name, a tested system address and at least one tested interface name, performing concurrent format conversion processing on a plurality of initial playback flow data in the initial playback flow data set through a plugin management component, wherein the process of performing format conversion processing on each initial playback flow data comprises the following steps: judging whether a format conversion plugin corresponding to the tested system name corresponding to the initial playback flow data exists in the plugin management component, if so, judging whether the format conversion plugin stores a format conversion method corresponding to the target tested interface name, if so, calling the format conversion plugin to perform format conversion on the initial playback flow data, playing back the obtained playback flow data to the tested system according to the tested system address, and recording a playback result. The invention improves the efficiency of the flow playback test.

Description

Method, system, equipment 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 testing flow playback.
Background
In order to reduce the complexity and cost of the civil aviation passenger service system (Passenger Service System, PSS) in performing service expansion, it has become a trend to replace the host system employed by the current PSS system with an open system.
Since PSS systems often face high concurrency and network congestion scenarios, in order to ensure operational reliability of an open system through function migration, a traffic replay test may be used to test the open system. However, since the message data of the original host system is usually in unstructured string format, the message data of the open system is in structured JSON format. And the host system is instruction set based, where the number of message formats relating to different services is enormous. This makes it necessary to convert the message format of the host system into a format recognizable by the corresponding interface of the open system one by one before the traffic playback test is performed. The message formats related to the interfaces of the huge number of open systems are also different, so that the conversion needs to be performed manually one by one, and once the test fails due to missing the interfaces, the investigation needs to be performed manually one by one, so that the test efficiency is reduced.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a system, equipment and a storage medium for flow playback test, so as to achieve the aim of improving 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 identifier of an initial playback flow data set, a tested system name, a tested system address and at least one tested interface name, and obtaining the initial playback flow data set according to the identifier, wherein the initial playback flow data set comprises a plurality of pieces of initial playback flow data, the tested interface name has a corresponding relation with the tested system name, the identifier has a corresponding relation with the tested system name, and the initial playback flow data has a corresponding relation with the tested interface name;
concurrent format conversion processing is performed on a plurality of the initial playback flow data in the initial playback flow data set by a plug-in management component,
the process of performing the format conversion process for each of the initial playback flow data includes:
judging whether a format conversion plugin corresponding to a tested system name corresponding to the initial playback flow data exists in a plugin management component, if so, judging whether the format conversion plugin stores a format conversion method corresponding to a target tested interface name, wherein the target tested interface name is the tested interface name corresponding to the initial playback flow data;
And under the condition that the format conversion plug-in stores a format conversion method corresponding to the tested interface name, calling the format conversion method of the format conversion plug-in to perform format conversion on the initial playback flow data, under the condition that the conversion is successful, obtaining the playback flow data, playing back the playback flow data to a tested system according to the tested system address, and recording a playback result.
Optionally, the process of performing the format conversion process on each of the initial playback flow data further includes:
under the condition that the plug-in management component does not have a format conversion plug-in corresponding to the name of the tested system corresponding to the initial playback flow data, a first format definition document corresponding to the identifier is obtained, and a second format definition document and an initial plug-in template respectively corresponding to the name of the tested system are obtained;
respectively importing the first format definition document and the second format definition document into the initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as the unique identifier of the initial format conversion plugin, initializing the version number of the initial format conversion plugin, and obtaining the format conversion plugin corresponding to the name of the tested system;
Adding the format conversion plug-in to a plug-in management component, setting the state of the format conversion plug-in as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
Optionally, the process of performing the format conversion process on each of the initial playback flow data further includes:
under the condition that the format conversion plug-in stores a format conversion method corresponding to the tested interface name, a first format definition document corresponding to the identifier is obtained, a second format definition document and an initial plug-in template corresponding to the tested system name are obtained, and a version number of the format conversion plug-in is obtained;
respectively importing the first format definition document and the second format definition document into the initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as a unique identifier of the initial format conversion plugin, updating the version number of the initial format conversion plugin based on the version number, and obtaining the format conversion plugin after updating the name of the tested system;
And using the updated format conversion plugin to carry out coverage update on the format conversion plugin corresponding to the tested system name in the plugin management component, setting the state of the updated format conversion plugin as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
Optionally, the method further comprises:
and under the condition of conversion failure, correspondingly storing the initial playback flow data, the name of the tested system, the name of the tested interface and the address of the tested system into a preset error information table.
A system for flow playback testing, the system comprising:
the data acquisition module is used for acquiring an identifier of an initial playback flow data set, a tested system name, a tested system address and at least one tested interface name, and acquiring the initial playback flow data set according to the identifier, wherein the initial playback flow data set comprises a plurality of pieces of initial playback flow data, the tested interface name has a corresponding relation with the tested system name, the identifier has a corresponding relation with the tested system name, and the initial playback flow data has a corresponding relation with the tested interface name;
A test module for performing concurrent format conversion processing on a plurality of the initial playback flow data in the initial playback flow data set through a plug-in management component,
the process of performing the format conversion process for each of the initial playback flow data includes:
judging whether a format conversion plugin corresponding to a tested system name corresponding to the initial playback flow data exists in a plugin management component, if so, judging whether the format conversion plugin stores a format conversion method corresponding to a target tested interface name, wherein the target tested interface name is the tested interface name corresponding to the initial playback flow data;
and under the condition that the format conversion plug-in stores a format conversion method corresponding to the tested interface name, calling the format conversion method of the format conversion plug-in to perform format conversion on the initial playback flow data, under the condition that the conversion is successful, obtaining the playback flow data, playing back the playback flow data to a tested system according to the tested system address, and recording a playback result.
Optionally, the test module is further configured to, when performing the format conversion process on each of the initial playback flow data:
Under the condition that the plug-in management component does not have a format conversion plug-in corresponding to the name of the tested system corresponding to the initial playback flow data, a first format definition document corresponding to the identifier is obtained, and a second format definition document and an initial plug-in template respectively corresponding to the name of the tested system are obtained;
respectively importing the first format definition document and the second format definition document into the initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as the unique identifier of the initial format conversion plugin, initializing the version number of the initial format conversion plugin, and obtaining the format conversion plugin corresponding to the name of the tested system;
adding the format conversion plug-in to a plug-in management component, setting the state of the format conversion plug-in as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
Optionally, the test module is further configured to, when performing the format conversion process on each of the initial playback flow data:
Under the condition that the format conversion plug-in stores a format conversion method corresponding to the tested interface name, a first format definition document corresponding to the identifier is obtained, a second format definition document and an initial plug-in template corresponding to the tested system name are obtained, and a version number of the format conversion plug-in is obtained;
respectively importing the first format definition document and the second format definition document into the initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as a unique identifier of the initial format conversion plugin, updating the version number of the initial format conversion plugin based on the version number, and obtaining the format conversion plugin after updating the name of the tested system;
and using the updated format conversion plugin to carry out coverage update on the format conversion plugin corresponding to the tested system name in the plugin management component, setting the state of the updated format conversion plugin as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
Optionally, the test module is further configured to:
and under the condition of conversion failure, correspondingly storing the initial playback flow data, the name of the tested system, the name of the tested interface and the address of the tested system into a preset error information table.
An apparatus for a traffic playback test, 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 device for a traffic playback test, causes the device for a traffic playback test to perform a method of the traffic playback test as described in any one of the preceding claims.
According to the method, the system, the equipment and the storage medium for flow playback testing, provided by the embodiment of the invention, the automatic execution and the call of the subsequent steps can be realized by configuring the corresponding relation among the name of the tested interface, the name of the tested system, the identification of the initial playback flow data set and the initial playback flow data, so that compared with the existing manual searching mode, the method and the device for flow playback testing have the advantage that the data preparation time is shortened. Meanwhile, by configuring the plug-in management component to perform concurrent format conversion processing on a plurality of initial playback flow data, compared with the manual one-by-one conversion mode in the prior art, the method and the device avoid the risk of reduced efficiency of the flow playback test caused by overlong single conversion time or conversion failure. Finally, the format conversion of the initial playback flow data is realized by configuring the format conversion plug-in and the format conversion method, so that compared with the existing manual format conversion mode, the automatic conversion is realized, the format conversion efficiency is improved, and the efficiency of the flow playback test is further improved. Therefore, the invention improves the 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 signaling diagram of obtaining an initial playback flow data set provided by 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 an embodiment of the present invention;
fig. 5 is a block diagram of an apparatus for a flow playback test according to an 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 identifier of an initial playback flow data set, a name of a tested system, a tested system address and at least one tested interface name, and obtaining the initial playback flow data set according to the identifier, wherein the initial playback flow data set comprises a plurality of pieces of initial playback flow data, the tested interface name has a corresponding relation with the name of the tested system, the identifier has a corresponding relation with the name of the tested system, and the initial playback flow data has a corresponding relation with the name of the tested interface.
It should be noted that, in a practical application scenario, there may be various implementations of the step S101 shown in fig. 1, and an example is provided herein:
as shown in fig. 2, which is a signaling diagram for obtaining an initial playback flow data set, the components involved in the process may include a man-machine interaction interface, a flow data management component and a preset database, and the specific steps thereof are as follows:
in step S201, the traffic data management component sends a presentation information acquisition request to a preset database. And triggers step S202.
It should be noted that, in an actual application scenario, there are various ways to construct the preset database storing each initial playback flow data set, for example, based on a relational database management system (MySQL), a relational database system (SqlServer), a remote dictionary service (dis), and the like. The invention does not limit the specific type of the preset database too much.
Step S202, a preset database responds to a display information acquisition request and sends display information to a man-machine interaction interface. And triggers step S203.
Step S203, the man-machine interaction interface displays the display information and records the selection operation result of the user. And triggers step S204.
Step S204, the man-machine interaction interface sends a selection operation result to the flow data management component. And triggers step S205.
In step S205, the flow management component parses the selection operation result to obtain the identifier of the initial playback flow data set, the name of the tested system, the address of the tested system and at least one interface name tested, and generates a data set loading request based on the identifier of the initial playback flow data set. And triggers step S206.
It should be noted that, in an actual application scenario, the detected system name may correspond to at least one detected interface name, and the detected interface name may correspond to a plurality of initial playback flow data. The corresponding relation can be set based on text extraction results of the development texts of the tested system and the source system and stored in a preset database.
In step S206, the traffic management component sends a data set loading request to a preset database. And triggers step S207.
In step S207, the preset database responds to the data set loading request, and searches the initial playback flow data set corresponding to the preset database according to the identifier. And triggers step S208.
In step S208, the preset database sends the initial playback flow data set to the flow management component. And triggers step S209.
In step S209, the flow management component stores the initial playback flow data set.
It should be noted that, under the actual application scenario, the host system works based on the instruction set, so that the number of the related message formats is huge, and the related message formats respectively correspond to different interfaces in the open system, so that the testers need to find and determine the corresponding relation between the instruction and the interface one by one according to the development texts of the systems of the two parties, thereby performing the subsequent format conversion and flow playback test process. By configuring the corresponding relation and obtaining the initial playback flow data set, the invention realizes the automatic execution and calling of the subsequent steps, shortens the data preparation time and improves the efficiency of the flow playback test compared with the existing manual searching mode.
S102, carrying out concurrent format conversion processing on a plurality of initial playback flow data in the initial playback flow data set through a plug-in management component,
the procedure of performing the format conversion process for each of the initial playback flow data includes:
judging whether a format conversion plugin corresponding to the tested system name corresponding to the initial playback flow data exists in the plugin management component, if so, judging whether the format conversion plugin stores a format conversion method corresponding to a target tested interface name, wherein the target tested interface name is the tested interface name corresponding to the initial playback flow data.
It should be noted that, in an actual application scenario, the plug-in management component may be constructed based on PF 4J. The PF4J is a Java lightweight plug-in framework, which can realize dynamic loading, execution and unloading of plug-ins and provide an application extension channel for a third party. By configuring the plug-in management component to perform concurrent format conversion processing on a plurality of initial playback flow data, compared with the manual one-by-one conversion mode in the prior art, the method and the device avoid the risk of reduced efficiency of flow playback test caused by overlong single conversion time or conversion failure. Meanwhile, based on the PF4J, plug-ins with different task functions can be compatible, and the adaptation and expandability of different systems are improved.
Optionally, in an optional embodiment of the present invention, since the plug-in management component may load multiple format conversion plug-ins corresponding to multiple system names under test at the same time, when a new set of system under test is subjected to a flow playback test, the flow playback test of the new system under test can be implemented by only replacing the corresponding format conversion plug-ins without reconstructing the whole flow, and the test efficiency is improved.
It should be noted that, in an actual application scenario, the format conversion plug-in may be obtained by performing encapsulation and compiling on a format conversion method constructed based on a type conversion function (conversion). The above-described type conversion function may implement conversion of data types. The invention realizes format conversion of the initial playback flow data by configuring the format conversion plug-in and the format conversion method, so that compared with the existing manual format conversion mode, the invention realizes automatic conversion, improves the format conversion efficiency, and further improves the efficiency of the flow playback test.
It should be noted that, in the actual application scenario, when performing the format conversion process on each initial playback flow data, the tested system name, the tested system address, and the tested interface name corresponding to the initial playback flow data may be packaged together with the initial playback flow data, and the format conversion process may be performed based on the packaged data, so as to reduce adjacent data interference when the format conversion process is concurrently performed.
It should be noted that, in the practical application scenario, in the implementation manner of determining whether the format conversion plug-in stores the format conversion method corresponding to the target tested interface name, the embedding point processing may be performed on the tested interface name recorded in the format conversion method when the format conversion plug-in is constructed, so that the embedding point responds to the triggering of the determining process. The specific process of the buried point treatment is not limited and repeated.
And under the condition that the format conversion plug-in stores a format conversion method corresponding to the name of the tested interface, calling the format conversion method of the format conversion plug-in to perform format conversion on the initial playback flow data, obtaining the playback flow data under the condition that the conversion is successful, playing back the playback flow data to the tested system according to the address of the tested system, and recording the playback result.
The invention realizes the automatic execution and calling of the subsequent steps by configuring the corresponding relation among the name of the tested interface, the name of the tested system, the identification of the initial playback flow data set and the initial playback flow data, so that compared with the existing manual searching mode, the invention shortens the data preparation time. Meanwhile, by configuring the plug-in management component to perform concurrent format conversion processing on a plurality of initial playback flow data, compared with the manual one-by-one conversion mode in the prior art, the method and the device avoid the risk of reduced efficiency of the flow playback test caused by overlong single conversion time or conversion failure. Finally, the format conversion of the initial playback flow data is realized by configuring the format conversion plug-in and the format conversion method, so that compared with the existing manual format conversion mode, the automatic conversion is realized, the format conversion efficiency is improved, and the efficiency of the flow playback test is further improved. Therefore, the invention improves the efficiency of the flow playback test.
Optionally, the process of performing format conversion processing on each initial playback flow data further includes:
under the condition that the plug-in management component does not have a format conversion plug-in corresponding to the name of the tested system corresponding to the initial playback flow data, a first format definition document corresponding to the identifier is obtained, and a second format definition document and an initial plug-in template corresponding to the name of the tested system are obtained;
respectively importing the first format definition document and the second format definition document into an initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of a tested system as a unique identifier of an initial format conversion plug-in, initializing a version number of the initial format conversion plug-in, and obtaining a format conversion plug-in corresponding to the name of the tested system;
adding the format conversion plug-in to the plug-in management component and setting the state of the format conversion plug-in as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
In the actual application scenario, the first format definition document and the second format definition document may be development text documents of a host system and an open system, and the documents may be obtained after character analysis. Since the definition information of each interface of the system and the analysis text of each message format are stored in the development text document. The first format definition document and the second format definition document after analysis are imported into the initial plug-in template, so that the initial plug-in template can identify the message format of a host system stored in the first format definition document and the message format which can be identified by a tested interface recorded in the second format definition document, and format conversion is carried out based on the preset configuration of the initial plug-in template.
It will be appreciated by those skilled in the art that in a practical application scenario, there are various implementations of obtaining the first format definition document and the second format definition document, for example, the developed text document is obtained by parsing the developed text document through algorithms such as a statistical method algorithm (termfreq— inverse document frequency, TF-IDF), a text summarization algorithm (TextRank), a named entity recognition (Named Entity Recognition, NER), and the like. The specific construction process of the algorithm is not repeated.
It will be appreciated by those skilled in the art that in a practical application scenario, the implementation of automatic compiling may be implemented by configuring an automatic compiling tool. The automated compiling tool can be various, such as SCons, CMake, autotools, maven, gradle, apache Ant and the like. The specific configuration process of the automated compiling tool of the invention is not excessively limited and repeated.
The invention realizes the automatic starting of the format conversion plug-in by configuring the automatic generating process of the format conversion plug-in and utilizing the extensible characteristic of the plug-in constructed based on the PF4J framework. When format conversion is unavailable, the plug-in for executing format conversion can be automatically constructed without manual intervention, so that full-automatic execution of flow playback test is realized, and test efficiency is improved. Meanwhile, the expandability of the platform is improved, and flexible adaptation to different systems is realized.
Optionally, the process of performing format conversion processing on each initial playback flow data further includes:
under the condition that the format conversion plug-in stores a format conversion method corresponding to the name of the tested interface, a first format definition document corresponding to the identifier is obtained, a second format definition document and an initial plug-in template corresponding to the name of the tested system are obtained, and the version number of the format conversion plug-in is obtained;
respectively importing the first format definition document and the second format definition document into an initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as a unique identifier of an initial format conversion plug-in, and updating the version number of the initial format conversion plug-in based on the version number to obtain a format conversion plug-in updated by the name of the tested system;
and using the updated format conversion plug-in to carry out coverage update on the format conversion plug-in corresponding to the name of the tested system in the plug-in management component, setting the state of the updated format conversion plug-in as loading starting, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
In the actual application scenario, since the open system for performing the flow playback test is not yet put into practical use, there is an actual scenario in which the open system interface is redefined or changed. Therefore, the invention configures version numbers for the format conversion plugins and carries out coverage updating on plugins in the plugin management components based on the configuration version numbers, thereby avoiding the risk of failure test or reduced test efficiency caused by format conversion errors due to the existence of two new and old versions of plugin management components at the same time.
Optionally, the method further comprises:
and under the condition of conversion failure, correspondingly storing the initial playback flow data, the name of the tested system, the name of the tested interface and the address of the tested system into a preset error information table.
It should be noted that, in the actual application scenario, the conversion failure may be caused by occasional reasons such as configuration errors of an automatic compiling tool, editing errors of a development document, system delay, etc., so, in order to facilitate a tester to accurately locate a failure point, under the condition of the conversion failure, the initial playback flow data, the name of the tested system, the name of the tested interface, and the address of the tested system may be correspondingly stored in a preset error information table, so that the tester may conveniently perform corresponding investigation and correction according to the above information.
To facilitate an understanding of the above-described method of flow playback testing as shown in fig. 1, an alternative embodiment of the present invention is described herein in particular:
as shown in fig. 3, a flow chart of a method for testing playback of traffic is provided in an alternative embodiment of the present invention. The method comprises the following specific steps:
step S301, obtaining an identifier of the initial playback flow data set, a name of the tested system, an address of the tested system and at least one name of the tested interface, and loading the initial playback flow data set according to the identifier of the initial playback flow data set. And triggers step S302.
Step S302, it is determined whether the initial playback flow data set is empty. If not, step S303 is triggered, if yes, the test is ended.
Alternatively, in an alternative embodiment of the present invention, if step S302 shown in fig. 3 is performed for the first time after step S301 shown in fig. 3 is completed, a loading error condition is indicated if the initial playback flow data set is empty. And outputting alarm information representing the loading error while ending the flow.
Optionally, in another alternative embodiment of the present invention, if the number of times of executing the step S302 shown in fig. 3 is not less than one after the step S301 shown in fig. 3 is completed, the technical process is normal, and a preset error message table is output.
Step S303, determining at least one initial playback flow data in the initial playback flow data set as current initial playback flow data, and concurrently performing format conversion processing based on data packets each containing one current initial playback flow data. And triggers step S304.
It should be noted that, in an actual application scenario, the data packet includes: the system comprises current initial playback flow data, a tested interface name corresponding to the current initial playback flow data, a tested system name corresponding to the identification of an initial playback flow data set where the current initial playback flow data is located, and a tested system address corresponding to the tested system name corresponding to the identification of the initial playback flow data set where the current initial playback flow data is located.
Step S304, judging whether the plug-in management component has a format conversion plug-in corresponding to the name of the tested system corresponding to the current initial playback flow data. If yes, step S305 is triggered. If not, step S310 is triggered.
In step S305, it is determined whether the format conversion plug-in stores a format conversion method corresponding to the target tested interface name. If yes, step S306 is triggered, and if no, step S311 is triggered.
Optionally, in an optional embodiment of the present invention, the target measured interface name in step S305 shown in fig. 3 is a measured interface name corresponding to the current initial playback flow data.
Step S306, calling a format conversion method corresponding to the name of the target tested interface in the format conversion plug-in, and performing format conversion on the current initial playback flow data. And triggers step S307.
Step S307, it is determined whether format conversion of the current initial playback flow data is successful. If yes, step S308 is triggered, and if no, step S312 is triggered.
Step S308, the playback flow data obtained by conversion is played back to the tested system corresponding to the tested system address corresponding to the current initial playback flow data, and the playback result is recorded. And triggers step S309.
It should be noted that, in the actual application scenario, since the initial playback flow data set corresponds to a plurality of initial playback flow data sets, and the identifier of the initial playback flow data set has a corresponding relationship with the name of the system under test, the name of the system under test also has a corresponding relationship with each initial playback flow data in the initial playback flow data set corresponding thereto.
Step S309, deleting the current initial playback flow data from the initial playback flow data set. And returns to step S302.
Step S310, according to the identification in the data packet and the name of the tested interface, a first format definition document, a second format definition document and an initial plug-in module are obtained, an updated format conversion plug-in is generated based on the obtained data, and the format conversion plug-in corresponding to the name of the tested system in the data packet in the plug-in management component is subjected to coverage update. And returns to step S304.
Step S311, according to the identification in the data packet and the name of the tested interface, a first format definition document, a second format definition document and an initial plug-in module are obtained, and based on the obtained data and the version number of the format conversion plug-in corresponding to the current initial playback flow, an updated format conversion plug-in is generated, and the format conversion plug-in corresponding to the name of the tested system in the data packet in the plug-in management component is subjected to coverage update. And returns to step S305.
In step S312, the data in the data packet containing the current initial playback flow data is stored in the preset error information table. And performs step S309.
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 S309 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.
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:
The data obtaining module 401 is configured to obtain an identifier of an initial playback flow data set, a name of a system to be tested, a system address to be tested, and at least one interface name to be tested, and obtain the initial playback flow data set according to the identifier, where the initial playback flow data set includes a plurality of pieces of initial playback flow data, the interface name to be tested has a corresponding relationship with the name of the system to be tested, the identifier has a corresponding relationship with the name of the system to be tested, and the initial playback flow data has a corresponding relationship with the name of the interface to be tested;
a test module 402 for performing concurrent format conversion processing on a plurality of initial playback flow data in an initial playback flow data set through a plug-in management component,
the procedure of performing the format conversion process for each of the initial playback flow data includes:
judging whether a format conversion plugin corresponding to the tested system name corresponding to the initial playback flow data exists in the plugin management component, if so, judging whether the format conversion plugin stores a format conversion method corresponding to a target tested interface name, wherein the target tested interface name is the tested interface name corresponding to the initial playback flow data;
and under the condition that the format conversion plug-in stores a format conversion method corresponding to the name of the tested interface, calling the format conversion method of the format conversion plug-in to perform format conversion on the initial playback flow data, obtaining the playback flow data under the condition that the conversion is successful, playing back the playback flow data to the tested system according to the address of the tested system, and recording the playback result.
Optionally, the test module 402 is further configured to, when performing the format conversion process on each of the initial playback flow data:
under the condition that the plug-in management component does not have a format conversion plug-in corresponding to the name of the tested system corresponding to the initial playback flow data, a first format definition document corresponding to the identifier is obtained, and a second format definition document and an initial plug-in template corresponding to the name of the tested system are obtained;
respectively importing the first format definition document and the second format definition document into an initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of a tested system as a unique identifier of an initial format conversion plug-in, initializing a version number of the initial format conversion plug-in, and obtaining a format conversion plug-in corresponding to the name of the tested system;
adding the format conversion plug-in to the plug-in management component and setting the state of the format conversion plug-in as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
Optionally, the test module 402 is further configured to, when performing the format conversion process on each of the initial playback flow data:
Under the condition that the format conversion plug-in stores a format conversion method corresponding to the name of the tested interface, a first format definition document corresponding to the identifier is obtained, a second format definition document and an initial plug-in template corresponding to the name of the tested system are obtained, and the version number of the format conversion plug-in is obtained;
respectively importing the first format definition document and the second format definition document into an initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as a unique identifier of an initial format conversion plug-in, and updating the version number of the initial format conversion plug-in based on the version number to obtain a format conversion plug-in updated by the name of the tested system;
and using the updated format conversion plug-in to carry out coverage update on the format conversion plug-in corresponding to the name of the tested system in the plug-in management component, setting the state of the updated format conversion plug-in as loading starting, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
Optionally, the test module 402 is further configured to:
And under the condition of conversion failure, correspondingly storing the initial playback flow data, the name of the tested system, the name of the tested interface and the address of the tested system into a preset error information table.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. The name of a module is not limited to the module itself in some cases, and for example, the first acquisition module may also be described as "a module that acquires at least two internet protocol addresses".
The embodiment of the invention also provides a device for flow playback test, as shown in fig. 5, the device for flow playback test 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 a device for flow playback testing, causes the device for flow playback testing to perform a method for flow playback testing as described above.
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.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
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 identifier of an initial playback flow data set, a tested system name, a tested system address and at least one tested interface name, and obtaining the initial playback flow data set according to the identifier, wherein the initial playback flow data set comprises a plurality of pieces of initial playback flow data, the tested interface name has a corresponding relation with the tested system name, the identifier has a corresponding relation with the tested system name, and the initial playback flow data has a corresponding relation with the tested interface name;
concurrent format conversion processing is performed on a plurality of the initial playback flow data in the initial playback flow data set by a plug-in management component,
the process of performing the format conversion process for each of the initial playback flow data includes:
judging whether a format conversion plugin corresponding to a tested system name corresponding to the initial playback flow data exists in a plugin management component, if so, judging whether the format conversion plugin stores a format conversion method corresponding to a target tested interface name, wherein the target tested interface name is the tested interface name corresponding to the initial playback flow data;
And under the condition that the format conversion plug-in stores a format conversion method corresponding to the tested interface name, calling the format conversion method of the format conversion plug-in to perform format conversion on the initial playback flow data, under the condition that the conversion is successful, obtaining the playback flow data, playing back the playback flow data to a tested system according to the tested system address, and recording a playback result.
2. The method of claim 1, wherein the performing of the format conversion process on each of the initial playback traffic data further comprises:
under the condition that the plug-in management component does not have a format conversion plug-in corresponding to the name of the tested system corresponding to the initial playback flow data, a first format definition document corresponding to the identifier is obtained, and a second format definition document and an initial plug-in template respectively corresponding to the name of the tested system are obtained;
respectively importing the first format definition document and the second format definition document into the initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as the unique identifier of the initial format conversion plugin, initializing the version number of the initial format conversion plugin, and obtaining the format conversion plugin corresponding to the name of the tested system;
Adding the format conversion plug-in to a plug-in management component, setting the state of the format conversion plug-in as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
3. The method of claim 1, wherein the performing of the format conversion process on each of the initial playback traffic data further comprises:
under the condition that the format conversion plug-in stores a format conversion method corresponding to the tested interface name, a first format definition document corresponding to the identifier is obtained, a second format definition document and an initial plug-in template corresponding to the tested system name are obtained, and a version number of the format conversion plug-in is obtained;
respectively importing the first format definition document and the second format definition document into the initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as a unique identifier of the initial format conversion plugin, updating the version number of the initial format conversion plugin based on the version number, and obtaining the format conversion plugin after updating the name of the tested system;
And using the updated format conversion plugin to carry out coverage update on the format conversion plugin corresponding to the tested system name in the plugin management component, setting the state of the updated format conversion plugin as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
4. The method according to claim 1, wherein the method further comprises:
and under the condition of conversion failure, correspondingly storing the initial playback flow data, the name of the tested system, the name of the tested interface and the address of the tested system into a preset error information table.
5. A system for flow playback testing, the system comprising:
the data acquisition module is used for acquiring an identifier of an initial playback flow data set, a tested system name, a tested system address and at least one tested interface name, and acquiring the initial playback flow data set according to the identifier, wherein the initial playback flow data set comprises a plurality of pieces of initial playback flow data, the tested interface name has a corresponding relation with the tested system name, the identifier has a corresponding relation with the tested system name, and the initial playback flow data has a corresponding relation with the tested interface name;
A test module for performing concurrent format conversion processing on a plurality of the initial playback flow data in the initial playback flow data set through a plug-in management component,
the process of performing the format conversion process for each of the initial playback flow data includes:
judging whether a format conversion plugin corresponding to a tested system name corresponding to the initial playback flow data exists in a plugin management component, if so, judging whether the format conversion plugin stores a format conversion method corresponding to a target tested interface name, wherein the target tested interface name is the tested interface name corresponding to the initial playback flow data;
and under the condition that the format conversion plug-in stores a format conversion method corresponding to the tested interface name, calling the format conversion method of the format conversion plug-in to perform format conversion on the initial playback flow data, under the condition that the conversion is successful, obtaining the playback flow data, playing back the playback flow data to a tested system according to the tested system address, and recording a playback result.
6. The system of claim 5, wherein the test module, when performing the format conversion process on each of the initial playback flow data, is further configured to:
Under the condition that the plug-in management component does not have a format conversion plug-in corresponding to the name of the tested system corresponding to the initial playback flow data, a first format definition document corresponding to the identifier is obtained, and a second format definition document and an initial plug-in template respectively corresponding to the name of the tested system are obtained;
respectively importing the first format definition document and the second format definition document into the initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as the unique identifier of the initial format conversion plugin, initializing the version number of the initial format conversion plugin, and obtaining the format conversion plugin corresponding to the name of the tested system;
adding the format conversion plug-in to a plug-in management component, setting the state of the format conversion plug-in as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
7. The system of claim 5, wherein the test module, when performing the format conversion process on each of the initial playback flow data, is further configured to:
Under the condition that the format conversion plug-in stores a format conversion method corresponding to the tested interface name, a first format definition document corresponding to the identifier is obtained, a second format definition document and an initial plug-in template corresponding to the tested system name are obtained, and a version number of the format conversion plug-in is obtained;
respectively importing the first format definition document and the second format definition document into the initial plug-in module, and automatically compiling the imported initial plug-in module to obtain an initial format conversion plug-in;
setting the name of the tested system as a unique identifier of the initial format conversion plugin, updating the version number of the initial format conversion plugin based on the version number, and obtaining the format conversion plugin after updating the name of the tested system;
and using the updated format conversion plugin to carry out coverage update on the format conversion plugin corresponding to the tested system name in the plugin management component, setting the state of the updated format conversion plugin as loading enabling, and executing the steps: and judging whether a format conversion plug-in corresponding to the tested system name corresponding to the initial playback flow data exists in the plug-in management component.
8. The system of claim 5, wherein the test module is further configured to:
and under the condition of conversion failure, correspondingly storing the initial playback flow data, the name of the tested system, the name of the tested interface and the address of the tested system into a preset error information table.
9. An apparatus for a playback test of traffic, 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.
CN202311622403.5A 2023-11-30 2023-11-30 Method, system, equipment and storage medium for flow playback test Pending CN117675635A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311622403.5A CN117675635A (en) 2023-11-30 2023-11-30 Method, system, equipment and storage medium for flow playback test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311622403.5A CN117675635A (en) 2023-11-30 2023-11-30 Method, system, equipment and storage medium for flow playback test

Publications (1)

Publication Number Publication Date
CN117675635A true CN117675635A (en) 2024-03-08

Family

ID=90063392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311622403.5A Pending CN117675635A (en) 2023-11-30 2023-11-30 Method, system, equipment and storage medium for flow playback test

Country Status (1)

Country Link
CN (1) CN117675635A (en)

Similar Documents

Publication Publication Date Title
CN108897691B (en) Data processing method, device, server and medium based on interface simulation service
CN110377462B (en) Interface testing method and device and terminal equipment
CN111124480B (en) Method and device for generating application program package, electronic equipment and storage medium
CN113760730B (en) Automatic test method and device
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN116028122A (en) Device processing method and device based on processor
CN114138633A (en) Method, device and equipment for testing software based on data driving and readable medium
CN113377770A (en) Data processing method and device
CN110443034B (en) Risk program file identification method and device, computing equipment and medium
CN110348226B (en) Engineering file scanning method and device, electronic equipment and storage medium
CN111930625A (en) Log obtaining method, device and system based on cloud service platform
CN114500348B (en) CDN gateway testing method and system
CN117675635A (en) Method, system, equipment and storage medium for flow playback test
CN111198853A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN110865818A (en) Application associated domain name detection method and device and electronic equipment
CN110580216A (en) application extraction and detection method and device
CN114490337A (en) Debugging method, debugging platform, equipment and storage medium
CN111176718B (en) Script online method and device, storage medium and electronic equipment
CN114090514A (en) Log retrieval method and device for distributed system
CN109783133B (en) Code packaging method and device, computer equipment and storage medium
US20170039448A1 (en) Capturing unique screenshots
CN113591147A (en) Data extraction method and device, computer equipment and storage medium
CN110795338A (en) Automatic testing method and device based on front-end and back-end interaction and electronic equipment
CN112765038A (en) Distributed cluster software testing method, device, equipment and storage medium
CN111538651A (en) Interface testing method, device, server 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