Card swiping method, terminal, electronic equipment, storage medium and program product

By acquiring card data and behavioral characteristic information, the NFC module is controlled to simulate card response behavior, solving the problem that smart terminal devices cannot respond to RATS commands and improving the card swiping success rate.

CN121328592APending Publication Date: 2026-01-13VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511388031.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

In existing technologies, smart terminal devices cannot effectively respond to the Select Response Request (RATS) command of access control devices, resulting in card swiping failure.

Method used

By acquiring card data and card-swiping behavior characteristics, the near-field communication (NFC) module of the control terminal simulates the card's response behavior when it receives instructions from the card-swiping device, including not responding or responding to instructions within a specific time.

Benefits of technology

This improves the success rate of card swiping on electronic devices and ensures that electronic devices can successfully respond to the instructions of the card swiping device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328592A_ABST
    Figure CN121328592A_ABST
Patent Text Reader

Abstract

The invention discloses a card swiping method, a terminal, electronic equipment, a storage medium and a program product, and belongs to the technical field of communication. The method comprises the following steps: acquiring card data information and card swiping behavior characteristic information of at least one card; wherein the card swiping behavior feature information comprises at least one of the following items: response capability information to the target instruction; response time information of the target instruction; under the condition that a first instruction sent by the card swiping equipment is received, a near field communication (NFC) module in the terminal is controlled to execute target operation based on the card data information and the card swiping behavior characteristic information, and the target operation comprises any one of the following items: not responding to the first instruction; and responding to the first instruction within the target response time range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technology, specifically relating to a card swiping method, terminal, electronic device, storage medium, and program product. Background Technology

[0002] More and more smart terminal devices are integrating Near Field Communication (NFC) functionality. Based on NFC, smart terminal devices can copy data from various physical cards such as bus cards, access cards, UnionPay cards, and ID cards to achieve the functions of these physical cards.

[0003] Taking access cards as an example, in related technologies, smart terminal devices generate electronic access cards by copying data from physical access cards, such as the unique identifier (UID). When a user brings the smart terminal device close to the access control device, the access control device sends a Type A (REQA) request command to the smart terminal device to activate the electronic access card. The smart terminal device then sends a Type A (ATQA) response request command to the access control device using the electronic access card, along with the corresponding UID. Upon receiving the UID, the access control device can successfully swipe the card.

[0004] However, after receiving the UID, some access control devices need to send a Request for Answer To Select (RATS) command to the smart terminal device. However, since the smart terminal device cannot currently respond to the RATS command with the electronic access card, the card swipe will fail. Summary of the Invention

[0005] The purpose of this application is to provide a card-swiping method, terminal, electronic device, storage medium, and program product that can improve the success rate of card swiping through electronic devices.

[0006] In a first aspect, embodiments of this application provide a card-swiping method, the method comprising:

[0007] Obtain card data information and card swiping behavior characteristic information of at least one card; wherein, the card swiping behavior characteristic information includes at least one of the following: responsiveness information to target instructions; response time information to target instructions;

[0008] Upon receiving the first instruction from the card-swiping device, the near-field communication (NFC) module in the control terminal executes a target operation based on the card data information and card-swiping behavior characteristics. The target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within the target response time range.

[0009] Secondly, embodiments of this application provide a terminal, which includes: a near-field communication (NFC) module, an acquisition module, and a control module; the acquisition module is used to acquire card data information and card swiping behavior feature information of at least one card; wherein, the card swiping behavior feature information includes at least one of the following: response capability information to target instructions; response time information to target instructions;

[0010] The aforementioned control module is used to control the near-field communication (NFC) module in the terminal to perform a target operation based on the card data information and the card swiping behavior feature information when it receives a first instruction sent by the card swiping device. The target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within the target response time range.

[0011] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the card swiping method as described in the first aspect.

[0012] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the card swiping method as described in the first aspect.

[0013] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the card swiping method as described in the first aspect.

[0014] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the card swiping method as described in the first aspect.

[0015] In this embodiment, card data information and card swiping behavior characteristic information of at least one card are acquired. The card swiping behavior characteristic information includes at least one of the following: responsiveness information to a target instruction; response time information to a target instruction. Upon receiving a first instruction from a card swiping device, the near-field communication (NFC) module in the terminal is controlled to perform a target operation based on the aforementioned card data information and the card swiping behavior characteristic information. This target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within a target response time range. In this solution, since the electronic device records the card swiping behavior characteristic information—that is, the electronic device records the card's responsiveness information to swiping instructions and the response time information to swiping instructions—after receiving a swiping instruction from the card swiping device, the electronic device can simulate the card's response instruction behavior based on the corresponding card's swiping behavior characteristic information, thereby successfully responding to the card swiping instruction from the card swiping device, thus improving the success rate of swiping cards through the electronic device. Attached Figure Description

[0016] Figure 1 This is one of the flowcharts of the card swiping method provided in the embodiments of this application;

[0017] Figure 2A This is a schematic diagram illustrating the interaction between the access control device and the electronic access card provided in this application embodiment;

[0018] Figure 2B This is a schematic diagram illustrating the interaction between the vehicle-mounted card reader terminal and the electronic bus card provided in this application embodiment;

[0019] Figure 3 This is the second flowchart of the card swiping method provided in the embodiments of this application;

[0020] Figure 4 This is the third flowchart of the card swiping method provided in the embodiments of this application;

[0021] Figure 5 This is one of the flowcharts illustrating the behavioral characteristics of an electronic device copying a physical card, as provided in the embodiments of this application.

[0022] Figure 6 This is the second flowchart illustrating the behavioral characteristics of an electronic device copying a physical card, as provided in the embodiments of this application.

[0023] Figure 7A This is the fourth flowchart of the card swiping method provided in the embodiments of this application;

[0024] Figure 7B This is the fifth flowchart of the card swiping method provided in the embodiments of this application;

[0025] Figure 8This is the third flowchart illustrating the behavioral characteristics of an electronic device copying a physical card, as provided in the embodiments of this application.

[0026] Figure 9 This is the sixth flowchart of the card swiping method provided in the embodiments of this application;

[0027] Figure 10 This is a schematic diagram of the terminal provided in an embodiment of this application;

[0028] Figure 11 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0029] Figure 12 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0031] The terms "first," "second," etc., used in this application's specification are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects have an "or" relationship.

[0032] The terms "at least one," "at least one," etc., in this application refer to any one, any two, or a combination of two or more of the included objects. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more, and its meaning is similar to that of "at least one."

[0033] The following explains some concepts and terms involved in the card swiping method, terminal, electronic device, storage medium and program product provided in the embodiments of this application.

[0034] NFC: A short-range, high-frequency wireless communication technology based on radio frequency identification (RFID) and wireless network protocols. It allows two electronic devices to exchange data contactlessly within a range of approximately 10 centimeters.

[0035] Proximity Coupling Device (PCD): A card reader device that emits radio frequency energy and controls communication, used to actively initiate communication, provide an energy field for proximity cards, and manage the communication process.

[0036] Proximity Integrated Circuit Card (PICC): A passive radio frequency smart card, such as an NFC card, which functions by passively responding within the energy field of a PCD to perform authentication and data exchange.

[0037] Electronic Card (EC): Also known as a virtual card, an electronic card is a digital card without a physical medium that stores and transmits information through electronic devices.

[0038] Physical Card (PC): A physical card is a card that uses a physical medium as its carrier. It is usually made of plastic, metal or paper materials and has a built-in chip, magnetic strip or integrated circuit module. It is used to store user information and realize specific functions.

[0039] ISO / IEC 14443-3 Type A Protocol: The ISO / IEC 14443-3 Type A protocol is the communication standard for contactless smart cards in Near Field Communication (NFC), which defines the frame structure, timing, and data encoding rules for initial anti-collision and card activation.

[0040] Mifare Classic Protocol: The Mifare Classic protocol is a contactless RFID (Radio Frequency Identification) protocol based on the ISO / IEC 14443-A standard, which verifies card information by reading card sector data.

