WO2021031856A1 - Nfc-based communication method and device - Google Patents

Nfc-based communication method and device Download PDF

Info

Publication number
WO2021031856A1
WO2021031856A1 PCT/CN2020/107144 CN2020107144W WO2021031856A1 WO 2021031856 A1 WO2021031856 A1 WO 2021031856A1 CN 2020107144 W CN2020107144 W CN 2020107144W WO 2021031856 A1 WO2021031856 A1 WO 2021031856A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
radio frequency
card
communication process
card reader
Prior art date
Application number
PCT/CN2020/107144
Other languages
French (fr)
Chinese (zh)
Inventor
甄家灏
姚振栋
易海涛
王金燕
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021031856A1 publication Critical patent/WO2021031856A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • G06K7/10198Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves setting parameters for the interrogator, e.g. programming parameters and operating modes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • G06K7/10297Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves arrangements for handling protocols designed for non-contact record carriers such as RFIDs NFCs, e.g. ISO/IEC 14443 and 18092
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Definitions

  • This application relates to near field communication (NFC) technology, and particularly relates to NFC-based communication methods and devices.
  • NFC near field communication
  • NFC technology provides a short-distance high-frequency wireless connection to achieve two-way communication between electronic devices.
  • Electronic devices that support NFC technology can work in the following three communication modes: read/write mode (reader/writer mode), card emulation mode (card emulation mode), and point-to-point mode (P2P mode).
  • the electronic device can be simulated as an integrated circuit (IC) card, such as subway card, bus card, bank card, access card, social security card, membership card, passport, etc. , Complete the same functions as the actual contactless smart card, such as access control, contactless payment, data transmission, etc.
  • IC integrated circuit
  • the user can hold the electronic device close to the card reader.
  • the electronic device can detect the radio frequency field (RF-field) provided by the card reader, and send relevant information to the card reader based on the radio frequency field.
  • RF-field radio frequency field
  • the card reader sends the received relevant information to the connected computer or other processing equipment, and the computer or other processing equipment verifies the relevant information. After the verification is passed, operations such as payment and unlocking can be completed.
  • the performance of the electronic device to send and receive radio frequency signals may be unstable, causing the card to fail.
  • the credit card success rate is an important factor that affects the user experience. In order to improve the user experience, how to ensure the performance of the radio frequency signal sent and received by the electronic device to improve the credit card success rate is the direction of industry research.
  • This application provides a communication method and device based on NFC. It can improve the card swiping success rate of electronic devices working in card emulation mode, and improve user experience.
  • the embodiments of the present application provide an NFC-based communication method.
  • This method is applied to electronic equipment.
  • the method includes: the electronic device works in a card emulation mode, the electronic device stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card; the electronic device uses the first radio frequency parameter to execute the electronic device and read the card
  • the electronic device uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter; wherein, the NFC communication
  • the process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic device as a data transmission object; third radio frequency communication
  • the process is used to transmit data between the electronic device and the card reader, and the data includes the NFC card information; wherein, the first radio frequency parameter and the second radio frequency parameter are both used in one or more of the following:
  • the radio frequency parameter and the second radio frequency parameter
  • the electronic device works in the card emulation mode.
  • the electronic device can adjust the currently used RF parameters and use the adjustment After the radio frequency parameters, re-execute the NFC communication process with the card reader. In this way, the performance of the radio frequency signal sent and received by the electronic device can be adjusted, thereby increasing the success rate of swiping the card.
  • the types of cards simulated by the electronic device may include, but are not limited to: subway cards, bus cards, access cards, credit cards, debit cards, stored value cards, shopping cards, Boarding pass, movie ticket, coupon, student ID, social security card, membership card, passport, etc.
  • the NFC card information may include, for example, the identification of an access card (such as UID), the identification of a bus card (such as UID), the card number of a bank card, and so on.
  • both the first radio frequency parameter and the second radio frequency parameter include one or more of the following: the sensitivity of the electronic device when receiving the radio frequency signal, the threshold value, and the input voltage of the receiving circuit; the electronic device The frame delay time used when transmitting the radio frequency signal, the modulation mode used when the load is modulated, the waveform of the carrier, the amplitude of the carrier, and the phase of the carrier, etc.
  • the electronic device may determine that the execution of the NFC communication process fails in any of the following situations:
  • the number of times the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the first value, or the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the second value .
  • the electronic device receives the negative response command NAK sent by the card reader.
  • the electronic device cannot parse the received command, or the command parsed by the electronic device is abnormal.
  • start times of the aforementioned time periods T1, T2, and T3 are all time points when the electronic device starts to perform the NFC communication process with the card reader.
  • N sets of radio frequency parameters are stored in the electronic device.
  • the N sets of radio frequency parameters may be preset in the electronic device when the electronic device leaves the factory, or may be obtained by the electronic device from a cloud server.
  • the first radio frequency parameter may be any set of radio frequency parameters selected by the electronic device from N sets of radio frequency parameters stored in advance. In other embodiments, the first radio frequency parameter may be the set of radio frequency parameters with the highest success rate of card swiping among the N sets of radio frequency parameters pre-stored by the electronic device.
  • the second radio frequency parameter can be obtained in the following ways:
  • the second radio frequency parameter may be a set of radio frequency parameters different from the first radio frequency parameter selected arbitrarily by the electronic device among the stored N sets of radio frequency parameters.
  • the second radio frequency parameter may be the radio frequency parameter with the highest card swipe success rate selected by the electronic device among other radio frequency parameters other than the first radio frequency parameter among the N sets of stored radio frequency parameters.
  • the electronic device selects the second radio frequency parameter at the local end, which can save time and power consumption and make the card swipe successfully faster.
  • the second radio frequency parameter may be obtained by the electronic device requesting the cloud server.
  • the second radio frequency parameter includes a set of radio frequency parameters
  • the first radio frequency parameter includes a set of radio frequency parameters.
  • the difference between the second radio frequency parameter and the first radio frequency parameter means that some or all of the radio frequency parameters in the second radio frequency parameter are different from the first radio frequency parameter.
  • the electronic device when the electronic device successfully executes the NFC communication process using the second radio frequency parameter, the electronic device may also store the second radio frequency parameter.
  • the electronic device may store the second radio frequency parameter in the following ways:
  • the second radio frequency parameter and the identity of the card reader are associated and stored; the second radio frequency parameter is used for the next time the electronic device executes an NFC communication process with the same card reader.
  • This storage method can ensure that each subsequent NFC communication process performed between the electronic device and the card reader can have a higher communication success rate.
  • the electronic device when the electronic device uses the second radio frequency parameter to successfully execute the NFC communication process, the electronic device sends first information to the cloud server, and the first information is used to indicate the electronic device The NFC communication process is successfully executed using the second radio frequency parameter, so that the cloud server counts the communication success rate corresponding to the second radio frequency parameter.
  • the cloud server can count the respective communication success rates of multiple sets of radio frequency parameters, and can deliver the N sets of radio frequency parameters with the highest communication success rate to each electronic device, thereby improving the credit card success rate of each electronic device.
  • the electronic device can adopt the following two strategies to execute the NFC communication process with the card reader:
  • Strategy 1 When the electronic device is in the on-screen and unlocked state, periodically detect the radio frequency field provided by the card reader; when the electronic device is in the off-screen state, locked-screen state or shut down state, continuously detect the card reader provides ⁇ RF field.
  • the electronic device can execute the NFC-based communication method provided in the embodiments of the present application in any state.
  • Strategy 2 The electronic device detects the radio frequency field provided by the card reader in response to the received user operation. That is, the electronic device detects the radio frequency field provided by the card reader under the trigger of the user. Using strategy one, the electronic device can execute the NFC-based communication method provided in the embodiments of the present application according to user requirements.
  • an embodiment of the present application provides an electronic device.
  • the electronic device includes: one or more processors, a memory, an NFC chip, and a security unit SE; the security unit stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card; the memory and the one or A plurality of processors are coupled, and the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to execute:
  • the NFC chip uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter;
  • the NFC communication process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic device as a data transmission object ;
  • the third radio frequency communication process, used for the electronic device and the card reader to transmit data, the data includes the NFC card information;
  • the first radio frequency parameter and the second radio frequency parameter are used for one or more of the following: the electronic device receives the radio frequency signal sent by the card reader during the NFC communication process, and generates the radio frequency signal to be sent to the card reader The radio frequency signal of the device, the sending radio frequency signal.
  • the electronic device of the second aspect can be used to implement the NFC-based communication method provided in the first aspect and any one of the implementations of the first aspect. Therefore, for the operations performed by the electronic device of the second aspect and the beneficial effects brought about by the electronic device, reference may be made to the related description in the first aspect or any one of the possible implementation manners of the first aspect, which will not be repeated here.
  • an embodiment of the present application provides an NFC chip.
  • the NFC chip is applied to an electronic device, the electronic device stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card;
  • the NFC chip includes: one or more processors and interfaces; the interface is used to receive The code instruction and the code instruction are transmitted to the processor, and the processor is configured to run the code instruction to make the electronic device execute the first aspect and the NFC-based communication method provided in any one of the implementation manners of the first aspect.
  • this application provides a computer program product containing instructions, which when the computer program product is run on an electronic device, causes the electronic device to execute:
  • the NFC chip uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter;
  • the NFC communication process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic device as a data transmission object ;
  • the third radio frequency communication process, used for the electronic device and the card reader to transmit data, the data includes the NFC card information;
  • the first radio frequency parameter and the second radio frequency parameter are used for one or more of the following: the electronic device receives the radio frequency signal sent by the card reader during the NFC communication process, and generates the radio frequency signal to be sent to the card reader The radio frequency signal of the device, the sending radio frequency signal.
  • the electronic device to which the NFC chip of the fourth aspect is applied can be used to implement the NFC-based communication method provided in the first aspect and any one of the implementations of the first aspect. Therefore, for the operations performed by the NFC chip of the fourth aspect and the beneficial effects brought about by the NFC chip, reference may be made to the relevant description in the first aspect or any one of the possible implementations of the first aspect, which will not be repeated here.
  • an embodiment of the present application provides a computer-readable storage medium, including instructions, which when the foregoing instructions run on an electronic device, cause the electronic device to execute the first aspect and any possible implementation manner in the first aspect Described method.
  • the electronic device works in the card emulation mode.
  • the electronic device can adjust the currently used radio frequency parameters and use The adjusted radio frequency parameters re-execute the NFC communication process with the card reader. In this way, the performance of the radio frequency signal sent and received by the electronic device can be adjusted, thereby increasing the success rate of swiping the card.
  • FIG. 1 is a schematic diagram of the flow of a successfully executed NFC communication process provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of the work flow of the card reader during a successfully executed NFC communication process provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of the NFC-based communication method provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of human-computer interaction provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of detecting radio frequency field strength by an electronic device provided by an embodiment of the present application.
  • 6A is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 6B is a schematic diagram of the location of a security unit provided by an embodiment of the present application.
  • FIG. 7 is a software structure block diagram of an electronic device provided by an embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of a card reader provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more.
  • the electronic device When the electronic device works in card emulation mode, it can be simulated as an NFC card and communicate with a card reader.
  • the card emulation mode may also be referred to as the card emulation mode.
  • the types of cards simulated by electronic devices can include but are not limited to: subway cards, bus cards, access cards, credit cards, debit cards, stored-value cards, shopping cards, boarding passes, movie tickets, coupons, Student ID, social security card, membership card, passport, etc.
  • the electronic device uses the stored NFC card information to simulate an NFC card.
  • the NFC card information is used to indicate the NFC card.
  • the NFC card information may include, for example, the unique identifier (UID) of the access card, the UID of the bus card, the card number of the bank card, and so on.
  • UID unique identifier
  • FIG. 1 shows an NFC communication process performed between an electronic device working in a card emulation mode and a card reader.
  • the NFC communication process may include:
  • the first radio frequency communication process the process of electronic equipment detecting the radio frequency field provided by the card reader;
  • the second radio frequency communication process the process in which the card reader selects the electronic device as the data transmission object;
  • the third radio frequency communication process the process of data transmission between the electronic device and the card reader.
  • the electronic device can realize the same functions as the actual contactless smart card, such as access control, contactless payment, information verification, and so on.
  • access control can include unlocking, door opening, etc.
  • Information verification may include verification of passport information, coupon information, movie coupon information, and so on.
  • the NFC communication process performed between the electronic device working in the card emulation mode and the card reader may also be referred to as a card swiping process.
  • the NFC communication process is described in detail below.
  • the card reader can continuously or periodically send a radio frequency signal with a frequency of 13.56 megahertz (MHz) to generate an electromagnetic field propagating through space, which is the radio frequency field provided by the card reader.
  • the oscillating circuit of the antenna in the electronic device within the coverage of the radio frequency field vibrates under the influence of the radio frequency field to form a voltage, and the electronic device determines to detect the radio frequency field according to the voltage.
  • the electronic device After the electronic device executes the first radio frequency communication process, it can execute the second radio frequency communication process and the third radio frequency communication process with the card reader.
  • the electronic device performs command interaction with the card reader based on the detected radio frequency field.
  • the card reader sends a radio frequency signal to the electronic device through a carrier with a frequency of 13.56Mhz, and the electronic device sends a radio frequency signal to the card reader through a load modulation technology.
  • the radio frequency signal carries instructions to realize the instruction interaction between the electronic device and the card reader.
  • FIG. 2 shows a schematic flow diagram of the NFC communication process between the card reader and the electronic device.
  • the second radio frequency communication process may specifically include the following steps 1-6:
  • the reader sends REQA (REQuest A)/WUPA (WakeUP A).
  • the card reader can continuously send REQA or WUPA based on the generated radio frequency field.
  • REQA or WUPA is used to instruct the card in the RF field to respond to its own card type.
  • the card types here are distinguished by the way the card sends signals to the card reader, which can be divided into type A and type B.
  • type A cards send signals through a 13.65 MHz carrier
  • the encoding method is Miller encoding
  • the carrier amplitude modulation method is 100% amplitude-shift keying (ASK).
  • Type B cards send signals through a 13.65MHz carrier, but the encoding method is nonreturn to zero (NRA), and the carrier amplitude modulation method is 10% ASK.
  • the type of the card can include actual non-contact smart cards, such as bus cards, bank cards, access control cards, etc., and can also include electronic devices working in card emulation mode.
  • the reader When multiple cards enter the coverage of the radio frequency field, the reader will receive ATQA from multiple cards. At this time, the card reader will perform bit-oriented anti-collision processing to select a unique card for communication. That is, the card reader will perform the following steps 3-6.
  • the card reader sends an anti-collision command (single device detection, SDD), and all cards within the coverage of the radio frequency field send their own identification to the card reader in response to the anti-collision command.
  • the identification may be a unique identifier (UID) of the card.
  • step 3 the card reader sets cascade level 1.
  • anti-collision loop (anticollision loop) processing: After the card reader detects a conflict, it selects some cards and sends a card selection command to it, which is used to instruct this part of the cards to continue speaking and prohibit the other cards from speaking.
  • the card After multiple anti-collision cycles, when only one card is left, there is no more conflict. Finally, the card sends its complete identification (such as UID) to the reader.
  • the card reader sends a card selection command (SELECT) to the card. After the card responds to the SAK, the card is selected and the card reader can communicate with the card.
  • SELECT card selection command
  • the conflict detected by the card reader means that after the card reader receives the identification of multiple cards, the first few digits of these card identifications may be the same, for example, the first four digits are all 1010, and there is one on the fifth digit.
  • the card is "0" and the other cards are "1", so when all the cards say their fifth digit identification together, since some cards say "0" and others say "1", the reader can detect it There was a conflict.
  • the reader will instruct some cards to continue speaking through the card selection command, for example, let the card whose first four digits are "1010" and the fifth digit is "1" to continue to send its own identity, and other cards are prohibited from speaking.
  • the card with “1” in the fifth place continues to speak. Since there are more than one card with “1” in the fifth place, there is a conflict in the process of returning the logo to these cards. The reader still uses the above method to make the conflict. The card whose bit (such as the sixth) is "1" continues to speak, and other cards are prohibited from speaking. Finally, after multiple anti-collision cycles, when there is only one card left, there is no conflict, that is, the card reader selects the card for communication.
  • the card selected by the card reader in FIG. 1 is an electronic device working in a card emulation mode.
  • the card reader After the card reader selects the electronic device working in the card emulation mode as the data transmission object, the card reader and the electronic device can perform the third radio frequency communication process.
  • the third radio frequency communication process may include the following step 7:
  • the card reader starts to process related instructions based on the NFC standard ISO/IEC 14443-4.
  • ISO/IEC 14443-4 defines a standard card identification format. Cards with standard format identification can communicate with the card reader based on ISO/IEC 14443-4, and cards without standard format identification can be based on the card manufacturer’s independent The developed proprietary protocol communicates with the card reader.
  • the above steps 1 to 6, that is, the second radio frequency communication process is based on the NFC standard ISO/IEC 14443-3.
  • ISO/IEC14443-3 belongs to the underlying handshake protocol.
  • the electronic device performs related operations in the second radio frequency communication process, only the configured NFC chip can perform the analysis of the ISO/IEC 14443-3 protocol without the intervention of the configured processor.
  • the above step 7, that is, the third radio frequency communication process is based on the NFC standard ISO/IEC 14443-4.
  • ISO/IEC 14443-4 belongs to the upper layer protocol.
  • the electronic device performs the related operations of the third radio frequency communication process, it needs to use the processor to analyze the ISO/IEC 14443-3 protocol.
  • step 7 is an expanded description of the above step 7 with reference to FIG. 1. That is to describe in detail the third radio frequency communication process performed by the electronic device and the card reader in the card emulation mode based on ISO/IEC 14443-4.
  • the card reader selects the electronic device operating in the card emulation mode, it first sends a card selection answer command (request answer to select, RATS) to the electronic device operating in the card emulation mode.
  • a card selection answer command request answer to select, RATS
  • the electronic device sends an answer to select (ATS) to the card reader.
  • RATS and ATS are to allow readers and electronic devices to confirm that the other party supports ISO/IEC 14443-4. Normally, RATS is the first instruction sent to the electronic device after the card reader selects the electronic device as the data transmission object.
  • the card reader can interact with the electronic device in order to exchange information and realize functions such as access control, contactless payment, and data transmission.
  • the information exchanged by the card reader and the electronic device includes: card information used to simulate a card when the electronic device works in the card emulation mode, such as access card identification, bus card identification, bank card number, etc.
  • the electronic device when the electronic device simulates a bus card, it can send its own bus card information (such as UID) to the card reader. After the card reader receives the bus card information, it can communicate with the background server. The back-end server performs deduction processing on the account corresponding to the UID, updates the balance corresponding to the account, and records the time or location of this card swiping, thereby completing the payment.
  • UID bus card information
  • the back-end server performs deduction processing on the account corresponding to the UID, updates the balance corresponding to the account, and records the time or location of this card swiping, thereby completing the payment.
  • the electronic device when the electronic device simulates a bank card, it can send its own bank card information (such as bank card number, bank card password) to the card reader, and after receiving the bank card information, the card reader can communicate with the background server.
  • the back-end server performs deduction processing on the bank card, updates the balance of the bank card, and records the time or place of this card swiping, thereby completing the payment.
  • the electronic device when the electronic device simulates a membership card, it can send its own membership card information (such as UID) to the card reader. After the card reader receives the membership card information, it can communicate with the background server. The back-end server performs deduction processing or points processing on the account corresponding to the UID, updates the balance or point value corresponding to the account, and records the time or place of the card swiping.
  • UID membership card information
  • the card reader can send a consumption instruction to the electronic device.
  • the consumption instruction is used for Indicates that the credit card is completed or the transaction is successful.
  • the NFC chip of the electronic device can receive the consumption instruction and perform the following operations: (1) The NFC chip transmits the consumption instruction to a secure element (SE), and the SE updates the stored data in response to the consumption instruction, such as updating Account balance or point value, record the time or place of this card swipe, etc. (2) The SE reports the successful card swiping event to the processor in response to the consumption instruction. (3) The SE generates a consumption instruction response in response to the consumption instruction, and sends the consumption instruction response to the card reader through the NFC chip. At this point, the electronic device and the card reader have successfully swiped the card.
  • SE secure element
  • the above-mentioned NFC chip, SE, and processor are all components of an electronic device. Subsequent embodiments will describe the functions of these components in detail, and will not be repeated here. It is understandable that in addition to the several types of scenarios described in the above examples, in some simple scenarios that do not require the card reader to interact with the back-end server, the electronic device and the card reader can only exchange information through the above steps 1-6 to achieve Access control, contactless payment, data transmission and other functions. That is to say, in some scenarios, electronic devices and card readers can realize access control, contactless payment, data transmission and other functions based on ISO/IEC 14443-3 protocol only, without involving ISO/IEC 14443-4 protocol .
  • an electronic device simulates an access control card, it sends its own access control card information (such as UID) to the card reader through steps 1-6. After the card reader receives the access control card information, it can verify the permissions of the access control card locally. If the access card has permission to unlock, the card reader can instruct to open the door.
  • access control card information such as UID
  • Figures 1 and 2 are only examples.
  • the communication process between the electronic device and the card reader working in card emulation mode can refer to ISO/IEC 14443-3 and ISO/IEC 14443-4. Can include more or fewer interactive instructions.
  • the performance of the electronic device for sending and receiving radio frequency signals must be good to successfully complete the NFC communication process between the electronic device and the card reader shown in FIG. 1 or FIG. 2 to ensure the success of the card swipe.
  • the better the performance of the electronic device to send and receive radio frequency signals the higher the success rate of NFC communication between the electronic device and the card reader, that is, the higher the success rate of card swiping.
  • the performance of the electronic equipment to receive and transmit radio frequency signals may include, but is not limited to: the stability, continuity, and strength of the electronic equipment when receiving radio frequency signals; the stability, continuity, and strength of the electronic equipment when sending radio frequency signals.
  • the factors that affect the performance of the electronic device to send and receive radio frequency signals that is, the factors that affect the success rate of NFC communication and the success rate of card swiping can include the following two:
  • Card readers may include but are not limited to the following types: subway card readers, bus card readers, bank card readers (such as POS machines), access control card readers, and so on.
  • the card reader can communicate with corresponding types of cards to complete functions such as access control and contactless payment.
  • a metro card reader can communicate with a metro card
  • a bus reader can communicate with a bus card.
  • the hardware structure of the card reader may include the coupling mode of the antenna in the card reader, metal material, manufacturing process, internal shape, and so on.
  • the hardware structure of the card reader will affect the performance of the electronic device to send and receive radio frequency signals.
  • the electronic device has different radio frequency signal performance.
  • RF parameters can include one or more of the following: sensitivity, threshold, and input voltage of the receiving circuit when the electronic device receives the RF signal; frame delay time and load modulation used by the electronic device to send the RF signal The modulation mode, carrier waveform, carrier amplitude and phase of the carrier, etc.
  • the sensitivity of the electronic device to receive radio frequency signals can be configured by adjusting the gain of a low noise amplifier (LNA) in the electronic device.
  • LNA low noise amplifier
  • the receiving circuit of the electronic device includes an automatic gain control (AGC) circuit, which attenuates the received signal by adjusting the resistor divider to obtain the optimal received input voltage.
  • AGC automatic gain control
  • the electronic device can modulate the original information to be sent on the carrier wave corresponding to the waveform, amplitude, and phase of the carrier provided in the radio frequency parameters through a modulation mode, generate a corresponding radio frequency signal, and then send the radio frequency signal.
  • the modulation mode can be divided into the following four types according to the input and output modes: double-ended input and double-ended output, double-ended input and single-ended output, single-ended input and double-ended output, and single-ended input and single-ended output.
  • the electronic device can transmit the generated radio frequency signal according to the frame delay time.
  • the electronic device uses the configured radio frequency parameters to perform the above-mentioned NFC communication process with the card reader.
  • the electronic device can use the sensitivity, threshold value, and input voltage of the receiving circuit to detect the radio frequency field.
  • the electronic equipment uses the sensitivity, threshold value, and input voltage of the receiving circuit to detect the radio frequency signal sent by the card reader, and uses the modulation mode and carrier frequency used for load modulation.
  • the waveform, the amplitude of the carrier wave, and the phase of the carrier wave are used to generate the radio frequency signal, and the frame delay time is used to transmit the generated radio frequency signal.
  • the card reader After the card reader leaves the factory and is put into use, its hardware structure is basically fixed.
  • special RF parameters When performing NFC communication with the card reader, only electronic devices that use special RF parameters can guarantee the performance of sending and receiving RF signals.
  • the reader consider the influence of the reader’s hardware structure and RF parameters on the RF signal sent and received by the electronic device.
  • the electronic device uses special RF parameters to perform related operations in the NFC communication process, It can ensure the performance of the electronic equipment to send and receive radio frequency signals.
  • the special radio frequency parameters may be referred to as radio frequency parameters adapted or compatible with the card reader.
  • the radio frequency parameters used usually include the following two situations:
  • Case 1 The electronic device uses preset radio frequency parameters to perform related operations in the NFC communication process in any scene and any place.
  • the preset radio frequency parameters are obtained through a large number of tests, and the preset radio frequency parameters can be compatible or adapted with as many card readers on the market as possible.
  • the preset radio frequency parameters cannot be compatible or adapted to all card readers on the market.
  • a user may use an electronic device to swipe the card successfully at location A, but when using an electronic device to swipe the card at location B, the receiving and sending of radio frequency signals may be unstable, causing the card to fail. This will affect the user experience.
  • the electronic device can use the radio frequency parameters corresponding to the current location to perform related operations in the NFC communication process.
  • the electronic device can obtain radio frequency parameters corresponding to the current location from the cloud.
  • the card readers in the same place may come from the same manufacturer or used in the same scene, so the hardware structure of the card readers in the same place has certain similarities.
  • the radio frequency parameter corresponding to a certain place is the radio frequency parameter obtained after a large number of tests, which can be compatible or adapted with as many card readers in this place as possible.
  • embodiments of the present application provide a communication method and device based on NFC.
  • the electronic device works in a card emulation mode.
  • the electronic device can adjust the currently used RF parameters and use the adjusted RF parameters to re-execute the NFC communication with the card reader process. In this way, the performance of the radio frequency signal sent and received by the electronic device can be adjusted, thereby increasing the success rate of swiping the card.
  • the method provided in the embodiment of the present application can be applied to an electronic device working in a card emulation mode.
  • the types of cards simulated by the electronic device may include, but are not limited to: subway cards, bus cards, access cards, credit cards, debit cards, stored value cards, shopping cards, boarding passes, movie tickets, coupons, student cards, social security Cards, membership cards, passports, etc.
  • the electronic device stores card information used to simulate an NFC card.
  • the card information may include, for example, the identification of an access card (such as UID), the identification of a bus card (such as UID), the card number of a bank card, and so on.
  • the manner in which the electronic device is simulated as an NFC card may include the following two types:
  • the electronic device copies the physical card, that is, after storing the card information of the physical card, it uses NFC technology to execute the NFC communication process with the card reader. During the NFC communication process, the electronic device exchanges the card information of the physical card with the card reader to complete the card swiping.
  • Electronic devices can replicate physical cards through NFC technology.
  • Physical cards may include, but are not limited to: physical subway cards, bus cards, bank cards, access cards, social security cards, membership cards, passports, or other types of physical cards.
  • E-cards are virtual rather than physical. Electronic cards may include, but are not limited to: virtual subway cards, bus cards, bank cards, access cards, social security cards, membership cards, passports or other types of electronic cards, etc.
  • FIG. 3 is a schematic flowchart of the NFC-based communication method provided by an embodiment of the application. As shown in Figure 3, the method may include the following steps:
  • Step S110 the electronic device works in the card emulation mode, and uses the first radio frequency parameter to execute the NFC communication process between the electronic device and the card reader.
  • the NFC communication process may include a first radio frequency communication process, a second radio frequency communication process, and a third radio frequency communication process.
  • the electronic device can use the following two strategies to perform the first radio frequency communication process, that is, use the following two strategies to detect the radio frequency field provided by the card reader:
  • Strategy 1 When the electronic device is in the on-screen and unlocked state, periodically detect the radio frequency field provided by the card reader; when the electronic device is in the off-screen state, locked-screen state or shut down state, continuously detect the card reader provides ⁇ RF field.
  • the electronic device can execute the first radio frequency communication process in any state, that is, the electronic device can execute the NFC-based communication method provided in the embodiment of the present application in any state.
  • Strategy 2 The electronic device detects the radio frequency field provided by the card reader in response to the received user operation. That is, the electronic device detects the radio frequency field provided by the card reader under the trigger of the user.
  • FIG. 4 shows a schematic diagram of human-computer interaction provided by an embodiment of the present application.
  • the user interface 41 may be a user interface provided by a wallet application installed on an electronic device.
  • the wallet is an application used to manage credit cards, debit cards, stored value cards, shopping cards, boarding passes, movie tickets, coupons, student ID cards, or other card coupons.
  • the user interface 41 includes pictures of multiple cards that can be simulated by multiple electronic devices, such as pictures of bank cards, pictures of public transportation cards, pictures of subway cards, and so on.
  • the user can click the picture of any card to trigger the electronic device to simulate the card corresponding to the picture.
  • the user can click the picture 401 of the bus card.
  • the electronic device displays the user interface as shown in b of FIG. 4 and starts to detect the radio frequency field provided by the card reader to simulate the bus card.
  • the second use strategy is that the electronic device detects the radio frequency field provided by the card reader according to the user's needs, which can save power consumption.
  • the radio frequency field provided by the card reader when the electronic device enters the coverage of the radio frequency field provided by the card reader, the radio frequency field provided by the card reader can be detected.
  • the electronic device uses the first radio frequency parameter to perform the NFC communication process between the electronic device and the card reader.
  • the first radio frequency parameter may be any set of radio frequency parameters selected by the electronic device from N sets of radio frequency parameters stored in advance.
  • the first radio frequency parameter may be the set of radio frequency parameters with the highest success rate of card swiping among the N sets of radio frequency parameters pre-stored by the electronic device.
  • the electronic device stores N sets of radio frequency parameters in advance.
  • N is a positive integer greater than or equal to one.
  • the electronic device may store the N sets of radio frequency parameters in order from high to low according to the card swiping success rate.
  • the N sets of radio frequency parameters pre-stored by the electronic device can be obtained in the following two ways:
  • the N sets of radio frequency parameters pre-stored in the electronic device may be preset in the electronic device when the electronic device leaves the factory. Specifically, R&D personnel can obtain N sets of radio frequency parameters that are adapted or compatible with most card readers on the market through testing or other methods, and preset the N sets of radio frequency parameters in the electronic device.
  • the N sets of radio frequency parameters pre-stored by the electronic device may be obtained by the electronic device from the cloud server.
  • the cloud server may calculate the card swipe success rate corresponding to each set of radio frequency parameters based on the data reported by each electronic device.
  • the cloud server can periodically issue the N sets of radio frequency parameters with the highest card swiping success rate to the electronic device.
  • the manner in which the cloud server counts the card swiping success rate corresponding to each set of radio frequency parameters can refer to the related description in the subsequent embodiments, and will not be repeated here.
  • Step S120 The electronic device determines whether the performance of the NFC communication between the electronic device and the card reader fails due to poor performance of receiving and sending radio frequency signals.
  • the performance of the electronic device to send and receive radio frequency signals is an important factor affecting the execution of the NFC communication process between the electronic device and the card reader, that is, the performance of the electronic device to receive and send radio frequency signals To the success rate of credit card. If the electronic device has good performance in receiving and sending radio frequency signals, the NFC communication process between the electronic device and the card reader can be executed smoothly, that is, the card swipe is successful. If the performance of the electronic device to send and receive radio frequency signals is poor, the NFC communication process between the electronic device and the card reader cannot be executed smoothly, that is, the card swiping fails.
  • the electronic device can determine whether the NFC communication process between the electronic device and the card reader fails due to the poor performance of receiving and sending radio frequency signals in the following ways:
  • T1 After the electronic device detects the RF field for the first time, if the number of times the electronic device detects that the RF field strength is lower than the threshold is greater than the first value, or the electronic device detects the RF field strength is lower than the threshold for the duration If the value is greater than the second value, it is determined that the current NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals.
  • T1 the threshold, the first value, and the second value can all be preset.
  • the electronic device cannot detect the radio frequency field continuously and stably, and the electronic device cannot continuously and stably receive the reading.
  • the radio frequency signal sent by the card reader cannot continuously and stably send the radio frequency signal to the card reader, that is, the performance of the electronic device to send and receive radio frequency signals is poor.
  • the electronic device cannot smoothly perform the NFC communication process with the card reader, that is, the card cannot be swiped successfully.
  • FIG. 5 shows a possible schematic diagram of the strength of the radio frequency signal detected by the electronic device.
  • the electronic device cannot detect the radio frequency field stably, the performance of receiving and sending radio frequency signals is poor, and the NFC communication process with the card reader cannot be executed smoothly.
  • T2 (for example, 3 seconds) after the electronic device detects the radio frequency field for the first time, if the second radio frequency communication process with the card reader is not successfully executed, that is, the electronic device has not finished executing the above-mentioned Figure 1 or For the related operations of the ISO/IEC14443-3 protocol in FIG. 2, it is determined that the current NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals.
  • T2 can be preset.
  • the analysis of the ISO/IEC 14443-3 protocol is performed by the NFC chip of the electronic device without the intervention of the processor.
  • the electronic device performs the second radio frequency communication process with the card reader based on the ISO/IEC 14443-3 protocol, the electronic device itself cannot perceive whether it has received or sent the relevant ISO/IEC 14443-3 protocol. instruction.
  • the electronic device cannot know which step of the second radio frequency communication process with the card reader is currently being executed, nor can it determine whether the second radio frequency communication process with the card reader has been successfully executed.
  • the electronic device After the electronic device completes the second radio frequency communication process with the card reader, it starts to execute the third radio frequency communication process with the card reader.
  • the third radio frequency communication process between the electronic device and the card reader is based on the ISO/IEC 14443-4 protocol.
  • the analysis of the ISO/IEC 14443-4 protocol needs to be executed by the processor of the electronic device. Therefore, the electronic device can receive Based on the relevant instructions of the ISO/IEC 14443-4 protocol, to know whether the third radio frequency communication process with the card reader is currently started.
  • the electronic device in the time period T2 after the first detection of the radio frequency field, if the electronic device does not receive the relevant instructions based on the ISO/IEC 14443-4 protocol, it can be regarded as an electronic device The second radio frequency communication process with the card reader has not been completed.
  • the electronic device does not receive the RATS command based on the ISO/IEC 14443-4 protocol mentioned in the embodiment of FIG. 2 within the time period T2 after the first detection of the radio frequency field, then It can be considered that the electronic device has not completed the second radio frequency communication process with the card reader.
  • T3 In the time period T3 after the electronic device detects the radio frequency field for the first time, if the third radio frequency communication process with the card reader is not successfully executed, that is, the electronic device has not completed the ISO in Figure 1 or Figure 2 above. /IEC 14443-4 protocol related operations, it is determined that the current NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals.
  • T3 can be preset.
  • the third radio frequency communication process between the electronic device and the card reader is based on the ISO/IEC 14443-4 protocol, and the analysis of the ISO/IEC 14443-4 protocol needs to be executed by the processor of the electronic device. Therefore, the electronic device can determine which step in the third radio frequency communication process with the card reader is currently being executed according to the received and received radio frequency signals, and determine whether the third radio frequency communication with the card reader has been successfully executed. Communication process.
  • the electronic device does not receive the consumption instruction sent by the card reader within the time period T3 after detecting the radio frequency field for the first time, it can be considered that the electronic device has not completed the above and the card reader.
  • the card reader when the electronic device working in the card emulation mode communicates with the card reader, if the card reader does not receive instructions, the received instructions are incomplete, or errors, etc., the card reader can report to the electronic device Send a negative acknowledgment (NAK) command.
  • NAK negative acknowledgment
  • the NAK command is used to instruct the electronic device to resend the command sent last time.
  • the NFC chip of the electronic device can receive the NAK command and resend the command sent last time. This retransmission mechanism can ensure smooth data transmission between the electronic device and the card reader.
  • the NFC chip of the electronic device can report the NAK instruction to the processor, so that the processor knows that the current electronic device has poor performance in receiving and sending radio frequency signals.
  • the electronic device can determine whether the NFC communication process between the electronic device and the card reader is caused by the poor performance of the electronic device to send and receive radio frequency signals according to whether the received instruction can be parsed and whether the content of the parsed instruction is abnormal. The execution failed.
  • the NFC chip of the electronic device encapsulates the situation as an event and reports it to the processor.
  • the NFC chip may report the error code 0x02RF_FRAME_CORRUPTED to the processor, which is used to indicate that the received instruction cannot be parsed.
  • the NFC chip can report the error code 0xB0RF_TRANSMISSION_ERRO to the processor, which is used to indicate that the received instruction is abnormal or the verification fails.
  • Step S130 In the case that the NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals, the electronic device uses the second radio frequency parameters to re-execute the communication with the card reader NFC communication process.
  • the electronic device adjusts the radio frequency parameter from the first radio frequency parameter to the second radio frequency parameter, and executes and reads the card again NFC communication process between devices. That is, the electronic device uses the adjusted second radio frequency parameter to execute the first radio frequency communication process, the second radio frequency communication process, and the third radio frequency communication process with the card reader. In this way, the performance of the electronic device to receive and send radio frequency signals can be adjusted, and the card success rate of the electronic device can be improved.
  • the second radio frequency parameter is different from the first radio frequency parameter.
  • the second radio frequency parameter includes a set of radio frequency parameters
  • the first radio frequency parameter includes a set of radio frequency parameters
  • the difference between the second radio frequency parameter and the first radio frequency parameter means that some or all of the radio frequency parameters in the second radio frequency parameter are different from the first radio frequency parameter.
  • the radio frequency parameters are different.
  • the second radio frequency parameter can be obtained in the following ways:
  • the second radio frequency parameter may be a set of radio frequency parameters that is different from the first radio frequency parameter randomly selected by the electronic device among the N sets of stored radio frequency parameters.
  • the second radio frequency parameter may be the radio frequency parameter with the highest card swipe success rate selected by the electronic device among other radio frequency parameters other than the first radio frequency parameter among the N sets of stored radio frequency parameters.
  • the electronic device selects the second radio frequency parameter at the local end, which can save time and power consumption, and the card can be successfully swiped faster.
  • the second radio frequency parameter may be obtained by the electronic device requesting the cloud server.
  • the cloud server may send any set of radio frequency parameters to the electronic device in response to the request of the electronic device, or send a set of radio frequency parameters with the highest success rate of card swiping to the electronic device.
  • the electronic device may use the received radio frequency parameter as the second radio frequency parameter.
  • step S130 since the electronic device adjusts the radio frequency parameters, which is equivalent to adjusting the performance of receiving and sending radio frequency signals, the electronic device may succeed when it executes the NFC communication process with the card reader again. If the electronic device still fails when performing the NFC communication process with the card reader again, the electronic device repeats steps S120-S130 to adjust the radio frequency parameters again until the NFC communication process with the card reader is successfully performed.
  • the electronic device when the electronic device fails to perform the NFC communication process with the card reader due to poor transceiver RF signals, it can adjust the RF parameters, which is equivalent to adjusting the performance of the RF signal. , And re-execute the NFC communication process with the card reader. In this way, the successful execution of the NFC communication process between the electronic device and the card reader can be ensured, thereby increasing the card swiping success rate.
  • the electronic device may also store radio frequency parameters used when successfully executing the NFC communication process with the card reader.
  • the electronic device can store the second radio frequency parameter in the following ways:
  • the electronic device stores the identification of the card reader and the second radio frequency parameter in association.
  • the second radio frequency parameter used when the electronic device successfully executes the NFC communication process with the card reader is adapted to the card reader. After the electronic device stores the identity of the card reader and the second radio frequency parameter in association, when the electronic device executes the NFC communication process with the reader again, it can use the second radio frequency parameter stored in association with the identity of the card reader . In a specific implementation, the electronic device can learn the identity of the card reader through an instruction interaction with the card reader.
  • the first storage method can ensure that each subsequent NFC communication process performed between the electronic device and the card reader can have a higher communication success rate.
  • the electronic device stores the current simulated card type and the second radio frequency parameter in association.
  • the hardware structure of the card reader corresponding to the same type of card is similar.
  • the hardware structure of the bus card reader is similar, and the hardware structure of the bank card reader is similar.
  • the second radio frequency parameter can be adapted to most bus card readers. After the electronic device associates and stores the currently simulated card type (such as a bus card) and the second radio frequency parameter, when the electronic device is simulated as a bus card again, it can directly use the second radio frequency parameter to perform NFC communication with the bus card reader process.
  • the electronic device can learn the currently simulated card type according to the received user operation. For example, referring to Figure 4, the electronic device can learn the currently simulated card type according to the received user operation. For example, when the electronic device receives the user operation on the picture 401 on the user interface 41, it can learn that the currently simulated card type is Bus card.
  • the second storage method can ensure that each NFC communication process performed between the subsequent electronic device and the card reader corresponding to the same type of card can have a higher communication success rate.
  • the electronic device can also store the current location and the second radio frequency parameter in association.
  • the card readers at the same location may be of the same type or from the same manufacturer. Therefore, the hardware structure of the card readers at the same location is similar.
  • the second radio frequency parameter can be adapted to most card readers in the current location. After the electronic device associates and stores the current location and the second radio frequency parameter, when the electronic device is at the location again, it can directly use the second radio frequency parameter to perform each NFC communication process with the card reader under the location.
  • the third storage method can ensure that each NFC communication process performed between the subsequent electronic device and the card reader in the same location can have a higher communication success rate.
  • the electronic device can also count the number of successes and failures when using each set of radio frequency parameters to execute the NFC communication process with the card reader, that is, the number of successful swipes and swipes corresponding to each set of radio frequency parameters. The number of failures, and report the statistical data to the cloud server.
  • the cloud server can obtain the data reported by multiple electronic devices, respectively count the credit card success rate of each set of radio frequency parameters, and can periodically issue the N sets of radio frequency parameters with the highest credit card success rate to each electronic device.
  • the electronic device can also count the number of successes and failures when using various sets of radio frequency parameters on each card reader to perform the NFC communication process with the card reader, and count The data is reported to the cloud server.
  • the cloud server can obtain the data reported by multiple electronic devices, respectively count the N sets of radio frequency parameters with the highest swipe success rate corresponding to each card reader, and can periodically assign each card reader to the N sets of the highest swipe success rate.
  • the radio frequency parameters are delivered to the electronic equipment. In this way, when the electronic device works in the card emulation mode and swipes the card, it can select any set of radio frequency parameters from the N sets of radio frequency parameters with the highest swipe success rate corresponding to the card reader according to the current card reader's identification to send and receive radio frequency. Signal, thereby improving the success rate of electronic devices.
  • the electronic device can also count the number of successes and failures when using various sets of radio frequency parameters to execute the NFC communication process with the card reader in each location, and report the statistical data to Cloud server.
  • the cloud server can obtain the data reported by multiple electronic devices, count the N sets of radio frequency parameters with the highest credit card success rate corresponding to each location, and can periodically issue the N sets of radio frequency parameters with the highest credit card success rate corresponding to each location To electronic equipment.
  • the electronic device when the electronic device works in the card emulation mode and swipes the card, it can select any set of RF parameters from the N sets of RF parameters with the highest credit card success rate corresponding to the location according to the current location to send and receive RF signals, thereby improving the electronic equipment The success rate of credit card.
  • the electronic device can also count the number of successes and failures when simulating each type of card, using various sets of radio frequency parameters to execute the NFC communication process with the card reader, and count The data is reported to the cloud server.
  • the cloud server can obtain the data reported by multiple electronic devices, respectively count the N sets of radio frequency parameters with the highest swipe success rate corresponding to each type of card, and can periodically correspond each type of card to the N sets of radio frequency with the highest swipe success rate.
  • the parameters are delivered to the electronic device.
  • the electronic device when the electronic device is working in the card emulation mode and swiping the card, it can select any set of radio frequency parameters to send and receive from the N sets of radio frequency parameters with the highest swiping success rate corresponding to this type of card according to the type of the currently simulated card. Radio frequency signal, thereby improving the success rate of electronic devices.
  • the data collected by the electronic device and used for reporting to the cloud server in the above several situations may be referred to as the first information.
  • the embodiment of the present application also provides a corresponding device.
  • the electronic device and card reader provided in the embodiments of the present application are described in detail below.
  • the electronic device is a device that can communicate with other devices using NFC.
  • the electronic device can work in the card emulation mode to execute the first radio frequency communication process of radio frequency communication, the second radio frequency communication process of radio frequency communication, and the third radio frequency communication process of radio frequency communication to complete functions such as access control and contactless payment.
  • the electronic device in the embodiment of the present application can be used to execute the NFC-based communication method shown in the embodiment of FIG. 3 above.
  • Electronic devices can be mobile phones, tablet computers, personal digital assistants (personal digital assistants, PDAs), wearable devices (such as smart bracelets, smart watches), laptop computers, and touch-sensitive surfaces (such as touch panels). ) Laptop computer (laptop) and other portable electronic equipment.
  • portable electronic devices include, but are not limited to, portable electronic devices equipped with iOS, android, microsoft or other operating systems.
  • FIG. 6A shows a schematic structural diagram of an exemplary electronic device 100 provided in the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM Subscriber identification module
  • the sensor module 180 may include pressure sensor 180A, gyroscope sensor 180B, air pressure sensor 180C, magnetic sensor 180D, acceleration sensor 180E, distance sensor 180F, proximity light sensor 180G, fingerprint sensor 180H, temperature sensor 180J, touch sensor 180K, ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a two-way synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc. through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement the touch function of the electronic device 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to realize communication between the processor 110 and the audio module 170.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through the headphones. This interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering and amplifying the received electromagnetic waves, and then transmitting them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is processed by the baseband processor and then passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic wave radiation via the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150
  • the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, connected to the display 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, etc.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats.
  • the electronic device 100 may include 1 or N cameras 193, and N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in a variety of encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • the NPU can realize applications such as intelligent cognition of the electronic device 100, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called a “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can approach the microphone 170C through the mouth to make a sound, and input the sound signal to the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch location but have different touch operation strengths may correspond to different operation instructions. For example: when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • the electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, etc.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 executes to reduce the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can obtain the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal.
  • the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function.
  • the application processor may analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
  • the button 190 includes a power button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations applied to different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
  • the electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 may also be compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present application takes a layered Android system as an example to illustrate the software structure of the electronic device 100.
  • the wireless communication module 160 may include an NFC chip, and the NFC chip is used to provide an NFC solution applied to the electronic device 100.
  • the NFC chip is used to receive the radio frequency signal sent by the card reader via the antenna, thereby detecting the radio frequency field provided by the card reader and receiving the radio frequency signal sent by the card reader.
  • the NFC chip is also used to use load modulation technology to modulate the information to be sent in the inductance coil inside the antenna (for example, to change the impedance of the inductance coil regularly), so as to regularly change the inductance of the antenna in the reader in the radio frequency field
  • the load of the coil which transmits radio frequency signals.
  • the card reader can detect the change in the load of the inductance coil, read the information sent by the NFC chip, and realize the transmission of information.
  • the NFC chip can be used to parse commands based on the underlying protocol ISO/IEC 14443-3.
  • the NFC chip can be used to resolve REQA, SDD, SELECT, etc.
  • the NFC chip can perform corresponding processing operations based on the analysis results, such as generating and sending ATQA, SAK, etc.
  • the NFC chip when it receives an instruction based on the upper-layer protocol ISO/IEC 14443-4, it can send the processed instruction to the processor 110, and the processor 110 parses the instruction and executes the corresponding instruction in response to the instruction. Operation.
  • the commands based on the upper layer protocol ISO/IEC 14443-4 may include RATS, for example.
  • the processor 110 may generate a signal to be sent based on the upper layer protocol ISO/IEC 14443-4, and send the signal to the NFC chip, and the NFC chip converts the signal into a radio frequency signal via the antenna and sends it out.
  • the electronic device is also configured with SE.
  • the SE stores the card information of the card simulated by the electronic device, such as UID, account balance, card swiping record, etc.
  • the SE and the NFC chip cooperate to complete the card swiping process. For this process, refer to the relevant description of the previous embodiment.
  • the SE may be set in the processor 121, may be set in the SIM card, or may be set independently, which is not limited in this application.
  • the memory 121 may be used to store N sets of radio frequency parameters.
  • the N sets of radio frequency parameters may be preset when the electronic device leaves the factory, or may be periodically issued to the electronic device by the cloud server.
  • the N sets of radio frequency parameters may be radio frequency parameters with the highest card swipe success rate, or radio frequency parameters with the highest card swipe success rate corresponding to each card reader/location/card type.
  • the processor 110 may be used to determine whether the electronic device fails to swipe the card due to poor performance of sending and receiving radio frequency signals.
  • the specific judgment method refer to the related description of the foregoing method embodiment.
  • the processor 110 may also be used to re-execute the NFC communication process with the card reader using the second radio frequency parameter when the electronic device has a poor performance in receiving and sending radio frequency signals and the card swiping fails.
  • the determination method of the second radio frequency parameter refer to the related description of the foregoing method embodiment.
  • FIG. 7 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides application programming interfaces (application programming interface, API) and programming frameworks for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include video, image, audio, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text and controls that display pictures.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic equipment vibrates, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes touch operations into original input events (including touch coordinates, time stamps of touch operations, etc.).
  • the original input events are stored in the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer.
  • the camera 193 captures still images or videos.
  • FIG. 8 is a schematic structural diagram of an exemplary card reader 200 according to an embodiment of the application.
  • the card reader 200 may include: a processor 210, an NFC chip 220, an antenna 230, and a battery 240.
  • the processor 210 may include one or more processing units.
  • the processor 210 may include a modem processor, a digital signal processor, and a baseband processor.
  • the different processing units may be independent devices or integrated in one or more processors.
  • the processor 210 can generate operation control signals according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions.
  • the processor 210 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface.
  • the I2C interface is a two-way synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • SDA serial data line
  • SCL serial clock line
  • the processor 210 may be coupled to the NFC chip 220 through an I2C bus interface to implement data transmission with the NFC chip 220.
  • the processor 210 is configured to receive the signal transmitted from the NFC chip, analyze the signal, and perform corresponding operations in response to the signal.
  • the processor 210 is also used to generate a signal to be sent, and send the signal to be sent to the NFC chip 210.
  • the processor 210 may also be provided with a memory for storing instructions and data.
  • the processor 210 is configured to generate a signal to be sent, and send the signal to the NFC chip 220.
  • the NFC chip is used to perform frequency modulation, amplification and other processing on the signal from the processor 210, and then convert the signal into a radio frequency signal through the antenna and radiate it out to generate an electromagnetic field propagating through space.
  • the electromagnetic field is the radio frequency field generated by the card reader. .
  • the battery 240 is used to provide electrical energy for each module of the electronic device 200.
  • the battery 240 may include, but is not limited to: dry batteries, button batteries, rechargeable batteries, and so on.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 200.
  • the electronic device 200 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented by hardware, software, or a combination of software and hardware.
  • the embodiment of the present application also provides an NFC chip, the NFC chip is applied to an electronic device, the electronic device stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card;
  • the NFC The chip includes: one or more processors and an interface; the interface is used to receive code instructions and transmit the code instructions to the processor, and the processor is used to run the code instructions to make the electronic device execute
  • the NFC-based communication method provided by the embodiment of the present application.
  • the NFC-based communication method executed by the electronic device can refer to the previous related description, which will not be repeated here.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk).
  • the process can be completed by a computer program instructing relevant hardware.
  • the program can be stored in a computer readable storage medium. , May include the processes of the foregoing method embodiments.
  • the aforementioned storage media include: ROM or random storage RAM, magnetic disks or optical discs and other media that can store program codes.

