Protocol test method and device, electronic equipment and storage medium

By acquiring the attribute information of the device under test and the protocol transmission standard information to determine the test configuration, generating and sending the target test command, and parsing the response information to achieve flexible iTAP protocol testing, this solves the problem of fixed test device roles in existing technologies and improves the flexibility and accuracy of testing.

CN122226673APending Publication Date: 2026-06-16BEIJING CEC HUADA ELECTRONIC DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING CEC HUADA ELECTRONIC DESIGN CO LTD
Filing Date
2026-04-24
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing iTAP protocol testing methods cannot achieve flexible functional verification in complex testing scenarios, and the roles of test equipment and device under test are fixed in a single mode, resulting in narrow test coverage, low automation, and reduced flexibility and scalability of protocol testing.

Method used

By acquiring the attribute information of the device under test, determining its mode, and determining the test configuration information based on the attribute information and the protocol's transmission standard information, the target test command is generated. Data packets are sent through the target transmission device, and the response information is parsed to determine the test results. This enables protocol testing based on requirements, improving the flexibility and accuracy of the test.

Benefits of technology

It enables flexible selection of test scripts and target test commands according to requirements in different test scenarios, expands the test scenarios, improves the flexibility and scalability of protocol testing, reduces the repetitive development cost of hardware platforms, and ensures rapid problem localization through structured log storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122226673A_ABST
    Figure CN122226673A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computers and discloses a protocol testing method and device, electronic equipment and a storage medium. According to the acquired attribute information of a tested device, the mode of the tested device is determined. When in a command receiving mode, the testing configuration information is determined according to the attribute information and the transmission standard information of a protocol, and then the first target testing command corresponding to the protocol function test type is determined. The first target testing command is encapsulated according to the transmission standard information of the protocol, a to-be-transmitted data packet is generated, the to-be-transmitted data packet is sent to the tested device through a target transmission device, the first response information returned by the tested device is received, the first response information is analyzed to obtain the first test result of the tested device, the first target testing command is flexibly determined according to the testing configuration information and the function test demand, and then the first test result obtained by analyzing the first response information, so that the protocol test is carried out according to the demand, and the flexibility of the protocol test is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically to a protocol testing method, apparatus, electronic device, and storage medium. Background Technology

[0002] The iTAP protocol is a new contactless protocol based on Type-A technology, defining complete rules for communication and command transmission. Microprocessor-based devices (MP devices) convert commands into corresponding radio frequency signals according to the iTAP protocol, enabling interaction with the device under test (DUT). By verifying whether the data during the bidirectional interaction between the MP device and the DUT conforms to the protocol specifications, the correct execution of the iTAP protocol by the DUT can be confirmed.

[0003] In related technologies, iTAP protocol verification mainly relies on the accompanying software provided by the device for testing. However, this software only supports basic function verification and cannot realize other functions in complex testing scenarios. Furthermore, it is difficult to manage and analyze test-related data when test anomalies occur, which reduces the flexibility and scalability of protocol testing. Summary of the Invention

[0004] This application provides a protocol testing method, apparatus, electronic device, and storage medium to at least solve the problem that complex functions cannot be implemented in related technologies.

[0005] This application provides a protocol testing method, including: Obtain the attribute information of the device under test; Determine the mode of the device under test based on its attribute information; When the device under test is in command receiving mode, the test configuration information is determined based on the attribute information of the device under test and the transmission standard information of the protocol. Based on the test configuration information and the mode of the device under test, determine at least one first target test command corresponding to any protocol function test type; Based on the transmission standard information of the protocol, at least one first target test command is encapsulated to generate a data packet to be transmitted; The target transmission device sends the data packet to be transmitted to the device under test, so that the device under test responds to the first target test command represented by the data packet to be transmitted and generates the first response information corresponding to the first target test command. Based on the standard information transmitted according to the protocol, the first test result of the device under test is determined according to the first response information corresponding to each first target test command.

