POS terminal interface test method based on ECI protocol

The POS terminal interface testing method based on the ECI protocol solves the problem of resource waste caused by the diversification of POS terminal testing software, realizes unified testing of different POS terminals, improves efficiency and stability, and simplifies the testing process.

CN121187948APending Publication Date: 2025-12-23AITIWEIER ELECTRONICS TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511287939.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

Existing POS terminal testing methods require the development of different testing software based on different product forms and operating systems, resulting in a waste of human and time resources, and testers need to be trained, leading to low efficiency.

Method used

The POS terminal interface testing method based on the ECI protocol is adopted. A secure channel is established between the PC host computer testing software and the POS terminal. UKEY is used to manage testers, ECI mode is defined for API testing, the interface is standardized and unified, and multiple operating systems are supported.

Benefits of technology

It enables unified testing of different POS terminals, reduces redundant development, improves work efficiency, enhances the stability and reliability of terminal interfaces, simplifies the testing process, and saves testing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121187948A_ABST
    Figure CN121187948A_ABST
Patent Text Reader

Abstract

The invention discloses a POS terminal interface test method based on an ECI protocol, which develops a set of upper computer test software running at a PC end, develops a set of API test interface at a POS terminal, and defines the specific environment as an ECI mode in order to not affect the use of the normal functions of the POS and the POS end needs to run the API test interface in the specific environment. Namely, only when the POS terminal enters the ECI mode, the POS terminal can communicate with the upper computer test software, and the AP I test function is completed. The upper computer test software and the POS terminal need to follow an ECI protocol, and a tester needs to log in the upper computer test software through a UKEY in the test process and then starts related function tests. The POS terminal interface has the advantages that the repeated development rate of research and development personnel is greatly reduced, the working efficiency is improved, the stability, reliability and robustness of the POS terminal interface are also greatly enhanced, and the terminal test work of test personnel is also facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of financial payment, in particular to a POS terminal interface test method based on ECI protocol. BACKGROUND

[0002] POS (Point of Sales) is an electronic payment terminal device developed with the popularization of bank cards and the upgrading of network technology. POS machines are generally placed in shopping malls, hotels, restaurants, entertainment, sales centers and other places, and have functions such as consumption, cancellation, pre-authorization, balance inquiry and transfer, and are safe, fast and reliable to use.

[0003] The current POS terminal test method usually develops a function test software in the POS terminal, and tests all functions of the POS terminal by the test personnel executing each test case in the test software one by one. However, with the rise of the Android ecosystem, the forms of POS terminal products are becoming more and more diversified, such as traditional POS terminals, smart POS terminals, face payment terminals, barcode payment terminals, cloud flash payment terminals, and mobile POS terminals. Although these product forms belong to the POS series, due to the running of different operating systems (such as Android system, Linux system, FreeRTOS system, and manufacturer self-developed system) and the differences in POS functions according to different market needs, the developer needs to develop different test software according to different products, and needs to train the test personnel to familiarize them with the use of the test software, so that the test personnel can output correct test results. This consumes a lot of human and time resources to some extent. SUMMARY

[0004] The purpose of the present application is to provide a POS terminal interface test method based on ECI protocol, thereby solving the aforementioned problems in the prior art.

[0005] In order to achieve the above-mentioned purpose, the technical solution adopted by the present application is as follows:

[0006] A POS terminal interface test method based on ECI protocol, comprising the following steps,

[0007] S1, the test personnel inserts the UKEY into the PC end and inputs the UKEY password to log in to the host computer test software;

[0008] S2, the POS terminal is powered on and enters the ECI test mode;

[0009] S3, the host computer test software establishes a secure channel link with the POS terminal through the USB serial port;

[0010] S4, select a set of standardized API interface, configure the input parameters of the interface, start testing;

[0011] S5, the host test software converts the selected standardized API interface and its input parameters into corresponding ECI protocol instruction data, and sends the instruction data to the POS terminal through the serial port;