[0041] The card-swiping method, terminal, electronic device, storage medium, and program product provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0042] The embodiments of this application can be applied to scenarios where electronic devices swipe electronic cards.

[0043] For example, specific application scenarios may include, but are not limited to: scenarios where electronic devices unlock access control devices by simulating electronic access cards; scenarios where electronic devices make payments by swiping electronic transportation cards; scenarios where electronic devices make payments by swiping electronic UnionPay cards; scenarios where electronic devices complete identity verification by using electronic ID cards, etc.

[0044] It should be noted that the above scenarios are merely illustrative examples of some possible applications of the embodiments of this application. In actual implementation, the embodiments of this application can also be applied to more scenarios where electronic devices swipe electronic cards. The embodiments of this application are not limited here.

[0045] Currently, electronic devices are equipped with NFC chips, which can copy data from various physical cards such as bus cards, access cards, UnionPay cards, and ID cards, enabling the electronic device to perform the functions of these physical cards.

[0046] Take the Mifare 1K access card as an example. The Mifare 1K card complies with the International Organization for Standardization (ISO) / International Electrotechnical Commission (IEC) 14443 standard protocol and the Mifare Classic protocol.

[0047] Typically, there are two procedures for swiping a Mifare 1K access card:

[0048] Category 1: After completing the ISO / IEC 14443-3 Type A protocol process, the access control device obtains the UID of the physical card, indicating that the card swipe is successful.

[0049] Category 2: After completing the ISO / IEC 14443-3 Type A protocol process, the device enters the Mifare Classic protocol to read and write sector data. Once the access control device verifies that the sector data meets expectations, it determines that the card swipe was successful.

[0050] In related technologies, the ISO / IEC 14443-3 Type A card swiping process for Mifare 1K access cards manufactured according to the protocol specifications includes the following steps 1 to 3:

[0051] Step 1, Polling Phase: The PCD sends a REQA command or a Wake-Up (Type A, WUPA) command to wake up all Type A access cards in the NFC field, causing these access cards to enter the READY state, thereby returning an ATQA command to the PCD. This ATQA command contains UID length information, such as 4 bytes, 7 bytes, or 10 bytes.

[0052] Step 2, Anti-collision cycle: The PCD sends an Anti-Collision Command (AC), such as 0x93 or 0x95, causing the access card to return the complete UID to the PCD.

[0053] Step 3, Access Card Selection: The PCD sends a Select (SEL) command, which carries the complete UID of the selected access card. This allows the selected access card to return a Select AcKnowledge (SAK) command to the PCD and enter the ACTIVE state, enabling the access card to perform subsequent data transmission. Subsequently, the PCD can send a RATS command to the access card, so that upon receiving the RATS command, the access card can send an Answer To Select (ATS) command to the PCD. This ATS command carries the capability parameters of the access card.

[0054] However, in actual card swiping, the process required for a successful card swipe by the access control device differs from the process specified in the above protocol. Specifically, there are the following four card swiping processes:

[0055] Process 1: Some access control devices receive the UID returned by the access card (i.e., step 3 above), indicating that the card swipe was successful. Subsequently, the access control device will not send a RATS command. It should be noted that the card swipe behavior in process 1 complies with the protocol specifications.

[0056] Process 2: Some access control devices receive the UID returned by the access card (i.e., step 3 above). Subsequently, the access control device sends a RATS command to the access card, and the access card sends an ATS command to the access control device. When the access control device receives the ATS command in response to the access card, the card swipe is successful. It should be noted that the card swipe behavior in Process 2 does not comply with the protocol specifications.

[0057] Step 3: Some access control devices receive the UID returned by the access card (i.e., step 3 above). Subsequently, the access control device will send a RATS command to the access card, but the access control device does not expect to receive an ATS command in response from the access card. If the access control device does not receive an ATS command in response from the access card within a preset time, the access control device will successfully swipe the card. It should be noted that the card swiping behavior in Step 3 complies with the protocol specifications.

[0058] Step 4: After receiving the UID returned by the access card (i.e., step 3 above), some access control devices enter the Mifare Classic protocol to read sector data. If the access control device verifies that the sector data meets expectations, it determines that the card swipe was successful.

[0059] As can be seen from the above, after receiving the UID, some access control devices need to send a RATS command to the smart terminal device. However, since the smart terminal device cannot currently respond to the RATS command through the electronic access card, the card swipe will fail.

[0060] This application provides a card-swiping method, terminal, electronic device, storage medium, and program product, which acquires card data information and card-swiping behavior characteristic information of at least one card. The card-swiping behavior characteristic information includes at least one of the following: responsiveness information to a target instruction; response time information to a target instruction. Upon receiving a first instruction from a card-swiping device, the near-field communication (NFC) module in the terminal is controlled to perform a target operation based on the card data information and the card-swiping behavior characteristic information. The target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within a target response time range. In this solution, since the electronic device records the card-swiping behavior characteristic information, that is, the electronic device records the card's responsiveness information to card-swiping instructions and the response time information to card-swiping instructions, after receiving a card-swiping instruction from the card-swiping device, the electronic device can simulate the card's behavior of sending a response instruction based on the corresponding card's card-swiping behavior characteristic information, thereby successfully responding to the card-swiping instruction from the card-swiping device, thus improving the success rate of card swiping through the electronic device.

[0061] The card-swiping method provided in this application can be executed by a terminal, which can be an electronic device, or a functional module or functional entity within the electronic device. The following description uses an electronic device as an example to illustrate the technical solution provided in this application.

[0062] Figure 1 A flowchart of a card-swiping method provided in an embodiment of this application is shown, such as... Figure 1 As shown, the card swiping method provided in this application embodiment may include the following steps 201 and 202.

[0063] Step 201: The electronic device acquires card data information and card swiping behavior characteristic information of at least one card.

[0064] In some embodiments of this application, the aforementioned card-swiping behavior characteristic information includes at least one of the following: responsiveness information to the target instruction; and response time information to the target instruction.

[0065] In some embodiments of this application, the target instruction mentioned above is a card swiping instruction sent by a card swiping device.

[0066] In some embodiments of this application, the target instruction includes at least one of the following: a Type A Request for Response (REQA) instruction, an anti-collision instruction, a selection instruction, and a Select Response Request (RATS) instruction. The selection instruction carries the unique identifier (UID) of the card selected by the card reader.

[0067] In some embodiments of this application, the card data information includes at least one of the following: card manufacturer information, card unique identifier (UID), card type, and card password information.

[0068] In some embodiments of this application, the card data information may further include at least one of the following: data required for the card to send ATQA commands, data required for the card to send SAK commands, and data required for the card to send UID commands. Of course, the card data information may also include other data information from the card; to avoid redundancy, these will not be listed here.

[0069] In some embodiments of this application, the above-mentioned electronic device is an electronic device with NFC functionality.

[0070] In some embodiments of this application, the card reader can be a PCD. A proximity coupling device refers to a card reader device that transmits radio frequency energy and controls communication; its function is to actively initiate communication, provide an energy field to the proximity card, and manage the communication process.

[0071] In some embodiments of this application, the card-swiping device may include, but is not limited to: vehicle-mounted card-swiping terminal, access control device, point of sale (POS) terminal, and ID card reader.

[0072] In some embodiments of this application, the aforementioned at least one card can be a physical card. After the electronic device obtains the card data information and card swiping behavior feature information of at least one card, the electronic device can copy each physical card according to the card data information corresponding to each physical card obtained, and generate a corresponding electronic card. That is, after the electronic device obtains the card data information and card swiping behavior feature information of at least one card, the electronic device can generate an electronic card corresponding to each card according to the data information of each card in the at least one card, and associate each electronic card with its corresponding card swiping behavior feature information.