[0006] This application also provides a protocol testing apparatus, including: The acquisition module is used to acquire attribute information of the device under test. The first determining module is used to determine the mode of the device under test based on the attribute information of the device under test; The second determining module is used to determine the test configuration information based on the attribute information of the device under test and the transmission standard information of the protocol when the mode of the device under test is command receiving mode. The third determination module determines at least one first target test command corresponding to any protocol function test type based on the test configuration information and the mode of the device under test. The data packet generation module is used to encapsulate at least one first target test command according to the transmission standard information of the protocol to generate a data packet to be transmitted. The transmission module is used to send the data packet to be transmitted to the device under test through the target transmission device, so that the device under test responds to the first target test command represented by the data packet to be transmitted and generates the first response information corresponding to the first target test command. The fourth determination module is used to transmit standard information based on the protocol and determine the first test result of the device under test according to the first response information corresponding to each first target test command.

[0007] This application also provides a protocol testing system, including: a protocol testing device, a target transmission device, and a device under test; The protocol testing equipment is used to acquire the attribute information of the device under test (DUT), determine the mode of the DUT based on the attribute information, and determine the test configuration information based on the attribute information and the transmission standard information of the protocol when the DUT is in command receiving mode. Based on the test configuration information and the mode of the DUT, at least one first target test command corresponding to any protocol function test type is determined. Based on the transmission standard information of the protocol, at least one first target test command is encapsulated to generate a data packet to be transmitted and sent to the target transmission device. The target transmission device is used to receive the data packets to be transmitted sent by the protocol test device and to send the data packets to be transmitted to the device under test. The device under test is used to receive the data packet to be transmitted sent by the target transmission device, respond to the first target test command represented by the data packet to be transmitted, generate the first response information corresponding to the first target test command, and send the first response information corresponding to the first target test command to the target transmission device. The target transmission device is used to receive the first response information sent by the device under test and send the first response information to the protocol test device; The protocol testing equipment is used to transmit standard information based on the protocol and determine the test results of the device under test according to the first response information corresponding to each first target test command.

[0008] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described protocol testing methods when executing the computer program.

[0009] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described protocol testing methods.

[0010] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described protocol testing methods.

[0011] This application achieves a significant improvement in protocol testing flexibility by determining the device under test's (DUT) mode based on acquired attribute information. In command receiving mode, test configuration information is determined according to attribute information and protocol transmission standard information. This leads to the determination of the first target test command corresponding to the protocol's functional test type. The first target test command is then encapsulated according to the protocol's transmission standard information to generate a data packet to be transmitted. This packet is sent to the DUT via the target transmission device, and the first response information returned by the DUT is received. The first response information is then parsed to obtain the first test result of the DUT. By flexibly determining the first target test command based on test configuration information and functional test requirements, and then obtaining the first test result by parsing the first response information, protocol testing can be performed according to requirements, thus enhancing the flexibility of protocol testing. Attached Figure Description

[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating the protocol testing method provided in this application embodiment; Figure 2 A schematic diagram illustrating an exemplary protocol test structure provided in an embodiment of this application; Figure 3 A schematic diagram of the protocol testing device provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the protocol testing system provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0016] Micropross MP series devices, such as MP300, MP500, and CTS3, are widely used programmable RF protocol test platforms with complete RF front-end and protocol processing capabilities. They can serve as ideal carriers for automated testing of the iTAP protocol. The iTAP protocol involves the interaction of state changes and application data, resulting in high testing complexity. However, there is currently no complete technical solution that can be based on the MP device's native API, integrate the iTAP protocol standard, and support flexible development and management of test scripts.

[0017] In the field of contactless smart cards and near-field communication (NFC), protocol conformance testing is crucial for ensuring device interoperability and system reliability. Currently, testing of next-generation NFC protocols such as iTAP primarily relies on dedicated protocol analyzers or software provided by device manufacturers. This only enables basic communication function verification, but its test logic is rigid, script extensibility is poor, and it struggles to adapt to complex and ever-changing test scenarios. Existing solutions typically fix the roles of the test device and the device under test into a single "master-slave" model, preventing flexible switching within the same testing framework. This results in narrow test coverage, low automation, and reduced flexibility and scalability of protocol testing.