[0012] S6, the POS terminal receives the instruction data information sent by the host test software, parses the instruction and calls the corresponding standardized API interface;

[0013] S7, the POS terminal converts the data returned by the test interface into corresponding ECI protocol instruction data, and returns the instruction data to the host test software through the serial port;

[0014] S8, the host test software parses the received instruction data information, and feeds back the result to the tester; thus, the standardized API test is completed;

[0015] S9, the tester selects other standardized API interface, executes steps S4 to S8, until all interface tests are completed; the tester takes out the UKEY and exits the host test software.

[0016] Preferably, a set of host test software running on PC is developed, and the POS terminal develops a set of API test interface. In order to not affect the normal use of the POS function, the POS terminal needs to run the API test interface in a specific environment, which is defined as ECI mode, that is, only the POS terminal enters the ECI mode can communicate with the host test software to complete the API test function; the host test software and the POS terminal need to follow the ECI protocol, and the tester needs to log in to the host test software through the UKEY during the test process, and then start the related function test.

[0017] Preferably, the security channel establishment process in step S3 is,

[0018] S31, the host test software establishes connection with the POS terminal through the USB serial port;

[0019] S32, the host test software generates a random number R1, and sends R1 and its own public key certificate PC_Cer to the POS terminal;

[0020] S33, the POS terminal stores R1 as a subsequent session key component; at the same time, the POS terminal verifies the validity of the received host test software certificate PC_Cer using the manufacturer root CA certificate, and after verification, the terminal generates a random number R2 and encrypts R2 using the public key PC_Puk in the public key certificate PC_Cer sent by the host test software, and sends the ciphertext R2 to the host test software together with the public key certificate POS_Cer of the POS terminal;

[0021] S34, the host test software verifies the validity of the received POS terminal certificate POS_Cer using the manufacturer root CA certificate, and after verification, uses its own private key PC_Pvk to decrypt the ciphertext R2 to obtain plaintext R2, then generates a random number R3, and uses the public key POS_Puk in the public key certificate POS_Cer sent by the POS terminal to encrypt R3, and then sends the ciphertext R3 to the POS terminal;

[0022] S35, the POS terminal uses its own private key POS_Pvk to decrypt the ciphertext R3 to obtain plaintext R3, and then uses the SHA256 algorithm to generate a session key KEY, and returns an end information to the host test software;

[0023] KEY = SHA256[R1|R2|R3]

[0024] S36, after receiving the end information, the host test software uses the same algorithm to generate a session key KEY, and the subsequent communication between the two parties will be encrypted using KEY.

[0025] Preferably, in step S4, the host test software pre-defines all supported ECI protocol instruction sets of the POS product, when the tester selects a test case on the host test software, the host test software matches the instruction corresponding to the test case from the pre-built ECI protocol instruction set, finds the instruction for obtaining the serial number of the POS terminal, and then sends the instruction to the POS terminal through the USB serial port of the PC.

[0026] Preferably, in step S5, the POS terminal pre-defines the ECI protocol instruction set it supports, when the POS terminal receives the instruction data information sent by the host test software, it first matches the instruction corresponding to the test case from the pre-built ECI protocol instruction set, finds the corresponding instruction for obtaining the serial number of the POS terminal, and then calls the API interface of the corresponding function to perform the test, and for the unsupported instruction, the POS terminal returns the UNSUPPORTED instruction to the host test software.

[0027] Preferably, in step S6, the POS terminal encapsulates the API execution result into corresponding ECI instruction data in the ECI instruction protocol data packet format, and finally returns the ECI instruction data to the host computer test software through the POS terminal serial port.

[0028] Preferably, in step S7, the host computer test software analyzes the ECI instruction data information received by the serial port, extracts the result from the information according to the ECI instruction protocol data packet format, and finally displays the result to the tester through the host computer test software interface.