[0073] For example, taking a physical access card as an example, the electronic device obtains the card data information of the physical access card, such as the UID of the physical access card, in order to generate a corresponding electronic access card in the electronic device.

[0074] In some embodiments of this application, the aforementioned physical card may include, but is not limited to: physical transportation card, physical access card, physical UnionPay card, physical ID card, etc.

[0075] In some embodiments of this application, the first electronic card can be a PICC. A proximity card refers to a passive radio frequency smart card, such as an NFC card. The function of a proximity card is to passively respond within the energy field of a PCD, performing authentication and data exchange.

[0076] In some embodiments of this application, the first electronic card may include, but is not limited to, electronic transportation cards, electronic access control cards, electronic UnionPay cards, electronic ID cards, etc.

[0077] Step 202: Upon receiving the first instruction from the card swiping device, the electronic device controls the near-field communication (NFC) module in the terminal to execute the target operation based on the card data information and card swiping behavior characteristics.

[0078] In some embodiments of this application, the target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within the target response time range.

[0079] In some embodiments of this application, the first instruction is a card-swiping instruction sent by the card-swiping device, and the first instruction includes at least one of the following: a Type A Request for Response (REQA) instruction, an anti-collision instruction, a selection instruction, and a Select Response Request (RATS) instruction. The selection instruction carries the unique identifier (UID) of the card selected by the card-swiping device.

[0080] In some embodiments of this application, if the electronic device does not contain card data information and card swiping behavior characteristic information of a card that matches the card swiping device, the electronic device will not respond to the first instruction; if the electronic device contains card data information and card swiping behavior characteristic information of a card that matches the card swiping device, the electronic device can receive the first instruction from the card swiping device through the first electronic card.

[0081] In some embodiments of this application, the first electronic card is an electronic card generated by an electronic device by acquiring the card data information of the first physical card, so as to realize the function of the first physical card.

[0082] In some embodiments of this application, the first physical card is matched with the card-swiping device; the first electronic card is matched with the card-swiping device.

[0083] For example, if the card reader is an access control device, the first physical card matched with the access control device is a physical access control card, and the first electronic card matched with the access control device is an electronic access control card. Alternatively, if the card reader is a point-of-sale terminal, the first physical card matched with the point-of-sale terminal is a physical bank card, and the first electronic card matched with the point-of-sale terminal is an electronic bank card.

[0084] In some embodiments of this application, when an electronic device approaches a card reader, the card reader can send a card-swiping command to the electronic device. That is, when the electronic device enters the electromagnetic field range of the card reader, the first electronic card will be detected by the card reader, and then the card reader will send a card-swiping command to the first electronic card.

[0085] In some embodiments of this application, the card swiping behavior feature information described above can be used to characterize the card's behavior features in sending response instructions.

[0086] It should be noted that the first physical card matched with the aforementioned card reader can be understood as follows: the card reader and the first physical card are used in pairs, that is, the first physical card can complete radio frequency identification and two-way authentication on the aforementioned card reader and establish effective data communication; the first electronic card matched with the aforementioned card reader can be understood as follows: the card reader and the first electronic card are used in pairs, that is, the electronic device can complete radio frequency identification and two-way authentication with the aforementioned card reader through the first electronic card and establish effective data communication.

[0087] In some embodiments of this application, when an electronic device obtains card data information, it can first bring the device close to the card. The NFC module of the electronic device can then send a radio frequency field to power the card chip through electromagnetic induction. After that, the electronic device can send a read command to the card to obtain the card data information.

[0088] In some embodiments of this application, the card data information of the card mentioned above refers to the data stored in the card, that is, the binary information stored in the card's internal storage chip.

[0089] In some embodiments of this application, the card data information obtained by the electronic device may include, but is not limited to: data required for the card to send ATQA instructions, data required for the card to send SAK instructions, data required for the card to send UID instructions, card manufacturer information, card unique identifier UID, card type, and card password information.

[0090] In some embodiments of this application, the REQA instruction is a request instruction for initializing communication sent by the PCD to the PICC to wake up the card in the IDLE state. It is a fixed 7-bit short frame "0100110".

[0091] In some embodiments of this application, the aforementioned AC instruction is an instruction sent by a PCD to a PICC to resolve the conflict problem when multiple cards enter the card reader simultaneously. When its value is “10010011”, it indicates that its anti-collision level is 1; when its value is “10010101”, it indicates that its anti-collision level is 2; and when its value is “10010111”, it indicates that its anti-collision level is 3.

[0092] In some embodiments of this application, the SEL instruction is a selection instruction sent by the PCD to the PICC for anti-collision selection. When its value is "10010011", it indicates that its anti-collision level is 1; when its value is "10010101", it indicates that its anti-collision level is 2; and when its value is "10010111", it indicates that its anti-collision level is 3.

[0093] In some embodiments of this application, the aforementioned RATS instruction is an instruction sent by a PCD to a PICC for protocol verification, which includes command code E0 and the Frame Size for Proximity Coupling Device Integer (FSDI).

[0094] In some embodiments of this application, the WUPA instruction is a command sent by the PCD to the PICC to wake up a card in a HALT state, and its value is a fixed 7-bit short frame "1010010".

[0095] In some embodiments of this application, the electronic device can respond to a card swiping command by sending a response command to the card swiping device based on the behavioral feature information corresponding to the electronic card.

[0096] In some embodiments of this application, the aforementioned card swiping behavior feature information can be card swiping behavior feature information preset by the electronic device, that is, card swiping behavior feature information of at least one card pre-recorded by the electronic device.

[0097] In some embodiments of this application, after the electronic device obtains the card data information of the physical card to generate the electronic card corresponding to the physical card, it records the card swiping behavior characteristic information of the physical card.

[0098] In some embodiments of this application, after the electronic device obtains the card data information of the physical card, the electronic device can send swiping instructions to the physical card in sequence according to the swiping process of the ISO / IEC 14443-3 Type A protocol, so as to subsequently identify and record the swiping behavior feature information of the physical card.

[0099] In some embodiments of this application, the electronic device includes at least one electronic card and records the card-swiping behavior characteristics of the physical card corresponding to each of the at least one electronic card. It is understood that the electronic device pre-records the behavior characteristics of the physical card corresponding to each of the aforementioned electronic cards.

[0100] In some embodiments of this application, the aforementioned card-swiping behavior characteristic information may include, but is not limited to: responsiveness information to a target instruction; and response time information to a target instruction. The responsiveness information to a target instruction indicates whether the card has the ability to respond to a target instruction and send a response instruction to the card-swiping device, and the response time information to a target instruction indicates the time required for the card to send a response instruction from receiving the target instruction.

[0101] In some embodiments of this application, the above response instructions may include at least one of the following: ATQA instruction, SAK instruction, UID instruction, and ATS instruction.

[0102] In some embodiments of this application, the ATQA instruction is a response instruction sent by the PICC to the PCD in response to REQA or WUPA. It consists of 2 bytes of data, including UID length and bit rate information.

[0103] In some embodiments of this application, the SAK instruction is an instruction sent by PICC to PCD for making a selection confirmation response. Its data structure is 1 byte, and the 6th bit of the byte identifies whether the corresponding card supports the ISO / IEC 14443-4 protocol.

[0104] In some embodiments of this application, the aforementioned UID instruction is an instruction sent by PICC to PCD, serving as the core identification basis for the anti-collision process. Its essence is the unique identifier of the card, and its data structure is generally a sequence of 4, 7, or 10 bytes.

[0105] In some embodiments of this application, the aforementioned ATS command is a command sent by the PICC to the PCD for responding to the RATS command and performing protocol verification.

[0106] For example, if the card swipe instruction is a REQA instruction or a WUPA instruction, then the response instruction is an ATQA instruction; if the card swipe instruction is an AC instruction, then the response instruction is a UID instruction; if the card swipe instruction is a SEL instruction, then the response instruction is a SAK instruction; if the card swipe instruction is a RATS instruction, then the response instruction is an ATS instruction.

