Method for testing off-line dynamic personalization of ic card
By obtaining the IC card feature configuration file through the POS machine and generating the APDU instruction set for IC card personalization, the problems of complex and costly testing in existing technologies are solved. This achieves automation and flexibility in POS machine IC card transaction testing and reduces testing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUJIAN NEWLAND PAYMENT TECH
- Filing Date
- 2022-12-09
- Publication Date
- 2026-06-02
AI Technical Summary
When conducting IC card transaction tests, existing POS terminal manufacturers need to purchase professional testing platforms and equipment. The testing process is complex and costly, with low efficiency, high requirements for the testing environment, and poor testing convenience.
The IC card feature configuration file is obtained through the POS machine, the APDU instruction set is generated by parsing, and the IC card is personalized through contact or contactless APDU communication, realizing offline dynamic card production and automated transaction testing.
It automates and increases the flexibility of POS machine IC card transaction testing, reduces testing costs, improves testing efficiency, and eliminates the reliance on professional testing tools.
Smart Images

Figure CN116149989B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of POS card testing technology, and more particularly to a method for testing offline dynamic personalized IC cards for POS machines. Background Technology
[0002] With the development of IC card payment technology and globalization, current POS terminal devices integrate IC card transaction functions according to one or more card organization specifications. Based on the communication method, these can be divided into contact and contactless transactions; based on the card organization, they can be divided into UnionPay card transactions, VISA card transactions, JCB card transactions, etc. To ensure that the terminal can complete IC card transactions normally, POS terminal manufacturers need to develop corresponding transaction kernels for different card organization specifications. To ensure that the transaction kernel can correctly process various transactions, transaction testing is required for different IC card characteristics.
[0003] Currently, terminal manufacturers need to purchase specialized testing platforms for IC card transaction testing. The testing process requires connecting to a designated card-making device via PC software for personalized operation before the device can be provided to the POS terminal for the corresponding test items. During testing, testers are required to change test cards according to the test items. The PC testing software and equipment for IC card transaction testing vary for different card organizations, requiring terminal manufacturers to invest heavily in equipment purchases. While specialized testing software can perform comprehensive IC card transaction testing on POS terminals, this testing solution requires testers to monitor the testing progress in real time, has high requirements for the testing environment, necessitates the setup of multiple testing environments and equipment, resulting in high testing and learning costs, and low testing convenience and efficiency. Summary of the Invention
[0004] In view of this, the purpose of this invention is to propose a reliable, convenient and efficient offline dynamic personalized IC card testing method for POS machines.
[0005] To achieve the above-mentioned technical objectives, the technical solution adopted by this invention is as follows:
[0006] A method for testing offline dynamic personalized IC cards in a POS machine, comprising:
[0007] The POS machine acquires an IC card feature profile for offline dynamic personalization of IC cards;
[0008] The POS machine parses the IC card feature configuration file offline and generates an APDU instruction set for IC card personalization based on preset test content.
[0009] The APDU instruction set is sent to the IC card through a preset IC card communication interface, and the IC card response data is received and checked to obtain the IC card personalization result.
[0010] Based on the IC card personalization results, POS machine IC card transaction tests are conducted on IC cards that meet the preset requirements according to preset conditions, the test results are recorded, and the test is completed.
[0011] As one possible implementation, the IC card feature configuration file described in this solution is written using XML format Extensible Markup Language.
[0012] As a preferred implementation option, the IC card feature configuration file of this solution preferably includes one or more of the following: IC card applicable transaction kernel code label, API call label, IC card universal personalized instruction set label, IC card feature value number label, and APDU data label, and their dynamic combination forms IC card personalized data.
[0013] As a preferred implementation option, this solution allows the POS machine to parse the IC card feature configuration file offline and generate an APDU instruction set for IC card personalization based on preset test content, including:
[0014] The POS machine parses the IC card feature configuration file offline;
[0015] Based on the preset test content, obtain the IC card applicable transaction kernel code label and IC card feature value number label specified in the current test;
[0016] Based on the IC card applicable transaction kernel code label specified in the current test, locate the IC card feature configuration file.
[0017] When the IC card personalized data dynamically combined in the IC card feature configuration file has an IC card applicable transaction kernel code label that matches the IC card applicable transaction kernel code label specified in the current test, the IC card feature value number label specified in the current test is further matched.
[0018] The system matches the IC card feature value number label specified in the current test with the IC card feature value number label in the corresponding IC card personalization data. If the match does not match, the API interface is called; otherwise, an APDU instruction is generated.
[0019] Based on the API interface invoked or the generated APDU instructions, an APDU instruction set for IC card personalization is generated.
[0020] As a preferred implementation option, this solution, when calling the API interface, calls the tag to execute the API-specified function through the API of the IC card's personalized data;
[0021] When an APDU instruction is generated, the corresponding IC card universal personalized instruction set tag is found through the APDU data tag of the IC card's personalized data to complete the APDU instruction setting.
[0022] As a preferred implementation option, the method of generating APDU instruction sets for IC card personalization by calling the API interface in this solution includes one or more of the following: GP SCP02 initialization security channel APDU generation, application clearing APDU generation, application installation APDU generation, application deletion APDU generation, application selection APDU generation, application locking APDU generation, and application unlocking APDU generation.
[0023] As a preferred implementation option, the method for generating APDU instruction sets for IC card personalization in this scheme includes one or more of the following: specified data modification function, specified data deletion function, added specific data function, specified data encryption function, expected response status value setting function, and expected response data setting function.
[0024] As a preferred implementation option, this solution sends the APDU instruction set to the IC card through a preset IC card communication interface, and simultaneously receives and checks the IC card response data to obtain the IC card personalization result, including one of the following:
[0025] (1) Send and execute the APDU instruction set through the API interface call to make the card reach a preset specific state and return the API execution result. Obtain the IC card personalization result based on the returned API execution result.
[0026] (2) By calling the APDU interface, a single APDU instruction is sent to the IC card, and the response data is received and compared. If the response fails to be received or the response data is inconsistent with the preset expected value, the operation is returned as failed; otherwise, the operation is returned as successful.
[0027] As a preferred implementation option, this scheme, when the generation or execution of the APDU instruction set used for IC card personalization fails, outputs "IC card personalization operation failed" as the IC card personalization result.
[0028] When both the generation and execution of the APDU instruction set used for IC card personalization are successful, the IC card personalization operation is output as the IC card personalization result.
[0029] As a preferred implementation option, the POS machine and IC card in this solution preferably communicate via contact or contactless APDU.
[0030] Compared with the prior art, the present invention, employing the above technical solution, has the following advantages: This solution ingeniously loads personalized card data offline via a POS machine. Through contact or contactless APDU communication between the POS machine and the IC card, and based on preset test content, different transaction kernel codes and IC card feature value numbers are selected. After obtaining relevant information, the POS machine transmits the personalized data corresponding to the IC card feature configuration file pre-installed in the POS machine to the IC card for offline dynamic card creation. The completed card is then used to automate the testing of the POS machine's transaction kernel functions, reliably, efficiently, and flexibly completing the test. This solution eliminates the traditional method where testers need to manually replace test cards according to different POS machine functions, enabling automated completion of the entire testing process using only a single POS machine. This solution allows testers to flexibly and quickly automate POS machine transaction kernel function testing, improving testing and development efficiency. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a simplified system structure block diagram of the POS machine and IC card communication connection in the present invention.
[0033] Figure 2 This is a simplified step diagram of the offline dynamic personalized IC card testing method for POS machines in the present invention.
[0034] Figure 3 This is a simplified schematic diagram of the IC card personalized feature configuration file development steps in the present invention.
[0035] Figure 4 This is a simplified schematic diagram of the main process of offline dynamic personalized IC card in the POS machine according to the present invention;
[0036] Figure 5 This is a simplified schematic diagram of the IC card personalized configuration file parsing and execution process in the present invention.
[0037] Figure 6 This is a simplified schematic diagram of the POS machine IC card transaction testing process in the present invention. Detailed Implementation
[0038] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] This embodiment provides a method for testing offline dynamic personalized IC cards in a POS machine, which includes:
[0040] S01. The POS machine obtains the IC card feature profile for offline dynamic personalization of IC cards;
[0041] S02. The POS machine parses the IC card feature configuration file offline and generates an APDU instruction set for IC card personalization according to the preset test content.
[0042] S03. Send the APDU instruction set to the IC card through the preset IC card communication interface, and at the same time receive and check the IC card response data to obtain the IC card personalization result;
[0043] S04. Based on the IC card personalization results, conduct POS machine IC card transaction tests on IC cards that meet the preset requirements according to preset conditions, record the test results, and complete the test.
[0044] This embodiment downloads a pre-set IC card feature configuration file to the POS terminal. The POS terminal then parses the IC card feature configuration file offline, generates corresponding APDU commands or API interfaces based on preset test content, and interacts with the IC card through the terminal communication interface to complete card personalization. Finally, the POS machine tests the IC card to complete the POS machine IC card transaction test. The system structure diagram of the POS machine and IC card is as follows: Figure 1 As shown.
[0045] Combination Figure 2 As shown in the figure, in the construction of IC card feature configuration files, firstly, POS terminal test developers need to analyze and organize test cases for IC card transaction processes for different transaction kernels according to the specifications of different card organizations. Each test case needs to clearly define the requirements for card features and the applicable transaction kernel. That is, for the test points of the transaction kernel, the requirements for IC card features and the test result judgment criteria are clearly proposed to form an IC card transaction kernel test case set.
[0046] In addition, IC card application developers develop card applications based on card feature requirements and IC card characteristics, and provide corresponding personalized APDU instructions for IC cards. That is, IC card application developers develop IC card applications based on the specifications of various card organizations, using IC card characteristics and test cases to meet the requirements of test card features, and successfully load the application into the physical IC card. At the same time, they need to provide personalized APDU instruction sets for different IC card features.
[0047] Finally, the POS terminal test developers set a unique IC card feature value number for the card feature according to the APDU instructions provided by the IC card application developers, and wrote it in the configuration area of the transaction kernel (IC card applicable transaction kernel) corresponding to the card feature configuration file.
[0048] Based on the above, POS terminal test developers dynamically invoke the IC card personalization process according to the test case requirements. During card personalization, the system receives the transaction kernel code (applicable to the IC card) and card feature number (IC card feature value number) according to the test case requirements. The POS machine then parses the card feature configuration file to obtain the APDU instruction set required for this test and executes the APDU instructions sequentially via the POS machine-IC card communication interface. If the card response status is incorrect or times out during execution, the card personalization operation is considered a failure and terminated. Once all APDU instructions are executed correctly, the card personalization operation is complete. Based on the card personalization process results, the POS terminal test developers determine whether to continue with subsequent IC card transaction process testing; that is, transaction testing is conducted only after successful IC card personalization.
[0049] Combination Figure 3 As shown, when developing test cases for IC card transaction processes with different transaction kernels, POS terminal test developers need to identify the most representative card features from among the different card features applicable to that transaction kernel. Based on the card-personalized APDU instruction set provided by the IC card developer, a general IC card configuration file for that kernel is created. This general IC card configuration file must indicate the applicable IC card transaction kernel. On this basis, chip-personalized data for different card features is added, with each card feature configured with a unique IC card feature number, ultimately forming a card configuration file that covers the testing requirements of that kernel.
[0050] Regarding the format of the IC card feature configuration file, the IC card feature configuration file described in this solution is written using XML format Extensible Markup Language. Preferably, the IC card feature configuration file described in this solution includes one or more of the following: IC card applicable transaction kernel code label, API call label, IC card universal personalized instruction set label, IC card feature value number label, and APDU data label, and these are dynamically combined to form IC card personalized data.
[0051] Combination Figure 4 As shown, it illustrates the main process of offline dynamic card production for a POS machine. After the IC card feature configuration file is completed, it is imported into the POS machine's file system. When the POS machine performs the IC card dynamic personalization operation, it will parse and execute the APDU instruction set sequentially from the IC card feature configuration file according to the kernel code and IC card feature value number corresponding to the test, and finally complete the offline IC card personalization operation.
[0052] Combination Figure 5 As shown, this diagram illustrates a simplified process for parsing and executing the personalized configuration file of the IC card in this solution. Based on the characteristics of the IC card, this solution sets two methods for executing APDUs in the IC card configuration file; specifically:
[0053] Method 1: API interface call method, which implements specific functions of IC card, combines a series of APDU instructions, completes APDU assembly through API interface, and completes APDU interaction through IC card communication interface, responding to data, status judgment and other operations, and finally returns the execution result;
[0054] Method 2: APDU interface. This method involves directly calling the IC card communication interface to send a single APDU command and receive the IC card response data.
[0055] As an example of an implementation step, in S02 of this solution, the POS machine parses the IC card feature configuration file offline and generates an APDU instruction set for IC card personalization based on preset test content, including:
[0056] S021. The POS machine parses the IC card feature configuration file offline;
[0057] S022. Based on the preset test content, obtain the IC card applicable transaction kernel code label and IC card feature value number label specified in the current test;
[0058] S023. Locate the IC card feature configuration file based on the IC card applicable transaction kernel code label specified in the current test.
[0059] When the IC card personalized data dynamically combined in the IC card feature configuration file has an IC card applicable transaction kernel code label that matches the IC card applicable transaction kernel code label specified in the current test, the IC card feature value number label specified in the current test is further matched.
[0060] S024. Match the IC card feature value number label specified in the current test with the IC card feature value number label in the corresponding IC card personalization data. If the match is inconsistent, call the API interface; otherwise, generate an APDU instruction.
[0061] S025. Generate an APDU instruction set for IC card personalization based on the API interface called or the generated APDU instructions.
[0062] In summary, the above scheme searches for the IC card feature configuration file based on the applicable transaction kernel code of the IC card specified in the current test. If a kernel code tag matching the searched kernel code appears in the IC card feature configuration file, the POS machine IC card communication interface is specified; the API call tag is used to execute the API-specified function; or the APDU data tag is used to search for the IC card universal personalized instruction set tag to complete the general APDU instruction setting. If the current APDU data tag contains the specified IC card feature value number, the general APDU data is modified according to the IC card feature value number tag.
[0063] In step S024 of the example above, when the API interface is called, the tag executes the function specified by the API through the API call of the IC card's personalized data;
[0064] When an APDU instruction is generated, the corresponding IC card universal personalized instruction set tag is found through the APDU data tag of the IC card's personalized data to complete the APDU instruction setting.
[0065] Regarding the methods for generating APDU instruction sets, this solution utilizes API interfaces to generate APDU instruction sets for IC card personalization, including one or more of the following: GP SCP02 initialization security channel APDU generation, application clearing APDU generation, application installation APDU generation, application deletion APDU generation, application selection APDU generation, application locking APDU generation, and application unlocking APDU generation. The methods for generating APDU instruction sets for IC card personalization using this solution include one or more of the following: specifying data modification functions, specifying data deletion functions, adding specific data functions, specifying data encryption functions, setting expected response status values, and setting expected response data functions.
[0066] In this scheme S03, the APDU instruction set is sent to the IC card through a preset IC card communication interface, and the IC card response data is received and checked to obtain the IC card personalization result, including one of the following:
[0067] (1) Send and execute the APDU instruction set through the API interface call to make the card reach a preset specific state and return the API execution result. Obtain the IC card personalization result based on the returned API execution result.
[0068] (2) By calling the APDU interface, a single APDU instruction is sent to the IC card, and the response data is received and compared. If the response fails to be received or the response data is inconsistent with the preset expected value, the operation is returned as failed; otherwise, the operation is returned as successful.
[0069] Regarding the communication method between the POS machine and the IC card, the POS machine and the IC card described in this solution can communicate via contact or contactless APDU.
[0070] In this scheme, if the generation or execution of the APDU instruction set used for IC card personalization fails, the IC card personalization operation will be output as a failure.
[0071] When both the generation and execution of the APDU instruction set used for IC card personalization are successful, the IC card personalization operation is output as the IC card personalization result.
[0072] In IC card testing, combined with Figure 6 As shown, when conducting POS machine IC card transaction tests, this solution first determines whether the test item requires IC card participation. If so, it passes in the test kernel code and IC card feature value number, and executes the POS machine offline IC card personalization process. Secondly, it determines whether IC card personalization is successful. If successful, it proceeds with the POS machine IC card transaction process test; otherwise, it records the test as a failure. Finally, it determines whether there are subsequent test cases to execute. If so, it repeats the IC card personalization and POS machine transaction process test procedures until all test items are completed.
[0073] This solution dynamically parses the IC card feature configuration file through a POS machine to generate a personalized APDU instruction set for the IC card. It then executes the IC card APDU via the POS machine's IC card communication interface, achieving offline, dynamic, and personalized operation of the test IC card without the need for third-party tools. This method simplifies the POS machine IC card transaction testing process, solving the problem of frequent manual creation and replacement of test IC cards, and improving POS machine testing efficiency. Furthermore, this approach does not rely on other testing tools; a single POS machine can complete the IC card creation and transaction testing process, increasing testing flexibility.
[0074] In addition, this solution allows for the aggregation of personalized IC card data from different transaction kernels through IC card feature configuration files, enabling flexible selection during POS machine IC card transaction testing. This approach meets the testing needs of POS manufacturers for different card organization transaction kernels, reduces reliance on specialized testing tools to some extent, and lowers manufacturers' development and testing costs.
[0075] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for testing offline dynamic personalized IC cards in a POS machine, characterized in that, It includes: The POS machine acquires an IC card feature profile for offline dynamic personalization of IC cards; The POS machine parses the IC card feature configuration file offline and generates an APDU instruction set for IC card personalization based on preset test content. The APDU instruction set is sent to the IC card through a preset IC card communication interface, and the IC card response data is received and checked to obtain the IC card personalization result. Based on the IC card personalization results, POS machine IC card transaction tests are conducted on IC cards that meet the preset requirements according to preset conditions, the test results are recorded, and the test is completed.
2. The POS machine offline dynamic personalized IC card testing method as described in claim 1, characterized in that, The IC card feature configuration file is written using XML format Extensible Markup Language.
3. The POS machine offline dynamic personalized IC card testing method as described in claim 2, characterized in that, The IC card feature configuration file includes one or more of the following: IC card applicable transaction kernel code label, API call label, IC card universal personalized instruction set label, IC card feature value number label, and APDU data label, and their dynamic combination forms IC card personalized data.
4. The POS machine offline dynamic personalized IC card testing method as described in claim 3, characterized in that, The POS machine parses the IC card feature configuration file offline and generates an APDU instruction set for IC card personalization based on preset test content, including: The POS machine parses the IC card feature configuration file offline; Based on the preset test content, obtain the IC card applicable transaction kernel code label and IC card feature value number label specified in the current test; Based on the IC card applicable transaction kernel code label specified in the current test, locate the IC card feature configuration file. When the IC card personalized data dynamically combined in the IC card feature configuration file has an IC card applicable transaction kernel code label that matches the IC card applicable transaction kernel code label specified in the current test, the IC card feature value number label specified in the current test is further matched. The system matches the IC card feature value number label specified in the current test with the IC card feature value number label in the corresponding IC card personalization data. If the match does not match, the API interface is called; otherwise, an APDU instruction is generated. Based on the API interface invoked or the generated APDU instructions, an APDU instruction set for IC card personalization is generated.
5. The POS machine offline dynamic personalized IC card testing method as described in claim 4, characterized in that, When calling the API interface, the tag executes the function specified by the API through the personal data of the IC card. When an APDU instruction is generated, the corresponding IC card universal personalized instruction set tag is found through the APDU data tag of the IC card's personalized data to complete the APDU instruction setting.
6. The POS machine offline dynamic personalized IC card testing method as described in claim 5, characterized in that, Methods for generating APDU instruction sets for IC card personalization by calling the API interface include one or more of the following: GP SCP02 initialization security channel APDU generation, application clear APDU generation, application install APDU generation, application delete APDU generation, application select APDU generation, application lock APDU generation, and application unlock APDU generation.
7. The POS machine offline dynamic personalized IC card testing method as described in claim 5, characterized in that, Methods for generating APDU instruction sets for IC card personalization include one or more of the following: specifying data modification function, specifying data deletion function, specifying data encryption function, expecting response status value setting function, and expecting response data setting function.
8. The POS machine offline dynamic personalized IC card testing method as described in claim 1, characterized in that, The APDU instruction set is sent to the IC card through a preset IC card communication interface, and the IC card response data is received and checked to obtain the IC card personalization result, including one of the following: (1) Send and execute the APDU instruction set through the API interface to make the card reach a preset specific state and return the API execution result. Obtain the IC card personalization result based on the returned API execution result; (2) By calling the APDU interface, a single APDU instruction is sent to the IC card, and the response data is received and compared. If the response fails to be received or the response data is inconsistent with the preset expected value, the operation will be returned as failed; otherwise, the operation will be returned as successful.
9. The POS machine offline dynamic personalized IC card testing method as described in claim 8, characterized in that, If the generation or execution of the APDU instruction set used for IC card personalization fails, the IC card personalization operation will be output as a failure. When both the generation and execution of the APDU instruction set used for IC card personalization are successful, the IC card personalization operation is output as the IC card personalization result.
10. The POS machine offline dynamic personalized IC card testing method as described in claim 1, characterized in that, The POS machine and the IC card communicate via contact or contactless APDU.