A method for rapid debugging of contactless card
By curing the international card protocol layer of the contactless card in the main processing chip, the problem of the cumbersome debugging process of contactless card is solved, and a fast and efficient debugging method is achieved, which is suitable for contactless card chip debugging in various device types.
Patent Information
- Application Number
- CN202211517578.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-11-29
AI Technical Summary
In the prior art, the debugging process of non-contact card is complicated, and a large number of repetitive code modifications are required every time the contactless card chip is replaced, which affects the equipment technician and production efficiency.
The international card protocol layer in the contactless card is solidified in the main processing chip through software code, and the consistency of instructions and data formats is achieved between the main processing chip and the hardware driving layer of the contactless card, and the debugging instruction transmission is carried out using the international card protocol APDU standard format.
It reduces the workload of code modification, improves the debugging efficiency of contactless card, and realizes fast and efficient compatible debugging of various contactless card chips.
Smart Images

Figure CN115719074B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of contactless card debugging, in particular to a method for rapid debugging of a contactless card. Background Art
[0002] With the increase of electronic financial payment scenarios, more and more contactless card function debugging is required. At present, the debugging process of contactless cards mainly adopts the following methods: a dual-chip structure is adopted, in which the code structure level of the main processing chip includes API layer, data transmission layer, and hardware driver layer; the code structure level of the contactless card includes API layer, data transmission layer, international card protocol layer (i.e. EMVCo, 14443 protocol) and hardware driver layer, such as Figure 1 During debugging, the host computer debugging device needs to modify the hardware driver layer of the main processor chip (main CPU) code, as well as the API layer, data transmission layer, and hardware driver layer of the contactless card chip code, so that the dual-chip software interaction is coordinated and consistent, thereby realizing the debugging of the contactless card function, specifically including:
[0003] 1) The technicians modified the hardware driver layer of the main processor chip (main CPU) and the API layer of the contactless card chip respectively to make the instruction and data formats consistent. The hardware driver layer of the main processor chip (main CPU) then transmitted the instruction to the API layer of the contactless card chip.
[0004] 2) The technicians modify the data transmission layer of the contactless card chip to match the instruction and data format of the modified API layer. The API layer then transmits the instructions through the data transmission layer and the international card protocol layer to the hardware driver layer, and processes the instruction content at the hardware driver layer;
[0005] 3) After processing the instruction content, the hardware driver layer of the contactless card chip will obtain the contactless card data, and then pass it back to the API layer of the contactless card chip through the international card protocol layer and data transmission layer;
[0006] 4) After receiving the data, the API layer of the contactless card chip transmits the data to the hardware driver layer of the main processor chip (main CPU);
[0007] 5) The hardware driver layer of the main processor chip (main CPU) transmits the data returned by the contactless card chip to the API layer through the data transmission layer, ending the instruction sending and receiving process.
[0008] When debugging multiple contactless card chips, the aforementioned modification process must be repeated repeatedly, making the debugging process cumbersome. Furthermore, due to the large number of contactless card chip manufacturers and types on the market, and the varying chip codes used by each manufacturer, the workload of modifying the software for both chips when replacing contactless card chips in a device is extremely large. Each time a contactless card chip is replaced, technicians must modify the aforementioned software and then debug the contactless card function. This repetitive work severely impacts the efficiency of equipment technicians and the overall productivity of the equipment. Summary of the Invention
[0009] The object of the present invention is to provide a method for quickly debugging a contactless card, thereby solving the above-mentioned problems existing in the prior art.
[0010] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0011] A method for quickly debugging a contactless card uses a main processing chip (CPU) to debug the contactless card, wherein the code structure layer in the main processing chip includes: an API layer I, a data transmission layer, an international card protocol layer, and a hardware driver layer I. The contactless card includes a hardware driver layer II, and the method includes the following steps:
[0012] S1, the main processing chip corresponds to the hardware pin configuration of the contactless card to be debugged, is physically connected, and is configured with the same communication rate;
[0013] S2, the main processing chip sends a debugging instruction from the API layer 1, passes through the data transmission layer and the international card protocol layer, and reaches the hardware driver layer 1;
[0014] S3, modifying the hardware driver layer I of the main processor chip and the hardware driver layer II of the contactless card to make their instructions and data formats consistent, and then the hardware driver layer I of the main processor chip transmits the debugging instruction to the hardware driver layer II of the contactless card chip;
[0015] S4, after processing the instruction content, the hardware driver layer II of the contactless card chip will obtain the data returned by the contactless card and directly transmit the data back to the hardware driver layer I of the main processor chip;
[0016] S5, the data received by the hardware driver layer 1 is then transmitted to the API layer 1 through the international card protocol layer and data transmission layer of the main processor chip, ending the sending and receiving of a debugging instruction, thereby realizing the debugging process of the contactless card.
[0017] Preferably, the international card protocol layer of the main processing chip is an international card protocol layer on a contactless card, which is solidified in the code of the main processing chip through code movement.
[0018] Preferably, the instruction and data in step S3 adopt the international card protocol APDU standard format, and the specific format is: instruction header CMD+instruction data length LC+instruction data DATA+expected return data length LE.
[0019] Preferably, step S3 specifically includes:
[0020] 1) In the hardware driver layer I of the main processor chip, according to the international card APDU standard format, the transmission format is modified to: command header CMD + command data length LC + command data DATA + expected return data length LE;
[0021] It can fully connect to the debugging instructions processed by the international card protocol layer;
[0022] 2) Modify the hardware driver layer II of the contactless card so that the receiving format of the hardware driver layer II of the contactless card is also: command header CMD+command data length LC+command data DATA+expected return data length LE;
[0023] It can completely receive the content sent by the hardware driver layer of the main processor chip;
[0024] 3) Rapidly realize the transmission of contactless card debugging instructions between the hardware driver layer I of the main processor chip and the hardware driver layer II of the contactless card.
[0025] The beneficial effects of the present invention are:
[0026] The present invention provides a method for rapid debugging of a contactless card. The method solidifies a common international card protocol layer in the contactless card in a main processing chip (CPU) through portable software code. Therefore, when debugging the contactless card function, tedious code modification is no longer necessary. Instead, only the hardware driver layer in the CPU and the hardware driver layer in the contactless card need to be modified to make the instructions and formats the same, thereby realizing the transmission of debugging instructions. This method greatly reduces the workload of code modification, improves the debugging efficiency of the contactless card, and is more comprehensive, efficient, and compatible with various contactless card chips. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a schematic diagram of a debugging method for a contactless card chip and a main processing chip in the prior art;
[0028] Figure 2 It is a schematic diagram of the debugging method of the contactless card chip and the main processing chip given in the embodiment. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0030] Example
[0031] This embodiment provides a method for quickly debugging a contactless card, which uses a host computer with a main processing chip to debug the contactless card. Figure 2 As shown, the code structure layer in the main processing chip includes: API layer I, data transmission layer, international card protocol layer and hardware driver layer I, and the contactless card includes hardware driver layer II, including the following steps:
[0032] S1, the main processing chip corresponds to the hardware pin configuration of the contactless card to be debugged, is physically connected, and is configured with the same communication rate;
[0033] S2, the main processing chip sends a debugging instruction from the API layer 1, passes through the data transmission layer and the international card protocol layer, and reaches the hardware driver layer 1;
[0034] S3, modifying the hardware driver layer I of the main processor chip and the hardware driver layer II of the contactless card to make their instructions and data formats consistent, specifically including: the hardware driver layer I of the main processor chip transmits the debugging instruction to the hardware driver layer II of the contactless card chip;
[0035] S4, after the hardware driver layer II of the contactless card chip processes the received instruction content using the instruction processing method in the prior art, it will obtain the data returned by the contactless card and directly transmit the data back to the hardware driver layer I of the main processor chip;
[0036] S5, the data received by the hardware driver layer 1 is then transmitted to the API layer 1 through the international card protocol layer and data transmission layer of the main processor chip, ending the sending and receiving of a debugging instruction, thereby realizing a contactless card debugging process.
[0037] If you need to debug multiple contactless cards, you only need to repeat the above steps to achieve rapid debugging of multiple contactless chips.
[0038] For contactless cards, there are universal, clear and detailed protocol specifications internationally, namely the international card protocol layer. The international card protocol layer of different contactless card chips is the same; the international card protocol layer of the main processing chip described in this embodiment is the international card protocol layer on the contactless card. Technical personnel write the international card protocol layer code in accordance with the internationally disclosed and universal international card protocol specification documents, and then transplant the international card protocol layer through code, which can be solidified in the software code of the main processor chip (main CPU).
[0039] In this embodiment, in step S3, the hardware driver layer I of the main processor chip modifies the transmission format according to the international card APDU standard format to: command header CMD + command data length LC + command data DATA + expected return data length LE; thus, the debugging instructions processed by the international card protocol layer can be fully connected;
[0040] Modify the hardware driver layer II of the contactless card so that the receiving format of the hardware driver layer II of the contactless card is also: command header CMD + command data length LC + command data DATA + expected return data length LE; then the content sent by the hardware driver layer of the main processor chip can be fully received;
[0041] The above steps can quickly realize the transmission of contactless card debugging instructions between the hardware driver layer I of the main processor chip and the hardware driver layer II of the contactless card.
[0042] The debugging method provided by the present invention enables faster, more efficient and compatible debugging of various contactless card chips in various device types such as Android smart devices, Linux traditional devices, and single-chip simple devices.
[0043] By adopting the above technical solution disclosed in the present invention, the following beneficial effects are obtained:
[0044] The present invention provides a method for rapid debugging of a contactless card. The method solidifies a common international card protocol layer in the contactless card in a main processing chip (CPU) through portable software code. Therefore, when debugging the contactless card function, tedious code modification is no longer necessary. Instead, only the hardware driver layer in the CPU and the hardware driver layer in the contactless card need to be modified to make the instructions and formats the same, thereby realizing the transmission of debugging instructions. This method greatly reduces the workload of code modification, improves the debugging efficiency of the contactless card, and is more comprehensive, efficient, and compatible with various contactless card chips.
[0045] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for rapid debugging of a contactless card, characterized in that: Debugging a contactless card using a main processing chip, wherein the code structure layers within the main processing chip include: an API layer, a data transmission layer, an international card protocol layer, and a hardware driver layer I, and the contactless card includes a hardware driver layer II, includes the following steps: S1, the main processing chip corresponds to the hardware pin configuration of the contactless card to be debugged, is physically connected, and is configured with the same communication rate; S2, the main processing chip sends a debugging instruction from the API layer, passes through the data transmission layer and the international card protocol layer, and reaches the hardware driver layer I; S3, modifying the hardware driver layer I of the main processor chip and the hardware driver layer II of the contactless card to make their instructions and data formats consistent, and then the hardware driver layer I of the main processor chip transmits the debugging instruction to the hardware driver layer II of the contactless card chip; S4, after processing the instruction content, the hardware driver layer II of the contactless card chip will obtain the data returned by the contactless card and directly transmit the data back to the hardware driver layer I of the main processor chip; S5, the data received by the hardware driver layer 1 is then transmitted to the API layer through the international card protocol layer and data transmission layer of the main processor chip, ending the sending and receiving of a debugging instruction, thereby realizing the debugging process of the contactless card.
2. The contactless card rapid debugging method according to claim 1, characterized in that: The international card protocol layer of the main processing chip is the international card protocol layer on the contactless card, and is solidified in the code of the main processing chip through code movement.
3. The contactless card rapid debugging method according to claim 1, characterized in that: The instructions and data in step S3 adopt the international card protocol APDU standard format, and the specific format is: instruction header CMD+instruction data length LC+instruction data DATA+expected return data length LE.
4. The method for rapid debugging of a contactless card according to claim 3, characterized in that: Step S3 specifically includes: 1) In the hardware driver layer I of the main processor chip, according to the international card APDU standard format, the transmission format is modified to: command header CMD + command data length LC + command data DATA + expected return data length LE; It can fully connect to the debugging instructions processed by the international card protocol layer; 2) Modify the hardware driver layer II of the contactless card so that the receiving format of the hardware driver layer II of the contactless card is also: command header CMD+command data length LC+command data DATA+expected return data length LE; It can completely receive the content sent by the hardware driver layer of the main processor chip; 3) Rapidly realize the transmission of contactless card debugging instructions between the hardware driver layer I of the main processor chip and the hardware driver layer II of the contactless card.
Citation Information
Patent Citations
Method and device used for multi-mode smart card operating system
CN101068416A
Terminal device capable of implementing information interaction with central processing unit (CPU) card and method thereof
CN103095811A