[0029] Preferably, the ECI protocol includes a command header, a command body and a command footer, wherein the command header is a fixed byte 0x02, indicating the beginning of the command; the command body includes specific API test instructions, consisting of 2 bytes of instruction type, 2 bytes of parameter data length and variable length of parameter data; and the command footer is a byte of CRC check, used for the whole command integrity check by the command receiver, preventing data transmission errors caused by byte loss abnormality in the communication process.

[0030] Preferably, the host computer test software needs to support at least the following standardized API interfaces,

[0031] terminal name acquisition, terminal version information acquisition, key download, key use, key destruction, contact card data encryption, non-contact card data encryption, magnetic stripe card data encryption, non-contact card indicator, offline plaintext PIN verification, offline ciphertext PIN verification, terminal unique identification encryption.

[0032] Preferably, the key use includes calculation of PINBLOCK, calculation of MAC, and arbitrary data encryption and decryption.

[0033] The key download, key use and key destruction support three key types of TDES, AES and SM4, and support three key management systems of MK / SK, Fixed Key and DUKPT.

[0034] The beneficial effects of the present application are: 1. The host computer test software generated by the method of the present application can perform standardized testing on various types of POS terminal API interfaces, greatly reducing the repeated development rate of R&D personnel, improving work efficiency, and greatly enhancing the stability, reliability and robustness of the POS terminal interface, and also facilitating the testing work of the tester. 2. The present application standardizes the POS terminal interface on different operating systems, and cooperates with the host computer test software running on the PC end operating system, so that the tester only needs to be skilled in using the host computer test software to complete the function test of all POS series products, greatly reducing the workload of the tester and saving the test time. Since the POS terminal API test interface is unified, the reliability of the product is also improved. BRIEF DESCRIPTION OF DRAWINGS

[0035] Figure 1 is the communication flow chart of host computer test software and POS terminal in the embodiment of the present application;

[0036] Figure 2 is the ECI command format schematic diagram in the embodiment of the present application;

[0037] Figure 3 is the standardized API test flow chart in the embodiment of the present application;

[0038] Figure 4 is the security channel establishment flow chart in the embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application is further described in detail below with reference to the drawings. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0040] In the embodiment, a POS terminal API interface test method based on vendor self-defined protocol, i.e. ECI (Enhanced Communication Interfaces) protocol, is provided. The host computer test software developed based on the method can run on PC operating system. In the test process, the tester realizes the physical connection between the host computer test software and the POS terminal through the USB port of the PC, thereby completing the legality, reliability and robustness verification of the POS terminal interface function. The test method includes two parts of ECI protocol and API interface test. In order to further improve the security of the test system, UKEY is used to manage the tester, and the host computer test software and the POS terminal communication adopts the method of security channel.

[0041] The method of the present application first develops a set of host computer test software running on PC, and a set of API test interface is also needed to be developed for the POS terminal. In order to not affect the normal use of POS function, the POS terminal needs to run the API test interface in a specific environment. The specific environment can be defined as ECI mode, i.e. only the POS terminal device in ECI mode can communicate with the host computer test software to complete the API test function. In addition, the host computer test software and the POS terminal need to follow the ECI communication protocol, which improves the reliability of the API interface and also increases the stability of the POS machine operation. The tester needs to log in the host computer test software through UKEY during the test process, and then can start the related function test.

[0042] In this embodiment, the ECI protocol is a simplified custom protocol comprising three parts: a command header, a command body, and a command footer. The command header is a fixed byte of 0x02, indicating the start of the command. The command body contains specific API test instructions, consisting of a 2-byte instruction type, a 2-byte parameter data length, and variable-length parameter data. The command footer is a one-byte CRC checksum, used by the command receiver to verify the integrity of the entire command and prevent data transmission errors caused by byte loss during communication. To protect the security of the communication protocol transmission, a secure channel is established. Figure 2 As shown, in the ECI command format, CMD Head = 0x02. CMD Body = standardized API interface and its parameter data. CMD Foot = [CMD Head xor CMD Body], used to verify the integrity of message packets during communication.