[0018] To address the aforementioned technical problems, this application provides a protocol testing method, apparatus, electronic device, and storage medium. The method includes: acquiring attribute information of a device under test (DUT); determining the DUT's mode based on the attribute information; if the DUT's mode is command receiving mode, determining test configuration information based on the DUT's attribute information and protocol transmission standard information; determining at least one first target test command corresponding to any protocol function test type based on the test configuration information and the DUT's mode; encapsulating the at least one first target test command according to the protocol transmission standard information to generate a data packet to be transmitted; sending the data packet to be transmitted to the DUT through a target transmission device, so that the DUT responds to the first target test command represented by the data packet to generate first response information corresponding to the first target test command; and determining a first test result of the DUT based on the protocol transmission standard information and the first response information corresponding to each first target test command.

[0019] The method provided by the above scheme determines the mode of the device under test (DUT) based on the acquired attribute information. When in command receiving mode, it determines the test configuration information based on the attribute information and the protocol transmission standard information, and then determines the first target test command corresponding to the protocol function test type. The first target test command is encapsulated according to the protocol transmission standard information to generate a data packet to be transmitted, which is sent to the DUT through the target transmission device. The first response information returned by the DUT is received, and then the first test result of the DUT is obtained by parsing the first response information. By flexibly determining the first target test command based on the test configuration information and functional test requirements, and then obtaining the first test result by parsing the first response information, the method realizes protocol testing according to requirements, thus improving the flexibility of protocol testing.

[0020] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] The specific application environment architecture or specific hardware architecture on which the execution of the protocol testing method depends is described here.

[0022] This application provides a protocol testing method for performing protocol function testing on a device under test. The execution subject of this application is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, and other electronic devices that can be used for protocol testing.

[0023] like Figure 1 The diagram shown is a flowchart illustrating a protocol testing method provided in an embodiment of this application. The method includes: Step 101: Obtain the attribute information of the device under test.

[0024] Step 102: Determine the mode of the device under test based on its attribute information.

[0025] Specifically, the device under test (DUT) is the end that communicates non-contactly with the current test system and the target transmission equipment. DUTs include smart terminals, cards, turnstile readers, access control systems, etc. DUTs are categorized into two types: Proximity Coupling Devices (PCDs) and Proximity Integrated Circuit Cards (PICCs). The attribute information of the DUT includes its type, device subclass, supported protocol types, protocol versions, communication parameters, AID, and supported data rates.

[0026] Accordingly, the type of the device under test is determined by the attributes of the device under test, which provides a basis for determining the test configuration information and selecting the appropriate test script. At the same time, it enables protocol testing to be performed when the type of the device under test is PICC or PCD, thus expanding the test scenarios for protocol testing.

[0027] Step 103: When the device under test is in command receiving mode, determine the test configuration information based on the attribute information of the device under test and the transmission standard information of the protocol.

[0028] Specifically, the test attribute information is determined based on the attribute information of the device under test, the mode of the device under test, the test configuration definitions that can be used for PCD and PICC testing respectively, the transmission standard information of the protocol, and the enabling information of different functional test types.

[0029] When conducting protocol testing, the type of the device under test (DUT) is first determined. If the DUT is a PICC device, it acts as the passive party in the communication, thus determining the DUT's mode to be command-receive mode. The protocol's transmission standards include the data frame format, control field requirements, and error checking rules.

[0030] If the device under test is determined to be in command receiving mode, the target test protocol is identified. Then, the corresponding transmission standard information, supported functional test types, corresponding enabling information, and other required attribute information for the target test protocol are determined from the test attribute information, serving as the test configuration information. The target test protocol includes the iTAP protocol.

[0031] Step 104: Based on the test configuration information and the mode of the device under test, determine at least one first target test command corresponding to any protocol function test type.

[0032] Specifically, for any protocol function test type and the mode of the device under test, select the test configuration information in the test attribute information and determine the corresponding PICC script. The PICC script that completes the function test of this type includes one or more first target test commands. By executing the first target test command, the corresponding response information is obtained and the protocol test is performed. The PICC script is responsible for organizing and parsing iTAP data frames and also implements the logical control of the test device.

[0033] Accordingly, by determining the test configuration information for the protocol testing requirements based on the mode of the device under test and the type of function to be tested, the corresponding first target test command was determined, enabling flexible selection of test scripts and target test commands according to requirements, thus improving the flexibility of protocol testing.