Abstract

The present application provides an NFC-based communication method and device. In the method, the electronic device works in a card simulation mode, and the electronic device can adjust a currently used radio frequency parameter in the case that the execution of the NFC communication process fails due to poor performance in receiving and transmitting radio frequency signals of the electronic device, and uses an adjusted radio frequency parameter to re-execute the NFC communication process between the electronic device and a card reader. The method can adjust the performance in receiving and transmitting radio frequency signals of the electronic device, so as to improve the success rate of card swiping.

Description

基于NFC的通信方法及装置NFC-based communication method and device
本申请要求于2019年08月16日提交中国专利局、申请号为201910758668.5、申请名称为“基于NFC的通信方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910758668.5, and the application name is "NFC-based communication method and device" on August 16, 2019, the entire content of which is incorporated into this application by reference .
技术领域Technical field
本申请涉及近距离无线通信(near field communication,NFC)技术,特别涉及基于NFC的通信方法及装置。This application relates to near field communication (NFC) technology, and particularly relates to NFC-based communication methods and devices.
背景技术Background technique
随着电子技术的发展,越来越多的电子设备(例如智能手机、智能手环等)支持NFC技术。NFC技术提供短距离的高频无线连接,实现电子设备之间的双向通信。支持NFC技术的电子设备可以工作在以下3种通信模式:读/写模式(reader/writer mode)、卡仿真模式(card emulation mode)、点对点模式(P2P mode)。With the development of electronic technology, more and more electronic devices (such as smart phones, smart bracelets, etc.) support NFC technology. NFC technology provides a short-distance high-frequency wireless connection to achieve two-way communication between electronic devices. Electronic devices that support NFC technology can work in the following three communication modes: read/write mode (reader/writer mode), card emulation mode (card emulation mode), and point-to-point mode (P2P mode).
电子设备工作在卡仿真模式时,该电子设备可以模拟为一张集成电路(integrated circuit,IC)卡,例如地铁卡、公交卡、银行卡、门禁卡、社保卡、会员卡、护照等等等,完成和实际的非接触式智能卡片相同的功能,例如访问控制、非接触式支付、数据传输等等。When the electronic device works in the card simulation mode, the electronic device can be simulated as an integrated circuit (IC) card, such as subway card, bus card, bank card, access card, social security card, membership card, passport, etc. , Complete the same functions as the actual contactless smart card, such as access control, contactless payment, data transmission, etc.
具体的,用户可以手持电子设备靠近读卡器。电子设备可以侦测到读卡器提供的射频场(radio frequency field,RF-field),并基于该射频场将相关信息发送给读卡器。读卡器将接收到的相关信息发送至连接的电脑或其他处理设备,由电脑或其他处理设备对该相关信息进行验证,验证通过后即可完成付款、开锁等操作。Specifically, the user can hold the electronic device close to the card reader. The electronic device can detect the radio frequency field (RF-field) provided by the card reader, and send relevant information to the card reader based on the radio frequency field. The card reader sends the received relevant information to the connected computer or other processing equipment, and the computer or other processing equipment verifies the relevant information. After the verification is passed, operations such as payment and unlocking can be completed.
目前,读卡器在和电子设备模拟的卡片通信时,电子设备收发射频信号的性能有可能不稳定,导致刷卡失败。刷卡成功率是影响用户体验的重要因素,为了提升用户体验,如何保证电子设备收发射频信号的性能,从而提升刷卡成功率,是业界研究的方向。At present, when a card reader communicates with a card simulated by an electronic device, the performance of the electronic device to send and receive radio frequency signals may be unstable, causing the card to fail. The credit card success rate is an important factor that affects the user experience. In order to improve the user experience, how to ensure the performance of the radio frequency signal sent and received by the electronic device to improve the credit card success rate is the direction of industry research.
发明内容Summary of the invention
本申请提供了基于NFC的通信方法及装置。可以提升工作于卡仿真模式的电子设备的刷卡成功率,提升用户体验。This application provides a communication method and device based on NFC. It can improve the card swiping success rate of electronic devices working in card emulation mode, and improve user experience.
第一方面,本申请实施例提供了一种基于NFC的通信方法。该方法应用于电子设备。该方法包括:电子设备工作于卡仿真模式,该电子设备存储有NFC卡片信息,该NFC卡片信息用于该电子设备模拟为NFC卡片;该电子设备使用第一射频参数执行该电子设备与读卡器之间的NFC通信过程;当该NFC通信过程执行失败时,该电子设备使用第二射频参数再次执行该NFC通信过程;该第二射频参数和该第一射频参数不同;其中,该NFC通信过程包括:第一射频通信过程,用于该电子设备侦测该读卡器提供的射频场;第二射频通信过程,用于该读卡器选中该电子设备作为数据传输对象;第三射频通信过程,用于该电子设备和该读卡器传输数据,该数据包括该NFC卡片信息;其中,该第一射频参数、 该第二射频参数均用于以下一项或多项:该电子设备在该NFC通信过程中,接收该读卡器发送的射频信号、生成将要发送给该读卡器的射频信号、发送射频信号。In the first aspect, the embodiments of the present application provide an NFC-based communication method. This method is applied to electronic equipment. The method includes: the electronic device works in a card emulation mode, the electronic device stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card; the electronic device uses the first radio frequency parameter to execute the electronic device and read the card When the NFC communication process fails, the electronic device uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter; wherein, the NFC communication The process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic device as a data transmission object; third radio frequency communication The process is used to transmit data between the electronic device and the card reader, and the data includes the NFC card information; wherein, the first radio frequency parameter and the second radio frequency parameter are both used in one or more of the following: During the NFC communication process, the radio frequency signal sent by the card reader is received, the radio frequency signal to be sent to the card reader is generated, and the radio frequency signal is sent.
实施第一方面的方法,电子设备工作于卡仿真模式,在因为电子设备收发射频信号的性能较差而导致NFC通信过程执行失败的情况下,电子设备可以调整当前使用的射频参数,并使用调整后的射频参数重新执行和读卡器之间的NFC通信过程。这样可以调整电子设备收发射频信号的性能,从而提升刷卡成功率。To implement the method of the first aspect, the electronic device works in the card emulation mode. In the case that the NFC communication process fails due to the poor performance of the electronic device to send and receive RF signals, the electronic device can adjust the currently used RF parameters and use the adjustment After the radio frequency parameters, re-execute the NFC communication process with the card reader. In this way, the performance of the radio frequency signal sent and received by the electronic device can be adjusted, thereby increasing the success rate of swiping the card.
结合第一方面,在一些实施例中,按照场景分类,电子设备模拟的卡片的类型可包括但不限于:地铁卡、公交卡、门禁卡、信用卡、借记卡、储值卡、购物卡、登机牌、电影票、优惠券、学生证、社保卡、会员卡、护照等等。With reference to the first aspect, in some embodiments, according to scene classification, the types of cards simulated by the electronic device may include, but are not limited to: subway cards, bus cards, access cards, credit cards, debit cards, stored value cards, shopping cards, Boarding pass, movie ticket, coupon, student ID, social security card, membership card, passport, etc.
结合第一方面,在一些实施例中,NFC卡片信息例如可包括门禁卡的标识(例如UID)、公交卡的标识(例如UID)、银行卡的卡号等等。With reference to the first aspect, in some embodiments, the NFC card information may include, for example, the identification of an access card (such as UID), the identification of a bus card (such as UID), the card number of a bank card, and so on.
结合第一方面,在一些实施例中,第一射频参数、第二射频参数均包括以下一项或多项:电子设备接收射频信号时的灵敏度、门限值、接收电路的输入电压;电子设备发送射频信号时所使用的帧延迟时间、负载调制时所使用的调制模式、载波的波形、载波的幅度以及载波的相位等等。With reference to the first aspect, in some embodiments, both the first radio frequency parameter and the second radio frequency parameter include one or more of the following: the sensitivity of the electronic device when receiving the radio frequency signal, the threshold value, and the input voltage of the receiving circuit; the electronic device The frame delay time used when transmitting the radio frequency signal, the modulation mode used when the load is modulated, the waveform of the carrier, the amplitude of the carrier, and the phase of the carrier, etc.
结合第一方面,在一些实施例中,电子设备可以在以下任意一种情况下确定该NFC通信过程执行失败:With reference to the first aspect, in some embodiments, the electronic device may determine that the execution of the NFC communication process fails in any of the following situations:
(1)在时间段T1内,该电子设备侦测到射频场的强度低于阈值的次数大于第一值,或者,该电子设备侦测到射频场的强度低于阈值的时长大于第二值。(1) In the time period T1, the number of times the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the first value, or the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the second value .
(2)在时间段T2内,该电子设备没有接收到该读卡器发送的选卡回答命令RATS。(2) In the time period T2, the electronic device does not receive the card selection response command RATS sent by the card reader.
(3)在时间段T3内,该电子设备没有接收到该读卡器发送的消费指令。(3) In the time period T3, the electronic device does not receive the consumption instruction sent by the card reader.
(4)该电子设备接收到该读卡器发送的否定应答指令NAK。(4) The electronic device receives the negative response command NAK sent by the card reader.
(5)该电子设备无法解析接收到的指令,或者,该电子设备解析到的指令异常。(5) The electronic device cannot parse the received command, or the command parsed by the electronic device is abnormal.
这里,上述提及的时间段T1、T2、T3的起始时间均为电子设备开始执行和读卡器之间的NFC通信过程的时间点。Here, the start times of the aforementioned time periods T1, T2, and T3 are all time points when the electronic device starts to perform the NFC communication process with the card reader.
结合第一方面,在一些实施例中,电子设备中存储有N套射频参数。该N套射频参数可以是在电子设备出厂时预置在该电子设备中的,也可以是电子设备从云端服务器处获取的。With reference to the first aspect, in some embodiments, N sets of radio frequency parameters are stored in the electronic device. The N sets of radio frequency parameters may be preset in the electronic device when the electronic device leaves the factory, or may be obtained by the electronic device from a cloud server.
在一些实施例中,第一射频参数可以是电子设备在预先存储的N套射频参数中选择的任意一套射频参数。在另一些实施例中,第一射频参数可以是电子设备预先存储的N套射频参数中,刷卡成功率最高的一套射频参数。In some embodiments, the first radio frequency parameter may be any set of radio frequency parameters selected by the electronic device from N sets of radio frequency parameters stored in advance. In other embodiments, the first radio frequency parameter may be the set of radio frequency parameters with the highest success rate of card swiping among the N sets of radio frequency parameters pre-stored by the electronic device.
在本申请实施例中,第二射频参数可以通过以下几种方式获取:In the embodiment of the present application, the second radio frequency parameter can be obtained in the following ways:
(1)第二射频参数可以是电子设备在存储的N套射频参数中任意选择的一套和第一射频参数不同的射频参数。(1) The second radio frequency parameter may be a set of radio frequency parameters different from the first radio frequency parameter selected arbitrarily by the electronic device among the stored N sets of radio frequency parameters.
(2)第二射频参数可以是电子设备在存储的N套射频参数中除了第一射频参数以外的其他射频参数中,选择的刷卡成功率最高的射频参数。通过第2种方式,可以提高电子设备的刷卡成功率。(2) The second radio frequency parameter may be the radio frequency parameter with the highest card swipe success rate selected by the electronic device among other radio frequency parameters other than the first radio frequency parameter among the N sets of stored radio frequency parameters. Through the second method, the credit card success rate of electronic devices can be improved.
可理解的,在上述第1种方式和第2种方式中,电子设备在本地端选择第二射频参数, 可以节约时间及功耗,更快地刷卡成功。It is understandable that in the above-mentioned first method and second method, the electronic device selects the second radio frequency parameter at the local end, which can save time and power consumption and make the card swipe successfully faster.
(3)第二射频参数可以是电子设备向云端服务器请求获取的。(3) The second radio frequency parameter may be obtained by the electronic device requesting the cloud server.
结合第一方面,第二射频参数包括一套射频参数,第一射频参数包括一套射频参数。第二射频参数和第一射频参数不同是指,第二射频参数中的部分或者全部射频参数和第一射频参数不同。With reference to the first aspect, the second radio frequency parameter includes a set of radio frequency parameters, and the first radio frequency parameter includes a set of radio frequency parameters. The difference between the second radio frequency parameter and the first radio frequency parameter means that some or all of the radio frequency parameters in the second radio frequency parameter are different from the first radio frequency parameter.
结合第一方面,在一些实施例中,在电子设备使用第二射频参数成功执行该NFC通信过程的情况下,该电子设备还可以存储该第二射频参数。电子设备存储该第二射频参数的方式可包括如下几种:With reference to the first aspect, in some embodiments, when the electronic device successfully executes the NFC communication process using the second radio frequency parameter, the electronic device may also store the second radio frequency parameter. The electronic device may store the second radio frequency parameter in the following ways:
(1)关联存储该第二射频参数和该电子设备当前模拟的卡片类型;该第二射频参数用于该电子设备下一次模拟为该类型的卡片时,执行与该读卡器之间的NFC通信过程。这种存储方式,可以保证后续电子设备和同一类型的卡片所对应的读卡器之间执行的每一次NFC通信过程,都可以有较高的通信成功率。(1) Associate and store the second radio frequency parameter with the card type currently simulated by the electronic device; the second radio frequency parameter is used to execute NFC with the card reader when the electronic device simulates this type of card next time Communication process. This storage method can ensure that each NFC communication process performed between the subsequent electronic device and the card reader corresponding to the same type of card can have a higher communication success rate.
(2)关联存储该第二射频参数和该电子设备当前所处的地点;该第二射频参数用于该电子设备下一次处于该地点时,执行与该读卡器之间的NFC通信过程。可以保证后续电子设备和同一地点中的读卡器之间执行的每一次NFC通信过程,都可以有较高的通信成功率(2) Associate and store the second radio frequency parameter with the current location of the electronic device; the second radio frequency parameter is used to execute the NFC communication process with the card reader when the electronic device is at the location next time. It can ensure that every NFC communication process performed between the subsequent electronic device and the card reader in the same place can have a higher communication success rate
(3)关联存储该第二射频参数和该读卡器的标识;该第二射频参数用于该电子设备下一次执行和相同的该读卡器之间的NFC通信过程。这种存储方式,可以保证后续电子设备和该读卡器之间执行的每一次NFC通信过程,都可以有较高的通信成功率。(3) The second radio frequency parameter and the identity of the card reader are associated and stored; the second radio frequency parameter is used for the next time the electronic device executes an NFC communication process with the same card reader. This storage method can ensure that each subsequent NFC communication process performed between the electronic device and the card reader can have a higher communication success rate.
结合第一方面,在一些实施例中,电子设备使用该第二射频参数成功执行该NFC通信过程的情况下,该电子设备向云服务器发送第一信息,该第一信息用于指示该电子设备使用该第二射频参数成功执行该NFC通信过程,以使得该云服务器统计该第二射频参数对应的通信成功率。通过这种方式,云服务器可以统计多套射频参数各自的通信成功率,并可以将通信成功率最高的N套射频参数下发至各个电子设备,从而提升各个电子设备的刷卡成功率。With reference to the first aspect, in some embodiments, when the electronic device uses the second radio frequency parameter to successfully execute the NFC communication process, the electronic device sends first information to the cloud server, and the first information is used to indicate the electronic device The NFC communication process is successfully executed using the second radio frequency parameter, so that the cloud server counts the communication success rate corresponding to the second radio frequency parameter. In this way, the cloud server can count the respective communication success rates of multiple sets of radio frequency parameters, and can deliver the N sets of radio frequency parameters with the highest communication success rate to each electronic device, thereby improving the credit card success rate of each electronic device.
结合第一方面,在一些实施例中,电子设备可以采用以下两种策略来执行和读卡器之间的NFC通信过程:With reference to the first aspect, in some embodiments, the electronic device can adopt the following two strategies to execute the NFC communication process with the card reader:
策略一:电子设备在处于亮屏并且解锁状态时,周期性侦测读卡器提供的射频场;电子设备在处于熄屏状态、锁屏状态或者关机状态时,持续性侦测读卡器提供的射频场。使用策略一,电子设备可以在任意状态下执行本申请实施例提供的基于NFC的通信方法。Strategy 1: When the electronic device is in the on-screen and unlocked state, periodically detect the radio frequency field provided by the card reader; when the electronic device is in the off-screen state, locked-screen state or shut down state, continuously detect the card reader provides的RF field. Using strategy one, the electronic device can execute the NFC-based communication method provided in the embodiments of the present application in any state.
策略二:电子设备响应于接收到的用户操作,侦测读卡器提供的射频场。即,电子设备在用户的触发下侦测读卡器提供的射频场。使用策略一,电子设备可以根据用户需求执行本申请实施例提供的基于NFC的通信方法。Strategy 2: The electronic device detects the radio frequency field provided by the card reader in response to the received user operation. That is, the electronic device detects the radio frequency field provided by the card reader under the trigger of the user. Using strategy one, the electronic device can execute the NFC-based communication method provided in the embodiments of the present application according to user requirements.
第二方面,本申请实施例提供了一种电子设备。该电子设备包括:一个或多个处理器、存储器、NFC芯片和安全单元SE;该安全单元存储有NFC卡片信息,该NFC卡片信息用于该电子设备模拟为NFC卡片;该存储器与该一个或多个处理器耦合,该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令,该一个或多个处理器调用该计算机指令以使得该电子设备执行:In the second aspect, an embodiment of the present application provides an electronic device. The electronic device includes: one or more processors, a memory, an NFC chip, and a security unit SE; the security unit stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card; the memory and the one or A plurality of processors are coupled, and the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to execute:
工作于卡仿真模式;Work in card simulation mode;
通过该NFC芯片使用第一射频参数执行该电子设备与读卡器之间的NFC通信过程;Execute the NFC communication process between the electronic device and the card reader through the NFC chip using the first radio frequency parameter;
当该NFC通信过程执行失败时,通过该NFC芯片使用第二射频参数再次执行该NFC通信过程;该第二射频参数和该第一射频参数不同;When the execution of the NFC communication process fails, the NFC chip uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter;
其中,该NFC通信过程包括:第一射频通信过程,用于该电子设备侦测该读卡器提供的射频场;第二射频通信过程,用于该读卡器选中该电子设备作为数据传输对象;第三射频通信过程,用于该电子设备和该读卡器传输数据,该数据包括该NFC卡片信息;Wherein, the NFC communication process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic device as a data transmission object ; The third radio frequency communication process, used for the electronic device and the card reader to transmit data, the data includes the NFC card information;
其中,该第一射频参数、该第二射频参数均用于以下一项或多项:该电子设备在该NFC通信过程中,接收该读卡器发送的射频信号、生成将要发送给该读卡器的射频信号、发送射频信号。Wherein, the first radio frequency parameter and the second radio frequency parameter are used for one or more of the following: the electronic device receives the radio frequency signal sent by the card reader during the NFC communication process, and generates the radio frequency signal to be sent to the card reader The radio frequency signal of the device, the sending radio frequency signal.
基于同一发明构思,第二方面的电子设备可用于执行第一方面以及第一方面任意一种实施方式提供的基于NFC的通信方法。因此,第二方面的电子设备所执行的操作以及该电子设备带来的有益效果,可参照上述第一方面或第一方面任意一种可能的实施方式中的相关描述,这里不再赘述。Based on the same inventive concept, the electronic device of the second aspect can be used to implement the NFC-based communication method provided in the first aspect and any one of the implementations of the first aspect. Therefore, for the operations performed by the electronic device of the second aspect and the beneficial effects brought about by the electronic device, reference may be made to the related description in the first aspect or any one of the possible implementation manners of the first aspect, which will not be repeated here.
第三方面,本申请实施例提供了一种NFC芯片。该NFC芯片应用于电子设备,该电子设备存储有NFC卡片信息,该NFC卡片信息用于该电子设备模拟为NFC卡片;该NFC芯片包括:一个或多个处理器、接口;该接口用于接收代码指令并将该代码指令传输至该处理器,该处理器用于运行该代码指令以使得该电子设备执行第一方面以及第一方面任意一种实施方式提供的基于NFC的通信方法。In the third aspect, an embodiment of the present application provides an NFC chip. The NFC chip is applied to an electronic device, the electronic device stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card; the NFC chip includes: one or more processors and interfaces; the interface is used to receive The code instruction and the code instruction are transmitted to the processor, and the processor is configured to run the code instruction to make the electronic device execute the first aspect and the NFC-based communication method provided in any one of the implementation manners of the first aspect.
第四方面,本申请提供了一种包含指令的计算机程序产品,当上述计算机程序产品在电子设备上运行时,使得上述电子设备执行:In a fourth aspect, this application provides a computer program product containing instructions, which when the computer program product is run on an electronic device, causes the electronic device to execute:
工作于卡仿真模式;Work in card simulation mode;
通过该NFC芯片使用第一射频参数执行该电子设备与读卡器之间的NFC通信过程;Execute the NFC communication process between the electronic device and the card reader through the NFC chip using the first radio frequency parameter;
当该NFC通信过程执行失败时,通过该NFC芯片使用第二射频参数再次执行该NFC通信过程;该第二射频参数和该第一射频参数不同;When the execution of the NFC communication process fails, the NFC chip uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter;
其中,该NFC通信过程包括:第一射频通信过程,用于该电子设备侦测该读卡器提供的射频场;第二射频通信过程,用于该读卡器选中该电子设备作为数据传输对象;第三射频通信过程,用于该电子设备和该读卡器传输数据,该数据包括该NFC卡片信息;Wherein, the NFC communication process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic device as a data transmission object ; The third radio frequency communication process, used for the electronic device and the card reader to transmit data, the data includes the NFC card information;
其中,该第一射频参数、该第二射频参数均用于以下一项或多项:该电子设备在该NFC通信过程中,接收该读卡器发送的射频信号、生成将要发送给该读卡器的射频信号、发送射频信号。Wherein, the first radio frequency parameter and the second radio frequency parameter are used for one or more of the following: the electronic device receives the radio frequency signal sent by the card reader during the NFC communication process, and generates the radio frequency signal to be sent to the card reader The radio frequency signal of the device, the sending radio frequency signal.
基于同一发明构思,第四方面的NFC芯片所应用于的电子设备可用于执行第一方面以及第一方面任意一种实施方式提供的基于NFC的通信方法。因此,第四方面的NFC芯片所执行的操作以及该NFC芯片带来的有益效果,可参照上述第一方面或第一方面任意一种可能的实施方式中的相关描述,这里不再赘述。Based on the same inventive concept, the electronic device to which the NFC chip of the fourth aspect is applied can be used to implement the NFC-based communication method provided in the first aspect and any one of the implementations of the first aspect. Therefore, for the operations performed by the NFC chip of the fourth aspect and the beneficial effects brought about by the NFC chip, reference may be made to the relevant description in the first aspect or any one of the possible implementations of the first aspect, which will not be repeated here.
第五方面,本申请实施例提供一种计算机可读存储介质,包括指令,当上述指令在电子设备上运行时,使得上述电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, which when the foregoing instructions run on an electronic device, cause the electronic device to execute the first aspect and any possible implementation manner in the first aspect Described method.
实施本申请提供的技术方案,电子设备工作于卡仿真模式,在因为电子设备收发射频 信号的性能较差而导致NFC通信过程执行失败的情况下,电子设备可以调整当前使用的射频参数,并使用调整后的射频参数重新执行和读卡器之间的NFC通信过程。这样可以调整电子设备收发射频信号的性能,从而提升刷卡成功率。To implement the technical solution provided by this application, the electronic device works in the card emulation mode. In the case that the NFC communication process fails due to the poor performance of the electronic device to send and receive radio frequency signals, the electronic device can adjust the currently used radio frequency parameters and use The adjusted radio frequency parameters re-execute the NFC communication process with the card reader. In this way, the performance of the radio frequency signal sent and received by the electronic device can be adjusted, thereby increasing the success rate of swiping the card.
附图说明Description of the drawings
图1是本申请实施例提供的一次成功执行的NFC通信过程流程示意图;FIG. 1 is a schematic diagram of the flow of a successfully executed NFC communication process provided by an embodiment of the present application;
图2是本申请实施例提供的一次成功执行的NFC通信过程中,读卡器的工作流程示意图;2 is a schematic diagram of the work flow of the card reader during a successfully executed NFC communication process provided by an embodiment of the present application;
图3是本申请实施例提供的基于NFC的通信方法流程示意图;FIG. 3 is a schematic flowchart of the NFC-based communication method provided by an embodiment of the present application;
图4是本申请实施例提供的人机交互示意图;FIG. 4 is a schematic diagram of human-computer interaction provided by an embodiment of the present application;
图5是本申请实施例提供的电子设备侦测射频场场强的示意图;FIG. 5 is a schematic diagram of detecting radio frequency field strength by an electronic device provided by an embodiment of the present application;
图6A是本申请实施例提供的电子设备的结构示意图;6A is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图6B是本申请实施例提供的安全单元的位置示意图;FIG. 6B is a schematic diagram of the location of a security unit provided by an embodiment of the present application;
图7是本申请实施例提供的电子设备的软件结构框图;FIG. 7 is a software structure block diagram of an electronic device provided by an embodiment of the present application;
图8是本申请实施例提供的读卡器的结构示意图。Fig. 8 is a schematic structural diagram of a card reader provided by an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。Among them, in the description of the embodiments of the present application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this document is only a description of related objects The association relationship of indicates that there can be three relationships, for example, A and/or B, which can indicate: A alone exists, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" means two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
电子设备工作在卡仿真模式(card emulation mode)时,可以模拟为NFC卡片,和读卡器进行通信。卡仿真模式也可以被称为卡模拟模式。以应用场景分类,电子设备模拟的卡片的类型可包括但不限于:地铁卡、公交卡、门禁卡、信用卡、借记卡、储值卡、购物卡、登机牌、电影票、优惠券、学生证、社保卡、会员卡、护照等等。When the electronic device works in card emulation mode, it can be simulated as an NFC card and communicate with a card reader. The card emulation mode may also be referred to as the card emulation mode. Classified by application scenarios, the types of cards simulated by electronic devices can include but are not limited to: subway cards, bus cards, access cards, credit cards, debit cards, stored-value cards, shopping cards, boarding passes, movie tickets, coupons, Student ID, social security card, membership card, passport, etc.
具体的,电子设备利用存储的NFC卡片信息模拟为NFC卡片。NFC卡片信息用于指示NFC卡片。NFC卡片信息例如可包括:门禁卡的唯一标识符(unity identification,UID)、公交卡的UID、银行卡的卡号等等。Specifically, the electronic device uses the stored NFC card information to simulate an NFC card. The NFC card information is used to indicate the NFC card. The NFC card information may include, for example, the unique identifier (UID) of the access card, the UID of the bus card, the card number of the bank card, and so on.
参考图1,图1示出了工作于卡仿真模式的电子设备和读卡器之间执行的NFC通信过程。该NFC通信过程可包括:Referring to FIG. 1, FIG. 1 shows an NFC communication process performed between an electronic device working in a card emulation mode and a card reader. The NFC communication process may include:
第一射频通信过程:电子设备侦测读卡器提供的射频场的过程;The first radio frequency communication process: the process of electronic equipment detecting the radio frequency field provided by the card reader;
第二射频通信过程:读卡器选中电子设备作为数据传输对象的过程;The second radio frequency communication process: the process in which the card reader selects the electronic device as the data transmission object;
第三射频通信过程:电子设备和读卡器进行数据传输的过程。The third radio frequency communication process: the process of data transmission between the electronic device and the card reader.
在上述图1所示的NFC通信过程顺利完成后,电子设备可以实现和实际的非接触式智 能卡片相同的功能,例如访问控制、非接触式支付、信息验证等等。其中,访问控制可包括开锁、开门禁等。信息验证可包括验证护照信息、优惠券信息、电影券信息等等。After the NFC communication process shown in Figure 1 above is successfully completed, the electronic device can realize the same functions as the actual contactless smart card, such as access control, contactless payment, information verification, and so on. Among them, access control can include unlocking, door opening, etc. Information verification may include verification of passport information, coupon information, movie coupon information, and so on.
在本申请以下实施例中,工作于卡仿真模式的电子设备和读卡器之间执行的NFC通信过程,也可以被称为刷卡过程。In the following embodiments of the present application, the NFC communication process performed between the electronic device working in the card emulation mode and the card reader may also be referred to as a card swiping process.
下面详细介绍该NFC通信过程。The NFC communication process is described in detail below.
(一)第一射频通信过程。(1) The first radio frequency communication process.
具体的,读卡器可以不间断或者周期性地发送频率为13.56兆赫兹(MHz)的射频信号,产生一个通过空间传播的电磁场,该电磁场即为读卡器提供的射频场。该射频场覆盖范围内的电子设备中天线的振荡电路在射频场的影响下起振,形成电压,电子设备根据该电压确定侦测到射频场。Specifically, the card reader can continuously or periodically send a radio frequency signal with a frequency of 13.56 megahertz (MHz) to generate an electromagnetic field propagating through space, which is the radio frequency field provided by the card reader. The oscillating circuit of the antenna in the electronic device within the coverage of the radio frequency field vibrates under the influence of the radio frequency field to form a voltage, and the electronic device determines to detect the radio frequency field according to the voltage.
电子设备执行第一射频通信过程之后,可以执行和读卡器之间的第二射频通信过程以及第三射频通信过程。在第二射频通信过程和第三射频通信过程中,电子设备基于侦测到的射频场和读卡器进行指令交互。进一步地,读卡器通过频率为13.56Mhz的载波向电子设备发送射频信号,电子设备通过负载调制技术向读卡器发送射频信号。射频信号中承载有指令,从而实现电子设备和读卡器之间的指令交互。After the electronic device executes the first radio frequency communication process, it can execute the second radio frequency communication process and the third radio frequency communication process with the card reader. In the second radio frequency communication process and the third radio frequency communication process, the electronic device performs command interaction with the card reader based on the detected radio frequency field. Further, the card reader sends a radio frequency signal to the electronic device through a carrier with a frequency of 13.56Mhz, and the electronic device sends a radio frequency signal to the card reader through a load modulation technology. The radio frequency signal carries instructions to realize the instruction interaction between the electronic device and the card reader.
(二)第二射频通信过程。(2) The second radio frequency communication process.
下面结合图1及图2描述第二射频通信过程。其中,图2示出了读卡器在执行和电子设备之间的NFC通信过程时的流程示意图。如图1及图2所示,第二射频通信过程具体可包括以下步骤1-6:The second radio frequency communication process will be described below in conjunction with FIG. 1 and FIG. 2. Among them, FIG. 2 shows a schematic flow diagram of the NFC communication process between the card reader and the electronic device. As shown in Figure 1 and Figure 2, the second radio frequency communication process may specifically include the following steps 1-6:
1、读卡器发送REQA(REQuest A)/WUPA(WakeUP A)。1. The reader sends REQA (REQuest A)/WUPA (WakeUP A).
具体的,读卡器可以不间断地基于生成的射频场发送REQA或WUPA。Specifically, the card reader can continuously send REQA or WUPA based on the generated radio frequency field.
REQA或WUPA用于指示射频场内的卡片回应自己的卡片类型。这里的卡片类型以卡片向读卡器发送信号的方式区分,可分为type A和type B。其中,type A类型的卡片通过13.65MHz的载波发送信号,编码方式为米勒(miller)编码,载波振幅调制方式为100%的振幅键控(amplitude-shift keying,ASK)。type B类型的卡片通过13.65MHz的载波发送信号,但编码方式为不归零法(nonreturn to zero,NRA),载波振幅调制方式为10%ASK。REQA or WUPA is used to instruct the card in the RF field to respond to its own card type. The card types here are distinguished by the way the card sends signals to the card reader, which can be divided into type A and type B. Among them, type A cards send signals through a 13.65 MHz carrier, the encoding method is Miller encoding, and the carrier amplitude modulation method is 100% amplitude-shift keying (ASK). Type B cards send signals through a 13.65MHz carrier, but the encoding method is nonreturn to zero (NRA), and the carrier amplitude modulation method is 10% ASK.
2、射频场覆盖范围内的所有卡片响应于接收到的REQA或WUPA,向读卡器发送ATQA(Answer To REQuest A)。2. In response to the received REQA or WUPA, all cards within the coverage of the radio frequency field send ATQA (Answer To REQuest A) to the reader.
射频场覆盖范围内的卡片可包括一个或多个。根据卡片的形态区分,卡片的类型可包括实际的非接触式智能卡片,例如公交卡、银行卡、门禁卡等,还可以包括工作在卡仿真模式下的电子设备。There may be one or more cards within the coverage of the radio frequency field. According to the morphology of the card, the type of the card can include actual non-contact smart cards, such as bus cards, bank cards, access control cards, etc., and can also include electronic devices working in card emulation mode.
当有多张卡片进入射频场覆盖范围时,读卡器将接收到多张卡片回复的ATQA。此时,读卡器将执行面向比特(bit)的防冲突处理,用于选出唯一的一张卡片进行通信。即,读卡器将执行以下步骤3-6。When multiple cards enter the coverage of the radio frequency field, the reader will receive ATQA from multiple cards. At this time, the card reader will perform bit-oriented anti-collision processing to select a unique card for communication. That is, the card reader will perform the following steps 3-6.
3、读卡器发送防冲突命令(single device detection,SDD),射频场覆盖范围内的所有卡片响应于防冲突命令,向读卡器发送自己的标识。该标识可以为卡片的唯一标识符(unity identification,UID)。3. The card reader sends an anti-collision command (single device detection, SDD), and all cards within the coverage of the radio frequency field send their own identification to the card reader in response to the anti-collision command. The identification may be a unique identifier (UID) of the card.
读卡器在步骤3中,设定cascade level 1。In step 3, the card reader sets cascade level 1.
4-6、多次执行防冲突循环(anticollision loop)处理:读卡器检测到冲突后,选择部分卡片向其发送选卡命令,用于指示该部分卡片继续发言、禁止其余卡片发言。4-6. Multiple execution of anti-collision loop (anticollision loop) processing: After the card reader detects a conflict, it selects some cards and sends a card selection command to it, which is used to instruct this part of the cards to continue speaking and prohibit the other cards from speaking.
经过多次防冲突循环处理后,仅剩下一张卡片时,不再有冲突。最终该卡片向读卡器发送自己的完整标识(例如UID)。读卡器向该卡片发送卡选择命令(SELECT),该卡片回复SAK后,该卡片被选中,读卡器可以和该卡片进行通信。After multiple anti-collision cycles, when only one card is left, there is no more conflict. Finally, the card sends its complete identification (such as UID) to the reader. The card reader sends a card selection command (SELECT) to the card. After the card responds to the SAK, the card is selected and the card reader can communicate with the card.
举例说明,读卡器检测到冲突是指:读卡器接收到多张卡片的标识后,可能这些卡片标识的前几位是一样的,比如前四位都是1010,第五位上有一张卡片是“0”而其他卡片是“1”,于是所有卡片在一起说自己的第五位标识的时候,由于有卡片说“0”,有卡片说“1”,读写器即可以检测出来发生了冲突。检测到冲突后,读写器通过选卡命令指示部分卡片继续发言,例如让标识前四位是“1010”,第五位是“1”的卡片继续发送自己的标识,禁止其他卡片发言。第五位是“1”的卡片继续发言,由于第五位是“1”的卡片不止一张,于是在这些卡片回送标识的过程中又发生了冲突,读写器仍然用上面的办法让冲突位(如第六位)是“1”的卡片继续发言,其他卡片禁止发言。最终经过多次的防冲突循环处理,当只剩下一张卡片的时候,就没有冲突了,即读卡器选中该卡片进行通信。For example, the conflict detected by the card reader means that after the card reader receives the identification of multiple cards, the first few digits of these card identifications may be the same, for example, the first four digits are all 1010, and there is one on the fifth digit. The card is "0" and the other cards are "1", so when all the cards say their fifth digit identification together, since some cards say "0" and others say "1", the reader can detect it There was a conflict. After detecting the conflict, the reader will instruct some cards to continue speaking through the card selection command, for example, let the card whose first four digits are "1010" and the fifth digit is "1" to continue to send its own identity, and other cards are prohibited from speaking. The card with “1” in the fifth place continues to speak. Since there are more than one card with “1” in the fifth place, there is a conflict in the process of returning the logo to these cards. The reader still uses the above method to make the conflict. The card whose bit (such as the sixth) is "1" continues to speak, and other cards are prohibited from speaking. Finally, after multiple anti-collision cycles, when there is only one card left, there is no conflict, that is, the card reader selects the card for communication.
可理解的,图1中读卡器选中的卡片为工作于卡仿真模式的电子设备。It is understandable that the card selected by the card reader in FIG. 1 is an electronic device working in a card emulation mode.
(三)第三射频通信过程。(3) The third radio frequency communication process.
读卡器选中工作于卡仿真模式的电子设备作为数据传输对象后,该读卡器和该电子设备可以执行第三射频通信过程。After the card reader selects the electronic device working in the card emulation mode as the data transmission object, the card reader and the electronic device can perform the third radio frequency communication process.
参考图2,第三射频通信过程可包括如下步骤7:Referring to FIG. 2, the third radio frequency communication process may include the following step 7:
7、如果该电子设备模拟的卡片的标识的格式符合ISO/IEC 14443-4定义的格式,则读卡器基于NFC标准ISO/IEC 14443-4开始处理相关指令。7. If the format of the identification of the card simulated by the electronic device conforms to the format defined by ISO/IEC 14443-4, the card reader starts to process related instructions based on the NFC standard ISO/IEC 14443-4.
具体的,ISO/IEC 14443-4定义了标准的卡片标识格式,具有标准格式标识的卡片可以基于ISO/IEC 14443-4和读卡器进行通信,不具有标准格式标识的卡片可以基于卡片厂商自主研发的私有协议和读卡器进行通信。Specifically, ISO/IEC 14443-4 defines a standard card identification format. Cards with standard format identification can communicate with the card reader based on ISO/IEC 14443-4, and cards without standard format identification can be based on the card manufacturer’s independent The developed proprietary protocol communicates with the card reader.
上述步骤1-步骤6,即第二射频通信过程基于NFC标准ISO/IEC 14443-3。ISO/IEC14443-3属于底层的握手协议。电子设备执行第二射频通信过程中的相关操作时,仅利用配置的的NFC芯片即可进行ISO/IEC 14443-3协议的解析,无需配置的处理器介入。The above steps 1 to 6, that is, the second radio frequency communication process is based on the NFC standard ISO/IEC 14443-3. ISO/IEC14443-3 belongs to the underlying handshake protocol. When the electronic device performs related operations in the second radio frequency communication process, only the configured NFC chip can perform the analysis of the ISO/IEC 14443-3 protocol without the intervention of the configured processor.
上述步骤7,即第三射频通信过程基于NFC标准ISO/IEC 14443-4。ISO/IEC 14443-4属于上层协议。当电子设备执行上述第三射频通信过程的相关操作时,需要利用处理器进行ISO/IEC 14443-3协议的解析。The above step 7, that is, the third radio frequency communication process is based on the NFC standard ISO/IEC 14443-4. ISO/IEC 14443-4 belongs to the upper layer protocol. When the electronic device performs the related operations of the third radio frequency communication process, it needs to use the processor to analyze the ISO/IEC 14443-3 protocol.
下面结合图1对上述步骤7进行展开描述。即详细描述工作于卡仿真模式的电子设备和读卡器基于ISO/IEC 14443-4执行的第三射频通信过程。The following is an expanded description of the above step 7 with reference to FIG. 1. That is to describe in detail the third radio frequency communication process performed by the electronic device and the card reader in the card emulation mode based on ISO/IEC 14443-4.
如图1所示,读卡器选中工作于卡仿真模式的电子设备之后,首先向工作于卡仿真模式的电子设备发送选卡回答命令(request answer to select,RATS)。As shown in Figure 1, after the card reader selects the electronic device operating in the card emulation mode, it first sends a card selection answer command (request answer to select, RATS) to the electronic device operating in the card emulation mode.
然后,电子设备向读卡器发送选卡回答(answer to select,ATS)。Then, the electronic device sends an answer to select (ATS) to the card reader.
RATS和ATS的目的是为了让读卡器和电子设备确认对方支持ISO/IEC 14443-4。通常情况下,RATS为读卡器选中电子设备作为数据传输对象之后,向该电子设备发送的第一条指令。The purpose of RATS and ATS is to allow readers and electronic devices to confirm that the other party supports ISO/IEC 14443-4. Normally, RATS is the first instruction sent to the electronic device after the card reader selects the electronic device as the data transmission object.
然后,读卡器可以和电子设备之间进行指令交互,从而交换信息,实现访问控制、非接触式支付、数据传输等功能。其中,读卡器和电子设备交换的信息包括:电子设备工作于卡仿真模式时,用于模拟为卡片的卡片信息,例如门禁卡标识、公交卡标识、银行卡卡号等。Then, the card reader can interact with the electronic device in order to exchange information and realize functions such as access control, contactless payment, and data transmission. Among them, the information exchanged by the card reader and the electronic device includes: card information used to simulate a card when the electronic device works in the card emulation mode, such as access card identification, bus card identification, bank card number, etc.
例如,电子设备模拟公交卡时,可以向读卡器发送自己的公交卡信息(例如UID),读卡器接收到公交卡信息后,可以和后台服务器进行通信。后台服务器对该UID对应的账户执行扣款处理,更新该账户对应的余额,记录本次刷卡的时间或地点等信息,从而完成支付。For example, when the electronic device simulates a bus card, it can send its own bus card information (such as UID) to the card reader. After the card reader receives the bus card information, it can communicate with the background server. The back-end server performs deduction processing on the account corresponding to the UID, updates the balance corresponding to the account, and records the time or location of this card swiping, thereby completing the payment.
又例如,电子设备模拟银行卡时,可以向读卡器发送自己的银行卡信息(例如银行卡号、银行卡密码),读卡器接收到该银行卡信息后,可以和后台服务器进行通信。后台服务器对该银行卡执行扣款处理,更新该银行卡的余额,记录本次刷卡的时间或地点等信息,从而完成支付。For another example, when the electronic device simulates a bank card, it can send its own bank card information (such as bank card number, bank card password) to the card reader, and after receiving the bank card information, the card reader can communicate with the background server. The back-end server performs deduction processing on the bank card, updates the balance of the bank card, and records the time or place of this card swiping, thereby completing the payment.
又例如,电子设备模拟会员卡时,可以向读卡器发送自己的会员卡信息(例如UID),读卡器接收到会员卡信息后,可以和后台服务器进行通信。后台服务器对该UID对应的账户执行扣款处理或积分处理,更新该账户对应的余额或积分值,记录本次刷卡的时间或地点等信息等等。For another example, when the electronic device simulates a membership card, it can send its own membership card information (such as UID) to the card reader. After the card reader receives the membership card information, it can communicate with the background server. The back-end server performs deduction processing or points processing on the account corresponding to the UID, updates the balance or point value corresponding to the account, and records the time or place of the card swiping.
在非接触式支付的场景下,即电子设备模拟为公交卡、银行卡或会员卡时,读卡器和后台服务器通信完成后,读卡器可以向电子设备发送消费指令,该消费指令用于指示刷卡完成或者交易成功。电子设备的NFC芯片可以接收到该消费指令,并执行以下操作:(1)NFC芯片将该消费指令传输至安全单元(secure element,SE),SE响应于该消费指令更新存储的数据,例如更新账户的余额或积分值、记录本次刷卡的时间或地点等。(2)SE响应于该消费指令将刷卡成功的事件上报给处理器。(3)SE响应于该消费指令生成消费指令应答,并通过NFC芯片将该消费指令应答发送给读卡器。至此,电子设备和读卡器成功刷卡。In the non-contact payment scenario, that is, when the electronic device is simulated as a bus card, bank card or membership card, after the card reader communicates with the background server, the card reader can send a consumption instruction to the electronic device. The consumption instruction is used for Indicates that the credit card is completed or the transaction is successful. The NFC chip of the electronic device can receive the consumption instruction and perform the following operations: (1) The NFC chip transmits the consumption instruction to a secure element (SE), and the SE updates the stored data in response to the consumption instruction, such as updating Account balance or point value, record the time or place of this card swipe, etc. (2) The SE reports the successful card swiping event to the processor in response to the consumption instruction. (3) The SE generates a consumption instruction response in response to the consumption instruction, and sends the consumption instruction response to the card reader through the NFC chip. At this point, the electronic device and the card reader have successfully swiped the card.
这里,上述提及的NFC芯片、SE、处理器均为电子设备的部件,后续实施例将详细描述这些部件的作用,在此暂不赘述。可理解的,除了上述举例描述的几类场景,在一些无需读卡器和后台服务器进行交互的简单场景下,电子设备和读卡器可以仅通过上述的步骤1-6来交换信息,从而实现访问控制、非接触式支付、数据传输等功能。也就是说,在一些场景下,电子设备和读卡器仅基于ISO/IEC 14443-3协议即可实现访问控制、非接触式支付、数据传输等功能,而不涉及ISO/IEC 14443-4协议。举例说明,电子设备模拟门禁卡时,通过步骤1-6向读卡器发送自己的门禁卡信息(例如UID),读卡器接收到门禁卡信息后,可以在本地验证该门禁卡的权限,如果该门禁卡有权限开锁,则读卡器可以指示开启门禁。Here, the above-mentioned NFC chip, SE, and processor are all components of an electronic device. Subsequent embodiments will describe the functions of these components in detail, and will not be repeated here. It is understandable that in addition to the several types of scenarios described in the above examples, in some simple scenarios that do not require the card reader to interact with the back-end server, the electronic device and the card reader can only exchange information through the above steps 1-6 to achieve Access control, contactless payment, data transmission and other functions. That is to say, in some scenarios, electronic devices and card readers can realize access control, contactless payment, data transmission and other functions based on ISO/IEC 14443-3 protocol only, without involving ISO/IEC 14443-4 protocol . For example, when an electronic device simulates an access control card, it sends its own access control card information (such as UID) to the card reader through steps 1-6. After the card reader receives the access control card information, it can verify the permissions of the access control card locally. If the access card has permission to unlock, the card reader can instruct to open the door.
可理解的,图1及图2仅为示例,具体实现中,工作于卡仿真模式的电子设备和读卡器之间的通信过程可参照ISO/IEC 14443-3以及ISO/IEC 14443-4,可以包括更多或者更少的交互指令。It is understandable that Figures 1 and 2 are only examples. In specific implementation, the communication process between the electronic device and the card reader working in card emulation mode can refer to ISO/IEC 14443-3 and ISO/IEC 14443-4. Can include more or fewer interactive instructions.
可理解的,电子设备收发射频信号的性能必须要良好,才能顺利完成图1或图2所示的电子设备和读卡器之间的NFC通信过程,从而保证刷卡成功。电子设备收发射频信号的性能越好,电子设备和读卡器之间的NFC通信成功率越高,即刷卡成功率越高。It is understandable that the performance of the electronic device for sending and receiving radio frequency signals must be good to successfully complete the NFC communication process between the electronic device and the card reader shown in FIG. 1 or FIG. 2 to ensure the success of the card swipe. The better the performance of the electronic device to send and receive radio frequency signals, the higher the success rate of NFC communication between the electronic device and the card reader, that is, the higher the success rate of card swiping.
电子设备收发射频信号的性能可包括但不限于:电子设备接收射频信号时的稳定性、持续性、强度;电子设备发送射频信号时的稳定性、持续性、强度。The performance of the electronic equipment to receive and transmit radio frequency signals may include, but is not limited to: the stability, continuity, and strength of the electronic equipment when receiving radio frequency signals; the stability, continuity, and strength of the electronic equipment when sending radio frequency signals.
电子设备工作于卡仿真模式时,影响电子设备收发射频信号的性能的因素,即影响NFC通信成功率和刷卡成功率的因素可包括以下两个:When the electronic device is working in the card emulation mode, the factors that affect the performance of the electronic device to send and receive radio frequency signals, that is, the factors that affect the success rate of NFC communication and the success rate of card swiping can include the following two:
1、读卡器的硬件结构。1. The hardware structure of the card reader.
在本申请实施例中,读卡器的种类有多种。读卡器可包括但不限于以下几种类型:地铁读卡器、公交读卡器、银行卡读卡器(例如POS机)、门禁读卡器等等。读卡器可以和对应类型的卡片进行通信,从而完成访问控制、非接触式支付等功能。例如,地铁卡读卡器可以和地铁卡通信,公交读卡器可以和公交卡通信。In the embodiment of this application, there are multiple types of card readers. Card readers may include but are not limited to the following types: subway card readers, bus card readers, bank card readers (such as POS machines), access control card readers, and so on. The card reader can communicate with corresponding types of cards to complete functions such as access control and contactless payment. For example, a metro card reader can communicate with a metro card, and a bus reader can communicate with a bus card.
目前,读卡器没有统一的制造标准,不同的生产厂家制造的读卡器、不同种类的读卡器的硬件结构都可能不同。读卡器的硬件结构可包括读卡器内天线的耦合方式、金属材质、制造工艺、内部形状等等。At present, there is no uniform manufacturing standard for card readers, and the hardware structures of card readers and different types of card readers manufactured by different manufacturers may be different. The hardware structure of the card reader may include the coupling mode of the antenna in the card reader, metal material, manufacturing process, internal shape, and so on.
读卡器的硬件结构会影响电子设备收发射频信号的性能。同一电子设备和具有不同硬件结构的读卡器通信时,该电子设备收发射频信号的性能不同。The hardware structure of the card reader will affect the performance of the electronic device to send and receive radio frequency signals. When the same electronic device communicates with card readers with different hardware structures, the electronic device has different radio frequency signal performance.
2、电子设备配置的射频参数。2. The radio frequency parameters of the electronic equipment configuration.
射频参数可包括以下一项或多项:电子设备接收射频信号时的灵敏度、门限值、接收电路的输入电压;电子设备发送射频信号时所使用的帧延迟时间(frame delay time)、负载调制时所使用的调制模式、载波的波形、载波的幅度以及载波的相位等等。RF parameters can include one or more of the following: sensitivity, threshold, and input voltage of the receiving circuit when the electronic device receives the RF signal; frame delay time and load modulation used by the electronic device to send the RF signal The modulation mode, carrier waveform, carrier amplitude and phase of the carrier, etc.
具体的,电子设备接收射频信号的灵敏度可以通过调节电子设备中低噪音放大器(low noise amplifier,LNA)的增益(gain)来进行配置。门限值设置的越高,电子设备接收射频信号的稳定性越高,但灵敏度降低。电子设备的接收电路包含自动增益控制(auto gain control,AGC)电路,其通过调整电阻分压从而进行接收信号的衰减,得到最优的接收输入电压。Specifically, the sensitivity of the electronic device to receive radio frequency signals can be configured by adjusting the gain of a low noise amplifier (LNA) in the electronic device. The higher the threshold is set, the higher the stability of the radio frequency signal received by the electronic device, but the lower the sensitivity. The receiving circuit of the electronic device includes an automatic gain control (AGC) circuit, which attenuates the received signal by adjusting the resistor divider to obtain the optimal received input voltage.
具体的,电子设备可以将要发送的原始信息通过调制模式调制到射频参数中提供的载波的波形、幅度以及相位所对应的载波上,生成对应的射频信号,然后将该射频信号发送出去。其中,调制模式按输入输出方式可以分为以下四种:双端输入双端输出、双端输入单端输出、单端输入双端输出和单端输入单端输出。电子设备可依据帧延迟时间来发送生成的射频信号。Specifically, the electronic device can modulate the original information to be sent on the carrier wave corresponding to the waveform, amplitude, and phase of the carrier provided in the radio frequency parameters through a modulation mode, generate a corresponding radio frequency signal, and then send the radio frequency signal. Among them, the modulation mode can be divided into the following four types according to the input and output modes: double-ended input and double-ended output, double-ended input and single-ended output, single-ended input and double-ended output, and single-ended input and single-ended output. The electronic device can transmit the generated radio frequency signal according to the frame delay time.
电子设备使用配置的射频参数来执行上述和读卡器之间的NFC通信过程。在第一射频通信过程中,电子设备可使用灵敏度、门限值、接收电路的输入电压来侦测射频场。在第二射频通信过程和第三射频通信过程中,电子设备使用灵敏度、门限值、接收电路的输入电压来检测读卡器发送的射频信号,使用负载调制时所使用的调制模式、载波的波形、载波的幅度以及载波的相位来生成射频信号,使用帧延迟时间(frame delay time)来发送生成的射频信号。The electronic device uses the configured radio frequency parameters to perform the above-mentioned NFC communication process with the card reader. In the first radio frequency communication process, the electronic device can use the sensitivity, threshold value, and input voltage of the receiving circuit to detect the radio frequency field. In the second radio frequency communication process and the third radio frequency communication process, the electronic equipment uses the sensitivity, threshold value, and input voltage of the receiving circuit to detect the radio frequency signal sent by the card reader, and uses the modulation mode and carrier frequency used for load modulation. The waveform, the amplitude of the carrier wave, and the phase of the carrier wave are used to generate the radio frequency signal, and the frame delay time is used to transmit the generated radio frequency signal.
可理解的,电子设备配置不同的射频参数时,电子设备收发射频信号的性能不同。It is understandable that when the electronic device is configured with different radio frequency parameters, the performance of the electronic device for sending and receiving radio frequency signals is different.
读卡器出厂并投入使用之后,其硬件结构基本固定。在和该读卡器进行NFC通信时,只有使用特殊的射频参数的电子设备才可以保证收发射频信号的性能。这里,同时考虑读卡器的硬件结构和射频参数对电子设备收发射频信号的影响,对于一个固定硬件结构的读 卡器,电子设备使用特殊的射频参数来执行NFC通信过程中的相关操作时,能够保证电子设备收发射频信号的性能。该特殊的射频参数可以被称为和该读卡器适配或者兼容的射频参数。After the card reader leaves the factory and is put into use, its hardware structure is basically fixed. When performing NFC communication with the card reader, only electronic devices that use special RF parameters can guarantee the performance of sending and receiving RF signals. Here, consider the influence of the reader’s hardware structure and RF parameters on the RF signal sent and received by the electronic device. For a reader with a fixed hardware structure, when the electronic device uses special RF parameters to perform related operations in the NFC communication process, It can ensure the performance of the electronic equipment to send and receive radio frequency signals. The special radio frequency parameters may be referred to as radio frequency parameters adapted or compatible with the card reader.
目前,在现有技术中,工作于卡仿真模式的电子设备在执行和读卡器之间的NFC通信过程时,所使用的射频参数通常包括以下两种情况:At present, in the prior art, when an electronic device working in a card emulation mode performs an NFC communication process with a card reader, the radio frequency parameters used usually include the following two situations:
第1种情况:电子设备在任意场景、任意地点下都使用预置的射频参数来执行NFC通信过程中的相关操作。该预置的射频参数是经过大量测试所得到的,该预置射频参数可以和市面上尽可能多的读卡器兼容或者适配。Case 1: The electronic device uses preset radio frequency parameters to perform related operations in the NFC communication process in any scene and any place. The preset radio frequency parameters are obtained through a large number of tests, and the preset radio frequency parameters can be compatible or adapted with as many card readers on the market as possible.
在第1种情况下,由于读卡器种类繁多,且生产厂家众多,该预置射频参数不能和市面上所有的读卡器兼容或者适配。例如,用户可能在A地点使用电子设备刷卡成功,但是在B地点使用电子设备刷卡时,可能会出现收发射频信号不稳定的情况,导致刷卡失败。这样会影响用户体验。In the first case, due to the wide variety of card readers and numerous manufacturers, the preset radio frequency parameters cannot be compatible or adapted to all card readers on the market. For example, a user may use an electronic device to swipe the card successfully at location A, but when using an electronic device to swipe the card at location B, the receiving and sending of radio frequency signals may be unstable, causing the card to fail. This will affect the user experience.
第2种情况:电子设备可以使用和当前地点对应的射频参数来执行NFC通信过程中的相关操作。电子设备可以从云端获取和当前地点对应的射频参数。同一地点的读卡器可能来自同一厂家或者应用于同一场景,因此同一地点的读卡器的硬件结构有一定的相似性。和某地点对应的射频参数为经过大量测试所得到的、可以和该地点中尽可能多的读卡器兼容或者适配的射频参数。Case 2: The electronic device can use the radio frequency parameters corresponding to the current location to perform related operations in the NFC communication process. The electronic device can obtain radio frequency parameters corresponding to the current location from the cloud. The card readers in the same place may come from the same manufacturer or used in the same scene, so the hardware structure of the card readers in the same place has certain similarities. The radio frequency parameter corresponding to a certain place is the radio frequency parameter obtained after a large number of tests, which can be compatible or adapted with as many card readers in this place as possible.
在第2种情况下,由于读卡器种类繁多,且生产厂家众多,电子设备使用和当前地点对应的射频参数来收发射频信号时,仍然不能和当前地点下所有的读卡器兼容或者适配。例如,用户在A地点使用电子设备刷卡时,可能在A地点的部分读卡器上刷卡成功,在A地点的部分读卡器上刷卡失败。In the second case, due to the wide variety of card readers and numerous manufacturers, when electronic devices use the radio frequency parameters corresponding to the current location to send and receive radio frequency signals, they still cannot be compatible or adapted to all card readers in the current location . For example, when a user uses an electronic device to swipe a card at a location A, he may successfully swipe the card on some card readers at A location, but fail to swipe a card on some readers at A location.
基于现有技术的不足,本申请实施例提供了基于NFC的通信方法及装置。在该基于NFC的通信方法中,电子设备工作于卡仿真模式。在因为电子设备收发射频信号的性能较差而导致NFC通信过程执行失败的情况下,电子设备可以调整当前使用的射频参数,并使用调整后的射频参数重新执行和读卡器之间的NFC通信过程。这样可以调整电子设备收发射频信号的性能,从而提升刷卡成功率。Based on the shortcomings of the prior art, embodiments of the present application provide a communication method and device based on NFC. In this NFC-based communication method, the electronic device works in a card emulation mode. In the case that the NFC communication process fails due to the poor performance of the electronic device to send and receive RF signals, the electronic device can adjust the currently used RF parameters and use the adjusted RF parameters to re-execute the NFC communication with the card reader process. In this way, the performance of the radio frequency signal sent and received by the electronic device can be adjusted, thereby increasing the success rate of swiping the card.
本申请实施例提供的方法可以应用到工作于卡仿真模式的电子设备。该电子设备模拟的卡片的类型可包括但不限于:地铁卡、公交卡、门禁卡、信用卡、借记卡、储值卡、购物卡、登机牌、电影票、优惠券、学生证、社保卡、会员卡、护照等等。该电子设备中存储有用于模拟为NFC卡片的卡片信息。卡片信息例如可包括门禁卡的标识(例如UID)、公交卡的标识(例如UID)、银行卡的卡号等等。The method provided in the embodiment of the present application can be applied to an electronic device working in a card emulation mode. The types of cards simulated by the electronic device may include, but are not limited to: subway cards, bus cards, access cards, credit cards, debit cards, stored value cards, shopping cards, boarding passes, movie tickets, coupons, student cards, social security Cards, membership cards, passports, etc. The electronic device stores card information used to simulate an NFC card. The card information may include, for example, the identification of an access card (such as UID), the identification of a bus card (such as UID), the card number of a bank card, and so on.
在本申请实施例中,电子设备模拟为NFC卡片的方式可包括以下2种:In the embodiment of the present application, the manner in which the electronic device is simulated as an NFC card may include the following two types:
1、电子设备复制实体卡片,即存储实体卡片的卡片信息后,利用NFC技术执行和读卡器之间的NFC通信过程。电子设备在该NFC通信过程中,和读卡器交换该实体卡片的卡片信息,从而完成刷卡。电子设备可以通过NFC技术复制实体卡片。实体卡片可包括但不限于:实体的地铁卡、公交卡、银行卡、门禁卡、社保卡、会员卡、护照或其他类型的实体卡片等。1. The electronic device copies the physical card, that is, after storing the card information of the physical card, it uses NFC technology to execute the NFC communication process with the card reader. During the NFC communication process, the electronic device exchanges the card information of the physical card with the card reader to complete the card swiping. Electronic devices can replicate physical cards through NFC technology. Physical cards may include, but are not limited to: physical subway cards, bus cards, bank cards, access cards, social security cards, membership cards, passports, or other types of physical cards.
2、电子设备存储电子卡片的卡片信息后,利用NFC技术执行和读卡器之间的NFC通信过程。电子设备在该NFC通信过程中,和读卡器交换该电子卡片的卡片信息,从而完成刷卡。电子卡片是虚拟的而非实体的。电子卡片可包括但不限于:虚拟的地铁卡、公交卡、银行卡、门禁卡、社保卡、会员卡、护照或其他类型的电子卡片等。2. After the electronic device stores the card information of the electronic card, it uses NFC technology to execute the NFC communication process with the card reader. During the NFC communication process, the electronic device exchanges the card information of the electronic card with the card reader to complete the card swiping. E-cards are virtual rather than physical. Electronic cards may include, but are not limited to: virtual subway cards, bus cards, bank cards, access cards, social security cards, membership cards, passports or other types of electronic cards, etc.
下面结合图3详细描述本申请实施例提供的基于NFC的通信方法。参考图3,图3为本申请实施例提供的基于NFC的通信方法的流程示意图。如图3所示,该方法可包括如下步骤:The following describes in detail the NFC-based communication method provided by the embodiment of the present application with reference to FIG. 3. Referring to FIG. 3, FIG. 3 is a schematic flowchart of the NFC-based communication method provided by an embodiment of the application. As shown in Figure 3, the method may include the following steps:
步骤S110、电子设备工作于卡仿真模式,并使用第一射频参数执行电子设备与读卡器之间的NFC通信过程。Step S110, the electronic device works in the card emulation mode, and uses the first radio frequency parameter to execute the NFC communication process between the electronic device and the card reader.
电子设备与读卡器之间的NFC通信过程可参照前文实施例的相关描述。该NFC通信过程可包括第一射频通信过程、第二射频通信过程和第三射频通信过程。For the NFC communication process between the electronic device and the card reader, reference may be made to the related description of the foregoing embodiment. The NFC communication process may include a first radio frequency communication process, a second radio frequency communication process, and a third radio frequency communication process.
电子设备可以采用以下两种策略来执行第一射频通信过程,即采用以下两种策略来侦测读卡器提供的射频场:The electronic device can use the following two strategies to perform the first radio frequency communication process, that is, use the following two strategies to detect the radio frequency field provided by the card reader:
策略一:电子设备在处于亮屏并且解锁状态时,周期性侦测读卡器提供的射频场;电子设备在处于熄屏状态、锁屏状态或者关机状态时,持续性侦测读卡器提供的射频场。使用策略一,电子设备可以在任意状态下执行第一射频通信过程,即电子设备可以在任意状态下执行本申请实施例提供的基于NFC的通信方法。Strategy 1: When the electronic device is in the on-screen and unlocked state, periodically detect the radio frequency field provided by the card reader; when the electronic device is in the off-screen state, locked-screen state or shut down state, continuously detect the card reader provides的RF field. Using strategy one, the electronic device can execute the first radio frequency communication process in any state, that is, the electronic device can execute the NFC-based communication method provided in the embodiment of the present application in any state.
策略二:电子设备响应于接收到的用户操作,侦测读卡器提供的射频场。即,电子设备在用户的触发下侦测读卡器提供的射频场。Strategy 2: The electronic device detects the radio frequency field provided by the card reader in response to the received user operation. That is, the electronic device detects the radio frequency field provided by the card reader under the trigger of the user.
参考图4,图4示出了本申请实施例提供的人机交互示意图。如图4的a所示,用户界面41可以是电子设备上安装的钱包应用提供的一个用户界面。钱包为用于管理信用卡、借记卡、储值卡、购物卡、登机牌、电影票、优惠券、学生证或其他卡券的应用。如a所示,用户界面41中包括多个电子设备可以模拟的多个卡片的图片,例如银行卡的图片、公交卡的图片、地铁卡的图片等。用户可以点击任意卡片的图片,触发电子设备模拟该图片所对应的卡片。示例性地,用户可以点击公交卡的图片401,响应于该操作,电子设备显示如图4的b所示的用户界面,并开始侦测读卡器提供的射频场,从而模拟为公交卡。可理解的,使用策略二,电子设备根据用户需要来侦测读卡器提供的射频场,可以节约功耗。Referring to FIG. 4, FIG. 4 shows a schematic diagram of human-computer interaction provided by an embodiment of the present application. As shown in a of FIG. 4, the user interface 41 may be a user interface provided by a wallet application installed on an electronic device. The wallet is an application used to manage credit cards, debit cards, stored value cards, shopping cards, boarding passes, movie tickets, coupons, student ID cards, or other card coupons. As shown in a, the user interface 41 includes pictures of multiple cards that can be simulated by multiple electronic devices, such as pictures of bank cards, pictures of public transportation cards, pictures of subway cards, and so on. The user can click the picture of any card to trigger the electronic device to simulate the card corresponding to the picture. Exemplarily, the user can click the picture 401 of the bus card. In response to this operation, the electronic device displays the user interface as shown in b of FIG. 4 and starts to detect the radio frequency field provided by the card reader to simulate the bus card. Understandably, the second use strategy is that the electronic device detects the radio frequency field provided by the card reader according to the user's needs, which can save power consumption.
在本申请实施例中,当电子设备进入读卡器提供的射频场的覆盖范围时,即可侦测到该读卡器提供的射频场。In the embodiment of the present application, when the electronic device enters the coverage of the radio frequency field provided by the card reader, the radio frequency field provided by the card reader can be detected.
在步骤S110中,电子设备使用第一射频参数来执行电子设备与读卡器之间的NFC通信过程。在一些实施例中,第一射频参数可以是电子设备在预先存储的N套射频参数中选择的任意一套射频参数。在另一些实施例中,第一射频参数可以是电子设备预先存储的N套射频参数中,刷卡成功率最高的一套射频参数。In step S110, the electronic device uses the first radio frequency parameter to perform the NFC communication process between the electronic device and the card reader. In some embodiments, the first radio frequency parameter may be any set of radio frequency parameters selected by the electronic device from N sets of radio frequency parameters stored in advance. In other embodiments, the first radio frequency parameter may be the set of radio frequency parameters with the highest success rate of card swiping among the N sets of radio frequency parameters pre-stored by the electronic device.
具体的,电子设备预先存储有N套射频参数。N为大于或等于一的正整数。在一些实施例中,电子设备可以根据刷卡成功率,由高到低依次存储该N套射频参数。每一套射频参数包括的参数项可参照前文实施例的相关描述,这里不再赘述。在本申请实施例中,电子设备预先存储的N套射频参数可通过以下两种方式获取:Specifically, the electronic device stores N sets of radio frequency parameters in advance. N is a positive integer greater than or equal to one. In some embodiments, the electronic device may store the N sets of radio frequency parameters in order from high to low according to the card swiping success rate. For the parameter items included in each set of radio frequency parameters, reference may be made to the relevant description in the foregoing embodiment, and details are not described herein again. In the embodiment of the present application, the N sets of radio frequency parameters pre-stored by the electronic device can be obtained in the following two ways:
1、电子设备预先存储的N套射频参数可以是在电子设备出厂时预置在该电子设备中的。具体的,研发人员可以通过测试或其他方式来获取和市面上大部分读卡器适配或者兼容的N套射频参数,并将该N套射频参数预置在电子设备中。1. The N sets of radio frequency parameters pre-stored in the electronic device may be preset in the electronic device when the electronic device leaves the factory. Specifically, R&D personnel can obtain N sets of radio frequency parameters that are adapted or compatible with most card readers on the market through testing or other methods, and preset the N sets of radio frequency parameters in the electronic device.
2、电子设备预先存储的N套射频参数可以是电子设备从云端服务器处获取的。具体的,云端服务器可以根据各个电子设备上报的数据,统计各套射频参数对应的刷卡成功率。云端服务器可以周期性地将刷卡成功率最高的N套射频参数下发至电子设备。云端服务器统计各套射频参数对应的刷卡成功率的方式可参考后续实施例的相关描述,在此暂不赘述。2. The N sets of radio frequency parameters pre-stored by the electronic device may be obtained by the electronic device from the cloud server. Specifically, the cloud server may calculate the card swipe success rate corresponding to each set of radio frequency parameters based on the data reported by each electronic device. The cloud server can periodically issue the N sets of radio frequency parameters with the highest card swiping success rate to the electronic device. The manner in which the cloud server counts the card swiping success rate corresponding to each set of radio frequency parameters can refer to the related description in the subsequent embodiments, and will not be repeated here.
步骤S120、电子设备判断是否由于收发射频信号的性能较差,而导致电子设备与读卡器之间的NFC通信过程执行失败。Step S120: The electronic device determines whether the performance of the NFC communication between the electronic device and the card reader fails due to poor performance of receiving and sending radio frequency signals.
可理解的,电子设备工作于卡仿真模式时,该电子设备收发射频信号的性能是影响电子设备与读卡器之间的NFC通信过程执行的重要因素,即该电子设备收发射频信号的性能影响到刷卡成功率。如果电子设备收发射频信号的性能较好,则电子设备与读卡器之间的NFC通信过程可以顺利执行,即刷卡成功。如果电子设备收发射频信号的性能较差,则无法顺利执行电子设备与读卡器之间的NFC通信过程,即刷卡失败。It is understandable that when the electronic device is working in the card emulation mode, the performance of the electronic device to send and receive radio frequency signals is an important factor affecting the execution of the NFC communication process between the electronic device and the card reader, that is, the performance of the electronic device to receive and send radio frequency signals To the success rate of credit card. If the electronic device has good performance in receiving and sending radio frequency signals, the NFC communication process between the electronic device and the card reader can be executed smoothly, that is, the card swipe is successful. If the performance of the electronic device to send and receive radio frequency signals is poor, the NFC communication process between the electronic device and the card reader cannot be executed smoothly, that is, the card swiping fails.
在本申请实施例中,电子设备可以通过以下几种方式,来判断是否由于收发射频信号的性能较差而导致电子设备与读卡器之间的NFC通信过程执行失败:In the embodiment of the present application, the electronic device can determine whether the NFC communication process between the electronic device and the card reader fails due to the poor performance of receiving and sending radio frequency signals in the following ways:
1、电子设备在首次侦测到射频场后的时间段T1内,如果电子设备检测到射频场强度低于阈值的次数大于第一值,或者,电子设备检测到射频场强度低于阈值的时长大于第二值,则确定当前由于电子设备收发射频信号的性能较差而导致电子设备与读卡器之间的NFC通信过程执行失败。其中,T1、阈值、第一值、第二值均可以预先设置。1. In the time period T1 after the electronic device detects the RF field for the first time, if the number of times the electronic device detects that the RF field strength is lower than the threshold is greater than the first value, or the electronic device detects the RF field strength is lower than the threshold for the duration If the value is greater than the second value, it is determined that the current NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals. Among them, T1, the threshold, the first value, and the second value can all be preset.
具体的,如果电子设备多次或者长时间检测到的射频场的强度低于阈值,则可以看作电子设备不能持续且稳定地侦测到射频场,那么电子设备无法持续且稳定地接收到读卡器发送的射频信号,也不能持续且稳定地向读卡器发送射频信号,即电子设备收发射频信号的性能较差。在这种情况下,电子设备不能顺利地执行与读卡器之间的NFC通信过程,即不能刷卡成功。Specifically, if the intensity of the radio frequency field detected by the electronic device many times or for a long time is lower than the threshold, it can be regarded that the electronic device cannot detect the radio frequency field continuously and stably, and the electronic device cannot continuously and stably receive the reading. The radio frequency signal sent by the card reader cannot continuously and stably send the radio frequency signal to the card reader, that is, the performance of the electronic device to send and receive radio frequency signals is poor. In this case, the electronic device cannot smoothly perform the NFC communication process with the card reader, that is, the card cannot be swiped successfully.
参考图5,图5示出了一种可能的电子设备侦测到的射频信号的强度示意图。在图5所示的情况下,电子设备无法稳定地侦测到射频场,收发射频信号的性能较差,不能顺利地执行与读卡器之间的NFC通信过程。Referring to FIG. 5, FIG. 5 shows a possible schematic diagram of the strength of the radio frequency signal detected by the electronic device. In the situation shown in FIG. 5, the electronic device cannot detect the radio frequency field stably, the performance of receiving and sending radio frequency signals is poor, and the NFC communication process with the card reader cannot be executed smoothly.
2、在电子设备首次侦测到射频场后的时间段T2(例如3秒)内,如果与读卡器之间的第二射频通信过程没有成功执行,即电子设备没有执行完上述图1或图2中关于ISO/IEC14443-3协议的相关操作时,则确定当前由于电子设备收发射频信号的性能较差而导致电子设备与读卡器之间的NFC通信过程执行失败。T2可以预先设置。2. In the time period T2 (for example, 3 seconds) after the electronic device detects the radio frequency field for the first time, if the second radio frequency communication process with the card reader is not successfully executed, that is, the electronic device has not finished executing the above-mentioned Figure 1 or For the related operations of the ISO/IEC14443-3 protocol in FIG. 2, it is determined that the current NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals. T2 can be preset.
具体的,ISO/IEC 14443-3协议的解析由电子设备的NFC芯片执行,无需处理器介入。电子设备在基于ISO/IEC 14443-3协议执行与读卡器之间的第二射频通信过程时,该电子设备本身无法感知到是否接收到或者是否发送了基于ISO/IEC 14443-3协议的相关指令。电子设备不能获知当前正在执行与读卡器之间的第二射频通信过程中的哪一步,也不能判断当前是否成功执行完与读卡器之间的第二射频通信过程。Specifically, the analysis of the ISO/IEC 14443-3 protocol is performed by the NFC chip of the electronic device without the intervention of the processor. When the electronic device performs the second radio frequency communication process with the card reader based on the ISO/IEC 14443-3 protocol, the electronic device itself cannot perceive whether it has received or sent the relevant ISO/IEC 14443-3 protocol. instruction. The electronic device cannot know which step of the second radio frequency communication process with the card reader is currently being executed, nor can it determine whether the second radio frequency communication process with the card reader has been successfully executed.
电子设备执行完与读卡器之间的第二射频通信过程后,开始执行与读卡器之间的第三 射频通信过程。电子设备与读卡器之间的第三射频通信过程基于ISO/IEC 14443-4协议,ISO/IEC 14443-4协议的解析需要由电子设备的处理器执行,因此,电子设备能够根据是否接收到基于ISO/IEC 14443-4协议的相关指令,来获知当前是否开始执行与读卡器之间的第三射频通信过程。After the electronic device completes the second radio frequency communication process with the card reader, it starts to execute the third radio frequency communication process with the card reader. The third radio frequency communication process between the electronic device and the card reader is based on the ISO/IEC 14443-4 protocol. The analysis of the ISO/IEC 14443-4 protocol needs to be executed by the processor of the electronic device. Therefore, the electronic device can receive Based on the relevant instructions of the ISO/IEC 14443-4 protocol, to know whether the third radio frequency communication process with the card reader is currently started.
也就是说,在第2种判断方式中,在首次侦测到射频场后的时间段T2内,如果电子设备没有接收到基于ISO/IEC 14443-4协议的相关指令,则可以看作电子设备没有执行完上述与读卡器之间的第二射频通信过程。在一种具体的实施方式中,如果电子设备在首次侦测到射频场后的时间段T2内,没有接收到图2实施例中提及的基于ISO/IEC 14443-4协议的RATS命令,则可以看作电子设备没有执行完上述与读卡器之间的第二射频通信过程。That is to say, in the second judgment method, in the time period T2 after the first detection of the radio frequency field, if the electronic device does not receive the relevant instructions based on the ISO/IEC 14443-4 protocol, it can be regarded as an electronic device The second radio frequency communication process with the card reader has not been completed. In a specific implementation, if the electronic device does not receive the RATS command based on the ISO/IEC 14443-4 protocol mentioned in the embodiment of FIG. 2 within the time period T2 after the first detection of the radio frequency field, then It can be considered that the electronic device has not completed the second radio frequency communication process with the card reader.
3、在电子设备首次侦测到射频场后的时间段T3内,如果与读卡器之间的第三射频通信过程没有成功执行,即电子设备没有执行完上述图1或图2中关于ISO/IEC 14443-4协议的相关操作时,则确定当前由于电子设备收发射频信号的性能较差而导致电子设备与读卡器之间的NFC通信过程执行失败。T3可以预先设置。3. In the time period T3 after the electronic device detects the radio frequency field for the first time, if the third radio frequency communication process with the card reader is not successfully executed, that is, the electronic device has not completed the ISO in Figure 1 or Figure 2 above. /IEC 14443-4 protocol related operations, it is determined that the current NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals. T3 can be preset.
具体的,电子设备与读卡器之间的第三射频通信过程基于ISO/IEC 14443-4协议,ISO/IEC 14443-4协议的解析需要由电子设备的处理器执行。因此,电子设备可以根据收发的射频信号来判断当前正在执行与读卡器之间的第三射频通信过程中的哪一步,以及,判断当前是否顺利执行完与读卡器之间的第三射频通信过程。Specifically, the third radio frequency communication process between the electronic device and the card reader is based on the ISO/IEC 14443-4 protocol, and the analysis of the ISO/IEC 14443-4 protocol needs to be executed by the processor of the electronic device. Therefore, the electronic device can determine which step in the third radio frequency communication process with the card reader is currently being executed according to the received and received radio frequency signals, and determine whether the third radio frequency communication with the card reader has been successfully executed. Communication process.
在一个具体的实施例中,若电子设备在首次侦测到射频场后的时间段T3内,没有接收到读卡器发送的消费指令,则可以看作电子设备没有执行完上述与读卡器之间的第三射频通信过程。In a specific embodiment, if the electronic device does not receive the consumption instruction sent by the card reader within the time period T3 after detecting the radio frequency field for the first time, it can be considered that the electronic device has not completed the above and the card reader. The third radio frequency communication process between.
4、在电子设备接收到NAK指令时,确定当前由于电子设备收发射频信号的性能较差而导致电子设备与读卡器之间的NFC通信过程执行失败。4. When the electronic device receives the NAK instruction, it is determined that the current NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals.
在一些实施例中,工作于卡仿真模式的电子设备和读卡器通信时,如果读卡器出现侧未接收到指令、接收到的指令不全或错误等情况,则读卡器可以向电子设备发送否定应答(negative acknowledgment,NAK)指令。该NAK指令用于指示电子设备重新发送上一次发送的指令。电子设备的NFC芯片可以接收到该NAK指令,并重新发送上一次发送的指令。这种重发机制可以保证电子设备和读卡器之间的数据传输顺利进行。In some embodiments, when the electronic device working in the card emulation mode communicates with the card reader, if the card reader does not receive instructions, the received instructions are incomplete, or errors, etc., the card reader can report to the electronic device Send a negative acknowledgment (NAK) command. The NAK command is used to instruct the electronic device to resend the command sent last time. The NFC chip of the electronic device can receive the NAK command and resend the command sent last time. This retransmission mechanism can ensure smooth data transmission between the electronic device and the card reader.
读卡器侧出现的未接收到指令、接收到的指令不全或错误等情况,可能是由于电子设备收发射频信号的性能较差而导致的。因此,电子设备接收到NAK指令后,可以认为当前电子设备收发射频信号的性能较差,可能导致电子设备与读卡器之间的NFC通信过程执行失败。Situations such as failure to receive instructions, incomplete instructions or errors on the card reader side may be caused by the poor performance of the electronic device to send and receive radio frequency signals. Therefore, after the electronic device receives the NAK instruction, it can be considered that the current electronic device has poor performance in receiving and sending radio frequency signals, which may cause the execution of the NFC communication process between the electronic device and the card reader to fail.
具体实现中,电子设备的NFC芯片接收到该NAK指令后,可以将该NAK指令上报给处理器,以使得处理器获知当前电子设备收发射频信号的性能较差。In a specific implementation, after receiving the NAK instruction, the NFC chip of the electronic device can report the NAK instruction to the processor, so that the processor knows that the current electronic device has poor performance in receiving and sending radio frequency signals.
5、在电子设备无法解析接收到的指令,或者,电子设备解析到的指令的内容异常时,确定当前由于电子设备收发射频信号的性能较差而导致电子设备与读卡器之间的NFC通信过程执行失败。5. When the electronic device cannot parse the received instruction, or the content of the instruction parsed by the electronic device is abnormal, it is determined that the current NFC communication between the electronic device and the card reader is caused by the poor performance of the electronic device to send and receive radio frequency signals The process execution failed.
具体的,电子设备收发射频信号的性能较差时,可能导致电子设备侧无法解析接收到的指令、接收到的指令内容异常等情况。因此,电子设备可以根据是否能够解析接收到的 指令以及解析到的指令内容是否异常,来判断当前是否由于电子设备收发射频信号的性能较差而导致电子设备与读卡器之间的NFC通信过程执行失败。Specifically, when the performance of the electronic device for receiving and sending radio frequency signals is poor, it may cause the electronic device side to fail to parse the received command, and the content of the received command is abnormal. Therefore, the electronic device can determine whether the NFC communication process between the electronic device and the card reader is caused by the poor performance of the electronic device to send and receive radio frequency signals according to whether the received instruction can be parsed and whether the content of the parsed instruction is abnormal. The execution failed.
具体实现中,在NFC通信过程中,如果电子设备侧出现无法解析接收到的指令、接收到的指令内容异常等情况,则电子设备的NFC芯片将该情况封装为事件上报给处理器。在具体的实施例中,NFC芯片可以向处理器上报出错码0x02RF_FRAME_CORRUPTED,用于指示无法解析接收到的指令。NFC芯片可以向处理器上报出错码0xB0RF_TRANSMISSION_ERRO,用于指示接收到的指令异常或校验失败。In specific implementation, during the NFC communication process, if the electronic device cannot parse the received instruction or the content of the received instruction is abnormal, the NFC chip of the electronic device encapsulates the situation as an event and reports it to the processor. In a specific embodiment, the NFC chip may report the error code 0x02RF_FRAME_CORRUPTED to the processor, which is used to indicate that the received instruction cannot be parsed. The NFC chip can report the error code 0xB0RF_TRANSMISSION_ERRO to the processor, which is used to indicate that the received instruction is abnormal or the verification fails.
步骤S130、在由于电子设备收发射频信号的性能较差,而导致电子设备与读卡器之间的NFC通信过程执行失败的情况下,电子设备使用第二射频参数重新执行与读卡器之间的NFC通信过程。Step S130: In the case that the NFC communication process between the electronic device and the card reader fails due to the poor performance of the electronic device to send and receive radio frequency signals, the electronic device uses the second radio frequency parameters to re-execute the communication with the card reader NFC communication process.
具体的,在电子设备使用第一射频参数执行与读卡器之间的NFC通信过程失败的情况下,电子设备将射频参数由第一射频参数调整为第二射频参数,并再次执行与读卡器之间的NFC通信过程。即,电子设备使用调整后的第二射频参数,执行与读卡器之间的第一射频通信过程、第二射频通信过程及第三射频通信过程。这样可以调整电子设备收发射频信号的性能,提高电子设备的刷卡成功率。Specifically, in the case that the electronic device fails to execute the NFC communication process with the card reader using the first radio frequency parameter, the electronic device adjusts the radio frequency parameter from the first radio frequency parameter to the second radio frequency parameter, and executes and reads the card again NFC communication process between devices. That is, the electronic device uses the adjusted second radio frequency parameter to execute the first radio frequency communication process, the second radio frequency communication process, and the third radio frequency communication process with the card reader. In this way, the performance of the electronic device to receive and send radio frequency signals can be adjusted, and the card success rate of the electronic device can be improved.
在本申请实施例中,第二射频参数和第一射频参数不同。具体的,第二射频参数包括一套射频参数,第一射频参数包括一套射频参数,第二射频参数和第一射频参数不同是指,第二射频参数中的部分或者全部射频参数和第一射频参数不同。In the embodiment of the present application, the second radio frequency parameter is different from the first radio frequency parameter. Specifically, the second radio frequency parameter includes a set of radio frequency parameters, the first radio frequency parameter includes a set of radio frequency parameters, and the difference between the second radio frequency parameter and the first radio frequency parameter means that some or all of the radio frequency parameters in the second radio frequency parameter are different from the first radio frequency parameter. The radio frequency parameters are different.
在本申请实施例中,第二射频参数可以通过以下几种方式获取:In the embodiment of the present application, the second radio frequency parameter can be obtained in the following ways:
1、第二射频参数可以是电子设备在存储的N套射频参数中任意选择的一套和第一射频参数不同的射频参数。1. The second radio frequency parameter may be a set of radio frequency parameters that is different from the first radio frequency parameter randomly selected by the electronic device among the N sets of stored radio frequency parameters.
2、第二射频参数可以是电子设备在存储的N套射频参数中除了第一射频参数以外的其他射频参数中,选择的刷卡成功率最高的射频参数。通过第2种方式,可以提高电子设备的刷卡成功率。2. The second radio frequency parameter may be the radio frequency parameter with the highest card swipe success rate selected by the electronic device among other radio frequency parameters other than the first radio frequency parameter among the N sets of stored radio frequency parameters. Through the second method, the credit card success rate of electronic devices can be improved.
可理解的,在上述第1种方式和第2种方式中,电子设备在本地端选择第二射频参数,可以节约时间及功耗,更快地刷卡成功。It is understandable that in the above-mentioned first method and second method, the electronic device selects the second radio frequency parameter at the local end, which can save time and power consumption, and the card can be successfully swiped faster.
3、第二射频参数可以是电子设备向云端服务器请求获取的。在一些实施例中,云端服务器可以响应于电子设备的请求,向电子设备发送任意一套射频参数,或者,向电子设备发送刷卡成功率最高的一套射频参数。电子设备可以将接收到的射频参数作为第二射频参数。3. The second radio frequency parameter may be obtained by the electronic device requesting the cloud server. In some embodiments, the cloud server may send any set of radio frequency parameters to the electronic device in response to the request of the electronic device, or send a set of radio frequency parameters with the highest success rate of card swiping to the electronic device. The electronic device may use the received radio frequency parameter as the second radio frequency parameter.
在执行完步骤S130后,由于电子设备调整了射频参数,相当于调整了收发射频信号的性能,电子设备再次执行与读卡器之间的NFC通信过程时有可能成功。如果电子设备再次执行与读卡器之间的NFC通信过程时仍旧失败,则电子设备重复执行步骤S120-S130,再次调整射频参数,直至成功执行与读卡器之间的NFC通信过程。After performing step S130, since the electronic device adjusts the radio frequency parameters, which is equivalent to adjusting the performance of receiving and sending radio frequency signals, the electronic device may succeed when it executes the NFC communication process with the card reader again. If the electronic device still fails when performing the NFC communication process with the card reader again, the electronic device repeats steps S120-S130 to adjust the radio frequency parameters again until the NFC communication process with the card reader is successfully performed.
通过图3所示的基于NFC的通信方法,电子设备在由于收发射频信号较差而导致与读卡器之间的NFC通信过程执行失败时,可以调整射频参数,相当于调整收发射频信号的性能,并重新执行与读卡器之间的NFC通信过程。这样可以保证电子设备与读卡器之间的NFC通信过程成功执行,从而提升刷卡成功率。Through the NFC-based communication method shown in Figure 3, when the electronic device fails to perform the NFC communication process with the card reader due to poor transceiver RF signals, it can adjust the RF parameters, which is equivalent to adjusting the performance of the RF signal. , And re-execute the NFC communication process with the card reader. In this way, the successful execution of the NFC communication process between the electronic device and the card reader can be ensured, thereby increasing the card swiping success rate.
在本申请的一些实施例中,电子设备还可以存储成功执行与读卡器之间的NFC通信过程时所使用的射频参数。以电子设备成功执行与读卡器之间的NFC通信过程时所使用的射频参数为第二射频参数举为例,电子设备存储第二射频参数的方式可包括以下几种:In some embodiments of the present application, the electronic device may also store radio frequency parameters used when successfully executing the NFC communication process with the card reader. Taking the second radio frequency parameter as the radio frequency parameter used when the electronic device successfully performs the NFC communication process with the card reader as an example, the electronic device can store the second radio frequency parameter in the following ways:
1、电子设备关联存储读卡器的标识和第二射频参数。1. The electronic device stores the identification of the card reader and the second radio frequency parameter in association.
具体的,电子设备成功执行与读卡器之间的NFC通信过程时所使用的第二射频参数和读卡器是适配的。电子设备关联存储读卡器的标识和第二射频参数后,该电子设备再次执行与该读卡器之间的NFC通信过程时,可以使用和该读卡器的标识关联存储的第二射频参数。具体实现中,电子设备可以通过和读卡器的指令交互获知读卡器的标识。Specifically, the second radio frequency parameter used when the electronic device successfully executes the NFC communication process with the card reader is adapted to the card reader. After the electronic device stores the identity of the card reader and the second radio frequency parameter in association, when the electronic device executes the NFC communication process with the reader again, it can use the second radio frequency parameter stored in association with the identity of the card reader . In a specific implementation, the electronic device can learn the identity of the card reader through an instruction interaction with the card reader.
第1种存储方式,可以保证后续电子设备和该读卡器之间执行的每一次NFC通信过程,都可以有较高的通信成功率。The first storage method can ensure that each subsequent NFC communication process performed between the electronic device and the card reader can have a higher communication success rate.
2、电子设备关联存储当前模拟的卡片类型和第二射频参数。2. The electronic device stores the current simulated card type and the second radio frequency parameter in association.
具体的,同一类型的卡片所对应的读卡器的硬件结构相似性较高。例如,公交读卡器的硬件结构相似、银行卡读卡器的硬件结构相似。举例说明,如果电子设备当前模拟的卡片类型为公交卡,则该第二射频参数可以和大部分的公交读卡器适配。电子设备关联存储当前模拟的卡片类型(例如公交卡)和第二射频参数后,该电子设备再次模拟为公交卡时,可以直接使用第二射频参数执行与公交卡读卡器之间的NFC通信过程。Specifically, the hardware structure of the card reader corresponding to the same type of card is similar. For example, the hardware structure of the bus card reader is similar, and the hardware structure of the bank card reader is similar. For example, if the card type currently simulated by the electronic device is a bus card, the second radio frequency parameter can be adapted to most bus card readers. After the electronic device associates and stores the currently simulated card type (such as a bus card) and the second radio frequency parameter, when the electronic device is simulated as a bus card again, it can directly use the second radio frequency parameter to perform NFC communication with the bus card reader process.
在一些实施例中,电子设备可以根据接收到的用户操作来获知当前模拟的卡片类型。例如,参考图4,电子设备可以根据接收到的用户操作来获知当前模拟的卡片类型,例如当电子设备在用户界面41上的图片401上接收到用户操作时,可以获知当前模拟的卡片类型为公交卡。In some embodiments, the electronic device can learn the currently simulated card type according to the received user operation. For example, referring to Figure 4, the electronic device can learn the currently simulated card type according to the received user operation. For example, when the electronic device receives the user operation on the picture 401 on the user interface 41, it can learn that the currently simulated card type is Bus card.
第2种存储方式,可以保证后续电子设备和同一类型的卡片所对应的读卡器之间执行的每一次NFC通信过程,都可以有较高的通信成功率。The second storage method can ensure that each NFC communication process performed between the subsequent electronic device and the card reader corresponding to the same type of card can have a higher communication success rate.
3、电子设备还可以关联存储当前地点和第二射频参数。3. The electronic device can also store the current location and the second radio frequency parameter in association.
具体的,同一地点的读卡器有可能属于同一类型,或者来自同一厂家,因此,同一地点的读卡器的硬件结构相似性较高。第二射频参数可以和当前地点中的大部分读卡器适配。电子设备关联存储当前地点和第二射频参数后,该电子设备再次处于该地点时,可以直接使用第二射频参数执行和该地点下的读卡器之间的每一次NFC通信过程。Specifically, the card readers at the same location may be of the same type or from the same manufacturer. Therefore, the hardware structure of the card readers at the same location is similar. The second radio frequency parameter can be adapted to most card readers in the current location. After the electronic device associates and stores the current location and the second radio frequency parameter, when the electronic device is at the location again, it can directly use the second radio frequency parameter to perform each NFC communication process with the card reader under the location.
第3种存储方式,可以保证后续电子设备和同一地点中的读卡器之间执行的每一次NFC通信过程,都可以有较高的通信成功率。The third storage method can ensure that each NFC communication process performed between the subsequent electronic device and the card reader in the same location can have a higher communication success rate.
在本申请的一些实施例中,电子设备还可以统计使用各套射频参数执行和读卡器之间的NFC通信过程时的成功次数以及失败次数,即各套射频参数对应的刷卡成功次数和刷卡失败次数,并将统计的数据上报给云端服务器。云端服务器可以获取多个电子设备上报的数据,分别统计各套射频参数的刷卡成功率,并可以周期性地将刷卡成功率最高的N套射频参数下发至各个电子设备。In some embodiments of the present application, the electronic device can also count the number of successes and failures when using each set of radio frequency parameters to execute the NFC communication process with the card reader, that is, the number of successful swipes and swipes corresponding to each set of radio frequency parameters. The number of failures, and report the statistical data to the cloud server. The cloud server can obtain the data reported by multiple electronic devices, respectively count the credit card success rate of each set of radio frequency parameters, and can periodically issue the N sets of radio frequency parameters with the highest credit card success rate to each electronic device.
在本申请的一些实施例中,电子设备还可以统计在每一个读卡器上使用各套射频参数执行和该读卡器之间的NFC通信过程时,成功以及失败的次数,并将统计的数据上报给云 端服务器。云端服务器可以获取多个电子设备上报的数据,分别统计各个读卡器对应的刷卡成功率最高的N套射频参数,并可以周期性地将各个读卡器分别对应的刷卡成功率最高的N套射频参数下发至电子设备。通过这种方式,电子设备工作于卡仿真模式刷卡时,可以根据当前读卡器的标识,在该读卡器对应的刷卡成功率最高的N套射频参数中任意选择一套射频参数来收发射频信号,从而提升电子设备的刷卡成功率。In some embodiments of the present application, the electronic device can also count the number of successes and failures when using various sets of radio frequency parameters on each card reader to perform the NFC communication process with the card reader, and count The data is reported to the cloud server. The cloud server can obtain the data reported by multiple electronic devices, respectively count the N sets of radio frequency parameters with the highest swipe success rate corresponding to each card reader, and can periodically assign each card reader to the N sets of the highest swipe success rate. The radio frequency parameters are delivered to the electronic equipment. In this way, when the electronic device works in the card emulation mode and swipes the card, it can select any set of radio frequency parameters from the N sets of radio frequency parameters with the highest swipe success rate corresponding to the card reader according to the current card reader's identification to send and receive radio frequency. Signal, thereby improving the success rate of electronic devices.
在本申请的一些实施例中,电子设备还可以统计在每一个地点下使用各套射频参数执行和读卡器之间的NFC通信过程时,成功以及失败的次数,并将统计的数据上报给云端服务器。云端服务器可以获取多个电子设备上报的数据,分别统计各个地点对应的刷卡成功率最高的N套射频参数,并可以周期性地将各个地点分别对应的刷卡成功率最高的N套射频参数下发至电子设备。通过这种方式,电子设备工作于卡仿真模式刷卡时,可以根据当前地点,在该地点对应的刷卡成功率最高的N套射频参数中任意选择一套射频参数来收发射频信号,从而提升电子设备的刷卡成功率。In some embodiments of the present application, the electronic device can also count the number of successes and failures when using various sets of radio frequency parameters to execute the NFC communication process with the card reader in each location, and report the statistical data to Cloud server. The cloud server can obtain the data reported by multiple electronic devices, count the N sets of radio frequency parameters with the highest credit card success rate corresponding to each location, and can periodically issue the N sets of radio frequency parameters with the highest credit card success rate corresponding to each location To electronic equipment. In this way, when the electronic device works in the card emulation mode and swipes the card, it can select any set of RF parameters from the N sets of RF parameters with the highest credit card success rate corresponding to the location according to the current location to send and receive RF signals, thereby improving the electronic equipment The success rate of credit card.
在本申请的一些实施例中,电子设备还可以统计在模拟每一类卡片时,使用各套射频参数执行和读卡器之间的NFC通信过程时,成功以及失败的次数,并将统计的数据上报给云端服务器。云端服务器可以获取多个电子设备上报的数据,分别统计每一类卡片对应的刷卡成功率最高的N套射频参数,并可以周期性地将各类卡片分别对应的刷卡成功率最高的N套射频参数下发至电子设备。通过这种方式,电子设备工作于卡仿真模式刷卡时,可以根据当前模拟的卡片的类型,在该类型的卡片所对应的刷卡成功率最高的N套射频参数中任意选择一套射频参数来收发射频信号,从而提升电子设备的刷卡成功率。In some embodiments of the present application, the electronic device can also count the number of successes and failures when simulating each type of card, using various sets of radio frequency parameters to execute the NFC communication process with the card reader, and count The data is reported to the cloud server. The cloud server can obtain the data reported by multiple electronic devices, respectively count the N sets of radio frequency parameters with the highest swipe success rate corresponding to each type of card, and can periodically correspond each type of card to the N sets of radio frequency with the highest swipe success rate. The parameters are delivered to the electronic device. In this way, when the electronic device is working in the card emulation mode and swiping the card, it can select any set of radio frequency parameters to send and receive from the N sets of radio frequency parameters with the highest swiping success rate corresponding to this type of card according to the type of the currently simulated card. Radio frequency signal, thereby improving the success rate of electronic devices.
在本申请实施例中,可以将上述几种情况中,电子设备统计的用于上报给云服务器的数据称为第一信息。In the embodiments of the present application, the data collected by the electronic device and used for reporting to the cloud server in the above several situations may be referred to as the first information.
为了执行上述实施例描述的基于NFC的通信方法,本申请实施例还提供了对应的装置。下面详细描述本申请实施例提供的电子设备和读卡器。In order to implement the NFC-based communication method described in the foregoing embodiment, the embodiment of the present application also provides a corresponding device. The electronic device and card reader provided in the embodiments of the present application are described in detail below.
在本申请实施例中,电子设备是可以利用NFC和其他设备进行通信的设备。电子设备可以工作于卡仿真模式,执行上述射频通信第一射频通信过程、射频通信第二射频通信过程及射频通信第三射频通信过程,从而完成访问控制、非接触式支付等功能。本申请实施例中的电子设备可用于执行上述图3实施例所示的基于NFC的通信方法。In the embodiments of the present application, the electronic device is a device that can communicate with other devices using NFC. The electronic device can work in the card emulation mode to execute the first radio frequency communication process of radio frequency communication, the second radio frequency communication process of radio frequency communication, and the third radio frequency communication process of radio frequency communication to complete functions such as access control and contactless payment. The electronic device in the embodiment of the present application can be used to execute the NFC-based communication method shown in the embodiment of FIG. 3 above.
本申请实施例对电子设备的类型不做限制。电子设备可以为手机、平板电脑、个人数字助理(personal digital assistant,PDA)、可穿戴设备(例如智能手环、智能手表)、膝上型计算机(laptop)、具有触敏表面(例如触控面板)的膝上型计算机(laptop)等便携式电子设备。便携式电子设备的示例性实施例包括但不限于搭载iOS、android、microsoft或者其他操作系统的便携式电子设备。The embodiments of the present application do not limit the types of electronic devices. Electronic devices can be mobile phones, tablet computers, personal digital assistants (personal digital assistants, PDAs), wearable devices (such as smart bracelets, smart watches), laptop computers, and touch-sensitive surfaces (such as touch panels). ) Laptop computer (laptop) and other portable electronic equipment. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices equipped with iOS, android, microsoft or other operating systems.
图6A示出了本申请提供的示例性电子设备100的结构示意图。FIG. 6A shows a schematic structural diagram of an exemplary electronic device 100 provided in the present application.
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器 192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2. , Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include pressure sensor 180A, gyroscope sensor 180B, air pressure sensor 180C, magnetic sensor 180D, acceleration sensor 180E, distance sensor 180F, proximity light sensor 180G, fingerprint sensor 180H, temperature sensor 180J, touch sensor 180K, ambient light Sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. Among them, the different processing units may be independent devices or integrated in one or more processors.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface. receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a two-way synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement the touch function of the electronic device 100.
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled with the audio module 170 through an I2S bus to realize communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块 170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on. GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through the headphones. This interface can also be used to connect other electronic devices, such as AR devices.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna can be used in combination with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering and amplifying the received electromagnetic waves, and then transmitting them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is processed by the baseband processor and then passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites. System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic wave radiation via the antenna 2. In some embodiments, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED), 有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye. ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, and N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in a variety of encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, for example, the transfer mode between human brain neurons, it can quickly process input information and can continuously learn by itself. The NPU can realize applications such as intelligent cognition of the electronic device 100, such as image recognition, face recognition, voice recognition, text understanding, and so on.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。The internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 170C, also called "microphone", "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can approach the microphone 170C through the mouth to make a sound, and input the sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used to connect wired earphones. The earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be provided on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors and so on. The capacitive pressure sensor may include at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location but have different touch operation strengths may correspond to different operation instructions. For example: when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the movement posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套 的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip holster. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and used in applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。Distance sensor 180F, used to measure distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, etc.
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 executes to reduce the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”. The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can obtain the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal. In some embodiments, the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone. The audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The button 190 includes a power button, a volume button, and so on. The button 190 may be a mechanical button. It can also be a touch button. The electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback. For example, touch operations applied to different applications (such as photographing, audio playback, etc.) can correspond to different vibration feedback effects. Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminding, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used to connect to the SIM card. The SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. The same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication. In some embodiments, the electronic device 100 adopts an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes a layered Android system as an example to illustrate the software structure of the electronic device 100.
在本申请实施例中,无线通信模块160可以包括NFC芯片,NFC芯片用于提供应用在电子设备100上的NFC解决方案。In the embodiment of the present application, the wireless communication module 160 may include an NFC chip, and the NFC chip is used to provide an NFC solution applied to the electronic device 100.
具体的,NFC芯片用于经由天线接收读卡器发送的射频信号,从而检测到读卡器提供的射频场、接收读卡器发送的射频信号。NFC芯片还用于利用负载调制技术将要发送的信息调制在天线内部的电感线圈中(例如有规律地改变电感线圈的阻抗),从而在射频场内有规律地改变读卡器中天线内部的电感线圈的负载,从而发送射频信号。读卡器可以检测到电感线圈负载的变化,读取NFC芯片发送的信息,实现信息的传递。Specifically, the NFC chip is used to receive the radio frequency signal sent by the card reader via the antenna, thereby detecting the radio frequency field provided by the card reader and receiving the radio frequency signal sent by the card reader. The NFC chip is also used to use load modulation technology to modulate the information to be sent in the inductance coil inside the antenna (for example, to change the impedance of the inductance coil regularly), so as to regularly change the inductance of the antenna in the reader in the radio frequency field The load of the coil, which transmits radio frequency signals. The card reader can detect the change in the load of the inductance coil, read the information sent by the NFC chip, and realize the transmission of information.
在一些实施例中,NFC芯片可以用于解析基于底层协议ISO/IEC 14443-3的指令。例如,NFC芯片可以用于解析REQA、SDD、SELECT等。NFC芯片可以根据解析结果进行相应的处理操作,如生成并发送ATQA、SAK等。In some embodiments, the NFC chip can be used to parse commands based on the underlying protocol ISO/IEC 14443-3. For example, the NFC chip can be used to resolve REQA, SDD, SELECT, etc. The NFC chip can perform corresponding processing operations based on the analysis results, such as generating and sending ATQA, SAK, etc.
在一些实施例中,NFC芯片在接收到基于上层协议ISO/IEC 14443-4的指令时,可以将处理后的指令发送至处理器110,由处理器110解析该指令并响应于该指令执行对应的操作。基于上层协议ISO/IEC 14443-4的指令例如可包括RATS。处理器110可以生成待发送的基于上层协议ISO/IEC 14443-4的信号,并将该信号发送至NFC芯片,由NFC芯片经由天线将该信号转为射频信号发送出去。In some embodiments, when the NFC chip receives an instruction based on the upper-layer protocol ISO/IEC 14443-4, it can send the processed instruction to the processor 110, and the processor 110 parses the instruction and executes the corresponding instruction in response to the instruction. Operation. The commands based on the upper layer protocol ISO/IEC 14443-4 may include RATS, for example. The processor 110 may generate a signal to be sent based on the upper layer protocol ISO/IEC 14443-4, and send the signal to the NFC chip, and the NFC chip converts the signal into a radio frequency signal via the antenna and sends it out.
在本申请实施例中,电子设备还配置有SE。SE中存储有电子设备模拟的卡片的卡片信息,例如UID、账户余额、刷卡记录等等。SE和NFC芯片配合完成刷卡过程,该过程 可参考前文实施例的相关描述。In the embodiment of the present application, the electronic device is also configured with SE. The SE stores the card information of the card simulated by the electronic device, such as UID, account balance, card swiping record, etc. The SE and the NFC chip cooperate to complete the card swiping process. For this process, refer to the relevant description of the previous embodiment.
参考图6B,SE可以设置在处理器121中,也可以设置在SIM卡中,还可以独立设置,本申请对此不做限制。Referring to FIG. 6B, the SE may be set in the processor 121, may be set in the SIM card, or may be set independently, which is not limited in this application.
在本申请实施例中,存储器121可用于存储N套射频参数。该N套射频参数可以是电子设备出厂时预置的,也可以是云端服务器周期性下发到电子设备中的。该N套射频参数可以是刷卡成功率最高的射频参数,也可以是各个读卡器/地点/卡片类型对应的刷卡成功率最高的射频参数,可参照前文方法实施例的相关描述。In the embodiment of the present application, the memory 121 may be used to store N sets of radio frequency parameters. The N sets of radio frequency parameters may be preset when the electronic device leaves the factory, or may be periodically issued to the electronic device by the cloud server. The N sets of radio frequency parameters may be radio frequency parameters with the highest card swipe success rate, or radio frequency parameters with the highest card swipe success rate corresponding to each card reader/location/card type. Refer to the relevant description of the foregoing method embodiment.
在本申请实施例中,处理器110可用于判断电子设备是否由于收发射频信号的性能较差而导致刷卡失败。具体的判断方式可参照前文方法实施例的相关描述。In the embodiment of the present application, the processor 110 may be used to determine whether the electronic device fails to swipe the card due to poor performance of sending and receiving radio frequency signals. For the specific judgment method, refer to the related description of the foregoing method embodiment.
在本申请实施例中,处理器110还可用于在电子设备收发射频信号的性能较差而导致刷卡失败的情况下,使用第二射频参数重新执行和读卡器之间的NFC通信过程。第二射频参数的确定方式可参照前文方法实施例的相关描述。In the embodiment of the present application, the processor 110 may also be used to re-execute the NFC communication process with the card reader using the second radio frequency parameter when the electronic device has a poor performance in receiving and sending radio frequency signals and the card swiping fails. For the determination method of the second radio frequency parameter, refer to the related description of the foregoing method embodiment.
图7是本申请实施例的电子设备100的软件结构框图。FIG. 7 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图7所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 7, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides application programming interfaces (application programming interface, API) and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions.
如图7所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 7, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the size of the display, determine whether there is a status bar, lock the screen, take a screenshot, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。The content provider is used to store and retrieve data and make these data accessible to applications. The data may include video, image, audio, phone calls made and received, browsing history and bookmarks, phone book, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text and controls that display pictures. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状 态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic equipment vibrates, and indicator lights flash.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。The system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
2D图形引擎是2D绘图的绘图引擎。The 2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
下面结合捕获拍照场景,示例性说明电子设备100软件以及硬件的工作流程。In the following, the workflow of the software and hardware of the electronic device 100 will be exemplified in conjunction with capturing a photo scene.
当触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头193捕获静态图像或视频。When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes touch operations into original input events (including touch coordinates, time stamps of touch operations, etc.). The original input events are stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer. The camera 193 captures still images or videos.
参考图8,图8为本申请实施例提供的示例性读卡器200的结构示意图。Referring to FIG. 8, FIG. 8 is a schematic structural diagram of an exemplary card reader 200 according to an embodiment of the application.
如图8所示,读卡器200可以包括:处理器210、NFC芯片220、天线230、电池240。As shown in FIG. 8, the card reader 200 may include: a processor 210, an NFC chip 220, an antenna 230, and a battery 240.
处理器210可以包括一个或多个处理单元,例如处理器210中可以包括调制解调处理器、数字信号处理器、基带处理器等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。处理器210可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor 210 may include one or more processing units. For example, the processor 210 may include a modem processor, a digital signal processor, and a baseband processor. Among them, the different processing units may be independent devices or integrated in one or more processors. The processor 210 can generate operation control signals according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions.
处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口。I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。处理器210可以通过I2C总线接口耦合NFC芯片220,实现和NFC芯片220之间的数据传输。The processor 210 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface. The I2C interface is a two-way synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). The processor 210 may be coupled to the NFC chip 220 through an I2C bus interface to implement data transmission with the NFC chip 220.
处理器210用于接收NFC芯片传输过来的信号,解析该信号并响应于该信号执行对应的操作。处理器210还用于生成待发送的信号,并将待发送的信号发送至NFC芯片210。The processor 210 is configured to receive the signal transmitted from the NFC chip, analyze the signal, and perform corresponding operations in response to the signal. The processor 210 is also used to generate a signal to be sent, and send the signal to be sent to the NFC chip 210.
处理器210中还可以设置存储器,用于存储指令和数据。The processor 210 may also be provided with a memory for storing instructions and data.
在本申请实施例中,处理器210用于生成待发送的信号,并将该信号发送至NFC芯片220。NFC芯片用于对来自处理器210的信号做调频、放大等处理后,经由天线将该信号转为射频信号辐射出去,产生一个通过空间传播的电磁场,该电磁场即为读卡器生成的射频场。In the embodiment of the present application, the processor 210 is configured to generate a signal to be sent, and send the signal to the NFC chip 220. The NFC chip is used to perform frequency modulation, amplification and other processing on the signal from the processor 210, and then convert the signal into a radio frequency signal through the antenna and radiate it out to generate an electromagnetic field propagating through space. The electromagnetic field is the radio frequency field generated by the card reader. .
电池240用于为电子设备200的各个模块提供电能。电池240可包括但不限于:干电池、纽扣电池、可充电电池等等。The battery 240 is used to provide electrical energy for each module of the electronic device 200. The battery 240 may include, but is not limited to: dry batteries, button batteries, rechargeable batteries, and so on.
可理解的,本申请实施例示意的结构并不构成对电子设备200的具体限定。在另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件,或者,软件和硬件的组合实现。It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments, the electronic device 200 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented by hardware, software, or a combination of software and hardware.
本申请实施例还提供了一种NFC芯片,所述NFC芯片应用于电子设备,所述电子设备存储有NFC卡片信息,所述NFC卡片信息用于所述电子设备模拟为NFC卡片;所述NFC芯片包括:一个或多个处理器、接口;所述接口用于接收代码指令并将所述代码指令传输至所述处理器,所述处理器用于运行所述代码指令以使得所述电子设备执行本申请实施例提供的基于NFC的通信方法。这里,电子设备执行的基于NFC的通信方法可参照前文相关描述,在此不再赘述。The embodiment of the present application also provides an NFC chip, the NFC chip is applied to an electronic device, the electronic device stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card; the NFC The chip includes: one or more processors and an interface; the interface is used to receive code instructions and transmit the code instructions to the processor, and the processor is used to run the code instructions to make the electronic device execute The NFC-based communication method provided by the embodiment of the present application. Here, the NFC-based communication method executed by the electronic device can refer to the previous related description, which will not be repeated here.
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。The various embodiments of the present application can be combined arbitrarily to achieve different technical effects.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in this application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk).
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。A person of ordinary skill in the art can understand that all or part of the process in the above-mentioned embodiment method can be realized. The process can be completed by a computer program instructing relevant hardware. The program can be stored in a computer readable storage medium. , May include the processes of the foregoing method embodiments. The aforementioned storage media include: ROM or random storage RAM, magnetic disks or optical discs and other media that can store program codes.
总之,以上所述仅为本发明技术方案的实施例而已,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。In short, the above are only examples of the technical solution of the present invention, and are not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.