[0107] Thus, since the card swiping behavior feature information includes the card's response time to the swiping command, the electronic device can simulate the card's response time to the swiping device and thus successfully respond to the swiping command, improving the success rate of swiping cards through the electronic device.

[0108] In some embodiments of this application, the target instruction includes a RATS instruction; the card swiping behavior feature information includes first capability feature information, which is used to characterize the card's ability to send an ATS instruction.

[0109] Thus, since the card swiping behavior feature information includes first capability feature information that characterizes the card's ability to send ATS commands, the electronic device can simulate the card's behavior of sending ATS commands based on the first capability feature information, thereby successfully responding to the RATS command of the card swiping device and improving the success rate of swiping cards through the electronic device.

[0110] Furthermore, in some embodiments of this application, the aforementioned card swiping behavior characteristic information also includes the response time of the card in response to the card swiping command.

[0111] Thus, since the card swiping behavior characteristic information includes first capability characteristic information representing the card's ability to send ATS commands, the electronic device, upon receiving a RATS command, can simulate the card's behavior of sending an ATS command, thereby successfully responding to the RATS command from the card reader. Simultaneously, since the aforementioned card swiping behavior characteristic information also includes the card's response time to the swiping command, the electronic device can simulate the card's feedback of a response command to the card reader within that response time, successfully responding to the card reader's swiping command. This improves the success rate of card swiping via electronic devices.

[0112] In some embodiments of this application, an electronic device can receive target instructions from a card reader and send response instructions to the card reader via an electronic card that is matched with the card reader.

[0113] In some embodiments of this application, assuming the target instruction includes: REQA instruction, AC instruction, and SEL instruction, the card swiping process of the electronic device includes the following steps: When the electronic device approaches the card swiping device, the card swiping device can send a REQA instruction to the electronic card in the electronic device to wake up the corresponding electronic card in the electronic device. Then, the electronic device sends an ATQA instruction to the card swiping device through the electronic card to respond to the REQA instruction sent by the access control device. After receiving the ATQA instruction, the card swiping device sends an AC instruction to the electronic device to perform anti-collision loop to obtain the UID of the corresponding electronic card in the electronic device. After receiving the AC instruction, the electronic device sends a UID instruction to the card swiping device through the corresponding electronic card. After receiving the UID instruction, the card swiping device sends a SEL instruction to the corresponding electronic card in the electronic device, indicating that the card swiping device has selected the UID of the corresponding electronic card in the electronic device. After receiving the SEL instruction, the electronic device sends an SAK instruction to the card swiping device through the corresponding electronic card to confirm the selection. After receiving the SAK instruction, the card swiping device can successfully swipe the card.

[0114] For example, assuming the aforementioned electronic device is a mobile phone, the aforementioned card reader is an access control device, and the aforementioned electronic card is an electronic access control card, such as... Figure 2A As shown, if a user needs to swipe an electronic access card to unlock the access control device in community A, the user can first select the electronic access card for community A on their mobile phone and bring the phone close to the access control device. The access control device will send a REQA command to the electronic access card in the phone to wake it up. Then, the phone sends an ATQA command to the access control device in response to the REQA command sent by the access control device. After receiving the ATQA command, the access control device sends an AC command to the electronic access card in the phone to perform anti-collision loop to obtain the UID of the electronic access card in the phone. After receiving the AC command, the phone can send a UID command to the access control device through the electronic access card. After receiving the UID command, the access control device can send a SEL command to the electronic access card in the phone, indicating that the access control device has selected the UID of the electronic access card in the phone. After receiving the SEL command sent by the access control device, the electronic access card in the phone can send a SAK command to the access control device to confirm the selection, thereby unlocking the access control device in community A.

[0115] In some embodiments of this application, it is assumed that the target instruction includes: when an electronic device approaches a card reader, the card reader can send a REQA instruction to the electronic card in the electronic device to wake up the corresponding electronic card in the electronic device. Then, the electronic device sends an ATQA instruction to the card reader via the electronic card to respond to the REQA instruction sent by the access control device. After receiving the ATQA instruction, the card reader sends an AC instruction to the electronic device to perform anti-collision loop to obtain the UID of the corresponding electronic card in the electronic device. After receiving the AC instruction, the electronic device sends a UID instruction to the card reader via the corresponding electronic card. The card reader receives... After receiving the UID instruction, the electronic device sends an SEL instruction to the corresponding electronic card in the electronic device, indicating that the card reader has selected the UID of the corresponding electronic card in the electronic device. After receiving the SEL instruction, the electronic device sends an SAK instruction to the card reader through the corresponding electronic card to confirm the selection. After receiving the SAK instruction, the card reader sends a RATS instruction to the corresponding electronic card in the electronic device to request confirmation of communication parameters. After receiving the RATS instruction, the electronic device sends an ATS instruction to the card reader through the corresponding electronic card to complete the confirmation of communication parameters. After receiving the ATS instruction, the card reader can successfully swipe the card.

[0116] For example, assuming the aforementioned electronic device is a mobile phone, the aforementioned card reader is a vehicle-mounted card reader terminal, and the aforementioned electronic card is an electronic bus card, such as... Figure 2BAs shown, if a user needs to use an electronic bus card to pay for bus fares, the user first selects the electronic bus card compatible with the bus on their mobile phone and then holds the phone close to the bus's onboard card reader. The onboard card reader sends a REQA command to the electronic bus card on the phone to activate it. The phone then sends an ATQA command to the onboard card reader in response to the REQA command. Upon receiving the ATQA command, the onboard card reader sends an AC command to the electronic bus card on the phone to perform anti-collision looping to obtain the UID of the electronic bus card. After receiving the AC command, the phone can send a UID command to the onboard card reader via the electronic bus card. Upon receiving the UID command, the onboard card reader can... The system sends an SEL command to the electronic bus card in the mobile phone, indicating that the on-board card reader has selected the UID of the electronic bus card in the mobile phone. After receiving the SEL command from the on-board card reader, the electronic bus card in the mobile phone can send an SAK command to the on-board card reader to confirm the selection. Then, the on-board card reader sends a RATS command to the electronic bus card in the mobile phone to request confirmation of communication parameters. After receiving the RATS command, the electronic bus card in the mobile phone can respond to the RATS command by sending an ATS command to the on-board card reader to complete the confirmation of communication parameters. Afterward, the on-board card reader sends a deduction command to the electronic bus card in the mobile phone. After receiving the deduction command, the electronic bus card in the mobile phone performs the deduction operation and sends a deduction confirmation command to the on-board card reader to complete the payment of the bus fare.

[0117] For example, assuming the aforementioned electronic device is a mobile phone, the aforementioned card reader is an ID card reader, and the aforementioned electronic card is an electronic ID card, if a user needs to swipe their electronic ID card for identity verification during a physical examination, the user can first select their electronic ID card on their mobile phone and bring the phone close to the ID card reader used for identity verification during the physical examination. The ID card reader will send a REQA command to the electronic ID card in the mobile phone to wake up the electronic ID card. Then, the mobile phone sends an ATQA command to the ID card reader in response to the REQA command sent by the ID card reader. After receiving the ATQA command, the ID card reader then sends an AC command to the electronic ID card in the mobile phone to perform anti-collision loop to obtain the UID of the electronic ID card in the mobile phone. After receiving the AC command, the mobile phone can then use the electronic ID card to communicate with the ID card reader. Upon receiving the UID command, the ID card reader can send a SEL command to the electronic ID card in the mobile phone, indicating that the ID card reader has selected the UID of the electronic ID card in the mobile phone. After receiving the SEL command from the ID card reader, the electronic ID card in the mobile phone can send a SAK command to the ID card reader to confirm the selection. Then, the ID card reader sends a RATS command to the electronic ID card in the mobile phone to request confirmation of communication parameters. After receiving the RATS command, the electronic ID card in the mobile phone can respond to the RATS command by sending an ATS command to the ID card reader to complete the confirmation of communication parameters. Afterward, the ID card reader sends an authentication command to the electronic ID card in the mobile phone. After receiving the authentication command, the electronic ID card in the mobile phone sends relevant identity information to the ID card reader to complete the authentication.