[0034] Step 105: According to the transmission standard information of the protocol, encapsulate at least one first target test command to generate a data packet to be transmitted.

[0035] Specifically, according to the communication format requirements of the iTAP protocol, one or more first target test commands are encapsulated to obtain the data packet to be transmitted.

[0036] Step 106: Send the data packet to be transmitted to the device under test through the target transmission device, so that the device under test responds to the first target test command represented by the data packet to be transmitted and generates the first response information corresponding to the first target test command.

[0037] Specifically, the target transmission devices include programmable protocol test devices such as MP300, MP500, and CTS3 devices. Based on the target transmission device characterized by the test configuration information, the target transmission device is selected from at least one transmission device, and the corresponding device driver is invoked to establish a communication link. The encapsulated data packet to be transmitted is converted into a radio frequency signal and transmitted to the device under test through the target device's antenna.

[0038] The device under test responds to the first target test command, generates corresponding first response information, and sends it to the target transmission device through the antenna of the device under test.

[0039] Accordingly, the target transmission device includes a variety of programmable protocol testing devices, which increases the scalability and compatibility of protocol testing and reduces the cost of repetitive development for different hardware platforms.

[0040] Step 107: Based on the standard transmission information of the protocol, determine the first test result of the device under test according to the first response information corresponding to each first target test command.

[0041] Specifically, the system receives the first response information sent by the device under test, and examines the format and content of the first response information according to the transmission standard information of the protocol to obtain the first test result. During the interactive verification process, if any first response information is abnormal, the protocol test is interrupted and the first test result is determined to be abnormal.

[0042] Accordingly, by identifying the attributes of the device under test and the type of function to be tested, the appropriate scripts and target test commands can be dynamically selected for testing, enabling protocol testing of multiple functions and improving the flexibility of protocol testing.

[0043] Based on the above embodiments, as an implementable approach, in one embodiment, the first test result of the device under test is determined according to the first response information corresponding to each first target test command, based on the protocol's transmission standard information, including: Step 1071: For any first response information, based on the protocol's transmission standard information and the transmission format information represented by the first response information, determine the format verification result. Step 1072: Based on the protocol's transmission standard information, parse the first response information to obtain the command response information; Step 1073: Determine the anomaly detection result based on the command response information and the preset anomaly database; Step 1074: Determine the consistency result based on the first target test command and the first response information; Step 1075: Determine the test results of the device under test based on the format verification results, anomaly inspection results, and execution consistency results.

[0044] Specifically, the first response information obtained is usually a data frame. Based on the protocol's transmission standard information, the data frame structure of the first response information is verified to ensure that it meets the protocol requirements, the filling of the control fields meets the protocol requirements, and the first response information is validated to determine whether there are any errors. Finally, the format verification result is obtained.

[0045] According to the protocol's transmission standard information, the received data frames are parsed to obtain the data payload, which serves as the command response information. For specific application scenarios, a pre-set anomaly database is used to perform anomaly checks on the command response information. This database contains common anomaly data and anomaly detection logic, including data authenticity verification. First, common anomaly data and the command response information are compared to determine if the command response information is abnormal. If the command response information matches the common anomaly data, an anomaly is found; otherwise, the anomaly detection process is further refined to verify the presence of anomalies. Specific application scenarios include those where the interactive data contains random numbers.

[0046] If any of the format validation results, anomaly detection results, or execution consistency results are abnormal, the first test result is determined to be abnormal. If the first test result is abnormal, an error message is displayed to the user.

[0047] Accordingly, format verification is performed based on the standard transmission information of the protocol, avoiding errors caused by manual parsing. Furthermore, by checking the format, data anomalies, and execution consistency of the first response information, the first response information is verified from multiple aspects, improving the accuracy and efficiency of the test.

[0048] In some alternative implementations, step 1074 above includes: Step a1: Determine the expected target command based on the first target test command corresponding to the first response information; Step a2: Determine the execution result of the target command based on the first response information; Step a3: Compare the expected result of the target command with the result of the target command execution to determine the consistency of the execution result.

[0049] Specifically, based on the first target test command, the standard response information of the device under test under normal circumstances is determined as the expected target command. Based on the first response information actually returned by the device under test, the execution result corresponding to the actual response information is determined as the execution result of the target command. The actual command execution result is compared with the expected target command to determine whether they are consistent, and then the execution consistency result is determined.