Claims (18)

  1. 一种基于NFC的通信方法,其特征在于,所述方法包括:A communication method based on NFC, characterized in that the method includes:
    电子设备工作于卡仿真模式,所述电子设备存储有NFC卡片信息,所述NFC卡片信息用于所述电子设备模拟为NFC卡片;The electronic device works in a card emulation mode, the electronic device stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card;
    所述电子设备使用第一射频参数执行所述电子设备与读卡器之间的NFC通信过程;The electronic device uses the first radio frequency parameter to execute the NFC communication process between the electronic device and the card reader;
    当所述NFC通信过程执行失败时,所述电子设备使用第二射频参数再次执行所述NFC通信过程;所述第二射频参数和所述第一射频参数不同;When the execution of the NFC communication process fails, the electronic device uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter;
    其中,所述NFC通信过程包括:第一射频通信过程,用于所述电子设备侦测所述读卡器提供的射频场;第二射频通信过程,用于所述读卡器选中所述电子设备作为数据传输对象;第三射频通信过程,用于所述电子设备和所述读卡器传输数据,所述数据包括所述NFC卡片信息;Wherein, the NFC communication process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic The device serves as the data transmission object; the third radio frequency communication process is used for the electronic device and the card reader to transmit data, and the data includes the NFC card information;
    其中,所述第一射频参数、所述第二射频参数均用于以下一项或多项:所述电子设备在所述NFC通信过程中,接收所述读卡器发送的射频信号、生成将要发送给所述读卡器的射频信号、发送射频信号。Wherein, the first radio frequency parameter and the second radio frequency parameter are both used for one or more of the following: during the NFC communication process, the electronic device receives the radio frequency signal sent by the card reader and generates The radio frequency signal sent to the card reader and the radio frequency signal sent.
  2. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, wherein:
    所述第一射频参数、所述第二射频参数均包括以下一项或多项:电子设备接收射频信号时的灵敏度、门限值、接收电路的输入电压;电子设备发送射频信号时所使用的帧延迟时间、负载调制时所使用的调制模式、载波的波形、载波的幅度以及载波的相位等等。Both the first radio frequency parameter and the second radio frequency parameter include one or more of the following: sensitivity, threshold value, and input voltage of the receiving circuit when the electronic device receives a radio frequency signal; The frame delay time, the modulation mode used in load modulation, the waveform of the carrier, the amplitude of the carrier, and the phase of the carrier, etc.
  3. 根据权利要求1或2所述的方法,其特征在于,在以下任意一种情况下,所述电子设备确定所述NFC通信过程执行失败:The method according to claim 1 or 2, wherein the electronic device determines that the execution of the NFC communication process fails in any of the following situations:
    在时间段T1内,所述电子设备侦测到射频场的强度低于阈值的次数大于第一值,或者,所述电子设备侦测到射频场的强度低于阈值的时长大于第二值;In the time period T1, the number of times that the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the first value, or the time period that the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the second value;
    在时间段T2内,所述电子设备没有接收到所述读卡器发送的选卡回答命令RATS;In the time period T2, the electronic device does not receive the card selection response command RATS sent by the card reader;
    在时间段T3内,所述电子设备没有接收到所述读卡器发送的消费指令;In the time period T3, the electronic device does not receive the consumption instruction sent by the card reader;
    所述电子设备接收到所述读卡器发送的否定应答指令NAK;或者,The electronic device receives the negative response instruction NAK sent by the card reader; or,
    所述电子设备无法解析接收到的指令,或者,所述电子设备解析到的指令异常。The electronic device cannot parse the received instruction, or the instruction parsed by the electronic device is abnormal.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述电子设备中存储有N套射频参数,The method according to any one of claims 1-3, wherein N sets of radio frequency parameters are stored in the electronic device,
    所述第一射频参数为:所述N套射频参数中,任意一套射频参数,或者,在NFC通信过程中成功率最高的一套射频参数。The first radio frequency parameter is: any set of radio frequency parameters among the N sets of radio frequency parameters, or a set of radio frequency parameters with the highest success rate in the NFC communication process.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述电子设备中存储有N套射频参数,The method according to any one of claims 1-4, wherein N sets of radio frequency parameters are stored in the electronic device,
    所述第二射频参数为:所述N套射频参数中所述第一射频参数以外的射频参数中,任意一套射频参数,或者,在NFC通信过程中成功率最高的一套射频参数。The second radio frequency parameter is: any set of radio frequency parameters among the radio frequency parameters other than the first radio frequency parameters in the N sets of radio frequency parameters, or a set of radio frequency parameters with the highest success rate in the NFC communication process.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:
    在所述电子设备使用所述第二射频参数成功执行所述NFC通信过程的情况下,关联存储所述第二射频参数和所述读卡器的标识;所述第二射频参数用于所述电子设备下一次执 行与所述读卡器之间的NFC通信过程。In the case that the electronic device successfully executes the NFC communication process using the second radio frequency parameter, the second radio frequency parameter and the card reader identification are stored in association; the second radio frequency parameter is used for the The electronic device executes the NFC communication process with the card reader next time.
  7. 根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:
    在所述电子设备使用所述第二射频参数成功执行所述NFC通信过程的情况下,关联存储所述第二射频参数和所述电子设备当前模拟的卡片类型;所述第二射频参数用于所述电子设备下一次模拟为所述类型的卡片时,执行与所述读卡器之间的NFC通信过程。When the electronic device uses the second radio frequency parameter to successfully perform the NFC communication process, the second radio frequency parameter is associated and stored with the card type currently simulated by the electronic device; the second radio frequency parameter is used for When the electronic device simulates the card of the type next time, it executes the NFC communication process with the card reader.
  8. 根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:
    在所述电子设备使用所述第二射频参数成功执行所述NFC通信过程的情况下,关联存储所述第二射频参数和所述电子设备当前所处的地点;所述第二射频参数用于所述电子设备下一次处于所述地点时,执行与所述读卡器之间的NFC通信过程。In the case that the electronic device successfully executes the NFC communication process using the second radio frequency parameter, the second radio frequency parameter and the current location of the electronic device are stored in association; the second radio frequency parameter is used for The next time the electronic device is at the location, it executes an NFC communication process with the card reader.
  9. 根据权利要求1-8任一项所述的方法,其特征在于,The method according to any one of claims 1-8, wherein:
    在所述电子设备使用所述第二射频参数成功执行所述NFC通信过程的情况下,所述电子设备向云服务器发送第一信息,所述第一信息用于指示所述电子设备使用所述第二射频参数成功执行所述NFC通信过程,以使得所述云服务器统计所述第二射频参数对应的通信成功率。In the case that the electronic device uses the second radio frequency parameter to successfully perform the NFC communication process, the electronic device sends first information to the cloud server, and the first information is used to instruct the electronic device to use the The second radio frequency parameter successfully executes the NFC communication process, so that the cloud server counts the communication success rate corresponding to the second radio frequency parameter.
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述电子设备使用第一射频参数执行所述电子设备与读卡器之间的NFC通信过程,具体包括:The method according to any one of claims 1-9, wherein the electronic device uses the first radio frequency parameter to execute the NFC communication process between the electronic device and the card reader, which specifically includes:
    所述电子设备周期性使用第一射频参数执行所述电子设备与读卡器之间的NFC通信过程;The electronic device periodically uses the first radio frequency parameter to execute the NFC communication process between the electronic device and the card reader;
    或者,or,
    所述电子设备响应于接收到的用户操作,使用第一射频参数执行所述电子设备与读卡器之间的NFC通信过程。In response to the received user operation, the electronic device uses the first radio frequency parameter to execute the NFC communication process between the electronic device and the card reader.
  11. 一种电子设备,其特征在于,包括:一个或多个处理器、存储器、NFC芯片和安全单元SE;An electronic device, characterized by comprising: one or more processors, memories, NFC chips, and a security unit SE;
    所述安全单元存储有NFC卡片信息,所述NFC卡片信息用于所述电子设备模拟为NFC卡片;所述存储器与所述一个或多个处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,所述一个或多个处理器调用所述计算机指令以使得所述电子设备执行:The security unit stores NFC card information, the NFC card information is used for the electronic device to simulate an NFC card; the memory is coupled with the one or more processors, and the memory is used for storing computer program codes, The computer program code includes computer instructions, and the one or more processors invoke the computer instructions to cause the electronic device to execute:
    工作于卡仿真模式;Work in card simulation mode;
    通过所述NFC芯片使用第一射频参数执行所述电子设备与读卡器之间的NFC通信过程;Executing the NFC communication process between the electronic device and the card reader through the NFC chip using the first radio frequency parameter;
    当所述NFC通信过程执行失败时,通过所述NFC芯片使用第二射频参数再次执行所述NFC通信过程;所述第二射频参数和所述第一射频参数不同;When the execution of the NFC communication process fails, the NFC chip uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter;
    其中,所述NFC通信过程包括:第一射频通信过程,用于所述电子设备侦测所述读卡器提供的射频场;第二射频通信过程,用于所述读卡器选中所述电子设备作为数据传输对象;第三射频通信过程,用于所述电子设备和所述读卡器传输数据,所述数据包括所述NFC卡片信息;Wherein, the NFC communication process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic The device serves as the data transmission object; the third radio frequency communication process is used for the electronic device and the card reader to transmit data, and the data includes the NFC card information;
    其中,所述第一射频参数、所述第二射频参数均用于以下一项或多项:所述电子设备 在所述NFC通信过程中,接收所述读卡器发送的射频信号、生成将要发送给所述读卡器的射频信号、发送射频信号。Wherein, the first radio frequency parameter and the second radio frequency parameter are both used for one or more of the following: during the NFC communication process, the electronic device receives the radio frequency signal sent by the card reader and generates The radio frequency signal sent to the card reader and the radio frequency signal sent.
  12. 根据权利要求11所述的电子设备,其特征在于,The electronic device according to claim 11, wherein:
    所述第一射频参数、所述第二射频参数均包括以下一项或多项:电子设备接收射频信号时的灵敏度、门限值、接收电路的输入电压;电子设备发送射频信号时所使用的帧延迟时间、负载调制时所使用的调制模式、载波的波形、载波的幅度以及载波的相位等等。Both the first radio frequency parameter and the second radio frequency parameter include one or more of the following: sensitivity, threshold value, and input voltage of the receiving circuit when the electronic device receives a radio frequency signal; The frame delay time, the modulation mode used in load modulation, the waveform of the carrier, the amplitude of the carrier, and the phase of the carrier, etc.
  13. 根据权利要求11或12所述电子设备,其特征在于,所述一个或多个处理器还用于调用所述计算机指令以使得所述电子设备执行:The electronic device according to claim 11 or 12, wherein the one or more processors are further configured to invoke the computer instruction to cause the electronic device to execute:
    在以下任意一种情况下,确定所述NFC通信过程执行失败:In any of the following cases, it is determined that the NFC communication process fails to execute:
    在时间段T1内,所述电子设备侦测到射频场的强度低于阈值的次数大于第一值,或者,所述电子设备侦测到射频场的强度低于阈值的时长大于第二值;In the time period T1, the number of times that the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the first value, or the time period that the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the second value;
    在时间段T2内,所述电子设备没有接收到所述读卡器发送的选卡回答命令RATS;In the time period T2, the electronic device does not receive the card selection response command RATS sent by the card reader;
    在时间段T3内,所述电子设备没有接收到所述读卡器发送的消费指令;In the time period T3, the electronic device does not receive the consumption instruction sent by the card reader;
    所述电子设备接收到所述读卡器发送的否定应答指令NAK;或者,The electronic device receives the negative response instruction NAK sent by the card reader; or,
    所述电子设备无法解析接收到的指令,或者,所述电子设备解析到的指令异常。The electronic device cannot parse the received instruction, or the instruction parsed by the electronic device is abnormal.
  14. 一种NFC芯片,所述NFC芯片应用于电子设备,所述电子设备存储有NFC卡片信息,所述NFC卡片信息用于所述电子设备模拟为NFC卡片;所述NFC芯片包括:一个或多个处理器、接口;An NFC chip, the NFC chip is applied to an electronic device, the electronic device stores NFC card information, and the NFC card information is used for the electronic device to simulate an NFC card; the NFC chip includes: one or more Processor, interface;
    所述接口用于接收代码指令并将所述代码指令传输至所述处理器,所述处理器用于运行所述代码指令以使得所述电子设备执行:The interface is configured to receive code instructions and transmit the code instructions to the processor, and the processor is configured to run the code instructions to cause the electronic device to execute:
    工作于卡仿真模式;Work in card simulation mode;
    通过所述NFC芯片使用第一射频参数执行所述电子设备与读卡器之间的NFC通信过程;Executing the NFC communication process between the electronic device and the card reader by using the first radio frequency parameter through the NFC chip;
    当所述NFC通信过程执行失败时,通过所述NFC芯片使用第二射频参数再次执行所述NFC通信过程;所述第二射频参数和所述第一射频参数不同;When the execution of the NFC communication process fails, the NFC chip uses the second radio frequency parameter to execute the NFC communication process again; the second radio frequency parameter is different from the first radio frequency parameter;
    其中,所述NFC通信过程包括:第一射频通信过程,用于所述电子设备侦测所述读卡器提供的射频场;第二射频通信过程,用于所述读卡器选中所述电子设备作为数据传输对象;第三射频通信过程,用于所述电子设备和所述读卡器传输数据,所述数据包括所述NFC卡片信息;Wherein, the NFC communication process includes: a first radio frequency communication process for the electronic device to detect the radio frequency field provided by the card reader; a second radio frequency communication process for the card reader to select the electronic The device serves as the data transmission object; the third radio frequency communication process is used for the electronic device and the card reader to transmit data, and the data includes the NFC card information;
    其中,所述第一射频参数、所述第二射频参数均用于以下一项或多项:所述电子设备在所述NFC通信过程中,接收所述读卡器发送的射频信号、生成将要发送给所述读卡器的射频信号、发送射频信号。Wherein, the first radio frequency parameter and the second radio frequency parameter are both used for one or more of the following: during the NFC communication process, the electronic device receives the radio frequency signal sent by the card reader and generates The radio frequency signal sent to the card reader and the radio frequency signal sent.
  15. 根据权利要求14所述的芯片,其特征在于,The chip of claim 14, wherein:
    所述第一射频参数、所述第二射频参数均包括以下一项或多项:电子设备接收射频信号时的灵敏度、门限值、接收电路的输入电压;电子设备发送射频信号时所使用的帧延迟时间、负载调制时所使用的调制模式、载波的波形、载波的幅度以及载波的相位等等。Both the first radio frequency parameter and the second radio frequency parameter include one or more of the following: sensitivity, threshold value, and input voltage of the receiving circuit when the electronic device receives a radio frequency signal; Frame delay time, modulation mode used in load modulation, carrier waveform, carrier amplitude and carrier phase, etc.
  16. 根据权利要求14或15所述的芯片,其特征在于,所述处理器还用于运行所述代 码指令以使得所述电子设备执行:The chip according to claim 14 or 15, wherein the processor is further configured to run the code instructions to make the electronic device execute:
    在以下任意一种情况下,确定所述NFC通信过程执行失败:In any of the following cases, it is determined that the NFC communication process fails to execute:
    在时间段T1内,所述电子设备侦测到射频场的强度低于阈值的次数大于第一值,或者,所述电子设备侦测到射频场的强度低于阈值的时长大于第二值;In the time period T1, the number of times that the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the first value, or the time period that the electronic device detects that the intensity of the radio frequency field is lower than the threshold is greater than the second value;
    在时间段T2内,所述电子设备没有接收到所述读卡器发送的选卡回答命令RATS;In the time period T2, the electronic device does not receive the card selection response command RATS sent by the card reader;
    在时间段T3内,所述电子设备没有接收到所述读卡器发送的消费指令;In the time period T3, the electronic device does not receive the consumption instruction sent by the card reader;
    所述电子设备接收到所述读卡器发送的否定应答指令NAK;或者,The electronic device receives a negative response instruction NAK sent by the card reader; or,
    所述电子设备无法解析接收到的指令,或者,所述电子设备解析到的指令异常。The electronic device cannot parse the received instruction, or the instruction parsed by the electronic device is abnormal.
  17. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1-10中任一项所述的方法。A computer program product containing instructions, characterized in that, when the computer program product runs on an electronic device, the electronic device is caused to execute the method according to any one of claims 1-10.
  18. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1-10中任一项所述的方法。A computer-readable storage medium, comprising instructions, characterized in that when the instructions run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1-10.
