CN109510737B - Protocol interface testing method and device, computer equipment and storage medium - Google Patents

Protocol interface testing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN109510737B
CN109510737B CN201811530304.3A CN201811530304A CN109510737B CN 109510737 B CN109510737 B CN 109510737B CN 201811530304 A CN201811530304 A CN 201811530304A CN 109510737 B CN109510737 B CN 109510737B
Authority
CN
China
Prior art keywords
protocol
interface
classification
information
identifier
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.)
Active
Application number
CN201811530304.3A
Other languages
Chinese (zh)
Other versions
CN109510737A (en
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.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201811530304.3A priority Critical patent/CN109510737B/en
Publication of CN109510737A publication Critical patent/CN109510737A/en
Priority to PCT/CN2019/120517 priority patent/WO2020119430A1/en
Application granted granted Critical
Publication of CN109510737B publication Critical patent/CN109510737B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • 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/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Abstract

The present application relates to the field of computer communications technologies, and in particular, to a protocol interface testing method and apparatus, a computer device, and a storage medium. Acquiring message request information, extracting a characteristic identifier of a protocol from the message request information, and acquiring a response message according to a feedback result after the characteristic identifier is input into an interface; extracting the protocol parameter information and parameter information in the response message to obtain the ID identification of the protocol, calling a classification file to classify the ID identification of the protocol to obtain the protocol classification identification of the protocol, and writing the protocol into a corresponding interface according to the protocol classification identification; and acquiring an inverse protocol classification identifier corresponding to the interface, assembling the inverse protocol classification identifier to obtain a protocol group, reading the protocol group to obtain an inverse classification file corresponding to the protocol group, and acquiring an extrapolation message of the protocol. The message information is effectively classified, and the message information can be effectively adapted according to the classification result.

Description

Protocol interface testing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer communications technologies, and in particular, to a protocol interface testing method and apparatus, a computer device, and a storage medium.
Background
The interface test is generally used for interactive development among multiple systems or test of development of an application system with multiple subsystems. The interface test is suitable for the bottom-layer framework system and the central service system which provide services for other systems, and mainly tests the interfaces provided by the systems to the outside to verify the correctness and stability of the interfaces. The interface test is also suitable for a service layer interface in an upper layer system, and the test difficulty is higher the upper layer is.
At present, the information entry modes of interfaces with different protocols are basically the same during interface testing, but the interface protocols are inconsistent during interface running, and certain platform tools adopt a mode suitable for the protocol during entry in order to ensure that the interfaces with different protocols are accurately sent, such as a Jmeter testing tool and the like.
However, in the conventional testing technology, when a multi-protocol test is performed, the same interface cannot meet the requirements of different protocols, so that data needs to be repeatedly input, and the testing efficiency is reduced.
Disclosure of Invention
In view of the above, it is necessary to provide a protocol interface testing method, apparatus, computer device and storage medium for solving the problem that multiple protocols cannot be adapted effectively when writing into an interface.
A protocol interface test method comprises the following steps:
acquiring message request information, extracting a characteristic identifier of a protocol from the message request information, and acquiring a response message according to a feedback result after the characteristic identifier is input into an interface;
extracting the protocol parameter information and parameter information in the response message to obtain the ID identification of the protocol, calling a classification file to classify the ID identification of the protocol to obtain the protocol classification identification of the protocol, writing the protocol into a corresponding interface according to the protocol classification identification, and pre-storing the classification file in a server;
acquiring an inverse protocol classification identifier corresponding to the interface, assembling the inverse protocol classification identifier to obtain a protocol group, reading the protocol group to obtain an inverse classification file corresponding to the protocol group, acquiring an extrapolation message of the protocol from the inverse classification file, and sending the extrapolation message of the protocol to a test terminal.
In one embodiment, the obtaining of the message request information, extracting a feature identifier of a protocol from the message request information, and obtaining a response message according to a feedback result after the feature identifier is input to the interface includes:
acquiring message request information, and extracting a characteristic identifier of a protocol from the message request information;
acquiring a regular expression rule corresponding to the message request information, extracting a starting identifier and a message source address field in the characteristic identifier of the protocol from the regular expression rule, generating a matching rule list according to the starting identifier and the message source address field, and storing the regular expression rule in a database;
positioning and acquiring a response message corresponding to the matching rule list according to the mapping relation between the matching rule list and the response message;
and detecting whether the upstream interface information contained in the response message is matched with the downstream mapping node information contained in the message request information, if so, accepting the response message, and otherwise, acquiring the response message again.
In one embodiment, the extracting the protocol entry parameter information and the protocol exit parameter information in the response packet to obtain the ID identifier of the protocol, calling a classification file to classify the ID identifier of the protocol to obtain a protocol classification identifier of the protocol, writing the protocol into a corresponding interface according to the protocol classification identifier, and pre-storing the classification file in a server includes:
extracting the parameter entering information and the parameter exiting information of the protocol in the response message, extracting the characteristic parameters of the parameter entering information and the parameter exiting information, marking the characteristic parameters, and determining the ID identification of the protocol according to the change of the characteristic parameters during parameter entering and parameter exiting;
acquiring an encryption rule of the classified file, encrypting the classified file, and acquiring an encrypted classified file and a key identifier;
classifying the ID identification of the protocol according to the key identifier in the key identification to obtain the protocol classification identification;
acquiring a corresponding table of an interface ID identification and the protocol classification identification, establishing a mapping relation between the protocol classification identification of the protocol and the interface ID corresponding to the protocol according to the corresponding table, and writing the protocol into a corresponding interface according to the mapping relation, wherein the corresponding table of the interface ID identification and the protocol classification identification is stored in a database.
In one embodiment, the obtaining the reverse protocol classification identifier corresponding to the interface, assembling the reverse protocol classification identifier to obtain a protocol group, reading the protocol group to obtain a reverse classification file corresponding to the protocol group, obtaining an extrapolation packet of the protocol from the reverse classification file, and sending the extrapolation packet of the protocol to the test terminal includes:
establishing a corresponding relation table of the interface and the protocol classification identifier, performing matrixing expression on elements in the corresponding relation table to obtain an interface protocol matrix, inverting the interface protocol matrix to obtain an interface protocol inverse matrix, performing normalization processing on the elements in the interface protocol inverse matrix to obtain each element in the interface protocol inverse matrix after the normalization processing, and setting the value of each element as the inverse protocol classification identifier corresponding to the interface;
assembling the reverse protocol classification identification to obtain the protocol group;
adding the protocol group into a new example function, and obtaining an inverse classification file corresponding to the protocol group after the protocol group is added;
and acquiring a starting node and an ending node of data generation in the reverse classified file, and sequentially sending protocol information in the reverse classified file to a test terminal from the starting node to the ending node.
In one embodiment, the obtaining the message request information and extracting the feature identifier of the protocol from the message request information includes:
acquiring a preset time interval for extracting message request information, and acquiring message information according to the time interval;
detecting whether the obtained message information is complete or not, and if the message information is incomplete, re-obtaining the message information;
and comparing the message information with the response message of the previous turn to obtain the difference points of the message information and the response message of the previous turn, and obtaining the characteristic identifier according to the position in a protocol characteristic mapping table corresponding to the difference points, wherein the protocol characteristic mapping table is stored in data.
In one embodiment, the extracting the entry parameter information and the exit parameter information of the protocol in the response message, extracting feature parameters of the entry parameter information and the exit parameter information, marking the feature parameters, and determining the ID identifier of the protocol according to the change of the feature parameters during entry and exit includes:
sorting the parameter input information according to a parameter input time sequence to generate a line of parameter input matrixes, and sorting the parameter output information according to a parameter output time sequence to generate a list parameter matrixes;
performing matrix multiplication on the parameter input matrix and the parameter output matrix to obtain a parameter input-parameter output matrix;
extracting data on a main diagonal line from the parameter input-parameter output matrix as an original characteristic parameter;
carrying out normalization processing on the parameter input-parameter output matrix to obtain a normalized parameter input-parameter output matrix;
extracting data on a secondary diagonal line in the normalized parameter-input-parameter-output matrix as a characteristic parameter weight;
and matching and calculating the characteristic parameter weight and the original characteristic parameter to obtain the ID of the protocol.
In one embodiment, the assembling the inverse protocol classification identifier to obtain the protocol group includes:
according to the interface source of the protocol classification mark, the inverse protocol classification mark is layered and packaged to form a plurality of protocol layers;
identifying protocol data between the protocol layers to obtain a data association index between the protocol layers, wherein the data association index is used for representing the number of data from the same interface between the two protocol layers;
and assembling the two protocol layers with the maximum data association degree into a protocol group.
A protocol interface testing device comprises the following modules:
the request acquisition module is arranged for acquiring message request information, extracting a characteristic identifier of a protocol from the message request information, and acquiring a response message according to a feedback result after the characteristic identifier is input into an interface;
a classification write-in module, configured to extract the protocol entry parameter information and the protocol exit parameter information in the response reply packet to obtain an ID identifier of the protocol, call a classification file to classify the ID identifier of the protocol to obtain a protocol classification identifier of the protocol, write the protocol into a corresponding interface according to the protocol classification identifier, and pre-store the classification file in a server;
and the extrapolation message module is configured to acquire the reverse protocol classification identifier corresponding to the interface, assemble the reverse protocol classification identifier to obtain a protocol group, read the protocol group to obtain a reverse classification file corresponding to the protocol group, acquire an extrapolation message of the protocol from the reverse classification file, and send the extrapolation message of the protocol to the test terminal.
A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the protocol interface testing method described above.
A storage medium having stored thereon computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the protocol interface testing method described above.
The protocol interface test method, the device, the computer equipment and the storage medium comprise the steps of obtaining message request information, extracting the characteristic identification of a protocol from the message request information, and obtaining a response message according to a feedback result after the characteristic identification is input into an interface; extracting the protocol parameter information and parameter information in the response message to obtain the ID identification of the protocol, calling a classification file to classify the ID identification of the protocol to obtain the protocol classification identification of the protocol, writing the protocol into a corresponding interface according to the protocol classification identification, and pre-storing the classification file in a server; acquiring an inverse protocol classification identifier corresponding to the interface, assembling the inverse protocol classification identifier to obtain a protocol group, reading the protocol group to obtain an inverse classification file corresponding to the protocol group, acquiring an extrapolation message of the protocol from the inverse classification file, and sending the extrapolation message of the protocol to a test terminal. The technical scheme can effectively adapt according to the classification result by effectively classifying the message information aiming at the problem that the various protocols can not effectively adapt when writing in the interface.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application.
FIG. 1 is a flowchart illustrating an overall protocol interface testing method according to an embodiment of the present application;
FIG. 2 is a diagram illustrating a request acquisition process in a protocol interface test according to an embodiment of the present application;
FIG. 3 is a diagram illustrating a classification writing process in a protocol interface testing method according to an embodiment of the present application;
fig. 4 is a block diagram of a protocol interface testing device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Fig. 1 is an overall flowchart of a protocol interface testing method in an embodiment of the present application, and as shown in fig. 1, a protocol interface testing method includes the following steps:
s1, obtaining message request information, extracting the characteristic identification of the protocol from the message request information, and obtaining a response message according to the feedback result after the characteristic identification is input into the interface;
specifically, a receiving protocol interface detection initiator sends message request information, and extracts a feature label for identifying a multi-protocol attribute, such as a type field of an operation, maintenance and management (OAM) message in multi-protocol label switching (MPLS), from the message request information; and then inputting the type field of the operation maintenance management OAM message in the multi-protocol label switching MPLS into an interface to obtain a response message.
S2, extracting the protocol parameter information and parameter information in the response message to obtain the ID identification of the protocol, calling a classification file to classify the ID identification of the protocol to obtain the protocol classification identification of the protocol, writing the protocol into a corresponding interface according to the protocol classification identification, and pre-storing the classification file in a server;
specifically, all functions used on an interface are obtained, a protocol is respectively entered into the functions for calculation to obtain a parameter result, and the result with the largest repeated occurrence frequency in the parameter result is used as the ID identification of the protocol; the protocol classification is mainly divided into a transmission control protocol TCP, a user datagram protocol UDP, a hypertext transfer protocol HTTP, and the like.
S3, obtaining the reverse protocol classification mark corresponding to the interface, assembling the reverse protocol classification mark to obtain a protocol group, reading the protocol group to obtain a reverse classification file corresponding to the protocol group, obtaining an extrapolation message of the protocol from the reverse classification file, and sending the extrapolation message of the protocol to a test terminal.
Specifically, the inverse protocol identifier corresponding to the interface is obtained by performing inverse analysis on the protocol, and when the inverse protocol identifier is assembled, the inverse protocol identifier may be assembled according to the generation sequence of the inverse protocol identifier, or the same inverse classification identifier may be assembled into a protocol group.
In the embodiment, the protocol can be adapted to the interface by effectively analyzing and classifying the protocol.
Fig. 2 is a schematic diagram of a request obtaining process in a protocol interface test according to the present application, where as shown in the figure, obtaining message request information, extracting a feature identifier of a protocol from the message request information, and obtaining a response message according to a feedback result after the feature identifier is input to an interface includes:
s101, acquiring message request information, and extracting a characteristic identifier of a protocol from the message request information;
specifically, a message request information sending task is set, and when the message request information sending task is triggered, the detection terminal sends the message request information and the server, wherein the characteristic identifier of the protocol refers to an abbreviated symbol of the protocol and the like.
S102, acquiring a regular expression rule corresponding to the message request information, extracting a starting identifier and a message source address field in a characteristic identifier of the protocol from the regular expression rule, generating a matching rule list according to the starting identifier and the message source address field, and storing the regular expression rule in a database;
the regular expression rule is mainly to use regular expression to carry out regularization processing to the character string, the regular expression is a logic formula for operating the character string, namely, a 'regular character string' is formed by using some specific characters defined in advance and the combination of the specific characters, and the 'regular character string' is used to express a filtering logic to the character string. A regular expression is a text pattern that describes one or more strings of characters to be matched when searching for text.
S103, positioning and acquiring a response message corresponding to the matching rule list according to the mapping relation between the matching rule list and the response message;
specifically, the structured query SQL language and the like are applied to search key contents in the message contents of the matching rule list, and the position of the response message in the matching rule list is determined according to the search result.
S104, detecting whether the upstream interface information contained in the response message is matched with the downstream mapping node information contained in the message request information, if so, accepting the response message, otherwise, acquiring the response message again.
In this embodiment, the integrity of the response message can be effectively ensured by verifying the receiving process of the response message.
Fig. 3 is a schematic diagram of a classification writing process in a protocol interface testing method according to the present application, where as shown in the figure, the protocol entry parameter information and the protocol exit parameter information in the response reply packet are extracted to obtain an ID identifier of the protocol, a classification file is called to classify the ID identifier of the protocol to obtain a protocol classification identifier of the protocol, the protocol is written into a corresponding interface according to the protocol classification identifier, and the classification file is prestored in a server, and includes:
s201, extracting the participation information and the participation information of the protocol in the response message, extracting the characteristic parameters of the participation information and the participation information, marking the characteristic parameters, and determining the ID identification of the protocol according to the change of the characteristic parameters during participation and participation;
specifically, the characteristic parameters in the response reply message mainly refer to information such as an interface method name, a version number, a group and the like, and if a version of a parameter output result corresponding to parameter output is changed, the version number is used as a protocol ID.
S202, acquiring an encryption rule of the classified file, encrypting the classified file, and acquiring an encrypted classified file and a key identifier;
the encryption rule may be based 64 encryption, MD5 encryption, key string encryption, or the like.
S203, classifying the ID identification of the protocol according to the key identifier in the key identification to obtain the protocol classification identification;
the key identifier refers to a first character in the key identifier, and if the first character identified by the protocol ID is consistent with the key identifier, the protocol is classified according to the category in the classification file corresponding to the key identifier.
S204, acquiring a corresponding table of an interface ID identification and the protocol classification identification, establishing a mapping relation between the protocol classification identification of the protocol and the interface ID corresponding to the protocol according to the corresponding table, and writing the protocol into a corresponding interface according to the mapping relation, wherein the corresponding table of the interface ID identification and the protocol classification identification is stored in a database.
In this embodiment, the interface is matched with the protocol by establishing the corresponding relationship between the interface ID identifier and the protocol classification identifier.
In an embodiment, the obtaining the reverse protocol classification identifier corresponding to the interface, assembling the reverse protocol classification identifier to obtain a protocol group, reading the protocol group to obtain a reverse classification file corresponding to the protocol group, obtaining an extrapolation packet of the protocol from the reverse classification file, and sending the extrapolation packet of the protocol to the test terminal includes:
establishing a corresponding relation table of the interface and the protocol classification identifier, performing matrixing expression on elements in the corresponding relation table to obtain an interface protocol matrix, inverting the interface protocol matrix to obtain an interface protocol inverse matrix, performing normalization processing on the elements in the interface protocol inverse matrix to obtain each element in the interface protocol inverse matrix after the normalization processing, and setting the value of each element as the inverse protocol classification identifier corresponding to the interface;
specifically, when an element in the correspondence table is extracted, the position of the extracted element in the record table is recorded, and the row-column number corresponding to the position is used as the numerical value of the element in the protocol matrix, for example, if the position of a certain element in the correspondence table is the 3 rd row and the 4 th column, the numerical value of the certain element in the protocol matrix is 34%; and writing the numerical values into the interface protocol matrix in turn according to the element extraction sequence.
Assembling the reverse protocol classification identification to obtain the protocol group;
specifically, the assembly can be performed by the plane tangent plane programming AOP only when the classification marks are assembled.
Adding the protocol group into a new example function, and obtaining an inverse classification file corresponding to the protocol group after the protocol group is added;
specifically, when the new example function uses AOP, a newInstance () function is used to perform an enter-join or exit-join operation.
And acquiring a starting node and an ending node of data generation in the reverse classified file, and sequentially sending protocol information in the reverse classified file to a test terminal from the starting node to the ending node.
In this embodiment, by performing matrixing processing on the protocol classification elements, the accuracy of extrapolation message sending can be improved.
In one embodiment, the obtaining of the message request information and extracting the feature identifier of the protocol from the message request information include:
acquiring a preset time interval for extracting message request information, and acquiring message information according to the time interval;
specifically, the time interval is obtained from the historical data, different weights may be given to different historical data when performing historical data statistics, and the weight of the historical data closer to the current time is larger, and vice versa.
Detecting whether the obtained message information is complete or not, and if the message information is incomplete, re-obtaining the message information;
specifically, when detecting the integrity of the message information, the initial character and the terminal character of the message may be detected according to a preset message rule, and if the initial character or the terminal character of the message information does not conform to the preset message rule, the message is incomplete.
And comparing the message information with the response message of the previous turn to obtain the difference points of the message information and the response message of the previous turn, and obtaining the characteristic identifier according to the position in a protocol characteristic mapping table corresponding to the difference points, wherein the protocol characteristic mapping table is stored in data.
Specifically, when comparing the response messages, the response messages may be segmented into a plurality of message subsections, and then difference point comparison is performed on each subsection.
In this embodiment, the integrity and the difference detection are completed by responding to the response message, so that the accuracy of the protocol and the interface matching can be better improved.
In one embodiment, the extracting the entry parameter information and the exit parameter information of the protocol in the response message, extracting feature parameters of the entry parameter information and the exit parameter information, marking the feature parameters, and determining the ID identifier of the protocol according to the change of the feature parameters during entry and exit includes:
sorting the parameter input information according to a parameter input time sequence to generate a line of parameter input matrixes, and sorting the parameter output information according to a parameter output time sequence to generate a list parameter matrixes;
performing matrix multiplication on the parameter input matrix and the parameter output matrix to obtain a parameter input-parameter output matrix;
specifically, if the parameter input information is subjected to numerical value conversion, a parameter input matrix a is established, and the parameter output information is subjected to numerical value conversion, and a parameter output matrix B is established. For example a matrix
Figure BDA0001905499440000121
The matrix A and the matrix B are subjected to product to obtain an input parameter-output parameter matrix
Figure BDA0001905499440000122
Extracting data on a main diagonal line from the parameter input-parameter output matrix as an original characteristic parameter;
specifically, as in the above example, the original characteristic parameter is 8+10 — 18.
Carrying out normalization processing on the parameter input-parameter output matrix to obtain a normalized parameter input-parameter output matrix;
extracting data on a secondary diagonal line in the normalized parameter-input-parameter-output matrix as a characteristic parameter weight;
specifically, after normalization processing is performed on the matrix C, the sum of the elements on the secondary diagonal is divided by 2, and the obtained weight is 0.5.
And matching and calculating the characteristic parameter weight and the original characteristic parameter to obtain the ID of the protocol.
In this embodiment, the accuracy of determining the protocol ID identifier is improved by performing matrixing processing on the entry parameter information and the exit parameter information.
In one embodiment, said assembling said reverse protocol class identifier to obtain said protocol stack includes:
according to the interface source of the protocol classification mark, the inverse protocol classification mark is layered and packaged to form a plurality of protocol layers;
specifically, when performing layered packing, the inverse protocol classification identifier of the same interface source may be written into one protocol layer, or the inverse protocols of several interface sources of the same category may be written into one protocol layer.
Identifying protocol data between the protocol layers to obtain a data association index between the protocol layers, wherein the data association index is used for representing the number of data from the same interface between the two protocol layers;
and assembling the two protocol layers with the maximum data association degree into a protocol group.
Specifically, if the association degrees between three or more protocol layers are consistent, two protocol layers are randomly extracted and assembled to form a protocol group, and the association degrees are recalculated between the remaining protocol layers and other protocol layers.
In the embodiment, the protocol group is formed by calculating the association degree, so that the speed of testing the protocol interface is improved.
In one embodiment, a protocol interface testing apparatus is proposed, as shown in fig. 4, including the following modules:
the request acquisition module is arranged for acquiring message request information, extracting a characteristic identifier of a protocol from the message request information, and acquiring a response message according to a feedback result after the characteristic identifier is input into an interface;
a classification write-in module, configured to extract the protocol entry parameter information and the protocol exit parameter information in the response reply packet to obtain an ID identifier of the protocol, call a classification file to classify the ID identifier of the protocol to obtain a protocol classification identifier of the protocol, write the protocol into a corresponding interface according to the protocol classification identifier, and pre-store the classification file in a server;
and the extrapolation message module is configured to acquire the reverse protocol classification identifier corresponding to the interface, assemble the reverse protocol classification identifier to obtain a protocol group, read the protocol group to obtain a reverse classification file corresponding to the protocol group, acquire an extrapolation message of the protocol from the reverse classification file, and send the extrapolation message of the protocol to the test terminal.
A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the steps of the protocol interface testing method in the embodiments described above.
A storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the protocol interface testing method described in the embodiments above. The storage medium may be a non-volatile storage medium.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-described embodiments are merely illustrative of some embodiments of the present application, which are described in more detail and detail, but are not to be construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (9)

1. A protocol interface testing method is characterized by comprising the following steps:
acquiring message request information, extracting a characteristic identifier of a protocol from the message request information, and acquiring a response message according to a feedback result after the characteristic identifier is input into an interface;
extracting the protocol parameter information and parameter information in the response message to obtain the ID identification of the protocol, calling a classification file to classify the ID identification of the protocol to obtain the protocol classification identification of the protocol, writing the protocol into a corresponding interface according to the protocol classification identification, and pre-storing the classification file in a server;
acquiring an inverse protocol classification identifier corresponding to the interface, assembling the inverse protocol classification identifier to obtain a protocol group, reading the protocol group to obtain an inverse classification file corresponding to the protocol group, acquiring protocol information of the protocol from the inverse classification file, and sending the protocol information of the protocol to a test terminal, wherein the inverse protocol classification identifier is a value of an element in an interface protocol inverse matrix;
the acquiring the reverse protocol classification identifier corresponding to the interface, assembling the reverse protocol classification identifier to obtain a protocol group, reading the protocol group to obtain a reverse classification file corresponding to the protocol group, acquiring protocol information of the protocol from the reverse classification file, and sending the protocol information of the protocol to a test terminal includes:
establishing a corresponding relation table of the interface and the protocol classification identifier, performing matrixing expression on elements in the corresponding relation table to obtain an interface protocol matrix, inverting the interface protocol matrix to obtain an interface protocol inverse matrix, performing normalization processing on the elements in the interface protocol inverse matrix to obtain each element in the interface protocol inverse matrix after the normalization processing, and setting the value of each element as the inverse protocol classification identifier corresponding to the interface;
assembling the reverse protocol classification identification to obtain the protocol group;
adding the protocol group into a new example function, and obtaining an inverse classification file corresponding to the protocol group after the protocol group is added;
and acquiring a starting node and an ending node of data generation in the reverse classified file, and sequentially sending protocol information in the reverse classified file to a test terminal from the starting node to the ending node.
2. The method for testing a protocol interface according to claim 1, wherein the obtaining of the message request information, extracting the feature identifier of the protocol from the message request information, and obtaining the response message according to the feedback result after the feature identifier is input to the interface comprises:
acquiring message request information, and extracting a characteristic identifier of a protocol from the message request information;
acquiring a regular expression rule corresponding to the message request information, extracting a starting identifier and a message source address field in the characteristic identifier of the protocol from the regular expression rule, generating a matching rule list according to the starting identifier and the message source address field, and storing the regular expression rule in a database;
positioning and acquiring a response message corresponding to the matching rule list according to the mapping relation between the matching rule list and the response message;
and detecting whether the upstream interface information contained in the response message is matched with the downstream mapping node information contained in the message request information, if so, accepting the response message, and otherwise, acquiring the response message again.
3. The protocol interface testing method according to claim 1, wherein the extracting the protocol entry parameter information and the protocol exit parameter information in the response reply packet to obtain the ID identifier of the protocol, calling a classification file to classify the ID identifier of the protocol to obtain a protocol classification identifier of the protocol, writing the protocol into a corresponding interface according to the protocol classification identifier, and the pre-storing of the classification file in a server includes:
extracting the parameter entering information and the parameter exiting information of the protocol in the response message, extracting the characteristic parameters of the parameter entering information and the parameter exiting information, marking the characteristic parameters, and determining the ID identification of the protocol according to the change of the characteristic parameters during parameter entering and parameter exiting;
acquiring an encryption rule of the classified file, encrypting the classified file, and acquiring an encrypted classified file and a key identifier;
classifying the ID identification of the protocol according to the key identifier in the key identification to obtain the protocol classification identification;
acquiring a corresponding table of an interface ID identification and the protocol classification identification, establishing a mapping relation between the protocol classification identification of the protocol and the interface ID corresponding to the protocol according to the corresponding table, and writing the protocol into a corresponding interface according to the mapping relation, wherein the corresponding table of the interface ID identification and the protocol classification identification is stored in a database.
4. The protocol interface testing method of claim 2, wherein the obtaining of the message request information and the extracting of the feature identifier of the protocol from the message request information comprise:
acquiring a preset time interval for extracting message request information, and acquiring message information according to the time interval;
detecting whether the obtained message information is complete or not, and if the message information is incomplete, re-obtaining the message information;
and comparing the message information with the response message of the previous turn to obtain the difference points of the message information and the response message of the previous turn, and obtaining the characteristic identifier according to the position in a protocol characteristic mapping table corresponding to the difference points, wherein the protocol characteristic mapping table is stored in a database.
5. The method according to claim 3, wherein the extracting the entry parameter information and the exit parameter information of the protocol in the response reply message, extracting feature parameters of the entry parameter information and the exit parameter information, marking the feature parameters, and determining the ID of the protocol according to changes of the feature parameters during entry and exit comprises:
sorting the parameter input information according to a parameter input time sequence to generate a line of parameter input matrixes, and sorting the parameter output information according to a parameter output time sequence to generate a list parameter matrixes;
performing matrix multiplication on the parameter input matrix and the parameter output matrix to obtain a parameter input-parameter output matrix;
extracting data on a main diagonal line from the parameter input-parameter output matrix as an original characteristic parameter;
carrying out normalization processing on the parameter input-parameter output matrix to obtain a normalized parameter input-parameter output matrix;
extracting data on a secondary diagonal line in the normalized parameter-input-parameter-output matrix as a characteristic parameter weight;
and matching and calculating the characteristic parameter weight and the original characteristic parameter to obtain the ID of the protocol.
6. The method according to claim 1, wherein said assembling the reverse protocol class identifier to obtain the protocol group comprises:
according to the interface source of the protocol classification mark, the inverse protocol classification mark is layered and packaged to form a plurality of protocol layers;
identifying protocol data between the protocol layers to obtain a data association index between the protocol layers, wherein the data association index is used for representing the number of data from the same interface between the two protocol layers;
and assembling the two protocol layers with the maximum data association degree into a protocol group.
7. A protocol interface testing apparatus, comprising:
the request acquisition module is arranged for acquiring message request information, extracting a characteristic identifier of a protocol from the message request information, and acquiring a response message according to a feedback result after the characteristic identifier is input into an interface;
a classification write-in module, configured to extract the protocol entry parameter information and the protocol exit parameter information in the response reply packet to obtain an ID identifier of the protocol, call a classification file to classify the ID identifier of the protocol to obtain a protocol classification identifier of the protocol, write the protocol into a corresponding interface according to the protocol classification identifier, and pre-store the classification file in a server;
an extrapolation message module, configured to obtain an inverse protocol classification identifier corresponding to the interface, assemble the inverse protocol classification identifier to obtain a protocol group, read the protocol group to obtain an inverse classification file corresponding to the protocol group, obtain protocol information of the protocol from the inverse classification file, and send the protocol information of the protocol to a test terminal, where the inverse protocol classification identifier is a value of an element in an inverse matrix of the interface protocol;
the acquiring the reverse protocol classification identifier corresponding to the interface, assembling the reverse protocol classification identifier to obtain a protocol group, reading the protocol group to obtain a reverse classification file corresponding to the protocol group, acquiring protocol information of the protocol from the reverse classification file, and sending the protocol information of the protocol to a test terminal includes:
establishing a corresponding relation table of the interface and the protocol classification identifier, performing matrixing expression on elements in the corresponding relation table to obtain an interface protocol matrix, inverting the interface protocol matrix to obtain an interface protocol inverse matrix, performing normalization processing on the elements in the interface protocol inverse matrix to obtain each element in the interface protocol inverse matrix after the normalization processing, and setting the value of each element as the inverse protocol classification identifier corresponding to the interface;
assembling the reverse protocol classification identification to obtain the protocol group;
adding the protocol group into a new example function, and obtaining an inverse classification file corresponding to the protocol group after the protocol group is added;
and acquiring a starting node and an ending node of data generation in the reverse classified file, and sequentially sending protocol information in the reverse classified file to a test terminal from the starting node to the ending node.
8. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to carry out the steps of the protocol interface testing method according to any one of claims 1 to 6.
9. A storage medium having stored thereon computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the protocol interface testing method according to any one of claims 1 to 6.
CN201811530304.3A 2018-12-14 2018-12-14 Protocol interface testing method and device, computer equipment and storage medium Active CN109510737B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811530304.3A CN109510737B (en) 2018-12-14 2018-12-14 Protocol interface testing method and device, computer equipment and storage medium
PCT/CN2019/120517 WO2020119430A1 (en) 2018-12-14 2019-11-25 Protocol interface test method, device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811530304.3A CN109510737B (en) 2018-12-14 2018-12-14 Protocol interface testing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109510737A CN109510737A (en) 2019-03-22
CN109510737B true CN109510737B (en) 2022-04-26

Family

ID=65753371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811530304.3A Active CN109510737B (en) 2018-12-14 2018-12-14 Protocol interface testing method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109510737B (en)
WO (1) WO2020119430A1 (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109510737B (en) * 2018-12-14 2022-04-26 深圳壹账通智能科技有限公司 Protocol interface testing method and device, computer equipment and storage medium
CN110287070B (en) * 2019-05-21 2024-03-19 平安银行股份有限公司 ESB special protocol interface test method, server and computer readable storage medium
CN110309058A (en) * 2019-05-24 2019-10-08 平安银行股份有限公司 Business end test method, device, computer installation and computer storage medium
CN110727475B (en) * 2019-10-12 2023-07-21 四川新网银行股份有限公司 Intelligent service calling method based on configuration
CN111611147B (en) * 2020-06-28 2023-05-30 中国人民解放军国防科技大学 Method, system and medium for detecting and analyzing performance of internal universal interface of processor
CN111884776A (en) * 2020-07-02 2020-11-03 深圳市赛特新能科技有限公司 Charging pile protocol consistency testing method
CN113992549B (en) * 2020-07-08 2023-06-13 大唐移动通信设备有限公司 Test method, test device, electronic equipment and storage medium
EP3979660B1 (en) 2020-08-03 2023-02-15 Wangsu Science & Technology Co., Ltd. Multi-protocol port sharing method and system, and server
CN114095588B (en) * 2020-08-03 2023-08-18 网宿科技股份有限公司 Sharing method, system and server of multi-protocol ports
CN112487163B (en) * 2020-11-30 2024-04-12 广州品唯软件有限公司 Execution method of automatic flow and method and device for acquiring interface data of execution method
CN113779128B (en) * 2021-09-09 2024-04-05 平安科技(深圳)有限公司 Medical data system docking method, device, equipment and storage medium
CN113709182B (en) * 2021-09-13 2023-03-10 支付宝(杭州)信息技术有限公司 Interface identification method, device and equipment
CN114070761B (en) * 2021-11-11 2023-09-26 北京轨道交通路网管理有限公司 Protocol message detection method and device and electronic equipment
CN114338448B (en) * 2021-12-29 2024-02-20 北京天融信网络安全技术有限公司 Performance test method and device, electronic equipment and storage medium
CN115242691B (en) * 2022-07-04 2023-05-19 中国电子科技集团公司第三十研究所 Protocol identification method based on protocol feature library
CN115633098B (en) * 2022-12-02 2023-03-31 北京红山微电子技术有限公司 Storage management method and device of many-core system and integrated circuit
CN116781790B (en) * 2023-08-25 2023-12-05 国网江西省电力有限公司电力科学研究院 Instrument specification intelligent conversion system, method, readable medium and electronic device
CN117254886B (en) * 2023-11-17 2024-01-23 广州市森锐科技股份有限公司 Cloud desktop data interaction method and device, computer equipment and storage medium
CN117576545B (en) * 2024-01-16 2024-04-05 成都同步新创科技股份有限公司 Multi-algorithm full-matching access adapter access method
CN117672342B (en) * 2024-01-29 2024-04-05 合肥康芯威存储技术有限公司 Protocol monitoring system and method for memory chip

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601403A (en) * 2015-01-07 2015-05-06 上海瀚之友信息技术服务有限公司 Automatic test system
CN205176829U (en) * 2013-07-25 2016-04-20 中国航天科工集团第三研究院第八三五七研究所 Multiple communications protocol's of test configuration system on a chip's test system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7099438B2 (en) * 2002-06-14 2006-08-29 Ixia Multi-protocol, multi-interface communications device testing system
CN100459530C (en) * 2005-10-13 2009-02-04 华为技术有限公司 Testing adopter and testing tool system and detecting method
KR100882814B1 (en) * 2007-06-05 2009-02-10 주식회사 이노와이어리스 Dual processing system for ensuring realtime of protocol test
KR101060181B1 (en) * 2009-08-03 2011-08-29 강원대학교산학협력단 Web-based software debugging device and its method for remote debugging
CN102694701B (en) * 2012-06-13 2015-12-02 青岛海信传媒网络技术有限公司 Message based method of testing and system
CN109510737B (en) * 2018-12-14 2022-04-26 深圳壹账通智能科技有限公司 Protocol interface testing method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN205176829U (en) * 2013-07-25 2016-04-20 中国航天科工集团第三研究院第八三五七研究所 Multiple communications protocol's of test configuration system on a chip's test system
CN104601403A (en) * 2015-01-07 2015-05-06 上海瀚之友信息技术服务有限公司 Automatic test system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于compactPcl总线的多功能串行通信接口设计;张国伟;《中国优秀硕士学位论文全文数据库》;20110930;全文 *

Also Published As

Publication number Publication date
CN109510737A (en) 2019-03-22
WO2020119430A1 (en) 2020-06-18

Similar Documents

Publication Publication Date Title
CN109510737B (en) Protocol interface testing method and device, computer equipment and storage medium
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN103164698B (en) Text fingerprints library generating method and device, text fingerprints matching process and device
CN111352907A (en) Method and device for analyzing pipeline file, computer equipment and storage medium
US20120150825A1 (en) Cleansing a Database System to Improve Data Quality
CN111680634A (en) Document file processing method and device, computer equipment and storage medium
US20170337386A1 (en) Method, apparatus, and computer-readable medium for automated construction of data masks
CN106485261A (en) A kind of method and apparatus of image recognition
CN112559526A (en) Data table export method and device, computer equipment and storage medium
CN111124421B (en) Abnormal contract data detection method and device for blockchain intelligent contract
CN113641833B (en) Service demand matching method and device
CN108415971B (en) Method and device for recommending supply and demand information by using knowledge graph
CN104573132B (en) Song lookup method and device
CN113900955A (en) Automatic testing method, device, equipment and storage medium
CN111723182B (en) Key information extraction method and device for vulnerability text
WO2021036681A1 (en) Data verification method and apparatus, computer device and storage medium
CN116910820A (en) Data report processing method, device, computer equipment and storage medium
CN116155597A (en) Access request processing method and device and computer equipment
CN106598983A (en) Information display method and device
Francois et al. Machine learning techniques for passive network inventory
WO2021129849A1 (en) Log processing method, apparatus and device, and storage medium
CN109919811B (en) Insurance agent culture scheme generation method based on big data and related equipment
CN113515705A (en) Response information generation method, device, equipment and computer readable storage medium
CN110569435A (en) Intelligent dual-ended recommendation engine system and method
CN116383883B (en) Big data-based data management authority processing method and system

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
GR01 Patent grant
GR01 Patent grant