Near field communication card test method and terminal device

By obtaining the test data length, assembling the data to be transmitted and recording the transmission time in the near field communication card test method, the problem that the prior art cannot accurately evaluate the NFC data transmission rate and stability of the mobile terminal is solved, and more accurate test results are achieved.

CN119675790APending Publication Date: 2025-03-21GUANGDONG TELEPOWER TELECOM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411886657.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing near field communication card testing tools cannot deeply test the data transmission of cards, resulting in the inability to accurately evaluate the NFC data transmission rate and stability of mobile terminals.

Method used

A test method for a near field communication card is provided. By obtaining the length of the test data, assemble the data to be transmitted, and recording the transmission time, the test results are determined based on these data to determine whether the data transmission complies with the design standards.

Benefits of technology

This method can accurately reflect the data transmission rate and stability of the near-field communication card, determine whether the data transmission meets the design standards, and improve the accuracy and effectiveness of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119675790A_ABST
    Figure CN119675790A_ABST
Patent Text Reader

Abstract

The invention discloses a test method of a near field communication card and a mobile terminal. The test method comprises the following steps: acquiring a test data length; according to the test data length, assembling the data to be transmitted; transmitting the to-be-transmitted data to the to-be-tested near field communication card; recording the transmission time of the data to be transmitted; determining a test result according to the test data length and the transmission time; the test result is used for indicating whether data transmission of the to-be-tested near field communication card meets a design standard or not. Compared with the prior art, the method has the advantages that the to-be-transmitted data is automatically assembled according to the length of the test data, the to-be-transmitted data is used for testing the near field communication card, the test result of data transmission is determined according to the transmission time, the rate and stability of data transmission are accurately reflected, and whether the data transmission meets the design standard or not is judged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of near field communication, and in particular to a testing method and terminal equipment of a near field communication card. Background Art

[0002] Near Field Communication (NFC) is an emerging technology. Devices that use NFC technology (such as mobile phones) can exchange data when they are close to each other. It is evolved from the integration of contactless radio frequency identification (RFID) and interconnection technology. By integrating the functions of inductive card readers, inductive cards and point-to-point communication on a single chip, mobile terminals can be used to realize mobile payment, electronic ticketing, access control, mobile identity recognition, anti-counterfeiting and other applications.

[0003] Existing near field communication card (NFC card) testing tools simply obtain basic information of the card without in-depth data transmission with the card, which will make it impossible to accurately test the speed and stability of NFC data transmission of mobile terminals. Summary of the invention

[0004] In order to overcome the deficiencies of the prior art, the present invention aims to provide a near field communication card testing method and terminal device, which can test the data transmission of the near field communication card, thereby accurately reflecting the rate and stability of data transmission of the mobile terminal.

[0005] In order to solve the above problems, the present invention is implemented according to the following scheme:

[0006] A method for testing a near field communication card is provided, comprising:

[0007] Get the test data length;

[0008] Assembling the data to be transmitted according to the test data length;

[0009] Transmitting the data to be transmitted to the near field communication card to be tested;

[0010] Recording the transmission time of the data to be transmitted;

[0011] A test result is determined according to the test data length and the transmission time; the test result is used to indicate whether the data transmission of the near field communication card to be tested meets the design standard.

[0012] Compared with the prior art, the beneficial effects of a near field communication card testing method of the present invention are as follows: by automatically assembling the data to be transmitted according to the test data length, the near field communication card is tested using the data to be transmitted, and the test result of the data transmission is determined according to the transmission time to accurately reflect the rate and stability of the data transmission, and to judge whether it meets the design standards.

[0013] Optionally, obtaining the test data length includes:

[0014] Get the length of the data input by the tester;

[0015] When the data length meets the test standard, determining the data length as the test data length;

[0016] When the data length does not meet the test standard, the data length is reacquired until the data length meets the test standard, and the data length is determined as the test data length.

[0017] Optionally, assembling the data to be transmitted according to the test data length includes:

[0018] Determine the preset instructions according to the read / write type;

[0019] Determine a data container according to the test data length and the preset instruction;

[0020] Determine the read / write instruction according to the read / write type and the test data length;

[0021] The data to be transmitted is assembled according to the preset instruction, the read and write instruction and the data container.

[0022] Optionally, determining a preset instruction according to the read / write type includes:

[0023] When the read / write type is reading data, the preset instructions include, in order, an instruction to select a near field communication application, an instruction to select a capability container file, an instruction to read a capability container file, an instruction to select a data exchange file, and an instruction to read a data exchange file;