[0050] Specifically, in one embodiment, when the device under test is in command sending mode, at least one second target test command sent by the device under test is received; based on the transmission standard information of the protocol, the second test result of the device under test is determined according to each second target test command.

[0051] Specifically, the attributes of the device under test (DUT) are obtained. When the type of the DUT is PCD, it acts as the initiator of communication, thereby determining the mode of the DUT to be command sending mode. Based on the attribute information of the DUT and the transmission standard information of the protocol, the PCD script is determined, and the device enters the listening mode to wait for the second target test command actively sent by the DUT. The PCD script is invoked to perform format verification and anomaly verification on the second target test command to determine whether the second target test command is abnormal. If the second test result is normal, the PCD script generates the corresponding second response information, encapsulates it, and sends it to the DUT through the target transmission device.

[0052] Correspondingly, compared to the limitation of only being able to perform unidirectional testing on the device under test (DUT), by identifying the DUT's attributes, the appropriate script can be dynamically selected for testing regardless of whether the DUT is a PICC or PCD type. This enables protocol testing of various devices such as contactless smart cards and mobile terminals, expanding the testing scenarios. Furthermore, by selecting the corresponding target test command for different protocol testing functions, the flexibility of protocol testing is enhanced.

[0053] Specifically, in one embodiment, test interaction information is generated based on all first target test commands and corresponding first response information, as well as the first test result of the device under test; if the first test result represented by the test interaction information is normal, an interaction log is generated based on the test interaction information; and the interaction log is automatically sent to the user based on the log viewing flag represented by the test configuration information.

[0054] Specifically, test interaction information is generated from all the first target test commands and corresponding first response information corresponding to this type of functional test, as well as the first test result of the device under test. If the first test result is normal, the test interaction information is used to generate a script execution log, which is then combined with the non-contact log to generate an interaction log. Based on the log viewing flag represented by the test configuration information, the interaction log is automatically sent to the user.

[0055] The test configuration information includes a log viewing flag. When the log viewing flag is enabled, interactive logs will be sent to the user after the functional test is completed, allowing the user to query the logs. Interactive logs include contactless logs, which contain all modulation and load modulation data transmitted between the target transmission device and the device under test via a 13.56MHz radio frequency signal.

[0056] Furthermore, based on the protocol testing requirements, corresponding test scripts are developed to expand the functionality of the protocol testing.

[0057] Correspondingly, compared to the uneditable logs provided by traditional supporting software, which cannot be flexibly queried, filtered, and managed, storing logs in a structured manner preserves all data from the entire testing process, ensuring that in the event of an anomaly, it can be quickly queried and traced, thereby quickly locating the root cause of the problem.

[0058] Based on the above embodiments, as an implementable approach, in one embodiment, at least one first target test command is encapsulated according to the protocol's transmission standard information to generate a data packet to be transmitted, including: Step 1051: Determine the test command queue based on all first target test commands corresponding to any functional test type; Step 1052: According to the transmission standard information of the protocol, encapsulate all the first target test commands in the test command queue to generate a data packet to be transmitted.

[0059] Specifically, it includes two methods: interactive testing and batch testing. Interactive testing, which is a non-sequencer method, involves encapsulating and sending a first target test command each time, waiting to obtain the corresponding first response information, and then sending the next first target test command to obtain the next first response information and the first test result. Interactive testing is usually used in scenarios with high real-time requirements and high interactivity requirements.

[0060] Batch testing, or the sequencer method, generates a test command queue for all first target test commands corresponding to this type of functional test, encapsulates all first target test commands into a data packet to be transmitted, and sends it to the device under test. The device under test responds sequentially, and the response information is verified.

[0061] Correspondingly, interactive testing can quickly identify anomalies by examining the response of the device under test one command at a time, while batch testing enables stress testing of the device under test by sending commands centrally to the device under test. Both interactive and batch testing are supported, which improves the flexibility of protocol testing.