[0118] This application provides a card swiping method. Since the electronic device records the card swiping behavior characteristics, that is, the electronic device records the card's responsiveness to swiping commands and the response time information, after receiving the card swiping command from the card swiping device, the electronic device can simulate the card's response command behavior based on the corresponding card's swiping behavior characteristics, thereby successfully responding to the card swiping command from the card swiping device, thus improving the success rate of swiping cards through the electronic device.

[0119] In some embodiments of this application, combined with Figure 1 ,like Figure 3 As shown, before the step 202 above, "controlling the near-field communication (NFC) module in the terminal to perform the target operation based on card data information and card swiping behavior feature information", this application embodiment also includes the following step 301.

[0120] Step 301: The electronic device determines a second card and the card-swiping behavior characteristics of the second card from at least one card based on the first instruction.

[0121] It should be noted that step 301 is executed after "when the electronic device receives the first instruction sent by the card swiping device" in step 202, and before "controlling the near-field communication (NFC) module in the terminal to execute the target operation based on card data information and card swiping behavior feature information" in step 202. Therefore, Figure 3 The contents of steps 301 and 202 have been adapted.

[0122] In some embodiments of this application, the second card described above can be a physical card.

[0123] In some embodiments of this application, the first instruction may carry card type information, and the electronic device may determine the second card that matches the first instruction and the card swiping behavior characteristics of the second card based on the card type information carried in the first instruction.

[0124] In some embodiments of this application, the electronic device may, in response to a first instruction, determine the card swiping behavior feature information corresponding to the UID of the second card, based on the UID of the second card and the correspondence between the UID and the card swiping behavior feature information.

[0125] In some embodiments of this application, the electronic device pre-stores a correspondence between UID and card swiping behavior feature information. Each UID corresponds to a card swiping behavior feature information, so that the electronic device can determine the card swiping behavior feature information corresponding to the card from the correspondence based on the card's UID.

[0126] It is understandable that electronic devices can quickly obtain the card swiping behavior characteristics of a card by associating the UID of each card with its card swiping behavior characteristics from the card data information of at least one card.

[0127] In this way, the electronic device can determine the card corresponding to the card swiping instruction from the card reader. By pre-stored the correspondence between the card's UID and the card swiping behavior feature information, the electronic device can quickly obtain the card swiping behavior feature information corresponding to the UID of the card matching the card reader after receiving the card swiping instruction from the card reader. Based on this correspondence, the electronic device can simulate the card sending a response instruction to the card reader, thereby successfully responding to the card reader's swiping instruction and improving the success rate of card swiping through the electronic device.

[0128] In some embodiments of this application, combined with Figure 1 ,like Figure 4 As shown, step 201 above can be implemented through steps 201a to 201c below.

[0129] Step 201a: The NFC module in the electronic device control terminal reads the card data information of at least one card.

[0130] In some embodiments of this application, when an electronic device obtains card data information, it can first bring the device close to the card. The NFC module of the electronic device can then send a radio frequency field to power the card chip through electromagnetic induction. After that, the electronic device can send a read command to the card to obtain the card data information.

[0131] Step 201b: The NFC module in the electronic device control terminal simulates a card swiping device and sends a target instruction to at least one card.

[0132] In some embodiments of this application, the electronic device can simulate a card reader to attempt to send the corresponding card swiping command and verify the card's ability to respond to the card swiping command.

[0133] In some embodiments of this application, the card swiping instruction sent by the electronic device to the card by the card swiping device may include at least one of the following: REQA instruction, AC instruction, SEL instruction, RATS instruction, WUPA instruction, etc.

[0134] Step 201c: When the NFC module in the terminal of the electronic device receives the response information of at least one card to the target instruction, it records the response capability information to the target instruction and the time from sending the target instruction to receiving the response information, thereby obtaining the response time information to the target instruction.

[0135] In some embodiments of this application, the response information of the card to the target instruction can be a response instruction to the target instruction, that is, the corresponding response instruction sent by the card in response to the target instruction.

[0136] In some embodiments of this application, the electronic device receiving a response instruction sent by the card in response to the card swipe instruction may include at least one of the following: ATQA instruction, SAK instruction, UID instruction, and ATS instruction.

[0137] In some embodiments of this application, if the electronic device sends a swipe instruction to the card and receives a response instruction corresponding to the swipe instruction within a preset time period, the electronic device records that the card has the ability to respond to the swipe instruction; if the electronic device sends a swipe instruction to the card and does not receive a response instruction corresponding to the swipe instruction within a preset time period, the electronic device records that the card does not have the ability to respond to the swipe instruction.

[0138] For example, if an electronic device sends a RATS command to a card and receives an ATS command corresponding to the RATS command within a preset time period, the electronic device records that the card has the ability to respond to RATS commands.

[0139] In some embodiments of this application, the conventional value of the preset duration can be 0.5 seconds. Of course, the preset duration can also be other durations preset by the user or set by the system. It can be set according to actual needs, and this application does not impose any limitations on it.

[0140] In some embodiments of this application, the above-mentioned response time information to the target instruction can be the response time of the card to the swipe instruction, or it can be understood as the time elapsed from when the electronic device sends the swipe instruction to when the electronic device receives the response instruction.

[0141] In some embodiments of this application, the electronic device starts a timer each time it simulates a card swiping device sending a card swiping instruction to the card, and stops the timer each time it receives a response instruction corresponding to the card swiping instruction sent by the card. At this time, the timer's duration is the time from when the electronic device sends the card swiping instruction to when it receives the response instruction. The electronic device can use this duration as the response duration of the card in response to the card swiping instruction.

[0142] For example, such as Figure 5 The diagram illustrates the process by which an electronic device acquires the card-swiping behavior characteristic information of a first physical card. Specifically, the process includes the following steps A1 to A5:

[0143] Step A1: The electronic device sends a swipe command to the first physical card.

[0144] Step A2: The electronic device determines whether it has received a response command sent by the first physical card.

[0145] If yes, the electronic device performs step A3 and subsequent steps as described below; if no, the electronic device performs step A4 and subsequent steps as described below.

[0146] Step A3: The electronic device records that the first physical card has the ability to respond to the above-mentioned response command, and records the response time of the above-mentioned response command.

[0147] Step A4: The electronic device records that the first physical card does not have the ability to respond to the above-mentioned response commands.

[0148] Step A5: The electronic device determines whether the above card swipe instruction is the last card swipe instruction.

[0149] If yes, the electronic device completes the acquisition of the card swiping behavior feature information of the first physical card; if no, the electronic device executes step A1 and subsequent steps.

[0150] In some embodiments of this application, the response time of the card in response to the card swiping instruction can be the time defined in the ISO / IEC14443-3 Type A protocol as "from the time the card swiping device sends an instruction to the time the card swiping device receives the response instruction of the instruction". This time can be called the frame delay time (FDT).

[0151] For example, such as Figure 6 The diagram illustrates the process by which an electronic device records the response time of a physical card A in response to a swipe command. Specifically, the process includes: first, the electronic device sends a REQA command to physical card A; after a time T1, the electronic device receives an ATQA command from physical card A; second, the electronic device sends an AC command to physical card A; after a time T2, the electronic device receives a UID command from physical card A; third, the electronic device sends a SEL command to physical card A; and after a time T3, the electronic device receives a SAK command from physical card A.

[0152] Optionally, in some embodiments of this application, since the prerequisite for a physical card to be swiped successfully in the ISO / IEC 14443-3 Type A protocol is that the physical card has the ability to send ATQA, UID, and SAK commands to the card swiping device, the electronic device may not need to record the response capability of the physical card to the ATQA, UID, and SAK commands.