[0024] When the read / write type is writing data, the preset instruction includes a select near field communication application instruction, a select capability container file instruction, a read capability container file instruction, and a select data exchange file instruction in sequence.

[0025] Optionally, the data container includes sequentially ordered instruction locations;

[0026] The step of determining the read / write instruction according to the read / write type and the test data length includes:

[0027] Determine the number of read and write times according to the test data length and the read and write data length;

[0028] Determine the data offset of each instruction position according to the read / write data length and the read / write times;

[0029] The read and write instructions for each instruction location are determined according to the data offset of each instruction location.

[0030] Optionally, assembling the data to be transmitted according to the preset instruction, the read / write instruction and the data container includes:

[0031] Placing the preset instruction and the read-write instruction in the instruction position of the data container in sequence;

[0032] According to the instructions in the data container, data to be transmitted including preset instructions and read and write instructions arranged in sequence are generated.

[0033] Optionally, the transmission time includes: a time point when the read and write instructions of the data to be transmitted are sequentially transmitted to the near field communication card to be tested.

[0034] Optionally, determining the test result according to the test data length and the transmission time includes:

[0035] Determine a data transmission rate set according to the test data length and the time points at which the read and write instructions of the data to be transmitted are sequentially transmitted to the near field communication card to be tested;

[0036] Determining test parameters according to the data transmission rate set;

[0037] A test result is determined according to the test parameters.

[0038] Optionally, the test parameters include: rate peak value, rate valley value and rate variation coefficient;

[0039] Determining a test result according to the test parameters includes:

[0040] When the rate peak value, the rate valley value and the coefficient of variation respectively meet the preset thresholds, the test result is that the data transmission of the near field communication card to be tested meets the design standard;

[0041] When at least one of the rate peak value, the rate valley value, and the coefficient of variation does not meet a preset threshold, the test result is that the data transmission of the near field communication card to be tested does not meet the design standard.

[0042] A mobile terminal is also provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the test method. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 Flow chart of the testing method of the present invention. DETAILED DESCRIPTION

[0044] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0045] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.

[0046] See also Figure 1 As shown, the present invention provides a method for testing a near field communication card, comprising:

[0047] S1: Get the test data length, including:

[0048] The data length input by the tester is obtained; when the data length meets the test standard, the data length is determined as the test data length; when the data length does not meet the test standard, the data length is obtained again until the data length meets the test standard, and the data length is determined as the test data length.

[0049] In one embodiment of the present invention, the test standard is determined by the characteristics of a near field communication card (NFC card), the test standard of the data length is an integer greater than 0, and the unit of the data length is KB.

[0050] S2: Assemble the data to be transmitted according to the test data length, including:

[0051] Determine the preset instructions according to the read-write type; when the read-write type is reading data, the preset instructions include the near field communication application selection instruction SELECT_NFC_AID, the capability container file selection instruction SELECT_CC_FILE, the capability container file read instruction READ_CC_FILE, the data exchange file selection instruction SELECT_NDEF_FILE, and the data exchange file read instruction READ_NLEN_FIELD_IN_NDEF_FILE, which are arranged in sequence; when the read-write type is writing data, the preset instructions include the near field communication application selection instruction SELECT_NFC_AID, the capability container file selection instruction SELECT_CC_FILE, the capability container file read instruction READ_CC_FILE, and the data exchange file selection instruction SELECT_NDEF_FILE, which are arranged in sequence.

[0052] The data container is determined according to the test data length and the preset instructions; when the read-write type is to read data, there are 5 corresponding preset instructions, and because the unit of the test data length is KB, and the maximum length of the data sent each time is 256 bytes, 1KB of data is composed of 4 256-Byte data, so when the read-write type is to read data, the size of the data container is X*4+5, where X is the test data length; when the read-write type is to write data, there are 4 corresponding preset instructions, and because the unit of the test data length is KB, and the maximum length of the data sent each time is 256 bytes, 1KB of data is composed of 4 256-Byte data, so when the read-write type is to write data, the size of the data container is X*4+4=(X+1)*4, where X is the test data length.

[0053] In a data container, instruction positions are arranged in sequence; according to the read / write type and the length of test data, the read / write instructions are determined, including: according to the test data length and the length of the read / write data, the number of read / write times is determined; according to the read / write data length and the number of read / write times, the data offset of each instruction position is determined; according to the data offset of each instruction position, the read / write instructions of each instruction position are determined; finally, according to the preset instructions, the read / write instructions and the data container, the data to be transmitted is assembled, including: the preset instructions and the read / write instructions are placed in sequence at the instruction position of the data container; according to the instructions in the data container, the data to be transmitted including the preset instructions and the read / write instructions arranged in sequence is generated.