[0062] For example, such as Figure 2 The diagram shown is an exemplary schematic of the protocol test structure provided in this application embodiment. When the device under test is in command receiving mode, the test configuration information is determined based on the attribute information of the iTAP device under test. Based on the test configuration information, the mode of the device under test, and the target test function type, the corresponding test script is determined. Typically, the command receiving mode is a PICC script. Based on different test scripts, the corresponding test configuration information is obtained from the test attribute information, and then at least one first target test command is determined. Based on the transmission standard information of the protocol, at least one first target test command is encapsulated to generate a data packet to be transmitted. The API encapsulation is a secondary encapsulation definition based on the API interface provided by the hardware device, which facilitates script differentiation and calling. Select the target transmission device, i.e., the MP device. Through the device driver, the data packet to be transmitted is sent to the target transmission device, and then sent to the device under test through the MP device. The device under test receives and responds to the first target test command represented by the data packet to be transmitted, generates the first response information corresponding to the first target test command, sends it to the MP device, parses the first response information, and performs format verification, anomaly detection, and consistency verification. If it passes, it sends the next first target test command, obtains the next first response information, and performs the verification again until the first test result is obtained. The entire process data of the protocol test is printed to generate an interaction log for users to query.

[0063] The protocol testing method provided in this application includes: acquiring attribute information of the device under test (DUT); determining the mode of the DUT based on the attribute information; determining test configuration information based on the attribute information and protocol transmission standard information when the DUT is in command receiving mode; determining at least one first target test command corresponding to any protocol function test type based on the test configuration information and the DUT's mode; encapsulating the at least one first target test command according to the protocol transmission standard information to generate a data packet to be transmitted; sending the data packet to be transmitted to the DUT through a target transmission device, so that the DUT responds to the first target test command represented by the data packet to be transmitted and generates first response information corresponding to the first target test command; and determining a first test result of the DUT based on the first response information corresponding to each first target test command according to the protocol transmission standard information.

[0064] The method provided by the above solution determines the mode of the device under test (DUT) based on the acquired attribute information. When in command receiving mode, it determines the test configuration information based on the attribute information and the protocol's transmission standard information, thereby determining the first target test command corresponding to the protocol functional test type. The first target test command is encapsulated according to the protocol's transmission standard information to generate a data packet to be transmitted, which is sent to the DUT through the target transmission device. The solution also receives the first response information returned by the DUT, and then parses the first response information to obtain the first test result of the DUT. By flexibly determining the first target test command based on the test configuration information and functional test requirements, and then obtaining the first test result by parsing the first response information, the solution enables protocol testing based on requirements, improving the flexibility of protocol testing. Furthermore, by determining the type of the DUT through its attributes, it provides a basis for subsequently determining the test configuration information and selecting appropriate test scripts. Simultaneously, it enables protocol testing even when the DUT type is PICC or PCD, expanding the test scenarios for protocol testing. By determining the test configuration information for protocol testing requirements based on the mode of the device under test (DUT) and the type of function to be tested, the corresponding first target test command was identified. This enabled flexible selection of test scripts and target test commands based on requirements, improving the flexibility of protocol testing. The target transmission devices include various programmable protocol test devices, increasing the scalability and compatibility of protocol testing and reducing the cost of repetitive development for different hardware platforms. By identifying the attributes of the DUT and the type of function to be tested, the appropriate scripts and target test commands can be dynamically selected for testing, enabling protocol testing of multiple functions and improving the flexibility of protocol testing. Format verification based on protocol transmission standard information avoids errors caused by manual parsing. Furthermore, by verifying the format, data anomalies, and execution consistency of the first response information, the accuracy and efficiency of the first response information are improved from multiple perspectives. Compared to only being able to perform unidirectional testing on the DUT, by identifying the attributes of the DUT, the appropriate scripts can be dynamically selected for testing in cases where the DUT is of type PICC or PCD, enabling protocol testing of various devices such as contactless smart cards and mobile terminals, expanding the testing scenarios. By selecting the corresponding target test commands for different functions of the protocol testing, the flexibility of protocol testing is improved. Compared with the uneditable logs provided by traditional supporting software, which cannot flexibly query, filter, and manage logs, storing logs in a structured manner preserves all data from the entire testing process, ensuring that in the event of anomalies, data can be quickly queried and traced, thereby quickly locating the root cause of the problem.Interactive testing can quickly identify anomalies by examining the response of the device under test (DUT) one command at a time. Batch testing, on the other hand, enables stress testing of the DUT by sending commands centrally to the DUT. Both interactive and batch testing support each other, thus improving the flexibility of protocol testing.