[0153] In this way, the electronic device can read the card data information and simulate a card reader to send a card swiping command to the card, so as to record the card's response capability and response time information. Then, the electronic device can use the recorded information to simulate the card not responding to the card swiping command or to send a card swiping command to the card reader within the corresponding response time, thereby improving the success rate of electronic devices swiping electronic cards.

[0154] In some embodiments of this application, the aforementioned target instructions include RATS instructions. Exemplarily, in conjunction with... Figure 1 ,like Figure 7A As shown, step 201 can be implemented through steps 201d, 201e, and 201f.

[0155] Step 201d: The NFC module in the electronic device control terminal reads the card data information of at least one card.

[0156] In some embodiments of this application, when an electronic device obtains card data information, it can first bring the device close to the card. The NFC module of the electronic device can then send a radio frequency field to power the card chip through electromagnetic induction. After that, the electronic device can send a read command to the card to obtain the card data information.

[0157] Step 201e: The NFC module in the electronic device control terminal simulates a card swiping device and sends a RATS command to the first card among at least one card.

[0158] In some embodiments of this application, the first card described above may be a physical card.

[0159] In some embodiments of this application, the electronic device can simulate a card swiping device sending a RATS instruction to the first card after receiving an SAK instruction from the first card among at least one card.

[0160] Step 201f: If the electronic device receives the Select Response (ATS) command sent by the first card, it records the first card's response capability information to the target command as the first capability feature information.

[0161] In some embodiments of this application, the aforementioned first capability feature information is used to characterize the first card's ability to send ATS commands.

[0162] For example, the aforementioned first capability feature information can be 1 bit of data. For instance, the first capability feature information can be "1". Of course, the first capability feature information can also be other information preset by the system, and the specific settings can be made according to actual needs. This application does not impose any limitations.

[0163] For example, if the electronic device believes that the first card has the ability to respond to ATS commands, it can set the ATS command capability parameter information of the electronic card corresponding to the first card to 1.

[0164] In some embodiments of this application, after the electronic device sends a RATS command to the first card using a simulated card reader, it can start a timer to determine whether it can receive the ATS command sent by the first card within a time threshold, thereby determining whether the first card has the ability to send ATS commands.

[0165] Specifically, after the electronic device sends a RATS command to the first card using the simulated card reader, it starts a timer. If the electronic device does not receive an ATS command from the first card after the timer has elapsed beyond a time threshold, the electronic device assumes that the first card does not have the capability to respond to an ATS command. Alternatively, if the electronic device receives an ATS command from the first card before the timer has elapsed beyond the time threshold, the electronic device assumes that the first card has the capability to respond to an ATS command, and records the time elapsed from sending the RATS command to receiving it, using this time as the response duration of the first card in response to the RATS command.

[0166] For example, the aforementioned time threshold can be a fixed value, such as 0.5s. Of course, the time threshold can also be other values ​​preset by the system or set by the user, which can be set according to actual needs, and this application does not impose any limitations.

[0167] In this way, the electronic device can obtain the card data information and control the NFC module to send RATS commands to the card. Upon receiving the ATS command sent by the card, the electronic device records that the card has the ability to respond to RATS commands and send ATS commands. This allows the electronic device to subsequently simulate the card, respond to the RATS commands sent by the card reader, and send ATS commands to the card reader, thereby improving the success rate of swiping cards through the electronic device.

[0168] In some embodiments of this application, the aforementioned target instructions include RATS instructions. Exemplarily, in conjunction with... Figure 1 ,like Figure 7B As shown, step 201 can be implemented through steps 201d, 201e, and 201g.

[0169] Step 201g: If the electronic device does not receive the ATS command sent by the first card, it records the first card's response capability information to the target command as the second capability feature information.

[0170] In some embodiments of this application, the aforementioned second capability feature information is used to characterize that the aforementioned first card does not have the capability to send ATS commands.

[0171] For example, the second capability feature information can be 1 bit of data. For instance, the first capability feature information can be "0". Of course, the second capability feature information can also be other information preset by the system, and the specific settings can be made according to actual needs. This application does not impose any limitations.

[0172] For example, if the electronic device believes that the first card does not have the ability to respond to ATS commands, it can set the ATS command capability parameter information of the electronic card corresponding to the first card to 0.

[0173] In this way, if the electronic device does not receive an ATS command in response from the copied physical card, it can record that the copied physical card does not have the ability to send ATS commands. This allows the electronic device to simulate the copied physical card using the corresponding electronic card, without sending ATS commands to the card reader. This avoids the risk of card swiping failure due to the access control device receiving unnecessary ATS commands, thereby improving the success rate of electronic card swiping.

[0174] For example, combined Figure 6 ,like Figure 8The diagram illustrates the process by which an electronic device records the response time of a physical card A in response to a swipe command. Specifically, after receiving the SAK command from physical card A, the electronic device sends a RATS command to physical card A. After a timeout of T4, the electronic device receives the ATS command from physical card A.

[0175] In some embodiments of this application, the step 202 above, "controlling the NFC module in the terminal to perform the target operation based on card data information and card swiping behavior feature information", can be specifically implemented through the following steps 202a or 202b.

[0176] Step 202a: If the swipe behavior characteristic information of the second card indicates that the second card does not have the ability to respond to the first command, the NFC module in the control terminal does not respond to the first command.

[0177] In some embodiments of this application, the second card does not have the ability to respond to the first instruction, which can be understood as the second card not having the ability to respond to the first instruction and send a response instruction to the first instruction.

[0178] Step 202b: When the swiping behavior feature information of the second card indicates that the second card has the ability to respond to the first command, the NFC module in the control terminal responds to the first command within the target response time range.

[0179] In some embodiments of this application, the second card is capable of responding to the first instruction, which can be understood as the second card being capable of responding to the first instruction and sending a response instruction to the first instruction.

[0180] In this way, after determining the corresponding card and card swiping behavior characteristics through the card swiping command, the electronic device can, based on the card swiping behavior characteristics, not respond to the first command if the card does not have the ability to respond to the card swiping command, thus avoiding the risk of the card swiping device receiving unnecessary response commands and causing card swiping failure; and, if the card has the ability to respond to the card swiping command, it can simulate the card and respond to the card swiping command, thereby improving the success rate of card swiping through the electronic device.

[0181] In this solution, when copying a physical card, the electronic device not only copies the card's data but also its behavioral characteristics. This makes the resulting electronic card more closely resemble the physical card, increasing the success rate of electronic card swiping. Figure 9 As shown, the card swiping method provided in this application embodiment includes the following steps 21 to 41.

[0182] Step 21: The electronic device is brought close to the physical card and the data in the physical card is copied through the NFC module to obtain the electronic card corresponding to the physical card.

[0183] Step 22: The electronic device sends a REQA command to the physical card and starts a timer.

[0184] Step 23: The electronic device receives the ATQA command sent by the physical card, stops the timer, and records the time T5 corresponding to the timer as the response time of the ATQA command from the physical card.

[0185] Step 24: The electronic device sends an AC command to the physical card and starts a timer.

[0186] Step 25: The electronic device receives the UID command sent by the physical card, stops the timer, and records the time T6 corresponding to the timer as the response time of the UID command of the physical card.

[0187] Step 26: The electronic device sends the SEL command to the physical card and starts the timer.

[0188] Step 27: The electronic device receives the SAK command sent by the physical card, stops the timer, and records the time T7 corresponding to the timer as the response time of the SAK command from the physical card.

[0189] Step 28: The electronic device sends a RATS command to the physical card and starts a timer.

[0190] Step 29: The electronic device determines whether it can receive the ATS command sent by the physical card within the time threshold.

[0191] If yes, then proceed to step 30 below, and then proceed to step 32 and the following steps; if no, then proceed to step 31 below, and then proceed to step 32 and the following steps.

[0192] Step 30: The electronic device receives the ATS command sent by the physical card, stops the timer, records the capability feature information of the ATS command corresponding to the physical card as "1" and the time T8 corresponding to the timer, and uses T8 as the response time of the ATS command of the physical card.