[0054] When the read / write type is to read data, the test data length is X (X*4*256Byte), and the read / write data length is 256Byte, so the number of read / write times is 4*X times. In the near field communication card (NFC card), data is stored in sectors, so it is necessary to calculate the starting position of each 256Byte separately, that is, the read / write instructions with different offsets, and place the selected near field communication application instruction SELECT_NFC_AID, the selected capability container file instruction SELECT_CC_FILE, the read capability container file instruction READ_CC_FILE, the selected data exchange file instruction SELECT_NDEF_FILE, and the read data exchange file instruction READ_NLEN_FIELD_IN_NDEF_FILE in the first 5 positions in the data container in sequence according to their sorting order, and place the read / write instructions with different offsets in the data container in sequence. When the read / write type is to read / write data, the read / write instructions include the read data exchange information instruction ADPU_READ_BINARY with different offsets, and the read data exchange information instruction ADPU_READ_BINARY is used to read the data exchange information in the data exchange file.

[0055] When the read / write type is write data, the test data length is X (X*4*256Byte), and the read / write data length is 256Byte, so the number of read / write times is 4*X times. In the near field communication card (NFC card), data is stored in the form of sectors, so it is necessary to calculate the starting position of each 256Byte separately, that is, the read / write instructions with different offsets, and place the near field communication application selection instruction SELECT_NFC_AID, the capability container file selection instruction SELECT_CC_FILE, the capability container file reading instruction READ_CC_FILE, and the data exchange file selection instruction SELECT_NDEF_FILE in the first 4 positions in the data container in sequence according to their sorting order, and place the read / write instructions with different offsets in the data container in sequence. When the read / write type is read / write data, the read / write instructions include the update binary file instruction UPDATE_BINARY_IN_NDEF_FILE with different offsets, and the update binary file instruction UPDATE_BINARY_IN_NDEF_FILE is used to update the binary file in the data exchange file.

[0056] S3: transmitting the data to be transmitted to the near field communication card to be tested, that is, using a terminal device that can read the near field communication card (NFC card) to be close to the near field communication card to be tested, when the terminal device detects the near field communication card to be tested, sending the data to be transmitted of different read and write types to the near field communication card to be tested, when the terminal device does not detect the near field communication card to be tested, then the connection between the near field communication card to be tested and the mobile terminal fails, and the data to be transmitted cannot be transmitted to the near field communication card to be tested; the data to be transmitted includes a data container when reading data, in which preset instructions (5) and read and write instructions with different offsets are placed in sequence; and also includes a data container when writing data, in which preset instructions (4) and read and write instructions with different offsets are placed in sequence.

[0057] S4: Record the transmission time of the data to be transmitted; wherein the transmission time includes the time point when the mobile terminal transmits the read and write instructions of the data to be transmitted to the near field communication card to be tested in sequence. When recording the transmission time, it is only necessary to record the time including the NFC instruction, and there is no need to record the transmission time of the preset instruction, that is, the preset instruction can be ignored, that is, when the read and write type is to read data, there is no need to record the first 5 instructions in its data container; when the read and write type is to write data, there is no need to record the first 4 instructions in its data container.

[0058] S5: Determine the test result according to the test data length and transmission time; the test result is used to indicate whether the data transmission of the near field communication card to be tested meets the design standard; determining the test result includes:

[0059] According to the test data length and the time point when the read and write instructions of the data to be transmitted are sequentially transmitted to the near field communication card to be tested, a data transmission rate set is determined, and the data transmission rate set includes the transmission speed at each time point, that is, when the read and write type is to read data, the transmission speed is recorded from the 6th instruction position, and when the read and write type is to write data, the transmission speed is recorded from the 5th instruction position; according to the data transmission rate set, the test parameters are determined; according to the test parameters, the test results are determined; wherein the test parameters include: rate peak value, rate valley value and rate variation coefficient; the speed peak value is the maximum rate recorded in the data transmission rate set, the rate valley value is the minimum rate recorded in the data transmission rate set, and the calculation method of the rate variation coefficient can refer to the prior art, which is used to represent the discrete degree of the transmission rates corresponding to multiple time points in the data transmission rate set, so as to accurately reflect the overall level of the data transmission rate on the basis of the average value; according to the test parameters, the test results are determined, including:

[0060] When the rate peak, rate valley and coefficient of variation respectively meet the preset thresholds, the test result is that the data transmission of the near field communication card to be tested meets the design standard; when at least one of the rate peak, rate valley and coefficient of variation does not meet the preset threshold, the test result is that the data transmission of the near field communication card to be tested does not meet the design standard.

[0061] The present invention determines the size of a data container when reading or writing data according to the test data length and the read-write type, and sequentially places preset instructions and read-write instructions in the data container of the determined size, so as to realize automatic assembly of data to be transmitted, and then, by using a mobile terminal to test the near-field communication card to be tested, the data transmission rate can be accurately obtained, and then the stability of data transmission of the near-field communication card to be tested can be determined.

[0062] The present invention also provides a mobile terminal, including a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the above-mentioned testing method.

[0063] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0064] The memory can be used to store the computer program or module, and the processor realizes various functions of the test method by running or executing the computer program or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0065] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for testing a near field communication card, characterized in that: include: Get the test data length; Assembling the data to be transmitted according to the test data length; Transmitting the data to be transmitted to the near field communication card to be tested; Recording the transmission time of the data to be transmitted; A test result is determined according to the test data length and the transmission time; the test result is used to indicate whether the data transmission of the near field communication card to be tested meets the design standard.

2. A method for testing a near field communication card according to claim 1, characterized in that: The obtaining of the test data length comprises: Get the length of the data input by the tester; When the data length meets the test standard, determining the data length as the test data length; When the data length does not meet the test standard, the data length is reacquired until the data length meets the test standard, and the data length is determined as the test data length.

3. A method for testing a near field communication card according to claim 1, characterized in that: The step of assembling the data to be transmitted according to the test data length includes: Determine the preset instructions according to the read / write type; Determine a data container according to the test data length and the preset instruction; Determine the read / write instruction according to the read / write type and the test data length; The data to be transmitted is assembled according to the preset instruction, the read and write instruction and the data container.

4. A method for testing a near field communication card according to claim 3, characterized in that: Determining the preset instruction according to the read / write type includes: When the read / write type is reading data, the preset instructions include, in order, an instruction to select a near field communication application, an instruction to select a capability container file, an instruction to read a capability container file, an instruction to select a data exchange file, and an instruction to read a data exchange file; When the read / write type is writing data, the preset instruction includes a near field communication application selection instruction, a capability container file selection instruction, a capability container file read instruction, and a data exchange file selection instruction in sequence.

5. A method for testing a near field communication card according to claim 4, characterized in that: The data container includes sequentially ordered instruction locations; The step of determining the read / write instruction according to the read / write type and the test data length includes: Determine the number of read and write times according to the test data length and the read and write data length; Determine the data offset of each instruction position according to the read / write data length and the read / write times; The read and write instructions for each instruction location are determined according to the data offset of each instruction location.

6. A method for testing a near field communication card according to claim 5, characterized in that: The step of assembling the data to be transmitted according to the preset instruction, the read / write instruction and the data container includes: Placing the preset instruction and the read-write instruction in the instruction position of the data container in sequence; According to the instructions in the data container, data to be transmitted including preset instructions and read and write instructions arranged in sequence are generated.

7. A method for testing a near field communication card according to claim 6, characterized in that: The transmission time includes: the time point when the read and write instructions of the data to be transmitted are sequentially transmitted to the near field communication card to be tested.

8. A method for testing a near field communication card according to claim 7, characterized in that: The step of determining a test result according to the test data length and the transmission time includes: Determine a data transmission rate set according to the test data length and the time points at which the read and write instructions of the data to be transmitted are sequentially transmitted to the near field communication card to be tested; Determining test parameters according to the data transmission rate set; A test result is determined according to the test parameters.

9. A method for testing a near field communication card according to claim 8, characterized in that: The test parameters include: rate peak value, rate valley value and rate variation coefficient; Determining a test result according to the test parameters includes: When the rate peak value, the rate valley value and the coefficient of variation respectively meet the preset thresholds, the test result is that the data transmission of the near field communication card to be tested meets the design standard; When at least one of the rate peak value, the rate valley value, and the coefficient of variation does not meet a preset threshold, the test result is that the data transmission of the near field communication card to be tested does not meet the design standard.

10. A mobile terminal, characterized in that: The mobile terminal includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the test method as described in claims 1-9.