[0043] like Figure 3 As shown, the standardized API testing process is as follows:

[0044] 1. Testers insert the U-key into the PC and enter the U-key password to log in to the host computer test software.

[0045] 2. Power on the POS terminal and enter ECI test mode.

[0046] 3. The host computer testing software establishes a secure channel connection with the POS terminal via USB serial port. For example... Figure 4 As shown, the process of establishing a safe passage is as follows:

[0047] (1) The host computer test software establishes a connection with the POS terminal through the USB serial port.

[0048] (2) The host computer test software generates a random number R1 and sends R1 and its own public key certificate PC_Cer to the POS terminal.

[0049] (3) The POS terminal stores R1 as a key component for subsequent sessions. At the same time, the POS terminal uses the manufacturer's root CA certificate to verify the validity of the PC_Cer certificate received from the host computer test software. After the verification is successful, the terminal generates a random number R2 and encrypts R2 with the public key PC_Puk in the public key certificate PC_Cer sent by the host computer test software. The encrypted R2 is then sent to the host computer test software along with the POS terminal's public key certificate POS_Cer.

[0050] (4) The host computer test software verifies the validity of the received POS terminal certificate POS_Cer using the vendor root CA certificate, and after verification, uses its own private key PC_Pvk to decrypt the ciphertext R2 to obtain the plaintext R2, then generates a random number R3, and uses the public key POS_Puk in the public key certificate POS_Cer sent by the POS terminal to encrypt R3, and then sends the ciphertext R3 to the POS terminal.

[0051] (5) The POS terminal uses its own private key POS_Pvk to decrypt the ciphertext R3 to obtain the plaintext R3, then uses the SHA256 algorithm to generate a session key KEY, and returns an end message to the host computer test software.

[0052] KEY = SHA256[R1|R2|R3]

[0053] (6) After receiving the end message, the host computer test software generates a session key KEY using the same algorithm, and subsequent communication between the two parties will be completed using KEY encryption.

[0054] 4. Select a set of standardized API interfaces, configure the input parameters of the interface, and start testing. In this step, the host computer test software pre-defines all supported ECI protocol instruction sets of the POS product, when the tester selects a test case on the host computer test software, the host computer test software matches the corresponding instruction of the test case from the pre-built ECI protocol instruction set, finds the instruction for obtaining the POS terminal serial number function, and then sends the instruction to the POS terminal through the USB serial port of the PC.

[0055] 5. The host computer test software converts the selected standardized API interface and its input parameters into corresponding ECI protocol instruction data, and sends the instruction data to the POS terminal through the serial port. In this step, the POS terminal pre-defines the ECI protocol instruction set it supports, when the POS terminal receives the instruction data information sent by the host computer test software, it first matches the corresponding instruction of the test case from the pre-built ECI protocol instruction set, finds the corresponding instruction for obtaining the POS terminal serial number function, and then calls the API interface of the corresponding function to perform testing. For instructions that are not supported, the POS terminal returns an UNSUPPORTED instruction to the host computer test software.

[0056] 6. The POS terminal receives the instruction data information sent by the host computer test software, parses the instruction and calls the corresponding standardized API interface. This step is similar to step 4, the POS terminal encapsulates the API execution result into corresponding ECI instruction data according to the ECI instruction protocol data packet format, and finally returns it to the host computer test software through the POS terminal serial port.

[0057] 7. The POS terminal converts the data returned by the test interface into corresponding ECI protocol command data and returns the command data to the host computer test software via serial port. This step is similar to step 5. The host computer test software analyzes the ECI command data information received from the serial port, extracts the results from the information according to the ECI command protocol data packet format, and finally displays the results to the testers through the host computer test software interface.

[0058] 8. The host computer test software parses the received instruction data and feeds the results back to the testers; at this point, the standardized API test is complete.

[0059] 9. Testers select other standardized API interfaces and execute steps S4 to S8 until all interface tests are completed; testers remove the UKEY and exit the host computer test software.