[0193] Step 31: The electronic device stops the timer and records the capability feature information of the ATS instruction corresponding to the physical card as "0".

[0194] In some embodiments of this application, after recording behavioral characteristic information such as the response time of the ATQA command of the physical card, the response time of the UID command of the physical card, the response time of the SAK command of the physical card, the response time of the ATS command of the physical card, and the capability characteristic information of the ATS command corresponding to the physical card, the electronic device obtains the correspondence between the UID of the electronic card corresponding to the physical card and the behavioral characteristic information.

[0195] Step 32: The electronic device receives the user's input and selects the aforementioned electronic card.

[0196] Step 33: The electronic device approaches the card reader and receives the REQA command sent from the card reader via the selected electronic card.

[0197] Step 34: After time T5 has elapsed, the electronic device sends an ATQA command to the card reader.

[0198] Step 35: The electronic device receives the AC command sent from the card reader.

[0199] Step 36: After time T6 has elapsed, the electronic device sends a UID instruction to the card reader.

[0200] Step 37: The electronic device receives the SEL command sent from the card reader.

[0201] Step 38: After time T7 has elapsed, the electronic device sends an SAK command to the card reader.

[0202] Step 39: The electronic device receives the RATS instruction sent from the card reader.

[0203] Step 40: The electronic device determines whether the capability feature information of the ATS instruction corresponding to the above electronic card is "1".

[0204] If yes, proceed to step 41 below; otherwise, the process ends.

[0205] Step 41: After time T8 has elapsed, the electronic device sends an ATS command to the card reader.

[0206] In some embodiments of this application, after the electronic device simulates a card-swiping device to complete the entire card-swiping process, the electronic device records the physical card's responsiveness to each received card-swiping command, such as whether it can respond to the card-swiping command and the time taken to respond. Furthermore, the electronic device can associate the electronic card corresponding to each physical card with the behavioral characteristics of that physical card, enabling the electronic device itself to subsequently act as the physical card and swipe the card at the card-swiping device. In other words, the electronic device has the ability to completely simulate itself as almost identical to a physical card.

[0207] In this way, after receiving the card swiping instruction from the card reader via the electronic card, the electronic device can simulate the behavior of the physical card corresponding to the electronic card by sending a response instruction based on the behavioral feature information of the electronic card, thereby successfully responding to the card swiping instruction of the card reader and improving the success rate of electronic devices swiping cards.

[0208] Each of the above-described method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application does not impose any restrictions on this.

[0209] The card-swiping method provided in this application can be executed by a terminal. This application uses a terminal executing the card-swiping method as an example to illustrate the terminal provided in this application embodiment.

[0210] Figure 10 A schematic diagram of a possible structure of a terminal involved in some embodiments of this application is shown. For example... Figure 10 As shown, the terminal 70 may include: a near field communication (NFC) module, an acquisition module 71, and a control module 72.

[0211] The acquisition module 71 is used to acquire card data information and card swiping behavior feature information of at least one card; wherein the card swiping behavior feature information includes at least one of the following: responsiveness information to a target instruction; response time information to a target instruction; the control module 72 is used to control the near-field communication (NFC) module in the terminal 70 to perform a target operation based on the card data information and the card swiping behavior feature information when receiving a first instruction sent by the card swiping device, wherein the target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within the target response time range.

[0212] In one possible implementation, the card data information includes at least one of the following: card manufacturer information, card unique identifier (UID), card type, and card password information.

[0213] In one possible implementation, the target instruction includes at least one of the following: a Type A Request for QA instruction, an anti-collision instruction, a selection instruction, and a Select Response Request for Transcription (RATS) instruction; wherein the selection instruction carries the card unique identifier (UID) selected by the card reader.

[0214] In one possible implementation, the control module 72 is specifically configured to control the NFC module in the terminal 70 to read the card data information of the at least one card, and to control the NFC module in the terminal 70 to simulate a card swiping device to send a target instruction to the at least one card; and, when the NFC module in the terminal 70 receives the response information of the at least one card to the target instruction, to record the response capability information to the target instruction, and to record the time from sending the target instruction to receiving the response information, thereby obtaining the response time information to the target instruction.

[0215] In one possible implementation, the target instruction includes a Select Response Request (RATS) instruction; the control module 72 is specifically configured to control the NFC module in the terminal 70 to read the card data information of the at least one card, and to control the NFC module in the terminal 70 to simulate a card swiping device and send a RATS instruction to the first card among the at least one card; the acquisition module 71 is specifically configured to, if a Select Response Request (ATS) instruction sent by the first card is received, record the first card's response capability information to the target instruction as first capability feature information; or, if no ATS instruction is received from the first card, record the first card's response capability information to the target instruction as second capability feature information; wherein the first capability feature information is used to characterize that the first card has the ability to send an ATS instruction; and the second capability feature information is used to characterize that the first card does not have the ability to send an ATS instruction.

[0216] In one possible implementation, the control module 72 is further configured to determine, based on the first instruction, a second card and the card swiping behavior feature information of the second card from the at least one card before controlling the NFC module in the terminal 70 to perform the target operation based on the card data information and the card swiping behavior feature information.

[0217] In one possible implementation, the control module 72 is specifically configured to control the NFC module in the terminal 70 not to respond to the first instruction when the card swiping behavior feature information of the second card obtained by the acquisition module 71 indicates that the second card does not have the ability to respond to the first instruction; or, when the card swiping behavior feature information of the second card obtained by the acquisition module 71 indicates that the second card has the ability to respond to the first instruction, control the NFC module in the terminal 70 to respond to the first instruction within a target response time range.

[0218] This application provides a terminal that records card swiping behavior characteristics, namely, the card's responsiveness to swiping commands and the response time. Therefore, after receiving a swiping command from a card reader, the terminal can simulate the card's response behavior based on the corresponding card's swiping behavior characteristics, thereby successfully responding to the card reader's swiping command and improving the success rate of swiping cards through the terminal.

[0219] The terminal in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the terminal.

[0220] The terminal in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0221] The terminal provided in this application embodiment can implement all the processes implemented in the above method embodiments, and will not be described again here to avoid repetition.

[0222] Optionally, such as Figure 11 As shown, this application embodiment also provides an electronic device 1000, including a processor 1001 and a memory 1002. The memory 1002 stores a program or instructions that can run on the processor 1001. When the program or instructions are executed by the processor 1001, they implement the various steps of the above-described card swiping method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0223] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0224] Figure 12 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0225] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.

[0226] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 12 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0227] The radio frequency unit 101 is used to acquire card data information and card swiping behavior feature information of at least one card; wherein the card swiping behavior feature information includes at least one of the following: responsiveness information to a target instruction; response time information to a target instruction; the processor 110 is used to control the near-field communication (NFC) module in the terminal to perform a target operation based on the card data information and the card swiping behavior feature information when receiving a first instruction sent by the card swiping device, wherein the target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within the target response time range.

[0228] Optionally, the aforementioned card data information includes at least one of the following: card manufacturer information, card unique identifier (UID), card type, and card password information.

[0229] Optionally, the target instruction includes at least one of the following: Type A Request for QA instruction, anti-collision instruction, selection instruction, and Select Response Request for QA (RATS) instruction; the selection instruction carries the card unique identifier (UID) selected by the card reader.

[0230] Optionally, the processor 110 is specifically configured to control the NFC module in the terminal to read the card data information of the at least one card, and control the NFC module in the terminal to simulate a card swiping device to send a target instruction to the at least one card; and, when the NFC module in the terminal receives the response information of the at least one card to the target instruction, record the response capability information to the target instruction, and record the time from sending the target instruction to receiving the response information, to obtain the response time information to the target instruction.