[0065] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0066] Embodiments of this application also provide a protocol testing apparatus for executing the protocol testing method provided in the above embodiments.

[0067] like Figure 3 The diagram shown is a schematic representation of the protocol testing apparatus provided in an embodiment of this application. The protocol testing apparatus 30 includes: an acquisition module 301, a first determination module 302, a second determination module 303, a third determination module 304, a data packet generation module 305, a transmission module 306, and a fourth determination module 307.

[0068] The system comprises the following modules: an acquisition module for acquiring attribute information of the device under test (DUT); a first determination module for determining the mode of the DUT based on its attribute information; a second determination module for determining test configuration information based on the DUT's attribute information and the protocol's transmission standard information when the DUT is in command receiving mode; a third determination module for determining at least one first target test command corresponding to any protocol function test type based on the test configuration information and the DUT's mode; a data packet generation module for encapsulating at least one first target test command according to the protocol's transmission standard information to generate a data packet to be transmitted; a transmission module for sending the data packet to be transmitted to the DUT via a target transmission device, so that the DUT responds to the first target test command represented by the data packet to generate first response information corresponding to the first target test command; and a fourth determination module for determining the first test result of the DUT based on the protocol's transmission standard information and the first response information corresponding to each first target test command.

[0069] For a description of the features in the embodiment corresponding to the protocol testing device, please refer to the relevant description of the embodiment corresponding to the protocol testing method, which will not be repeated here.

[0070] Embodiments of this application also provide a protocol testing system for executing the protocol testing method provided in the above embodiments.

[0071] like Figure 4The diagram shown is a schematic representation of the protocol testing system provided in this embodiment. The protocol testing system includes: a protocol testing device, a target transmission device, and a device under test. The protocol testing equipment is used to acquire the attribute information of the device under test (DUT), determine the mode of the DUT based on the attribute information, and determine the test configuration information based on the attribute information and the transmission standard information of the protocol when the DUT is in command receiving mode. Based on the test configuration information and the mode of the DUT, at least one first target test command corresponding to any protocol function test type is determined. Based on the transmission standard information of the protocol, at least one first target test command is encapsulated to generate a data packet to be transmitted and sent to the target transmission device. The target transmission device is used to receive the data packets to be transmitted sent by the protocol test device and to send the data packets to be transmitted to the device under test. The device under test is used to receive the data packet to be transmitted sent by the target transmission device, respond to the first target test command represented by the data packet to be transmitted, generate the first response information corresponding to the first target test command, and send the first response information corresponding to the first target test command to the target transmission device. The target transmission device is used to receive the first response information sent by the device under test and send the first response information to the protocol test device; The protocol testing equipment is used to transmit standard information based on the protocol and determine the test results of the device under test according to the first response information corresponding to each first target test command.

[0072] For a description of the features in the corresponding embodiment of the protocol testing system, please refer to the relevant description of the corresponding embodiment of the protocol testing method, which will not be repeated here.

[0073] Embodiments of this application also provide an electronic device, such as... Figure 5 The diagram shown is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above-described protocol testing method embodiments.

[0074] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described protocol testing method embodiments at runtime.

[0075] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0076] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described protocol testing method embodiments.

[0077] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described protocol testing method embodiments.

[0078] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0079] The foregoing has provided a detailed description of a protocol testing method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A protocol testing method, characterized in that, The method includes: Obtain the attribute information of the device under test; The mode of the device under test is determined based on the attribute information of the device under test; When the device under test is in command receiving mode, the test configuration information is determined based on the attribute information of the device under test and the transmission standard information of the protocol. Based on the test configuration information and the mode of the device under test, determine at least one first target test command corresponding to any protocol function test type; According to the transmission standard information of the protocol, the at least one first target test command is encapsulated to generate a data packet to be transmitted; The data packet to be transmitted is sent to the device under test through the target transmission device, so that the device under test responds to the first target test command represented by the data packet to be transmitted and generates first response information corresponding to the first target test command. Based on the transmission standard information of the protocol, and according to the first response information corresponding to each first target test command, the first test result of the device under test is determined.