PCT/CN2020/107144 2019-08-16 2020-08-05 Nfc-based communication method and device WO2021031856A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910758668.5 2019-08-16
CN201910758668.5A CN112395894B (en) 2019-08-16 2019-08-16 Communication method and device based on NFC

Publications (1)

Publication Number Publication Date
WO2021031856A1 true WO2021031856A1 (en) 2021-02-25

Family

ID=74602058

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/107144 WO2021031856A1 (en) 2019-08-16 2020-08-05 Nfc-based communication method and device

Country Status (2)

Country Link
CN (1) CN112395894B (en)
WO (1) WO2021031856A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115035642A (en) * 2021-03-03 2022-09-09 深圳市万普拉斯科技有限公司 Compatible method of radio frequency parameters, electronic equipment and readable storage medium
WO2023221429A1 (en) * 2022-05-19 2023-11-23 深圳市汇顶科技股份有限公司 Card emulation method, and nfc chip and electronic device

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113329379B (en) * 2020-02-29 2023-04-18 华为技术有限公司 Communication method, device and system based on NFC
CN115442780A (en) * 2021-06-04 2022-12-06 华为技术有限公司 Data interaction method and device based on NFC
CN113766059B (en) * 2021-11-09 2022-03-18 飞天诚信科技股份有限公司 Application program starting method, terminal device and computer readable storage medium
CN114640377B (en) * 2022-03-02 2023-08-15 维沃移动通信有限公司 Entity card adding method, device, equipment and storage medium
CN116993337A (en) * 2022-04-26 2023-11-03 中兴通讯股份有限公司 Terminal device, data processing method, terminal device, and storage medium
CN114942892B (en) * 2022-07-26 2022-10-28 北京紫光青藤微系统有限公司 Method and device for communicating with software to be tested, equipment and storage medium
CN115001542B (en) * 2022-07-28 2022-11-08 深圳市汇顶科技股份有限公司 Near field communication method and near field communication device
CN115603780B (en) * 2022-12-09 2023-04-18 北京紫光青藤微系统有限公司 Method and device for determining communication scheme, electronic equipment and storage medium
CN115720349B (en) * 2023-01-09 2023-06-20 北京紫光青藤微系统有限公司 Frame delay time adjustment method and device for near field communication

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160156386A1 (en) * 2014-11-28 2016-06-02 Proton World International N.V. Data access in a mobile device with nfc
CN105825158A (en) * 2015-01-08 2016-08-03 中国移动通信集团公司 NFC (Near Field Communication) device, reader, system and configuration data transmission method
US20180115948A1 (en) * 2016-10-26 2018-04-26 Samsung Electronics Co., Ltd. Methods of operating near field communication devices
CN108055089A (en) * 2017-12-14 2018-05-18 中兴通讯股份有限公司 The working frequency of NFC device determines method and device
CN109936838A (en) * 2017-12-19 2019-06-25 三星电子株式会社 System and mobile terminal is arranged in radio frequency

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8113435B2 (en) * 2009-01-28 2012-02-14 Cubic Corporation Card reader
US20120045989A1 (en) * 2010-08-18 2012-02-23 Nokia Corporation Device discovery in near-field communication
KR20130116602A (en) * 2012-04-16 2013-10-24 삼성전자주식회사 Method for controlling card emulation mode and an electronic device thereof
CN103544457B (en) * 2013-09-30 2016-09-21 小米科技有限责任公司 The recognition methods of a kind of near field communication tag, device and mobile terminal
CN106920090A (en) * 2017-02-24 2017-07-04 北京小米移动软件有限公司 NFC payment and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160156386A1 (en) * 2014-11-28 2016-06-02 Proton World International N.V. Data access in a mobile device with nfc
CN105825158A (en) * 2015-01-08 2016-08-03 中国移动通信集团公司 NFC (Near Field Communication) device, reader, system and configuration data transmission method
US20180115948A1 (en) * 2016-10-26 2018-04-26 Samsung Electronics Co., Ltd. Methods of operating near field communication devices
CN108055089A (en) * 2017-12-14 2018-05-18 中兴通讯股份有限公司 The working frequency of NFC device determines method and device
CN109936838A (en) * 2017-12-19 2019-06-25 三星电子株式会社 System and mobile terminal is arranged in radio frequency

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115035642A (en) * 2021-03-03 2022-09-09 深圳市万普拉斯科技有限公司 Compatible method of radio frequency parameters, electronic equipment and readable storage medium
WO2023221429A1 (en) * 2022-05-19 2023-11-23 深圳市汇顶科技股份有限公司 Card emulation method, and nfc chip and electronic device