[0060] In this embodiment, the host computer test software must support at least the following standardized API interfaces, and the test interfaces can also be expanded according to actual needs. (1) Terminal name acquisition; (2) Terminal serial number acquisition; (3) Terminal version information acquisition; (4) Key download; (5) Key usage, including: calculating PINBLOCK, calculating MAC, arbitrary data encryption and decryption; (6) Key destruction; (7) Contact card data encryption; (8) Contactless card data encryption; (9) Magnetic stripe card data encryption; (10) Contactless card indicator light; (11) Offline plaintext PIN verification; (12) Offline confidential text PIN verification; (13) Terminal unique identifier encryption.

[0061] The manufacturer's ECI testing software supports all of the above functions, and the key management module (key download, key use, key destruction) supports three key types: TDES / AES / SM4, and three key management systems: MK / SK, Fixed Key, and DUKPT.

[0062] The method of this invention standardizes the common API interfaces of POS terminals, such as key management interfaces (including key injection, key usage, and key destruction), PINBLOCK calculation interfaces, MAC calculation interfaces, arbitrary data encryption and decryption operation interfaces, IC card master account data encryption interfaces (including magnetic stripe cards, contact IC cards, and contactless IC cards), and terminal unique identifier encryption interfaces. This standardization of common API interfaces is then achieved through the ECI protocol, enabling information exchange between the host computer testing software and the POS terminal to verify the API interfaces. Furthermore, the testing tools implemented using this method can also be used for security authentication tests such as UnionPay security and PCI.

[0063] By adopting the above-disclosed technical solution of this invention, the following beneficial effects are obtained:

[0064] The application provides a POS terminal interface test method of an ECI protocol. The generated host computer test software compiled by the method can perform standardized test on various types of POS terminal API interfaces, greatly reduces the repeated development rate of R&D personnel, improves work efficiency, greatly enhances the stability, reliability and robustness of the POS terminal interface, and facilitates the terminal test work of the test personnel. The application standardizes the POS terminal interface on different operating systems, and cooperates with the host computer test software running on the PC end operating system, so that the test personnel can complete the function test of all POS series products by only being skilled in using the host computer test software, greatly reduces the work load of the test personnel, saves the test time, and improves the reliability of the products due to the unification of the POS terminal API test interface.

[0065] The above is only the preferred embodiment of the application, and it should be pointed out that those skilled in the art can make several improvements and refinements without departing from the principles of the application, and these improvements and refinements should be considered as the protection scope of the application.

Claims

1. A POS terminal interface testing method based on the ECI protocol, characterized in that: Includes the following steps, S1. The tester inserts the UKEY into the PC and enters the UKEY password to log in to the host computer test software; S2: Power on the POS terminal and enter ECI test mode; S3. The host computer test software establishes a secure channel connection with the POS terminal via USB serial port; S4. Select a set of standardized API interfaces, configure the input parameters of the interfaces, and start the test; S5. The host computer test software converts the selected standardized API interface and its input parameters into corresponding ECI protocol instruction data, and sends the instruction data to the POS terminal through the serial port. S6. The POS terminal receives instruction data information sent from the host computer test software, parses the instruction, and calls the corresponding standardized API interface. S7: The POS terminal converts the data returned by the test interface into corresponding ECI protocol instruction data, and returns the instruction data to the host computer test software through the serial port. S8. The host computer test software parses the received instruction data and feeds the results back to the testers; at this point, the standardized API test is complete. S9. Testers select other standardized API interfaces and execute steps S4 to S8 until all interface tests are completed; testers remove the UKEY and exit the host computer test software.

2. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: A PC-based host computer testing software was developed, and an API testing interface was developed for the POS terminal. To avoid affecting the normal operation of the POS, the API testing interface needs to be run in a specific environment, which is defined as ECI mode. This means that the POS terminal can only communicate with the host computer testing software and complete the API testing function when it enters ECI mode. Both the host computer testing software and the POS terminal must comply with the ECI protocol. During the testing process, testers need to log in to the host computer testing software via UKEY before starting the relevant functional tests.

3. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: The process of establishing a secure channel in step S3 is as follows: S31. The host computer test software establishes a connection with the POS terminal via USB serial port; S32. The host computer test software generates a random number R1 and sends R1 and its own public key certificate PC_Cer to the POS terminal. S33. The POS terminal stores R1 as a key component for subsequent sessions. At the same time, the POS terminal uses the manufacturer's root CA certificate to verify the validity of the received host computer test software certificate PC_Cer. After successful verification, the terminal generates a random number R2 and encrypts R2 using the public key PC_Puk in the public key certificate PC_Cer sent by the host computer test software. The encrypted R2, together with the POS terminal's public key certificate POS_Cer, is then sent to the host computer test software. S34. The host computer test software uses the manufacturer's root CA certificate to verify the validity of the received POS terminal certificate POS_Cer. After the verification is successful, it uses its own private key PC_Pvk to decrypt the ciphertext R2 to obtain the plaintext R2, and then generates a random number R3. At the same time, it uses the public key POS_Puk in the public key certificate POS_Cer sent by the POS terminal to encrypt R3, and then sends the ciphertext R3 to the POS terminal. S35. The POS terminal uses its own private key POS_Pvk to decrypt the ciphertext R3 to obtain the plaintext R3. Then, it uses the SHA256 algorithm to generate the session key KEY between the two parties and returns the end information to the host computer test software. KEY = SHA256[R1|R2|R3] S36. After receiving the end message, the host computer test software uses the same algorithm to generate a session key KEY. Subsequent calls between the two parties will be encrypted using the KEY.

4. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: In step S4, the host computer test software predefines all the ECI protocol instruction sets supported by the POS product. When the tester selects a test case on the host computer test software, the host computer test software matches the instruction corresponding to the test case from the pre-built ECI protocol instruction set, finds the instruction for obtaining the POS terminal serial number, and then sends this instruction to the POS terminal through the PC's USB serial port.

5. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: In step S5, the POS terminal predefines the ECI protocol instruction set it supports. When the POS terminal receives instruction data information sent by the host computer test software, it first matches the instruction corresponding to the test case from the pre-built ECI protocol instruction set, finds the corresponding instruction for the function of obtaining the POS terminal serial number, and then calls the API interface of the corresponding function to execute the test. For unsupported instructions, the POS terminal returns the UNSUPPORTED instruction to the host computer test software.

6. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: In step S6, the POS terminal encapsulates the API execution result into corresponding ECI instruction data according to the ECI instruction protocol data packet format, and finally returns it to the host computer test software through the POS terminal serial port.

7. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: In step S7, the host computer test software analyzes the ECI instruction data information received from the serial port, extracts the results from the information according to the ECI instruction protocol data packet format, and finally displays them to the testers through the host computer test software interface.

8. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: The ECI protocol includes a command header, a command body, and a command footer. The command header is a fixed byte of 0x02, which marks the beginning of the command. The command body contains specific API test instructions, consisting of a 2-byte instruction type, a 2-byte parameter data length, and variable-length parameter data. The command footer is a one-byte CRC checksum, used by the command receiver to verify the integrity of the entire command and prevent data transmission errors caused by byte loss during communication.

9. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: The host computer testing software must support at least the following standardized API interfaces. Terminal name acquisition, terminal version information acquisition, key download, key usage, key destruction, contact card data encryption, contactless card data encryption, magnetic stripe card data encryption, contactless card indicator light, offline plaintext PIN verification, offline confidential text PIN verification, and terminal unique identifier encryption.

10. The POS terminal interface testing method based on the ECI protocol according to claim 1, characterized in that: The key usage includes calculating PINBLOCK, calculating MAC, and encrypting / decrypting arbitrary data. The key download, key use, and key destruction functions support three key types: TDES, AES, and SM4, and three key management systems: MK / SK, Fixed Key, and DUKPT.