[0231] Optionally, the target instruction includes a Select Response Request (RATS) instruction; the processor 110 is specifically configured to control the NFC module in the terminal to read the card data information of the at least one card, and control the NFC module in the terminal to simulate a card swiping device to send a RATS instruction to the first card among the at least one card; and, if a Select Response Request (ATS) instruction sent by the first card is received, the response capability information of the first card to the target instruction is recorded as first capability feature information; if no ATS instruction is received from the first card, the response capability information of the first card to the target instruction is recorded as second capability feature information; wherein, the first capability feature information is used to characterize that the first card has the capability to send an ATS instruction; the second capability feature information is used to characterize that the first card does not have the capability to send an ATS instruction.

[0232] Optionally, the processor 110 is further configured to determine, based on the first instruction, a second card and the card swiping behavior feature information of the second card from the at least one card before controlling the NFC module in the terminal to perform the target operation based on the card data information and the card swiping behavior feature information.

[0233] Optionally, the processor 110 is specifically configured to control the NFC module in the terminal not to respond to the first instruction when the card swiping behavior feature information of the second card indicates that the second card does not have the ability to respond to the first instruction; or, when the card swiping behavior feature information of the second card indicates that the second card has the ability to respond to the first instruction, control the NFC module in the terminal to respond to the first instruction within a target response time range.

[0234] This application provides an electronic device that records card swiping behavior characteristics, namely, the card's responsiveness to swiping commands and the response time. Therefore, after receiving a swiping command from a card reader, the electronic device can simulate the card's response behavior based on the corresponding card's swiping behavior characteristics, thereby successfully responding to the card reader's swiping command and improving the success rate of swiping cards through the electronic device.

[0235] The electronic device provided in this application embodiment can implement all the processes implemented in the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here. The beneficial effects of the various implementation methods in this embodiment can be found in the beneficial effects of the corresponding implementation methods in the above method embodiments. To avoid repetition, it will not be described again here.

[0236] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0237] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0238] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.

[0239] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described card-swiping method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0240] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0241] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described card swiping method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0242] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0243] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the card swiping method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0244] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0245] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0246] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A card-swiping method, executed by a terminal, characterized in that, The method includes: Obtain card data information and card swiping behavior characteristic information of at least one card; wherein, the card swiping behavior characteristic information includes at least one of the following: responsiveness information to target instructions; response time information to target instructions; Upon receiving a first instruction from the card-swiping device, the near-field communication (NFC) module in the terminal is controlled to perform a target operation based on the card data information and the card-swiping behavior feature information. The target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within the target response time range.

2. The method according to claim 1, characterized in that, The card data information includes at least one of the following: card manufacturer information, card unique identifier (UID), card type, and card password information.

3. The method according to claim 1, characterized in that, The target instruction includes at least one of the following: Type A Request for Response (REQA) instruction, anti-collision instruction, selection instruction, and Select Response Request (RATS) instruction; the selection instruction carries the unique identifier (UID) of the card selected by the card reader.

4. The method according to any one of claims 1 to 3, characterized in that, The acquisition of card data information and card swiping behavior feature information of at least one card includes: Control the NFC module in the terminal to read the card data information of at least one card; The NFC module in the terminal is controlled to simulate a card swiping device and send a target instruction to the at least one card. When the NFC module in the terminal receives the response information of the at least one card to the target instruction, it records the response capability information to the target instruction and the time from sending the target instruction to receiving the response information, thereby obtaining the response time information to the target instruction.

5. The method according to any one of claims 1 to 3, characterized in that, The target instruction includes a Select Response Request (RATS) instruction; the acquisition of card data information and card swiping behavior feature information of at least one card includes: Control the NFC module in the terminal to read the card data information of at least one card; The NFC module in the terminal is controlled to simulate a card swiping device and send a RATS command to the first card among the at least one card. If the Select Response (ATS) command sent by the first card is received, the response capability information of the first card to the target command is recorded as the first capability feature information. If the ATS command sent by the first card is not received, the response capability information of the first card to the target command is recorded as the second capability feature information. Wherein, the first capability feature information is used to characterize that the first card has the ability to send ATS commands; the second capability feature information is used to characterize that the first card does not have the ability to send ATS commands.

6. The method according to claim 1, characterized in that, Before controlling the NFC module in the terminal to perform the target operation based on the card data information and the card swiping behavior feature information, the method further includes: Based on the first instruction, a second card and its swiping behavior characteristics are determined from the at least one card.

7. The method according to claim 6, characterized in that, The step of controlling the NFC module in the terminal to perform the target operation based on the card data information and the card swiping behavior feature information includes: If the card swiping behavior characteristic information of the second card indicates that the second card is not capable of responding to the first command, the NFC module in the terminal is controlled not to respond to the first command; When the card swiping behavior information of the second card indicates that the second card has the ability to respond to the first instruction, the NFC module in the terminal is controlled to respond to the first instruction within the target response time range.

8. A terminal, characterized in that, The terminal includes: a near-field communication (NFC) module, an acquisition module, and a control module; The acquisition module is used to acquire card data information and card swiping behavior feature information of at least one card; wherein, the card swiping behavior feature information includes at least one of the following: responsiveness information to target instructions; response time information to target instructions; The control module is configured to, upon receiving a first instruction from the card swiping device, control the near-field communication (NFC) module in the terminal to perform a target operation based on the card data information and the card swiping behavior feature information. The target operation includes any one of the following: not responding to the first instruction; or responding to the first instruction within the target response time range.

9. The terminal according to claim 8, characterized in that, The card data information includes at least one of the following: card manufacturer information, card unique identifier (UID), card type, and card password information.

10. The terminal according to claim 8, characterized in that, The target instruction includes at least one of the following: Type A Request for Response (REQA) instruction, anti-collision instruction, selection instruction, and Select Response Request (RATS) instruction; the selection instruction carries the unique identifier (UID) of the card selected by the card reader.

11. The terminal according to any one of claims 8 to 10, characterized in that, The control module is specifically used to control the NFC module in the terminal to read the card data information of the at least one card, and to control the NFC module in the terminal to simulate a card swiping device to send a target instruction to the at least one card; and, when the NFC module in the terminal receives the response information of the at least one card to the target instruction, to record the response capability information to the target instruction, and to record the time from sending the target instruction to receiving the response information, thereby obtaining the response time information to the target instruction.

12. The terminal according to any one of claims 8 to 10, characterized in that, The target instruction includes the Select Response Request (RATS) instruction; The control module is specifically used to control the NFC module in the terminal to read the card data information of the at least one card, and to control the NFC module in the terminal to simulate a card swiping device to send a RATS command to the first card among the at least one card; The acquisition module is specifically used to record the first card's response capability information to the target instruction as first capability feature information if it receives the Select Response (ATS) instruction sent by the first card. or, If the ATS command sent by the first card is not received, the response capability information of the first card to the target command is recorded as the second capability feature information. Wherein, the first capability feature information is used to characterize that the first card has the ability to send ATS commands; the second capability feature information is used to characterize that the first card does not have the ability to send ATS commands.

13. The terminal according to claim 8, characterized in that, The control module is further configured to determine, based on the first instruction, a second card and the card swiping behavior feature information of the second card from the at least one card before controlling the NFC module in the terminal to perform the target operation based on the card data information and the card swiping behavior feature information.

14. The terminal according to claim 13, characterized in that, The control module is specifically configured to, when the swipe behavior feature information of the second card acquired by the acquisition module indicates that the second card does not have the ability to respond to the first instruction, control the NFC module in the terminal not to respond to the first instruction; or... When the card swiping behavior feature information of the second card obtained by the acquisition module indicates that the second card has the ability to respond to the first instruction, the NFC module in the terminal is controlled to respond to the first instruction within the target response time range.

15. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the card swiping method as described in any one of claims 1 to 7.

16. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the card swiping method as described in any one of claims 1 to 7.

17. A computer program product, characterized in that, The program product is stored in a storage medium, and the program product is executed by at least one processor to implement the card swiping method as described in any one of claims 1 to 7.