Method for testing performance of intelligent card
By configuring the card reader firmware and processing smart card performance testing instructions, the problems of high cost and functional redundancy of smart card performance testing equipment in the existing technology are solved, and low-cost, simple and effective smart card performance testing is achieved.
Patent Information
- Application Number
- CN202411536667.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-14
AI Technical Summary
Existing smart card performance testing equipment is costly and has redundant functions, making it difficult to effectively utilize smart cards when only performance testing is required.
By configuring the card reader firmware and initializing the test program, receiving smart card performance test instructions and processing according to the instruction type, the performance testing of smart card is achieved.
It reduces the cost of smart card performance testing, avoids functional redundancy, and provides a simple and effective testing method.
Smart Images

Figure CN119623491A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart card testing, and in particular to a method for smart card performance testing. Background Art
[0002] Existing smart cards, such as SIM / financial / transportation cards, Mifare cards, etc., generally use professional contact / contactless smart card comprehensive testers (such as Micropross MP300 series instruments) to perform performance tests on contact / contactless APDU and Mifare card instructions. Such professional contact / contactless smart card comprehensive testers are expensive and integrate complex functions, such as monitoring contact / contactless protocol functions, comprehensive protocol analysis and simulation functions, open circuit / short circuit, working current, leakage current, voltage, timing and other measurement functions, hardware sequencer functions, etc. In addition, such professional test equipment also requires certain technical development capabilities to be used for smart card performance testing. However, in some specific cases, such as when the smart card only needs to be tested for performance, the use of such professional test equipment not only causes a waste of cost, but also has a lot of redundancy in the functions of the instrument. Therefore, a method for smart card performance testing is urgently needed to solve the existing technical problems. Summary of the invention
[0003] In view of the above problems, the present invention is proposed to provide a method for testing the performance of a smart card that overcomes the above problems or at least partially solves the above problems.
[0004] In order to solve the above technical problems, the embodiments of the present application disclose the following technical solutions:
[0005] In a first aspect, an embodiment of the present invention discloses a method for testing performance of a smart card, comprising:
[0006] S100. Configure the card reader firmware and initialize the card reader test program;
[0007] S200. The card reader receives a smart card performance test instruction and determines the type of the smart card performance test instruction; the smart card performance test instruction type includes contact and contactless types;
[0008] S300. Based on the result of the smart card performance test instruction type judgment, the smart card performance test instruction is processed according to different preset rules to implement the smart card performance test.
[0009] Furthermore, in S100, the card reader firmware is configured by downloading and installing the firmware and setting the card reader parameters; the card reader test program is initialized by downloading the test program, connecting the card reader, initializing the test program and executing the test program.
[0010] Further, in S300, when the smart card performance test instruction type is contact type, the specific method for processing the smart card performance test instruction includes: processing the command header of the smart card performance test instruction to obtain the start timing point T1 and the end timing point T2 for sending the command header respectively; judging whether there is command data in the smart card performance test instruction, if there is no command data in the smart card performance test instruction, judging whether the smart card performance test instruction contains process bytes, if the smart card performance test instruction contains process bytes, obtaining the smart card response data start timing point T3 and the smart card response data end timing point T4; after the smart card response data ends, obtaining the performance private instruction in the smart card performance test instruction, transmitting and processing the performance private instruction, obtaining the performance private instruction transmission and processing time, and obtaining the segmented time for processing the smart card performance test instruction by sending the start timing point T1, the end timing point T2, the smart card response data start timing point T3 and the smart card response data end timing point T4 through the command header.
[0011] Further, in S300, if the smart card performance test instruction contains command data, obtain the start timing point t3 and the end timing point t4 of the smart card sending the INS instruction; when the INS instruction is sent, obtain the start timing point t5 and the end timing point t6 of the command data sending, and determine whether the smart card performance test instruction contains process bytes; if the smart card performance test instruction contains process bytes, obtain the start timing point t7 and the end timing point t8 of the smart card response data; after the smart card response data ends, obtain the performance private instruction in the smart card performance test instruction, transmit and process the performance private instruction, and obtain the transmission and processing time of the performance private instruction, and obtain the segmented time of the smart card performance test instruction processing by sending the start timing point T1 and the end timing point T2 of the command header, the start timing point t3 and the end timing point t4 of the smart card sending the INS instruction, the start timing point t5 and the end timing point t6 of the command data sending, and the start timing point t7 and the end timing point t8 of the smart card response data.
[0012] Further, in S300, when the smart card performance test instruction type is contactless, the specific method for processing the smart card performance test instruction includes: determining whether the smart card test instruction is a CPU card instruction or a Mifare card instruction, when the smart card test instruction is a CPU card instruction, obtaining the instruction sending start timing point T1, determining whether the instruction contains a link block, if the instruction is not a link block, obtaining the instruction sending end timing point T2, determining whether the instruction contains a WTX request, if the instruction does not contain a WTX request, obtaining the smart card start response timing point T3, determining whether the response data is a link block, if the response data is a link block, obtaining the smart card end response timing point T4, obtaining the performance private instruction in the smart card performance test instruction, transmitting and processing the performance private instruction, obtaining the performance private instruction transmission and processing time, and obtaining the segmented time of the smart card performance test instruction processing through the instruction sending start timing point T1, the end timing point T2, the smart card response data start timing point T3 and the smart card response data end timing point T4.
[0013] Further, it is determined whether the instruction contains a link block. If the instruction contains a link block, the link block returned by the smart card is ignored. It is determined whether the instruction contains a WTX request. If the instruction contains a WTX request, the returned WTX request is ignored. It is determined whether the response data is a link block. If the response data is not a link block, wait for the smart card to continue sending the link block.
[0014] Furthermore, when the smart card performance test instruction type is contactless, the specific method for processing the smart card performance test instruction includes: determining whether the smart card test instruction is a CPU card instruction or a Mifare card instruction; when the smart card test instruction is a Mifare card instruction, obtaining the specific content of the Mifare card instruction; when the specific content of the Mifare card instruction is an authentication and write instruction, there are 2 sections of instructions in the authentication and write instructions that need to be processed; obtaining the first instruction sending end timing point T1, the smart card responds to the first instruction start timing point T2, the second instruction sending end timing point T3, and the smart card responds to the second instruction start timing point T4; obtaining a performance private instruction; and according to the first instruction sending end timing point T1, the smart card responds to the first instruction start timing point T2, the second instruction sending end timing point T3, and the smart card responds to the second instruction start timing point T4, obtaining the segmented time for processing the smart card performance test instruction.
[0015] Furthermore, when the specific content of the Mifare card instruction is read, increase or decrease value, transmission and recovery instruction, the first instruction sending end timing point T1 is obtained, and the smart card responds to the first instruction starting timing point T2, and the performance private instruction is obtained. According to the first instruction sending end timing point T1, the smart card responds to the first instruction starting timing point T2, the segmented time of the smart card performance test instruction processing is obtained.
[0016] In a second aspect, an embodiment of the present invention discloses an electronic device, including:
[0017] one or more processors;
[0018] A memory for storing one or more programs;
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the smart card performance testing method.
[0020] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:
[0021] The embodiment of the present invention discloses a method for smart card performance testing, including: configuring the card reader firmware, initializing the card reader test program; the card reader receives the smart card performance test instruction, and determines the type of the smart card performance test instruction; the smart card performance test instruction type includes contact type and contactless type; according to the smart card performance test instruction type judgment result, the smart card performance test instruction is processed according to different preset rules to test the smart card performance. The present invention adds APDU and Mifare card instruction performance statistics functions to the smart card reader, and obtains the command data transmission time, processing time, response data transmission time or total time when the card reader executes the contact / contactless APDU\Mifare card instruction through private instructions. Compared with the prior art, the method is simpler and the cost is lower.
[0022] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0024] Figure 1 This is a flow chart of a method for smart card performance testing in embodiment 1 of the present invention;
[0025] Figure 2 This is a flow chart of a contact instruction processing method in Embodiment 1 of the present invention;
[0026] Figure 3 This is a flow chart of a method for processing a non-contact CPU card instruction in Embodiment 1 of the present invention;
[0027] Figure 4 This is a flow chart of a method for processing a contactless Mifare card instruction in Embodiment 1 of the present invention;
[0028] Figure 5 This is a schematic diagram of the structure of an electronic device in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0029] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0030] In order to solve the problems existing in the prior art, the embodiments of the present invention provide.
[0031] Example 1
[0032] The present invention discloses a method for testing the performance of a smart card. Figure 1 ,include:
[0033] S100. Configure the card reader firmware and initialize the card reader test program; specifically, configure the card reader firmware and initialize the card reader test program. In S100 of this embodiment, the card reader firmware is configured by downloading and installing the firmware and setting the card reader parameters; the card reader test program is initialized by downloading the test program, connecting the card reader, initializing the test program and executing the test program.
[0034] Specifically, the card reader firmware configuration method includes:
[0035] Prepare the configuration environment, including hardware connection: ensure that the card reader is correctly connected to the development platform (such as microcontroller, development board), and communicate using serial port, USB, I2C, SPI and other interfaces. It also includes driver installation: if you are using a PC for development, you need to ensure that the card reader driver has been installed and the device is recognized.
[0036] Get the firmware, including firmware download: Get the appropriate firmware from the card reader's official website or supplier. Also select the firmware version: Select a stable version of the firmware to ensure compatibility with the hardware and software development environment.
[0037] Burn the firmware, including the firmware burning tool: use the adapted tool (such as STM32CubeProgrammer, J-Flash, Segger, etc.) to burn the firmware into the card reader. It also includes the burning steps: follow the operating instructions of the burning tool to successfully write the firmware into the card reader.
[0038] Configuration parameters include communication configuration: configure the communication mode between the card reader and the main control device (such as baud rate, data bit, check bit, etc.) to ensure normal communication between the devices. It also includes function settings: configure the functions in the firmware according to requirements, such as card reading protocol, card type (IC card, NFC card, etc.), etc.
[0039] Through the above steps, the configuration of the card reader firmware and the initialization of the test program are completed, and the normal operation and stable performance of the card reader are ensured.
[0040] S200. The card reader receives the smart card performance test instruction and determines the type of the smart card performance test instruction; the smart card performance test instruction type includes contact type and contactless type; specifically, the contact card is a bank card that needs to be inserted into the card slot of the POS machine for reading. This card usually has an IC chip, which contains the cardholder's account information and payment data. When in use, the cardholder needs to insert the card into the designated card slot of the POS machine and ensure that the card is in good contact with the card slot so that the POS machine can accurately read the card information. The security of contact card payment is relatively high because physical contact is required for transactions, which reduces the risk of illegal copying and theft to a certain extent. However, the card insertion operation is relatively cumbersome and may take some time to complete. A contactless card, also known as an induction card or a waving card, is a bank card that uses wireless communication technology for payment. This card is embedded with an RFID (radio frequency identification) microchip. When the card is close to the sensing area of the POS machine, the information in the chip will be read and used to complete the transaction. Contactless card payment is fast and convenient. Cardholders only need to bring the card close to the POS machine to complete the payment, without inserting the card into the card slot or entering the password (if the small amount double-free service is activated). However, since contactless card payment uses wireless communication technology, there are certain security risks, such as illegal reading and theft.
[0041] The process of POS machine identifying contact card and contactless card mainly depends on the card reader designed inside. The process of contact card identification by the card reader includes: when the cardholder inserts the contact card into the card slot of the POS machine, the POS machine first detects the insertion of the card. Contact cards usually have specific contacts, which contact with the corresponding contacts in the card slot of the POS machine to establish an electrical connection. Through the electrical connection, the POS machine can read the chip information on the contact card. The process of contactless card identification by the card reader includes: the contactless card has an RFID microchip embedded in it, and the chip will be activated when the card approaches the sensing area of the POS machine. The sensing area is usually located at the front or side of the POS machine, which is convenient for the cardholder to wave the card. The activated chip will send a wireless signal to the POS machine to transmit the information on the card. The information includes the cardholder's account information, card type, etc. After receiving the information, the POS machine will verify it with the bank system. After the verification is passed, the POS machine will perform the transaction operation and may display the transaction results on the screen.
[0042] S300. Based on the result of the smart card performance test instruction type judgment, the smart card performance test instruction is processed according to different preset rules to implement the smart card performance test.
[0043] In S300 of this embodiment, if Figure 2 When the smart card performance test instruction type is contact type, the specific method for processing the smart card performance test instruction includes: processing the command header of the smart card performance test instruction, and obtaining the command header sending start timing point T1 and end timing point T2 respectively; judging whether there is command data in the smart card performance test instruction, if there is no command data in the smart card performance test instruction, judging whether the smart card performance test instruction contains process bytes, if the smart card performance test instruction contains process bytes, obtaining the smart card response data start timing point T3 and the smart card response data end timing point T4; after the smart card response data ends, obtaining the performance private instruction in the smart card performance test instruction, transmitting and processing the performance private instruction, obtaining the performance private instruction transmission and processing time, and obtaining the segmented time of the smart card performance test instruction processing by sending the command header start timing point T1, end timing point T2, smart card response data start timing point T3 and smart card response data end timing point T4.
[0044] In some preferred embodiments, Figure 2, determine whether there is command data in the smart card performance test instruction, if the smart card performance test instruction contains command data, obtain the start timing point t3 and the end timing point t4 of the smart card sending the INS instruction, when the INS instruction is sent, obtain the start timing point t5 and the end timing point t6 of the command data sending, determine whether the smart card performance test instruction contains process bytes, if the smart card performance test instruction contains process bytes, obtain the start timing point t7 of the smart card response data and the end timing point t8 of the smart card response data; after the smart card response data ends, obtain the performance private instruction in the smart card performance test instruction, transmit and process the performance private instruction, obtain the transmission and processing time of the performance private instruction, and obtain the segment time of the smart card performance test instruction processing through the command header sending start timing point T1 and the end timing point T2, the smart card sending INS instruction start timing point t3 and the end timing point t4, the command data sending start timing point t5 and the end timing point t6, the smart card response data start timing point t7 and the smart card response data end timing point t8.
[0045] In this embodiment, when the smart card performance test instruction type is contactless, such as Figure 3 , the specific method for processing the smart card performance test instruction includes: determining whether the smart card test instruction is a CPU card instruction or a Mifare card instruction, wherein the CPU card instruction is a set of commands for communicating and exchanging data with the CPU card. A CPU card, also known as a smart card, is an integrated circuit card with a microprocessor (CPU) and a memory embedded therein. Mifare card instructions mainly involve commands for communicating and operating with Mifare cards. Mifare cards, such as Mifare S50 and Mifare S70 (also known as Mifare Standard, Mifare Classic, MF1), are contactless smart cards that comply with the ISO14443A standard.
[0046] When the smart card test instruction is a CPU card instruction, obtain the instruction sending start timing point T1, judge whether the instruction contains a link block, if the instruction is not a link block, obtain the instruction sending end timing point T2, judge whether the instruction contains a WTX request, if the instruction does not contain a WTX request, obtain the smart card start response timing point T3, judge whether the response data is a link block, if the response data is a link block, obtain the smart card end response timing point T4, obtain the performance private instruction in the smart card performance test instruction, transmit and process the performance private instruction, obtain the performance private instruction transmission and processing time, and obtain the segmented time of the smart card performance test instruction processing through the instruction sending start timing point T1, end timing point T2, smart card response data start timing point T3 and smart card response data end timing point T4.
[0047] In some preferred embodiments, when the smart card test instruction is a CPU card instruction, it is determined whether the instruction contains a link block. If the instruction contains a link block, the link block returned by the smart card is ignored. It is determined whether the instruction contains a WTX request. If the instruction contains a WTX request, the returned WTX request is ignored. It is determined whether the response data is a link block. If the response data is not a link block, wait for the smart card to continue sending the link block.
[0048] In this embodiment, when the smart card performance test instruction type is contactless, the specific method for processing the smart card performance test instruction includes: determining whether the smart card test instruction is a CPU card instruction or a Mifare card instruction; when the smart card test instruction is a Mifare card instruction, obtaining the specific content of the Mifare card instruction; when the specific content of the Mifare card instruction is an authentication and write instruction, there are 2 sections of instructions in the authentication and write instructions that need to be processed; obtaining the first instruction sending end timing point T1, the smart card responds to the first instruction start timing point T2, the second instruction sending end timing point T3, and the smart card responds to the second instruction start timing point T4; obtaining a performance private instruction; and according to the first instruction sending end timing point T1, the smart card responds to the first instruction start timing point T2, the second instruction sending end timing point T3, and the smart card responds to the second instruction start timing point T4, obtaining the segmented time for processing the smart card performance test instruction.
[0049] In some preferred embodiments, when the specific content of the Mifare card instruction is read, increase or decrease value, transmission and recovery instructions, the first instruction sending end timing point T1 is obtained, the smart card responds to the first instruction start timing point T2, the performance private instruction is obtained, and based on the first instruction sending end timing point T1 and the smart card responds to the first instruction start timing point T2, the segmented time of the smart card performance test instruction processing is obtained.
[0050] This embodiment uses a card reader to identify the instruction type, and identifies it as a contact instruction and a contactless instruction. When it is a contact instruction, it continues to determine whether there is command data in the smart card performance test instruction, and adopts different methods to process it, and obtains the timing points of the card and instruction transmission and processing steps in the case of a contact instruction; when it is a contactless instruction, it continues to determine whether the smart card test instruction is a CPU card instruction or a Mifare card instruction, and adopts different methods to process the CPU card instruction and the Mifare card instruction, and obtains the timing points of the card and instruction transmission and processing steps. Finally, the smart card performance test result is obtained through the timing points of the card and instruction transmission and processing steps.
[0051] In order to verify the disclosed method of this embodiment, this embodiment compares the disclosed method of this embodiment with the existing professional test equipment Micropross MP300 series instrument, wherein the Micropross MP300 series instrument is a powerful and highly flexible test equipment, which is widely used in the testing and production of smart cards, RFID tags, M2M modules and NFC devices. Micropross MP300 series instrument is a professional solution launched by Micropross to solve production line testing problems. This series of instruments supports all devices working at 13.56MHz frequency, such as wireless smart cards, Micro-Modules, Readers / Writers and NFC devices.
[0052] When using MP300 for performance testing, only the card processing time (i.e., the time between the end of the last frame of the command code or data and the start of the card response) can be directly obtained through the MP300 command, but the transmission time of the command code, data, and card response data in the APDU command, the processing time of the CASE3 command card returning to INS, and the Mifare card command performance cannot be directly obtained. It is necessary to generate MPLOG while executing relevant instructions on MP300, and then manually measure the time of specific fields from MP300. This embodiment realizes that different private instructions directly obtain the total time of command transmission and processing and each time period during command transmission and execution. Under the same test environment, the transmission, processing, and segmentation performance of the card reader using the method of this embodiment are compared with MP300, and the comparison table obtained is shown in Table 1.
[0053] Table 1
[0054]
[0055] It can be seen from Table 1 that the card reader using the method of this embodiment has a smaller error than the existing MP300, but the method is simple to operate and has a lower cost of use. When the smart card only needs to be tested for performance, the present invention will not cause a waste of cost or a large amount of functional redundancy.
[0056] This embodiment discloses a method for smart card performance testing, including: configuring the card reader firmware, initializing the card reader test program; the card reader receives the smart card performance test instruction, and determines the type of the smart card performance test instruction; the smart card performance test instruction type includes contact type and contactless type; according to the smart card performance test instruction type judgment result, the smart card performance test instruction is processed according to different preset rules to test the smart card performance. The present invention adds APDU and Mifare card instruction performance statistics functions to the smart card reader, and obtains the command data transmission time, processing time, response data transmission time or total time when the card reader executes the contact / contactless APDU\Mifare card instruction through private instructions. Compared with the prior art, the method is simpler and the cost is lower.
[0057] Example 2
[0058] Based on the same inventive concept, an embodiment of the present disclosure also provides an electronic device. Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Figure 5 As shown, an embodiment of the present disclosure provides an electronic device including: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement any optimization method in the above embodiments; the one or more I / O interfaces 103 are connected between the processor and the memory, and are configured to implement information interaction between the processor and the memory.
[0059] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus), etc.
[0060] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.
[0061] In some embodiments, the one or more processors 101 include a field programmable gate array.
[0062] According to an embodiment of the present disclosure, a computer-readable medium is further provided, wherein a computer program is stored on the computer-readable medium, wherein when the program is executed by a processor, the steps in any optimization method in the above-mentioned embodiment are implemented.
[0063] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.
[0064] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
[0065] Those skilled in the art will also appreciate that the various illustrative logic blocks, modules, circuits, and algorithmic steps described in conjunction with the embodiments herein can all be implemented as electronic hardware, computer software, or a combination thereof. In order to clearly illustrate the interchangeability between hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above around their functions. Whether such functions are implemented as hardware or software depends on specific applications and the design constraints imposed on the entire system. A skilled person can implement the described functions in an alternative manner for each specific application, but such implementation decisions should not be interpreted as departing from the scope of protection of the present disclosure.
[0066] The steps of the method or algorithm described in conjunction with the embodiments herein may be directly embodied as hardware, a software module executed by a processor, or a combination thereof. The software module may be located in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in an ASIC. The ASIC may be located in a user terminal. Of course, the processor and the storage medium may also be present in a user terminal as discrete components.
[0067] For software implementation, the techniques described in this application can be implemented with modules (e.g., procedures, functions, etc.) that perform the functions described in this application. These software codes can be stored in a memory unit and executed by a processor. The memory unit can be implemented within the processor or outside the processor. In the latter case, it is coupled to the processor in a communication manner via various means, which are well known in the art.
[0068] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".
Claims
1. A method for testing the performance of a smart card, characterized in that: include: S100. Configure the card reader firmware and initialize the card reader test program; S200. The card reader receives a smart card performance test instruction and determines the type of the smart card performance test instruction; The smart card performance test instruction types include contact type and contactless type; S300. Based on the result of the smart card performance test instruction type judgment, the smart card performance test instruction is processed according to different preset rules to implement the smart card performance test.
2. A method for testing smart card performance as claimed in claim 1, characterized in that: In S100, the card reader firmware is configured by downloading and installing the firmware and setting the card reader parameters; the card reader test program is initialized by downloading the test program, connecting the card reader, initializing the test program and executing the test program.
3. A method for testing smart card performance as claimed in claim 1, characterized in that: In S300, when the smart card performance test instruction type is contact type, the specific method for processing the smart card performance test instruction includes: processing the command header of the smart card performance test instruction to obtain the start timing point T1 and the end timing point T2 of the command header sending respectively; judging whether there is command data in the smart card performance test instruction, if there is no command data in the smart card performance test instruction, judging whether the smart card performance test instruction contains process bytes, if the smart card performance test instruction contains process bytes, obtaining the smart card response data start timing point T3 and the smart card response data end timing point T4; after the smart card response data ends, obtaining the performance private instruction in the smart card performance test instruction, transmitting and processing the performance private instruction, obtaining the performance private instruction transmission and processing time, and obtaining the segmented time of the smart card performance test instruction processing by sending the start timing point T1, the end timing point T2, the smart card response data start timing point T3 and the smart card response data end timing point T4 through the command header.
4. A method for testing smart card performance as claimed in claim 3, characterized in that: In S300, if the smart card performance test instruction contains command data, the start timing point t3 and the end timing point t4 of the smart card sending the INS instruction are obtained. When the INS instruction is sent, the start timing point t5 and the end timing point t6 of the command data are obtained, and it is determined whether the smart card performance test instruction contains process bytes. If the smart card performance test instruction contains process bytes, the start timing point t7 and the end timing point t8 of the smart card response data are obtained; after the smart card response data ends, the performance private instruction in the smart card performance test instruction is obtained, the performance private instruction is transmitted and processed, and the transmission and processing time of the performance private instruction is obtained, and the start timing point T1 and the end timing point T2 of the command header are sent, the start timing point t3 and the end timing point t4 of the smart card sending the INS instruction, the start timing point t5 and the end timing point t6 of the command data sending, the start timing point t7 and the end timing point t8 of the smart card response data are obtained, and the segmented time of the smart card performance test instruction processing is obtained.
5. A method for testing smart card performance as claimed in claim 1, characterized in that: In S300, when the smart card performance test instruction type is contactless, the specific method for processing the smart card performance test instruction includes: judging whether the smart card test instruction is a CPU card instruction or a Mifare card instruction, when the smart card test instruction is a CPU card instruction, obtaining the instruction sending start timing point T1, judging whether the instruction includes a link block, if the instruction is not a link block, obtaining the instruction sending end timing point T2, judging whether the instruction includes a WTX request, if the instruction does not include a WTX request, obtaining the smart card start response timing point T3, judging whether the response data is a link block, if the response data is a link block, obtaining the smart card end response timing point T4, obtaining the performance private instruction in the smart card performance test instruction, transmitting and processing the performance private instruction, obtaining the performance private instruction transmission and processing time, and obtaining the segmented time of the smart card performance test instruction processing through the instruction sending start timing point T1, the end timing point T2, the smart card response data start timing point T3 and the smart card response data end timing point T4.
6. A method for testing smart card performance as claimed in claim 5, characterized in that: Determine whether the instruction contains a link block. If so, ignore the link block returned by the smart card. Determine whether the instruction contains a WTX request. If so, ignore the returned WTX request. Determine whether the response data is a link block. If not, wait for the smart card to continue sending the link block.
7. A method for testing smart card performance as claimed in claim 1, characterized in that: When the smart card performance test instruction type is contactless, the specific method for processing the smart card performance test instruction includes: judging whether the smart card test instruction is a CPU card instruction or a Mifare card instruction; when the smart card test instruction is a Mifare card instruction, obtaining the specific content of the Mifare card instruction; when the specific content of the Mifare card instruction is an authentication and write instruction, there are 2 sections of instructions in the authentication and write instructions that need to be processed; obtaining the first instruction sending end timing point T1, the smart card responds to the first instruction start timing point T2, the second instruction sending end timing point T3, and the smart card responds to the second instruction start timing point T4; obtaining a performance private instruction; and according to the first instruction sending end timing point T1, the smart card responds to the first instruction start timing point T2, the second instruction sending end timing point T3, and the smart card responds to the second instruction start timing point T4, obtaining the segmented time for processing the smart card performance test instruction.
8. A method for testing smart card performance as claimed in claim 7, characterized in that: When the specific content of the Mifare card instruction is read, increase or decrease value, transmission and recovery instructions, obtain the first instruction sending end timing point T1, the smart card responds to the first instruction start timing point T2, obtain the performance private instruction, and based on the first instruction sending end timing point T1, the smart card responds to the first instruction start timing point T2, obtain the segmented time of the smart card performance test instruction processing.
9. An electronic device, comprising: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for smart card performance testing according to any one of claims 1 to 8.