2. The protocol testing method according to claim 1, characterized in that, The transmission standard information based on the protocol, and the determination of the first test result of the device under test according to the first response information corresponding to each first target test command, include: For any first response message, based on the transmission standard information of the protocol, and according to the transmission format information represented by the first response message, the format verification result is determined; Based on the transmission standard information of the protocol, the first response information is parsed to obtain command response information; The anomaly detection result is determined based on the command response information and the preset anomaly database; Based on the first target test command and the first response information, determine the consistency result of the execution; The test results of the device under test are determined based on the format verification results, anomaly detection results, and execution consistency results.

3. The protocol testing method according to claim 2, characterized in that, The step of determining the execution consistency result based on the first target test command and the first response information includes: Based on the first target test command corresponding to the first response information, determine the expected target command; Based on the first response information, determine the execution result of the target command; Compare the expected result of the target command with the result of the target command execution to determine the consistency of the execution result.

4. The protocol testing method according to claim 1, characterized in that, The method further includes: When the device under test is in command sending mode, receive at least one second target test command sent by the device under test; Based on the transmission standard information of the protocol, the second test result of the device under test is determined according to each of the second target test commands.

5. The protocol testing method according to claim 1, characterized in that, The method further includes: Based on all the first target test commands and the corresponding first response information, as well as the first test results of the device under test, test interaction information is generated; If the first test result represented by the test interaction information is normal, an interaction log is generated based on the test interaction information. Based on the log viewing flags represented by the test configuration information, the interaction logs are automatically sent to the user.

6. The protocol testing method according to claim 1, characterized in that, The step of encapsulating the at least one first target test command according to the transmission standard information of the protocol to generate a data packet to be transmitted includes: Determine the test command queue based on all first target test commands corresponding to any of the aforementioned functional test types; Based on the transmission standard information of the protocol, all first target test commands in the test command queue are encapsulated to generate a data packet to be transmitted.

7. A protocol testing device, characterized in that, The device includes: The acquisition module is used to acquire attribute information of the device under test. The first determining module is used to determine the mode of the device under test based on the attribute information of the device under test; The second determining module is used to determine test configuration information based on the attribute information of the device under test and the transmission standard information of the protocol when the mode of the device under test is command receiving mode. The third determining module determines at least one first target test command corresponding to any protocol function test type based on the test configuration information and the mode of the device under test. The data packet generation module is used to encapsulate the at least one first target test command according to the transmission standard information of the protocol to generate a data packet to be transmitted. The transmission module is used to send the data packet to be transmitted to the device under test through the target transmission device, so that the device under test responds to the first target test command represented by the data packet to be transmitted and generates first response information corresponding to the first target test command; The fourth determining module is used to determine the first test result of the device under test based on the transmission standard information of the protocol and the first response information corresponding to each of the first target test commands.

8. A protocol testing system, characterized in that, The system includes: protocol testing equipment, target transmission equipment, and the device under test; The protocol testing device is used to acquire the attribute information of the device under test, determine the mode of the device under test based on the attribute information of the device under test, and when the mode of the device under test is command receiving mode, determine the test configuration information based on the attribute information of the device under test and the transmission standard information of the protocol, determine at least one first target test command corresponding to any protocol function test type based on the test configuration information and the mode of the device under test, encapsulate the at least one first target test command based on the transmission standard information of the protocol, generate a data packet to be transmitted, and send the data packet to be transmitted to the target transmission device. The target transmission device is used to receive the data packet to be transmitted sent by the protocol test device and send the data packet to be transmitted to the device under test; The device under test is used to receive a data packet to be transmitted sent by the target transmission device, respond to a first target test command represented by the data packet to be transmitted, generate a first response information corresponding to the first target test command, and send the first response information corresponding to the first target test command to the target transmission device. The target transmission device is used to receive the first response information sent by the device under test, and send the first response information to the protocol test device; The protocol testing equipment is used to determine the test result of the device under test based on the transmission standard information of the protocol and the first response information corresponding to each first target test command.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the protocol testing method as described in any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the protocol testing method as described in any one of claims 1 to 6.