Also Published As

Publication number Publication date
CN112395894A (en) 2021-02-23
CN112395894B (en) 2022-09-09

Similar Documents

Publication Publication Date Title
WO2021031856A1 (en) Nfc-based communication method and device
WO2021052263A1 (en) Voice assistant display method and device
EP3916534A1 (en) Shortcut function activation method and electronic device
WO2021023032A1 (en) Device unlocking method and system, and related device
WO2021213164A1 (en) Application interface interaction method, electronic device, and computer readable storage medium
WO2021185105A1 (en) Method for switching between sim card and esim card, and electronic device
EP3819174B1 (en) Business processing method and device
WO2020238728A1 (en) Login method for intelligent terminal, and electronic device
WO2020215995A1 (en) Electronic payment method and electronic device
CN112468979B (en) SIM card drop recovery method of electronic equipment and electronic equipment
CN114553814B (en) Method and device for processing push message
CN113704205A (en) Log storage method, chip, electronic device and readable storage medium
CN115914461B (en) Position relation identification method and electronic equipment
WO2021082620A1 (en) Image recognition method and electronic device
CN114828098B (en) Data transmission method and electronic equipment
CN115017498A (en) Method for operating applet and electronic device
CN114398108A (en) Electronic device, drive loading method thereof, and medium
CN114690849A (en) Clock skew determination method, device and storage medium
CN115016666B (en) Touch processing method, terminal equipment and storage medium
WO2021129453A1 (en) Screenshot method and related device
WO2023024887A1 (en) Cross-device authentication method and apparatus
CN113271577B (en) Media data playing system, method and related device
WO2024022310A1 (en) Device security processing method and electronic devices
WO2022166550A1 (en) Data transmission method and electronic device
CN114490006A (en) Task determination method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20854920

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20854920

Country of ref document: EP

Kind code of ref document: A1