NFC-based Communication Method and Electronic Device
By detecting card swipe information, adjusting NFC radio frequency parameters and optimizing NFC communication methods, the problem of low card swipe success rate of NFC card simulation is solved, and a higher card swipe success rate and user experience is achieved.
Patent Information
- Application Number
- CN202411556648.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2044-11-04
AI Technical Summary
The success rate of existing NFC cards simulated card swiping is low and cannot meet the user's card swiping experience.
By detecting card swiping information, including the orientation of the electronic device, the tilt angle, the distance between the screen and the card reader, adjusting radio frequency parameters such as load modulation amplitude (LMA), noise and frame delay time (FDT), optimizing NFC communication methods, and improving card swiping success rate.
In different card swiping postures, the card swiping success rate of NFC simulated cards is improved, the cost of manual testing is reduced, and the user experience is improved.
Smart Images

Figure CN119070857B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to near field communication (NFC) technology, and particularly to a communication method and an electronic device based on NFC. Background Art
[0002] NFC technology is a short-range high-frequency wireless communication technology that allows non-contact peer-to-peer data transmission between electronic devices within ten centimeters. This technology evolved from contactless radio frequency identification (RFID) and is downward compatible with RFID. The information exchanged in NFC technology is transmitted through electromagnetic induction coupling in the wireless frequency part of the spectrum, and has the characteristics of short distance, high bandwidth, and low energy consumption.
[0003] In recent years, mobile phones with NFC function have used card emulation technology to replace NFC-based cards such as transportation cards, access control cards, and shopping cards, bringing convenience to people's travel. People do not need to carry various cards when going out. They only need to use their mobile phones to replace various NFC cards for swiping, and they can realize taking transportation, shopping, identity verification, etc.
[0004] However, the success rate of simulating the swiping of NFC cards needs to be improved to meet the swiping experience of users. Summary of the Invention
[0005] Embodiments of the present application provide a communication method and an electronic device based on NFC. By setting the load modulation amplitude (LMA), noise, and frame delay time (FDT) according to the swiping information, and using LMA, noise, and FDT for NFC communication, the success rate of the electronic device simulating the swiping of MFC cards is improved. Among them, LMA, noise, and FDT are NFC radio frequency parameters, and specific reference can be made to the ISO / IEC14443-3 protocol.
[0006] In a first aspect, an embodiment of the present application provides an NFC-based communication method. This method can be applied to an electronic device supporting NFC, and the electronic device can be used to simulate an NFC card. The method may include: after the electronic device detects a card reader, it collects card-swiping information, where the card-swiping information includes one or more of the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, the distance between the electronic device and the card reader, and the information of the card reader; determines a set of radio frequency parameters according to the card-swiping information, where the set of radio frequency parameters includes LMA, noise, and FDT, and the noise is the clutter at the NFC operating frequency; and performs NFC communication with the card reader using the set of radio frequency parameters. Exemplarily, determining a set of radio frequency parameters according to the card-swiping information may include: selecting a set of radio frequency parameters from one or more existing sets of radio frequency parameters according to the card-swiping information, or setting the values of LMA, noise, and FDT according to the card-swiping information, or setting the values of LMA, noise, and FDT by referring to the values of the existing radio frequency parameters (the values of the existing radio frequency parameters may correspond to card-swiping information, and when referring, the collected card-swiping information can be matched with the card-swiping information corresponding to the values of the existing radio frequency parameters) (the values of LMA, noise, and FDT can be set according to the matching degree).
[0007] Based on the above technical solution, the radio frequency parameters used by the electronic device to simulate card-swiping with an NFC card can comprehensively consider the actual card-swiping situation, such as the user's card-swiping actions or habits, which helps to improve the card-swiping success rate.
[0008] In a possible implementation, in the case of the above NFC communication failure, the method may further include: adjusting the value of one or more of LMA, noise, and FDT according to the card-swiping information to obtain another set of radio frequency parameters; and performing NFC communication with the card reader using the another set of radio frequency parameters.
[0009] Based on the above technical solution, the communication method provided by the embodiment of the present application enables the electronic device to adaptively adjust the radio frequency parameters after a card-swiping failure, so that the user can successfully swipe the card in different card-swiping postures, further improving the card-swiping success rate and user experience. For example, for two mobile phones of the same model, the user can successfully swipe the card with different card-swiping postures. Another example is that for the same transportation card and the same turnstile, when the user swipes the card with the same mobile phone in different card-swiping postures, the mobile phone interacts with the card reader using different radio frequency parameters (see different parameter sets in the following text) and can successfully swipe the card.
[0010] In a possible implementation, before collecting the card swiping information, the method may further include: turning on the camera. Correspondingly, the collecting of the card swiping information may include: obtaining, through the camera, one or more of the orientation of the screen of the electronic device relative to the card reader (such as whether the screen of the electronic device is facing the card reader or back to the card reader), the distance between the electronic device and the card reader, and the information of the card reader.
[0011] Based on the above technical solution, the communication method provided by the embodiment of the present application obtains the card swiping information through the camera, which can make the way of obtaining the card swiping information more diversified. Moreover, the electronic device uses the camera to obtain the card swiping information, so that the camera can be fully utilized and the utilization rate of the camera is improved.
[0012] In a possible implementation, the adjusting of one or more values of the LMA, the noise, and the FDT according to the card swiping information may include: adjusting the values of the LMA and the noise according to one or more of the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader; and / or adjusting the value of the FDT according to the information of the card reader.
[0013] Based on the above technical solution, the communication method provided by the embodiment of the present application adjusts the radio frequency parameters according to different card swiping information, which can make the values of the radio frequency parameters more accurate and is more conducive to improving the success rate of card swiping.
[0014] In a possible implementation, in the case that the card swiping information lacks the information of the card reader, the method may further include: obtaining the information of the card reader according to the type of the NFC card during the NFC communication process.
[0015] Based on the above technical solution, the communication method provided by the embodiment of the present application can enable the electronic device to obtain the card swiping information as much as possible, thereby ensuring the accuracy of the radio frequency parameters and being more conducive to improving the success rate of card swiping.
[0016] In a possible implementation, the adjusting of one or more values of the LMA, the noise, and the FDT according to the card swiping information may include: comparing the card swiping information with the card swiping information corresponding to a set of radio frequency parameters, and adjusting one or more values of the LMA, the noise, and the FDT according to the comparison result.
[0017] Based on the above technical solution, the communication method provided by the embodiment of the present application can finely adjust the radio frequency parameters to make the radio frequency parameters better, which is conducive to further improving the success rate of card swiping.
[0018] In a possible implementation, the determining of a set of radio frequency parameters according to the card swiping information may include: selecting a set of radio frequency parameters from one or more sets of preset radio frequency parameters according to the card swiping information.
[0019] Based on the above technical solution, the communication method provided by the embodiments of the present application can make the method for determining radio frequency parameters more flexible, which is conducive to improving the success rate of card swiping.
[0020] In a possible implementation, before determining a set of radio frequency parameters according to the card swiping information, the method may further include: receiving one or more sets of radio frequency parameters sent by the server. Accordingly, determining a set of radio frequency parameters according to the card swiping information may include: selecting a set of radio frequency parameters from the one or more sets of radio frequency parameters sent by the server according to the card swiping information.
[0021] Based on the above technical solution, the communication method provided by the embodiments of the present application obtains radio frequency parameters from the server, making the radio frequency parameters available for reference by the electronic device more abundant, which helps to quickly determine better radio frequency parameters, thereby further improving the card swiping success rate.
[0022] In a possible implementation, when the NFC communication is successful, the information of the electronic device, the card swiping information, and the radio frequency parameters used for the successful NFC communication may be reported to the server.
[0023] Based on the above technical solution, the communication method provided by the embodiments of the present application can enable the server to obtain more abundant radio frequency parameters by reporting information related to successful card swiping to the server, which helps to quickly determine better radio frequency parameters for the same model or the same type of electronic device, thereby further improving the card swiping success rate.
[0024] In a possible implementation, the method may further include: reporting one or more of the location information of the card reader and the type of the NFC card to the server.
[0025] Based on the above technical solution, the communication method provided by the embodiments of the present application can enable the server to store radio frequency parameters corresponding to more card swiping information by reporting the location information of the card reader and the type of the NFC card to the server, meet the requirements of more card swiping scenarios, and also help the same model or the same type of electronic device to more easily match better radio frequency parameters, thereby further improving the card swiping success rate and efficiency.
[0026] In a second aspect, the embodiments of the present application provide an electronic device. The electronic device may include: one or more processors, a memory, and an NFC chip. The one or more processors are respectively coupled to the memory and the NFC chip. The memory may be used to store computer program code. The computer program code may include computer instructions. When the one or more processors and the NFC chip execute the computer instructions, the electronic device may execute the method provided by any implementation of the first aspect.
[0027] In a third aspect, an embodiment of the present application provides a chip. The chip may include a processor and a communication interface. The processor may call a computer program or instruction through the communication interface to execute the method provided by any one of the implementation manners in the first aspect above.
[0028] In combination with the third aspect, as an implementation manner, the chip may further include a memory. A computer program or instruction is stored in the memory and is connected to the processor through the communication interface. The processor may call and execute the computer program or instruction stored on the memory through the communication interface to execute the method provided by any one of the implementation manners in the first aspect above.
[0029] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer, the computer may execute the method provided by any one of the implementation manners in the first aspect above.
[0030] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, the computer may execute the method described in any item of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0032] Figure 1 FIG. is an example of an application scenario of the NFC-based communication method provided by an embodiment of the present application;
[0033] Figure 2 FIG. is an example of a hardware structure of an electronic device in the NFC-based communication method provided by an embodiment of the present application;
[0034] Figure 3 FIG. is an example of a structure of an electronic device in the NFC-based communication method provided by an embodiment of the present application;
[0035] Figure 4 FIG. is an example of a software structure of an electronic device in the NFC-based communication method provided by an embodiment of the present application;
[0036] Figure 5 FIG. is an example of a method for communication between an electronic device emulation card and a card reader based on NFC provided by an embodiment of the present application;
[0037] Figure 6aAn example of a communication method based on NFC provided by an embodiment of the present application;
[0038] Figure 6b Another example of a communication method based on NFC provided by an embodiment of the present application;
[0039] Figure 6c Yet another example of a communication method based on NFC provided by an embodiment of the present application;
[0040] Figure 7 Another example of a communication method based on NFC provided by an embodiment of the present application;
[0041] Figure 8 Another example of a communication method based on NFC provided by an embodiment of the present application;
[0042] Figure 9 A possible structural example of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0043] To better understand the technical solutions of the present application, the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0044] The NFC-based communication method provided by the embodiments of the present application can be applied between an electronic device and a card reader. Among them, the electronic device can be a portable electronic device such as a mobile phone, a tablet computer, or a personal digital assistant (PDA) with NFC function, or a wearable device such as a watch, a bracelet, or a ring with NFC function. The electronic device can simulate an NFC card for transportation, shopping, membership consumption, identity authentication, or authorization, etc. As Figure 1 shown, the user can use the mobile phone 10 to simulate a transportation card and swipe it at the card swiping area of the subway turnstile 20 to take the subway. The card reader can be a point of sale (POS), an access control, a ticket gate, etc. The POS machine can be a bus POS, a bank POS, a subway POS, etc. The POS is a multi-functional terminal that can be installed in special merchants and acceptance points of credit cards, connected to a computer network to achieve automatic electronic fund transfer, and has functions such as supporting consumption, pre-authorization, balance inquiry, and transfer. It is safe and fast to use.
[0045] A structural example of the electronic device is as Figure 2 shown.
[0046] 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, antennas 11, 12, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker, a receiver, a microphone, a headphone interface, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0047] Among them, the audio module 170 can be used to convert digital audio information into analog audio signals, and can also be used to convert analog audio into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.
[0048] The speaker, also known as the "loudspeaker", can be used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or hands-free calls through the speaker.
[0049] The receiver, also known as the "earpiece", can be used to convert audio electrical signals into sound signals. When the electronic device 100 answers a call or a voice message, the voice can be listened to by bringing the receiver close to the human ear.
[0050] The microphone, also known as the "microphone" or "transmitter", can be used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone to input the sound signal into the microphone. The electronic device 100 can be provided with at least one microphone. In some other embodiments, the electronic device 100 can be provided with two microphones, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones to implement functions such as collecting sound signals, noise reduction, and directional recording.
[0051] The headphone interface is used to connect a wired headphone. The headphone interface can be the USB interface 130, or can be a 3.5 mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface, etc.
[0052] The electronic device 100 can implement audio functions through an audio module 170, a speaker, a receiver, a microphone, a headphone jack, an application processor, etc. The audio functions can be music playback, recording, etc.
[0053] The sensor module 180 may include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0054] The pressure sensor can be used to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor may be disposed in the display screen 194. The pressure sensor can be a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. When a touch operation acts on the display screen 194, the electronic device 100 can detect the intensity of the touch operation through the pressure sensor, or can calculate the position of the touch according to the detection signal of the pressure sensor. In some embodiments, when the touch operations act on the same position but with different intensities, different operation instructions can be corresponding. For example: when a touch operation with a touch operation intensity less than a first pressure threshold acts on the short message application icon, the electronic device 100 executes an instruction to view the short message. 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, the electronic device 100 executes an instruction to create a new short message.
[0055] The gyroscope sensor can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes) can be determined through the gyroscope sensor. The gyroscope sensor can be used for anti-shake shooting. Exemplarily, when the camera shutter is pressed, the gyroscope sensor detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and makes the lens offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor can also be used in navigation, motion sensing game scenarios.
[0056] The barometric pressure sensor can be used to measure barometric pressure. In some embodiments, the electronic device 100 can calculate the altitude according to the barometric pressure value measured by the barometric pressure sensor to assist in positioning and navigation.
[0057] The magnetic sensor may include a Hall sensor. When the electronic device 100 is protected by a flip leather case, the magnetic sensor can be used to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone or a folding phone, the opening and closing of the flip or the opening and closing of the folding phone can be detected according to the magnetic sensor. The electronic device 100 can also set functions such as automatic flip unlocking according to the detected opening and closing state of the leather case or the opening and closing state of the flip.
[0058] The acceleration sensor 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, it can detect the magnitude and direction of gravity, and identify the posture of the electronic device accordingly, for applications such as horizontal and vertical screen switching and pedometers.
[0059] The distance sensor can be used to measure distance, and can include an infrared distance sensor, a laser distance sensor, an ultrasonic distance sensor, etc. For example, in a shooting scenario, the electronic device 100 can use the distance sensor to measure the distance to achieve rapid focusing.
[0060] The proximity light sensor can include a light-emitting diode (LED) and a light detector (such as a photodiode). The light-emitting diode can be an infrared light-emitting diode. For example, the electronic device 100 can emit infrared light outward through the light-emitting diode and use the photodiode to detect the infrared reflected light from nearby objects. When sufficient reflected light is detected, the electronic device 100 can determine that there is an object nearby. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object nearby. The electronic device 100 can use the proximity light sensor to detect when the user holds the electronic device 100 close to the ear during a call, so as to automatically turn off the screen to save power. The proximity light sensor can also be used for automatic unlocking and locking of the leather case mode and pocket mode.
[0061] The ambient light sensor can be used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the ambient light brightness sensed by the ambient light sensor. The ambient light sensor can also be used to automatically adjust the white balance during photography, and can also cooperate with the proximity light sensor to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
[0062] The fingerprint sensor can be used to collect fingerprints. The electronic device 100 can use the fingerprint characteristics collected by the fingerprint sensor to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering of incoming calls, etc.
[0063] The temperature sensor is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor exceeds a threshold, the electronic device 100 reduces the performance of the processor near the temperature sensor 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 caused by low temperature. In other embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0064] A touch sensor, also known as a "touch panel", can be disposed on the display screen 194 and form a touch screen, also known as a "touch display screen", together with the display screen 194. The touch sensor is used to detect touch operations acting on or near it. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. The touch sensor can also provide visual output related to the touch operation through the display screen 194. In some other embodiments, the touch sensor can also be disposed at a position different from the display screen 194 on the surface of the electronic device 100.
[0065] The bone conduction sensor can acquire vibration signals. In some embodiments, the bone conduction sensor can acquire vibration signals of the vibrating bone mass of the human vocal part. The bone conduction sensor can also contact the human pulse and receive blood pressure pulsation signals. The application processor can analyze heart rate information based on the blood pressure pulsation signals acquired by the bone conduction sensor to implement the heart rate detection function. In some embodiments, the bone conduction sensor can also be disposed in the earphone to form a bone conduction earphone. The audio module 170 can analyze voice signals based on the vibration signals of the vibrating bone mass of the human vocal part acquired by the bone conduction sensor to implement the voice function.
[0066] 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), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated in one or more chips or devices.
[0067] The controller is the control center of the electronic device 100 and can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
[0068] A memory (such as a cache memory) can also be disposed in the processor 110 for storing instructions and data. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use this instruction or data again, it can directly call it from this memory. In this way, the electronic device 100 can avoid repeated access, reduce the waiting time of the processor 110, and improve the efficiency of the system.
[0069] In some embodiments, the processor 110 may include one or more interfaces. For example, the processor 110 may include an inter-integrated circuit (I2C) bus interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a Serial Peripheral Interface (SPI), a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0070] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the sensor 180, charger, flash, camera 193, etc. through different I2C interfaces respectively. For example: the processor 110 may be coupled to the touch sensor through the I2C interface, enabling the processor 110 to communicate with the touch sensor through the I2C interface to implement the touch function of the electronic device 100. In some embodiments, the processor 110 may also be coupled to the wireless communication module 160 through the I2C interface to implement the wireless communication function of the electronic device 100.
[0071] Both the I2S interface and the PCM interface can be used for audio communication. The I2S interface includes a clock line, a data line, and a frame synchronization line. In some embodiments, the processor 110 may include multiple groups of I2S buses. The processor 110 may be coupled to the audio module 170 through the I2S interface to implement communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface to implement the function of answering a call through a Bluetooth headset.
[0072] The PCM interface can be used to sample, quantize, and encode an analog audio signal, converting the analog audio signal into a digital audio signal. In some embodiments, the audio module 170 can be coupled to the wireless communication module 160 through the PCM interface to transmit an audio signal to the wireless communication module 160, implementing the function of answering a call through a Bluetooth headset.
[0073] The SPI interface is a secure hardware interface that can be used to provide a data transmission channel between the processor 110 and external devices with security requirements.
[0074] The UART interface is a universal serial data bus for asynchronous communication. This bus can be a bidirectional communication bus that converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically 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 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0075] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 can communicate through the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 can communicate through the DSI interface to implement the display function of the electronic device 100.
[0076] The GPIO interface can be set to an output mode to control external devices or to an input / output mode to transmit data signals, etc. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc. through software simulation.
[0077] The USB interface 130 is an interface that complies with the USB standard specification. Specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. 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. For example, the USB interface 130 can be used to connect a headset so that the electronic device 100 plays audio through the headset. This interface can also be used to connect other electronic devices, such as Augmented Reality (AR) devices, etc.
[0078] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are only exemplary descriptions and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0079] The charging management module 140 can be used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments, the charging management module 140 can receive the charging input of the wired charger through the USB interface 130. In some embodiments, the charging management module 140 can receive the wireless charging input through the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.
[0080] The power management module 141 can be used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives the 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, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as the battery capacity, the number of battery charge cycles, and the battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.
[0081] The communication function between the electronic device 100 and the outside world can be implemented through the antenna 11, the antenna 12, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.
[0082] Antennas 11 and 12 can be used for transmitting and receiving electromagnetic waves. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, antenna 11 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0083] The mobile communication module 150 can provide solutions for wireless communication including second-generation wireless telephone technology (2G) / third-generation wireless telephone technology (3G) / fourth-generation wireless telephone technology (4G) / fifth-generation wireless telephone technology (5G) / sixth-generation wireless telephone technology (6G), etc. for applications on the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through antenna 11, filter and amplify the received electromagnetic waves, and then transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through antenna 11 for radiation. In some embodiments, some functional modules of the mobile communication module 150 can be provided in the processor 110. In some embodiments, some functional modules of the mobile communication module 150 and some modules of the processor 110 can be provided in the same device.
[0084] The modulation and demodulation processor can include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal and transmit it to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor can output a sound signal through an audio device (not limited to speakers, receivers, etc.), or can display an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor can be an independent device. In some other embodiments, the modulation and demodulation processor can be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
[0085] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), etc.
[0086] The wireless communication module 160 receives electromagnetic waves via the antenna 12, performs frequency modulation and filtering processing on the electromagnetic wave signals, and then sends them to the processor 110. The wireless communication module 160 may also receive the signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 12 and radiate them out.
[0087] In some embodiments, the antenna 11 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 12 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technologies. The wireless communication technologies may include 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, and / or IR technologies, etc. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS), etc.
[0088] The wireless communication module 160 may be one or more devices integrating at least one communication processing module. For example, the wireless communication module 160 may integrate an NFC chip to provide an NFC solution for applications on the electronic device 100. For example, the NFC chip may be coupled to the processor 110 through an I2C interface to implement the NFC function of the electronic device 100. Specifically, the NFC chip may utilize the radio frequency signal sent by the card reader received via the antenna 12, detect the radio frequency field provided by the card reader (i.e., detect the card reader), and receive the radio frequency signal sent by the card reader. The wireless communication module 160 may also include an oscillation circuit. In some embodiments, when the antenna 12 receives the electromagnetic wave emitted by the NFC card reader, the oscillation circuit starts to oscillate under the influence of the electromagnetic wave to form a voltage. The electronic device 100 may determine that the card reader is detected based on this voltage. The NFC chip may also be used to modulate the information to be sent in the inductance coil inside the antenna (e.g., regularly change the impedance of the inductance coil) using the load modulation technique, so as to regularly change the load of the inductance coil inside the antenna 12 in the card reader in the radio frequency field and send a radio frequency signal. The card reader may read the information sent by the NFC chip according to the detected change in the load of the inductance coil to achieve information transfer. In some embodiments, the NFC chip may be used to parse instructions based on the underlying protocol ISO / IEC 14443-3. For example, the NFC chip may be used to parse a Request Command (REQ), a Single Device Detection (SDD) command, a SELECT command, etc., and perform corresponding processing operations according to the parsing results, such as generating and sending an Answer To Request (ATQ), a Select Acknowledge (SAK), etc. In some embodiments, when the NFC chip receives an instruction based on the upper layer protocol ISO / IEC 14443-4, it may send the processed instruction to the processor 110, and the processor 110 parses the instruction and performs corresponding operations in response to the instruction. The instruction based on the upper layer protocol ISO / IEC 14443-4 may include, for example, a request for answer to select (RATS). The processor 110 may generate a signal based on the upper layer protocol ISO / IEC 14443-4 to be sent, and send the signal to the NFC chip. The NFC chip converts the signal into a radio frequency signal and sends it out via the antenna 12. Among them, the radio frequency signal is a high-frequency electromagnetic wave.
[0089] In some embodiments, an enhanced security element (eSE) may be further provided in the NFC chip. The eSE is an electronic component that resists physical attacks and may include independent physical hardware and an operating system to ensure the security of the NFC card emulated by the electronic device, such as a transportation card, a bank card, and their keys. Exemplarily, the eSE may include a microprocessor, storage, and encryption / decryption hardware, etc. The storage hardware may store card information of the emulated card of the electronic device, such as a unique identifier (UID), account balance, card swipe records, and so on. As Figure 3 shown, in the NFC chip, the NFC controller (NFCC) is used to set routing and radio frequency parameters and supports multiple application scenarios and data exchange modes. The eSE and the NFC controller (NFCC) may interact through a single wire protocol (SWP). The NFC controller may interact with the rich execution environment (REE) in the device host (DH) through an I2C interface, and the eSE may be coupled with the trusted execution environment (TEE) in the device host through an SPI interface to ensure the security of important data (such as identity information, transaction information, etc.) during the NFC communication process. Among them, the device host may be the main processor of the electronic device 100, such as one or more of the processing units such as a controller and an application processor, and is mainly used to control and manage the communication process of the NFC chip. REE and TEE are two independent environments that can be obtained by partitioning the hardware and software resources of the electronic device 100. REE is open and extensible and is a general execution environment for computer programs in the electronic device. For example, it can run general operating systems (such as Android ® , iOS ® , Linux ®), applications (such as wallets, cameras, etc.), providing all functions of the device for upper-layer applications. The TEE can be protected by hardware mechanisms, isolated from the REE, and can only communicate with the TEE through specific entrances. The TEE can access the memory of the REE, but the REE cannot access the TEE memory protected by hardware. The TEE is applicable to scenarios such as digital rights management, mobile payment, and protection of sensitive data (such as identity authentication and authorization), and can effectively resist certain hardware-based attacks. In some embodiments, the TEE may include a secure processor and TEE software. Among them, the secure processor is a special hardware, usually embedded in devices such as mobile phones, tablets, and smart cards. It is independent of the main processor and has its own memory and processing capabilities. The TEE software runs on the secure processor, providing a protected execution environment for running trusted applications. In some embodiments, the eSE can be used independently or embedded in other devices to provide high-security services.
[0090] The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor, and can be used to execute mathematical and geometric calculations and also for graphics rendering. In some embodiments, the processor 110 may include one or more GPUs for executing program instructions to generate or change display information. The electronic device 100 can implement the display function through the GPU, the display screen 194, and the application processor, etc.
[0091] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include multiple display screens 194.
[0092] The ISP can be used to process the data fed back by the camera 193.
[0093] The camera 193 may include a lens and a photosensitive element for capturing still images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. In some embodiments, the electronic device 100 may include multiple cameras 193.
[0094] The DSP can be used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0095] The video codec can be used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0096] The electronic device 100 can implement the shooting function through the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the photosensitive element of the camera. The photosensitive element converts the optical signal into an electrical signal and transmits it to the ISP for processing. The ISP converts the electrical signal into a digital image signal and outputs it to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard red green blue color mod (RGB), Luminance / Luma Chrominance / Chroma (YUV) and other formats. In some embodiments, the ISP can also optimize the noise, brightness, and color of the image through algorithms. In some embodiments, the ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0097] The NPU is a neural-network (NN) computing processor. By referring to the biological neural network structure, such as the transmission mode between human brain neurons, it can quickly process the input information and continuously self-learn. The electronic device 100 can implement applications such as intelligent cognition through the NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
[0098] The external memory interface 120 can be used to connect to an external memory card, such as a Micro Secure Digital Memory Card (SD) (abbreviated as 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 implement the data storage function. For example, the electronic device 100 can save files such as music and videos in the external memory card through the external memory interface 120.
[0099] The internal memory 121 can be used to store computer-executable program codes. In some embodiments, the internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store the operating system and application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the program codes stored in the internal memory 121 and / or the program codes stored in the memory provided in the processor 110.
[0100] The keys 190 can include a power-on key, volume keys, etc. The keys 190 can be mechanical keys, touch keys, etc. The electronic device 100 can receive key inputs through the keys 190 to generate key signal inputs related to the user settings and function control of the electronic device 100.
[0101] The motor 191 can be used to generate vibration prompts. For example, the motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback. In some embodiments, for touch operations on different applications (such as taking pictures, audio playback, etc.), the motor 191 can generate different vibration feedback effects. In some embodiments, for touch operations on different areas of the display screen 194, the motor 191 can also generate different vibration feedback effects. In some embodiments, in different application scenarios (such as time reminder, receiving messages, alarm clock, games, etc.), the motor 191 can also generate different vibration feedback effects. In some embodiments, the touch vibration feedback effect of the motor 191 also supports customization.
[0102] The indicator 192 can be an indicator light for indicating the charging state, power change, messages, missed calls, notifications, etc.
[0103] The SIM card interface 195 can be used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact with and separation from the electronic device 100. The electronic device 100 can support multiple SIM card interfaces. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 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 can also be compatible with external memory cards. The electronic device 100 can interact with the network through the SIM card to implement functions such as calls and data communication. In some embodiments, the electronic device 100 uses an embedded SIM (eSIM) card. The eSIM card can be fixedly embedded in the electronic device 100.
[0104] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture, etc. In the embodiments of this application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device.
[0105] As Figure 4 shown, the software structure from top to bottom is successively the application layer, the application framework layer, Android ® runtime (android ® runtime) and system libraries, the hardware abstraction layer (HAL), and the kernel layer. Communication between layers is through software interfaces.
[0106] The application layer may include a series of application packages, such as: wallet, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0107] The application framework layer can be used to provide application programming interfaces (APIs) and services for the applications in the application layer, and may include a window manager, a content provider, a view system, a phone manager, a Location Based Services (LBS) manager, an NFC service manager, a resource manager, a notification manager, a Java native interface (JNI) of NFC, etc.
[0108] The window manager can be used to manage window programs, for example, it can obtain the display screen size, determine whether there is a status bar, a locked screen, take a screenshot, etc.
[0109] The content provider can be used to store and retrieve data, and make this data accessible to applications. Such data can include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, etc.
[0110] The view system is mainly used to build the application interface and provides rich view components for program developers. The view system can include various basic user interface (UI) components, such as lists, grids, text boxes, buttons, etc., as well as more complex controls such as embeddable web browsers. These components enable developers to quickly build a feature-rich and user-friendly application interface.
[0111] The phone manager can be used to provide communication functions, such as the management of call status (e.g., connected, hung up, etc.).
[0112] The LBS manager is used to provide the location function of the electronic device, such as determining the geofence of the electronic device, etc.
[0113] The NFC service manager is used to provide the NFC function of the electronic device, such as determining the NFC radio frequency parameters used by the current electronic device, etc.
[0114] The resource manager can provide various resources for applications, such as localized strings, icons, pictures, layout files, video files, and so on.
[0115] The notification manager can be used to convey notification-type messages, enabling applications to display notification information in the status bar. For example, the displayed notification information automatically disappears after a short stay without user interaction. The notification manager can also be used to inform of download completion, message reminders, etc. The notification manager can also display notifications in the form of charts or scrollbar text in the system top status bar. Such notifications can be those of background-running applications or notifications that appear on the screen in the form of a dialogue window. The notification methods can include prompting text information in the status bar, emitting a prompt tone, vibrating the electronic device, flashing the indicator light, etc.
[0116] The NFC JNI can be used to expand and optimize the NFC function of the electronic device, such as allowing Java code to interact with native code (such as C or C++ code), which is beneficial for optimizing underlying hardware interactions or performance.
[0117] Android ® The runtime can include a core library and a virtual machine, which are responsible for the scheduling and management of the Android ® system.
[0118] The core library can consist of two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android ® system.
[0119] The virtual machine can be used to execute functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection, and can execute java files in the application layer and the application framework layer into binary files. The application layer and the application framework layer can run in the virtual machine.
[0120] The system library may include: NFC protocol stack, surface manager, medialibraries, three dimensional (3D) graphics processing library (such as OpenGL ES), two dimensional (2D) graphics engine (such as SGL), etc. The NFC protocol stack can be used to support NFC functions, such as determining NFC radio frequency parameters and completing NFC card swiping, etc. The surface manager can be used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications. The medialibrary can support the playback and recording of a variety of common audio and video formats, as well as static image files, etc. The audio and video coding formats supported by the medialibrary include MPEG4, High Efficiency Video Coding (H.264), Moving Picture Experts Group Audio Layer III (MP3), Advanced Audio Coding (AAC), Adaptive Multi-Rate (AMR), Joint Photographic Experts Group (JPG), Portable Network Graphics (PNG), etc. The 3D graphics processing library can be used to implement 3D graphics drawing, image rendering, synthesis, layer processing, etc. The 2D graphics engine is the drawing engine for 2D drawing.
[0121] The hardware abstraction layer is the interface layer between the kernel layer and the hardware layer, and may include LBS interface, NFC interface, Bluetooth, and camera, etc.
[0122] The kernel layer can be used to provide basic functions of the operating system, such as process management, memory management, device drivers, network protocol stack, etc. Among them, the device drivers may include NFC driver, display driver, camera driver, audio driver, sensor driver, etc. In some embodiments, the kernel layer may also include UART, I2C, SPI, and SWP, etc.
[0123] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. In other embodiments of the present application, the software structure of the electronic device may include more or fewer layers than those illustrated, and each layer may also include more or fewer modules.
[0124] In some embodiments, the electronic device may further include a security element (SE) (as Figure 4 shown), which has a similar function to the eSE. The SE may be disposed in the processor 110, or in the SIM card, or may be disposed independently.
[0125] In the embodiments of the present application, an electronic device provided with an SE or an eSE may simulate an NFC card in a hardware-based virtual card emulation (VCE) mode. When the electronic device simulates an NFC card in a host-based card emulation (HCE) mode, the above-mentioned SE and eSE may be omitted.
[0126] Figure 5 This is an example of a method for NFC-based communication between the electronic device emulating a card and a card reader provided in the embodiments of the present application. As Figure 5 shown, when the user swipes the electronic device, the electronic device enters the radio frequency field of the card reader and detects the card reader. Specifically, the card reader may continuously or periodically transmit a radio frequency signal with a frequency of 13.56 megahertz (MHz), thereby generating an electromagnetic field propagated through space near the card reader, that is, the radio frequency field. When the electronic device enters this radio frequency field, the oscillation circuit of the antenna generates a voltage under the influence of this radio frequency field, and the electronic device determines that the card reader is detected based on this voltage.
[0127] After the electronic device receives the REQ sent by the card reader, it replies with ATQ, and the NFC card simulated by the electronic device enters the ready state. Among them, REQ can be modulated by the card reader onto a 13.56 MHz radio frequency signal and sent out continuously or periodically to obtain information about the card in the radio frequency field, such as its type. ATQ can include the application and protocol types supported by the electronic device (application and Protocol selection, ATS) and SAK. In some embodiments, when the NFC card simulated by the electronic device is in the halt state, the card reader can send a wakeup (WUP) command to communicate with the electronic device based on NFC. The communication signal interface between the card simulated by the electronic device and the card reader can be type A or type B. When using a type A signal interface, the card reader can send a type A REQ (REQA, whose frame can be 0x26) to the electronic device. Correspondingly, the electronic device replies with a type A ATQ (ATQA, whose frame can be 0x0400). When using a type B signal interface, the card reader can send a type B REQ (REQB) to the electronic device. Correspondingly, the electronic device replies with a type B ATQ (ATQB).
[0128] When the NFC card simulated by the electronic device is in the ready state, bit collision avoidance or other collision avoidance methods can be used to make the NFC card simulated by the electronic device enter the active state.
[0129] Exemplarily, after the card reader receives the ATQ sent by the electronic device, it sends the first part of the collision avoidance frame (which can also be called the collision avoidance command). The collision avoidance command can at least include two fields: select (SEL) and number of valid bits (NVB) (the length of each field can be 1 byte). Among them, the SEL field is used to represent the concatenation level n of the UID (Collision Avoidance Level n, CLn), and the NVB field is used to represent the number of valid bits and also represents the separation position where the collision avoidance frame is separated into the first part and the second part. In some embodiments, the collision avoidance command can further include the UID. For example, when the collision avoidance command is 0x9320, the SEL value is 93, indicating the selection of concatenation level 1, that is, the UID length in a collision avoidance frame is 4 bytes. The NVB value is 20, indicating that there is no UID in the collision avoidance command, there is no UID in the first part of this frame, and the electronic device needs to reply with a complete 4-byte length UID as an answer.
[0130] After receiving the collision avoidance command, the electronic device sends the second part of the collision avoidance frame to the card reader. This part contains a UID with a length of 4 bytes.
[0131] When there is no conflict, the card reader can send a SELECT command to the electronic device. The SELECT command contains SEL, NVB, and the complete UID. Exemplarily, the SELECT command can be 0x9370, where the value of SEL is still 93, and the value of NVB is 70, indicating that the command also carries a 4-byte UID.
[0132] After receiving the SELECT command, the electronic device transitions from the ready state to the active state and returns SAK, indicating that the UID is complete in the SAK. For example, the SAK value of 0x20 indicates that the UID is complete and complies with ISO / IEC14443-4. After that, the electronic device and the card reader follow ISO / IEC14443-4 to perform card swiping operations such as transactions, authentication, and authorization.
[0133] For example, after receiving the SAK, the card reader can send a Request for Answer to SELECT (RATS). This request can contain the Frame Size for the Proximity Coupled Device Integer (FSDI) and the Card Identifier (CID), and its frame can be 0xE080. For details, refer to ISO / IEC14443.
[0134] After receiving the RATS command, the electronic device returns an Answer to SELECT (ATS).
[0135] After receiving the ATS, the card reader sends a SELECT command containing the Application Identity (AID) according to the content of the ATS.
[0136] After receiving the SELECT command containing the AID, the electronic device can find the corresponding application (APP) according to the AID and activate it. Then, the application communicates with the card reader for subsequent NFC communication. The application can be one of the NFC cards such as a transportation card, membership card, shopping card, access control card, or social security card simulated by the card reader.
[0137] The activated NFC card communicates with the card reader and sends corresponding information to the card reader.
[0138] The card reader performs operations such as deduction, authentication, or authorization according to the information sent by the NFC card. After the operation is completed, the card reader sends a successful card swiping message to the electronic device to end the communication with the electronic device.
[0139] In the embodiments of the present application, response contents such as UID, SAK, ATS, etc. sent by the electronic device to the card reader can generate radio frequency signals by using radio frequency parameters such as the configured load modulation amplitude (LMA) and noise, and send the generated radio frequency signals to the card reader by using the configured frame delay time (FDT).
[0140] Among them, the configuration of LMA affects the antenna coupling quality. Therefore, it is necessary to meet the emvco and forum protocol test standards. Otherwise, it may cause the card swiping to fail. For example, when the LMA is too small, it will affect the key performance indicator (KPI) and the card reader compatibility. Also, the card reader is sensitive to LMA. If the LMA is too large, it may cause the card reader to be unable to demodulate the signal sent by the electronic device, resulting in the card swiping failure.
[0141] The noise can be the clutter of the NFC operating frequency. When the clutter in the radio frequency signal sent by the electronic device simulating the NFC card is large, it affects the acquisition of the effective information in the radio frequency signal by the card reader, that is, it affects the KPI performance of the card reader and may cause the card swiping to fail. For example, if there is noise (clutter) interference in the radio frequency field of the card reader and the noise is too large, it will affect the demodulation of the electronic device and cause the card swiping to fail.
[0142] The FDT is the interval time from the received signal to the transmitted signal (or from the transmitted signal to the received signal). For example, the interval time can be in the range of 9.43us*n - 74ns to 9.43us*n + 74ns. The FDT can affect the card reader compatibility. For example, when the FDT configured by the electronic device is inconsistent with the FDT required by the card reader, it may cause the card reader to fail to receive the signal, resulting in the card swiping failure.
[0143] Generally, the electronic device sets the values of LMA, noise and FDT according to the hardware structure. For example, each mobile phone sets the corresponding values of LMA and noise according to the internal NFC chip model, antenna position, volume of the NFC chip, and integrated product development (IPD) layout. Also, for example, the electronic device sets the corresponding FDT value according to different card readers.
[0144] However, the values of LMA, noise, and FDT still need to match the actual card - swiping situation, or rather, meet the actual card - swiping situation, in order to ensure successful card - swiping. For example, when swiping the card, LMA and noise also need to match the direction of the NFC antenna in the electronic device, the distance between the NFC antenna and the card reader, etc., to ensure successful card - swiping. Different users' card - swiping habits or different card - swiping actions of the same user may result in differences in the direction of the NFC antenna in the electronic device, the distance between the NFC antenna and the card reader, etc., thus making the LMA and noise set according to the hardware structure of the electronic device not match the actual situation, resulting in card - swiping failure. Another example is that when manufacturing the electronic device, the value of FDT is set according to known or existing card readers on the market. However, when the user uses the electronic device to swipe the card, the card reader faced may be unknown or newly emerged, resulting in the mismatch between FDT and the card reader and causing card - swiping failure.
[0145] For ease of description, the card - swiping habits or card - swiping actions that affect the direction of the NFC antenna in the electronic device, the distance between the NFC antenna and the card reader, etc. are referred to as card - swiping postures. Card - swiping postures may include the orientation of the electronic device, the tilt angle of the electronic device, the distance between the electronic device and the card reader, the orientation of the screen of the electronic device relative to the card reader (such as whether the screen of the electronic device faces the card reader directly or backs the card reader), and so on. In the embodiments of the present application, the side with the screen of the electronic device can be regarded as the front of the electronic device, and the side of the electronic device opposite to the screen can be regarded as the back of the electronic device. When the front of the electronic device faces the card reader, it can be regarded as the electronic device facing the card reader directly. When the back of the electronic device faces the card reader, it can be regarded as the electronic device backing the card reader.
[0146] One way to improve the success rate of card swiping is to conduct actual card swiping tests on each type of electronic device for the NFC cards simulated by the electronic devices, so as to obtain relatively optimal NFC radio frequency parameter values. For example, for the transportation cards of each city simulated by the electronic devices, multiple combinations (parameter groups) of NFC radio frequency parameters (LMA, noise, FDT) are set for each type of electronic device for road tests. Then, according to the success rate of the road tests, the relatively optimal parameter group for each type of electronic device is determined. Among them, the multiple parameter groups represent multiple value combinations of LMA, noise, and FDT. For example, parameter groups 1 to 6 in Table 1 can be successively represented as (x1, y1, z1), (x2, y2, z2), …, (x6, y6, z6), where x1 to x6 are the values of LMA / noise / FDT, y1 to y6 are the values of noise / FDT / LMA, and z1 to z6 are the values of FDT / LMA / noise. In different parameter groups, the values of any one or two of the parameters LMA, noise, and FDT can be the same. For example, parameter groups 1 to 6 can also be successively (x1, y1, z1), (x2, y2, z1), …, (x6, y6, z1), or successively represented as (x1, y1, z2), (x2, y2, z2), …, (x6, y6, z2), and so on.
[0147]
[0148] As shown in Table 1, for the AA transportation card, the optimal NFC radio frequency parameter of the electronic device XX is parameter group 2, and the optimal NFC radio frequency parameter of the electronic device YY is parameter group 4. For the BB transportation card, the optimal NFC radio frequency parameter of the electronic device YY is parameter group 6. Then, the NFC radio frequency parameters with the value of parameter group 2 can be preset in the electronic device XX, and the NFC radio frequency parameters simulating the AA transportation card with the value of parameter group 4 and the NFC radio frequency parameters of the BB transportation card with the value of parameter group 6 can be preset in the electronic device YY. When the user uses the electronic device XX with parameter group 2 preset to simulate the AA transportation card for card swiping, the success rate of card swiping can be guaranteed, and the user's card swiping experience can be improved. When the user uses the electronic device YY with parameter group 4 preset to simulate the AA transportation card for card swiping, or when the user uses the electronic device YY with parameter group 6 preset to simulate the BB transportation card for card swiping, the success rate of card swiping can be guaranteed, and the user's card swiping experience can be improved.
[0149] However, on the one hand, the actual card - swiping test is a manual method, with high costs and low efficiency. For example, in road tests, first, the scenarios are relatively complex, including subway, bus, small - value consumption, taxi card - swiping consumption, bus and subway station recharging, subway ticket booth ticket card status query and update, etc. Second, the tests for each scenario are rather cumbersome. For example, for subway road tests, it is necessary to cover all subway lines in each city, randomly select 3 to 4 stations (including stations where the test has failed before) on each line, enter and exit each station twice, for a total of 4 card - swipes. And every time the NFC radio frequency parameters are adjusted, a retest is required. For bus road tests, it is necessary to cover all bus POS hardware types in each city, test more than 20 lines, and test more than 30 vehicles on each line, requiring about 120 card - swipes. Moreover, bus road tests include single - time and multiple - time card - swiping on the same bus POS, as well as the scenario of segmented charging. In addition, road tests also include tests on card - swiping when the device is turned off, intelligent flash cards, off - site card - swiping of interoperable cards, station display, subway entry and exit status display, consumption record display, etc.
[0150]
[0151] As can be seen from Table 2, the actual card - swiping test has high costs and low efficiency. And when a single device first uses a new NFC chip, the road tests required are more than those for the improved NFC chip, and the costs in all aspects are correspondingly higher. Here, the new NFC chip refers to the NFC chip from a new manufacturer.
[0152] On the other hand, the users of each electronic device vary greatly, resulting in a wide variety of card - swiping postures. For example, when different users use their mobile phones to simulate swiping a transportation card, some are used to facing the screen towards the card - swiping area of the turnstile, some are used to facing the external camera area towards the card - swiping area of the turnstile, some are used to facing the middle position of the back of the mobile phone towards the card - swiping area of the turnstile, and so on. In this way, the optimal NFC radio frequency parameter value measured by the tester (the NFC radio frequency parameter value with the highest card - swiping success rate) is optimal relative to the tester himself, but may not be an optimal NFC radio frequency parameter value for other different users. Therefore, when different users swipe cards with the optimal NFC radio frequency parameter value measured by the tester, the card - swiping may fail.
[0153] On yet another hand, the card reader during the actual card - swiping test may be different from the card reader encountered by the user when swiping the card, which may lead to the situation that the optimal FDT value obtained from the actual card - swiping test is not suitable for the card reader encountered by the user when swiping the card, resulting in card - swiping failure for the user.
[0154] In order to improve the card - swiping success rate, the embodiments of the present application provide a communication method based on NFC, as Figure 6a shown. This method can be applied to any NFC - supported electronic device provided by the embodiments of the present application, including:
[0155] Step 601: After the electronic device detects the card reader, it collects the card swiping information.
[0156] The card swiping information includes one or more of the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, the distance between the electronic device and the card reader, and the information of the card reader.
[0157] In some embodiments, the way to collect the information of the card reader can be: the electronic device prompts the user to inform the information of the card reader, and through components such as the microphone and the audio module, receives the user's voice, and obtains the information of the card reader according to the voice. Or, the electronic device senses the user's input operation through the touch screen to obtain the information of the card reader. In other embodiments, the way to collect the information of the card reader can be: the electronic device obtains the information of the card reader according to the image of the card reader acquired by the camera. This way can not only reduce the unnecessary operations of the user, improve the user experience, but also improve the efficiency of collecting information. Correspondingly, before the electronic device collects the card swiping information, it may also include turning on the camera. In some embodiments, collecting the card swiping information may include: obtaining one or more of the orientation of the screen of the electronic device relative to the card reader, the distance between the electronic device and the card reader, and the information of the card reader through the camera.
[0158] In some embodiments, the way to collect the card swiping gesture information can be: the electronic device obtains the orientation of the electronic device through direction sensors such as the acceleration sensor and the gyroscope sensor, obtains the tilt angle of the electronic device through the level function in the application camera, and obtains the direction of the NFC antenna according to the orientation and the tilt angle.
[0159] In some embodiments, collecting the card swiping gesture information can be: the electronic device senses the distance between the electronic device and the card reader through the distance sensor. In other embodiments, the way to obtain the distance between the electronic device and the card reader can be: the electronic device obtains it according to the image acquired by the camera.
[0160] In some embodiments, this step may include steps 611 and 612 as Figure 6b shown.
[0161] Figure 6b This is another example of an NFC-based communication method provided by the embodiments of the present application. In this embodiment, the communication method includes:
[0162] Step 611: After the electronic device enters the radio frequency field of the card reader, it detects the card reader by sensing the radio frequency signal.
[0163] In this embodiment, the electronic device can simulate NFC cards such as transportation cards, shopping cards, membership cards or bank cards in the VCE mode or the HCE mode.
[0164] Step 612: The electronic device collects the card-swipe information.
[0165] For example, the electronic device can turn on the camera to collect information of the card reader, and based on the image captured by the camera, obtain the distance between the electronic device and the card reader. It can also obtain the orientation of the electronic device through the acceleration sensor and gyroscope, and obtain the tilt angle of the electronic device through the level. In some embodiments, when cameras are provided on both the front and back of the electronic device, the back camera can be turned on. When the electronic device is facing away from the card reader, the camera can capture an image of the card reader. In some embodiments, the front camera of the electronic device can also be turned on. When the electronic device is facing the card reader, the camera can capture an image of the card reader. In other embodiments, the electronic device can turn on both the front and back cameras simultaneously. In this way, whether the electronic device is facing the card reader or facing away from the card reader, an image of the card reader can be captured to obtain information of the card reader, improving the success rate of collecting information of the card reader.
[0166] Step 602: Determine a set of radio frequency parameters based on the card-swipe information.
[0167] Wherein, a set of radio frequency parameters includes LMA, noise, and FDT, and the noise is the clutter at the NFC operating frequency.
[0168] In some embodiments, the manner in which the electronic device determines the value of one or more of LMA, noise, and FDT based on the card-swipe information can be: based on the value of one or more of LMA, noise, and FDT determined according to the hardware structure, the electronic device further adjusts the value of one or more of LMA, noise, and FDT according to the card-swipe information to obtain a better value of one or more of LMA, noise, and FDT.
[0169] In other embodiments, the manner in which the electronic device determines the value of one or more of LMA, noise, and FDT based on the card-swipe information can be: the electronic device selects the group with the highest matching degree from one or more preset parameter groups as the optimal values of LMA, noise, and FDT. Specifically, one or more preset parameter groups can be stored in the memory shown in the embodiments of the present application. In some embodiments, one or more preset parameter groups can also be stored in external devices such as external memories and servers. The electronic device can obtain one or more preset parameter groups from external devices such as external memories and servers after detecting the card reader, or periodically. In other embodiments, the server can periodically send down parameter groups so that the electronic device can obtain the one or more preset parameter groups.
[0170] In some embodiments, an external device such as an electronic device, an external memory, or a server may set the index items of the one or more preset parameter groups as the card-swipe information, or save the one or more preset parameter groups and the card-swipe information through a mapping relationship.
[0171] In some embodiments, this step may be as Figure 6b shown in step 613.
[0172] Step 613: The electronic device determines the value of one or more of LMA, noise, and FDT according to the card-swipe information.
[0173] For example, the electronic device may determine the values of LMA and noise according to the orientation, tilt angle of the electronic device, and the distance from the card reader, and may determine the value of FDT according to the information of the card reader. When the electronic device does not collect the information of the card reader or the collected information of the card reader has no matching FDT value, the preset FDT value may be used as the determined FDT value for NFC communication. Among them, the collected information of the card reader has no matching FDT value, which may be that the information of the card reader corresponding to or mapped by the preset FDT value does not match the collected information of the card reader. In some embodiments, the electronic device may select the most matching parameter group from the preset parameter groups according to the card-swipe information (that is, the parameter group corresponding to the preset card-swipe information closest to the collected card-swipe information) as the determined values of LMA, noise, and FDT.
[0174] In some embodiments, when both the card-swipe gesture information and the information of the card reader collected by the electronic device do not match the card-swipe information corresponding to the preset parameter group, the electronic device may select the parameter group corresponding to the card-swipe information with a higher matching degree for card swiping. For example, when the preset parameter groups are parameter group 1 (x1, y1, z1) and parameter group 2 (x2, y2, z1), and the information of the card reader corresponding to parameter group 1 and parameter group 2 is the same, but the matching degree between the card-swipe gesture information corresponding to parameter group 1 and the collected card-swipe gesture information is higher than that of parameter group 2, then parameter group 1 is selected as the determined parameter group. Another example is when the preset parameter groups are parameter group 1 (x1, y1, z1) and parameter group 2 (x2, y2, z2), the deviation between the card-swipe gesture information corresponding to parameter group 1 and parameter group 2 and the collected card-swipe gesture information is large, and the information of the card reader corresponding to parameter group 2 is more matched with the collected information of the card reader, then parameter group 2 is selected as the determined parameter group, and so on.
[0175] Step 603: Perform NFC communication with the card reader using a set of radio frequency parameters.
[0176] The technical solution provided in this embodiment collects one or more of the information of the card reader and the card swiping gesture information through an electronic device, determines the values of one or more of the LMA, noise, and FDT according to the card swiping information, and performs NFC communication based on the determined values of the LMA, noise, and FDT. In this way, even if different users swipe the card or the same user swipes the card each time, the LMA, noise, and FDT can be better matched with the actual card swiping situation while matching the hardware structure, thereby improving the success rate of card swiping. Moreover, the NFC-based communication method provided in the embodiment of the present application does not require manual tests such as road tests, saves the test cost, and also improves the production efficiency of the electronic device.
[0177] In some embodiments, this step can be, for example, Figure 6b Step 614 shown: The electronic device performs NFC communication with the card reader based on the determined LMA, noise, and FDT.
[0178] Exemplarily, when the electronic device simulates an NFC card based on the VCE mode, the determined LMA, noise, and FDT can be sent to the NFC chip through a system application such as a wallet, and then the NFC chip performs NFC communication with the card reader based on the determined LMA, noise, and FDT. The NFC communication between the electronic device and the card reader can be, for example, Figure 6c shown as including:
[0179] Step 621: The process of the card reader selecting the electronic device is similar to the steps before the electronic device sends "data or information to be verified for authorization, etc." in Figure 5 .
[0180] Step 622: After the electronic device is selected, a card swiping transaction is performed with the card reader. For example, after the electronic device is selected, that is, the simulated NFC card is selected, the application in the REE of the system application such as a wallet sends the card information to the eSE through the TEE, and the eSE performs a security check on the card according to the card information and activates the card. Or, the NFCC directly sends the card information selected by the card reader to the eSE to activate the card. After that, the eSE and the card reader interact information or data through Application Protocol Data Unit (APDU) instructions through the NFCC to perform a card swiping transaction. After the card reader side completes the relevant operations, it notifies the electronic device that the card swiping is successful.
[0181] When the camera in step 612 does not capture the image of the card reader, for example, when the rear camera of the electronic device is turned on and it is facing the card reader, the electronic device can further find the corresponding NFC card information (such as UID) according to the AID sent by the card reader, and obtain the information of the corresponding card reader using the NFC card information.
[0182] In some embodiments, when the card swiping is successful, the communication method may further include:
[0183] Step 615: The electronic device reports the collected card swiping information, the adopted LMA, noise, and FDT values to the server. When the server receives the information reported by the electronic device, it is considered that the card swiping is successful by default. In some embodiments, the electronic device may further report the card swiping result. In some embodiments, the server may be a cloud server.
[0184] In some embodiments, the electronic device may further report to the server one or more of the site information (i.e., the location information of the card reader, such as subway station information, bus stop information, office building information, mall / market information, gym information, hospital information, catering and entertainment venue information, etc.), its own hardware information such as model, serial number, and the card type simulated by the card. In this way, the server can count the success rate of each electronic device using different cards in different card swiping postures and using different parameter sets when swiping cards at each site or each card reader. The server can also regularly send statistical data to the electronic device to improve the efficiency of the electronic device in obtaining a better parameter set, enabling the electronic device to swipe the card successfully faster and further improving the user experience.
[0185] In some embodiments, the server may send a better parameter set of the same model to the electronic device. For example, if the server separately counts the number of successful card swipes of electronic devices XX and YY in different card swiping postures and using different parameter sets at each site or each card reader, it will send the better parameter set of XX when swiping cards at each site or each card reader with different card swiping postures to the electronic device XX, and send the better parameter set of YY when swiping cards at each site or each card reader with different card swiping postures to the electronic device YY.
[0186] In some embodiments, the communication method may further include: The electronic device saves one or more of the site information, card reader information, card type, card swiping posture information, the parameter set used, and the card swiping result locally. Exemplarily, the electronic device may save the site information, card reader information, card type, card swiping posture information, and parameter set correspondingly in the memory shown in the embodiments of the present application. For example, the electronic device may save the site information, card reader information, card type, card swiping posture information, and parameter set corresponding to each card swipe (successful card swipe) in one row, using the site information, card reader information, or card type as the index item.
[0187] In some embodiments, the electronic device may obtain the site information through map Point of Interest (POI) information.
[0188] In some embodiments, when the electronic device fails to obtain the reader image through the camera, the DH of the electronic device can interact with the NFC controller through protocols such as the host controller interface (HCI) or the NFC controller interface (NCI) to obtain information about the reader from the NFC controller. Among them, HCI can be mainly used for the transmission and parsing of transaction information in the embodiments of the present application. Exemplarily, after the NFC controller obtains the turnstile number (such as 102702000899) according to the AID, it interacts with the DH of the electronic device through the HCI protocol and sends the following to the DH of the electronic device:
[0189] E3019000F12B 9F02 06 000000000000 5F2A 02 0156 9F79 06 000000000CB29A03 240831 9F21 03 112425 9F1C 06 102702000899
[0190] Among them, E3019000F12B represents the HCI protocol information;
[0191] 9F02 represents the transaction amount, 06 represents that the length of the transaction amount field is 6 bytes, and 000000000000 represents that the transaction amount is 0;
[0192] 5F2A represents the currency symbol, 02 represents that the length of the currency symbol field is 2 bytes, and 0156 represents that the transaction currency symbol is yuan;
[0193] 9F79 represents the balance, 06 represents that the length of the balance field is 6 bytes, and 000000000CB2 represents that the balance is 3250;
[0194] 9A03 represents the transaction date, and 240831 represents that the transaction date is August 31, 24;
[0195] 9F21 represents the transaction time, 03 represents that the actual length of the transaction field is 3 bytes, and 112425 represents that the transaction time is 11:24:25;
[0196] 9F1C represents the terminal number, 06 represents that the length of the terminal number field is 6 bytes, and 102702000899 is the turnstile number.
[0197] The electronic device DH obtains the turnstile number from the above data sent by the NFC controller.
[0198] Figure 7 Another example of an NFC-based communication method provided by the embodiments of the present application. This embodiment is the same as Figure 6bThe difference in the illustrated embodiment is that the communication method further includes:
[0199] Step 701: The electronic device determines that the card swipe fails.
[0200] If the electronic device does not receive any of the anti-collision command, SELECT command, RATS and other commands sent by the card reader in step 614, it determines that the card swipe fails. Exemplarily, the electronic device can start timing at the moment when it should receive but does not receive the card reader command. When the timing duration reaches the threshold and it still does not receive the card reader command, it determines that the card swipe fails. One reason for the card swipe failure may be that the card reader does not send further commands to the electronic device because it cannot demodulate the signal sent by the electronic device. The reason why the card reader cannot demodulate the signal sent by the electronic device may be that the signal generated and sent by the electronic device using the determined parameter set does not meet the requirements of the card reader, that is, the parameter set determined by the electronic device is not appropriate and needs to be further optimized to meet the requirements.
[0201] Step 702: The electronic device adjusts the value of one or more of the LMA, noise, and FDT according to the card swipe information to obtain another set of radio frequency parameters.
[0202] In some embodiments, this step includes: adjusting the values of the LMA and noise according to one or more of the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader; and / or adjusting the value of the FDT according to the information of the card reader.
[0203] Exemplarily, in step 613, when the electronic device selects the most matching parameter set from the preset parameter sets according to the card swipe information, the card swipe information corresponding to the parameter set may not be approximate or have a large deviation from the collected card swipe information, resulting in the card reader still being unable to demodulate the radio frequency signal sent by the electronic device when the electronic device generates and sends a radio frequency signal based on the most matching parameter set, causing the card swipe to fail. Therefore, the electronic device can compare the card swipe information collected in step 612 with the card swipe information corresponding to the parameter set determined in step 613, and adjust the parameter set according to the comparison result.
[0204] In some embodiments, adjusting the value of one or more of the LMA, noise, and FDT according to the card swipe information includes: comparing the card swipe information with the card swipe information corresponding to a set of radio frequency parameters, and adjusting the value of one or more of the LMA, noise, and FDT according to the comparison result.
[0205] For example, when a user uses a mobile phone with a BB transportation card enabled and swipes the card on the subway turnstile at the Optics Valley Square Subway Station in Wuhan, after the mobile phone detects the turnstile, it collects the card-swipe information and determines a parameter group (64, 23, 6) based on the card-swipe information. Among them, the value of LMA is 64, the noise value is 23, and the value of FDT is 6 ms. After that, the mobile phone DH sends the parameter group (64, 23, 6) to the NFC controller for configuration, as follows:
[0206] #LMA, Noise, FDT
[0207] HW_RF_CONF_BLK={
[0208] #Open Channel
[0209] 20, 02, 7F, 05,
[0210] #Adjust 6A Register
[0211] A0, 6A, 10, 64, 00, B4, 00, B4, 00, B4, 00, 1C, 02, 1C, 02, 1C, 02,1C, 02, / / Set the LMA value in the 6A register to 64
[0212] #Adjust 0E Register
[0213] A0, 0E, 2C, F0, 00, 3E, 11, E4, E4, E4, 00, 00, 00, 00, 00, A7, 8E,FF, FF, 23, 23, 23, 23, 0A, 00, 00, 00, 00, 02, 00, 00, 01, 00, 10, 00, 04,00, 00, 00, 17, 40, FF, 07, 13, 07, 05, 13, / / Set the noise value in the 0E register to 23
[0214] #FDT
[0215] A0, 28, 26, 00, 00, 00, 00, CB, 78, 00, 00, 88, FF, 00, F0, 00, 00,10, FF, 00, 68, 01, 00, 98, FE, 00, E0, 01, 00, 20, FE, 00, 58, 02, 00, A8,FD, 00, D0, 02, 00, / / Set the storage location corresponding to the value of FDT to "00, A8, FD, 00, D0, 02,00", and the value of FDT = 9.43 * (A8 + FD + D0 + 02) = 9.43 * 631 = 5950us = 6ms
[0216] };
[0217] The NFC controller interacts with the turnstile using the configured parameter group (64, 23, 6), resulting in a failed card swipe.
[0218] Assume that the preset card swipe information corresponding to the parameter group (64, 23, 6) is: the mobile phone is facing away from the turnstile, the distance between the mobile phone and the turnstile is 5 cm, and the turnstile model is 06102701034613. The card swipe information collected by the mobile phone is: the mobile phone is facing away from the turnstile, the distance between the mobile phone and the turnstile is 20 cm, and the turnstile model is 06102701034613. After the mobile phone DH compares the two, it determines that the possible reason for the failure is that the distance between the mobile phone and the turnstile is relatively far. Therefore, the value of the noise is correspondingly reduced (such as reduced to 20) to reduce clutter, and the value of LMA is increased (such as increased to B4) to strengthen the signal, obtaining another set of RF parameters (LMA = B4, noise = 20, FDT = 6), and reconfiguring the parameter group such as (B4, 20, 6), as follows:
[0219] HW_RF_CONF_BLK = {
[0220] # Turn on the channel
[0221] 20, 02, 7F, 05,
[0222] # Increase the value of LMA for the 6A register
[0223] A0, 6A, 10, B4, 00, B4, 00, B4, 00, B4, 00, 1C, 02, 1C, 02, 1C, 02,1C, 02,
[0224] # Decrease the noise value for the 0E register
[0225] A0, 0E, 2C, F0, 00, 3E, 11, E4, E4, E4, 00, 00, 00, 00, 00, A7, 8E,FF, FF, 20, 20, 20, 20, 0A, 00, 00, 00, 00, 02, 00, 00, 01, 00, 10, 00, 04,00, 00, 00, 17, 40, FF, 07, 13, 07, 05, 13,
[0226] #FDT
[0227] A0, 28, 26, 00, 00, 00, 00, CB, 78, 00, 00, 88, FF, 00, F0, 00, 00,10, FF, 00, 68, 01, 00, 98, FE, 00, E0, 01, 00, 20, FE, 00, 58, 02, 00, A8,FD, 00, D0, 02, 00,
[0228] };
[0229] In some embodiments, when the reason for the card - swiping failure may be that the value of FDT is not optimal. For example, when the preset parameter groups are parameter group 1 (x1, y1, z1) and parameter group 2 (x2, y2, z1) (assuming that x1, x2 are the values of LMA, y1, y2 are the noise values, and z1 is the value of FDT), and the card - swiping gesture information corresponding to x1, y1 completely matches the card - swiping gesture information of the mobile phone, while the information of the card reader corresponding to z1 does not match the collected information of the card reader, step 613 determines parameter group 1 as the parameter group to be used and uses it for NFC communication. In this case, in this step, the values of LMA and noise remain unchanged, and the value of FDT can be increased or decreased to z0.
[0230] Step 703: The electronic device performs NFC communication with the card reader (such as another set of radio frequency parameters (LMA = B4, noise = 20, FDT = 6)) based on the adjusted LMA, noise, and FDT.
[0231] This step can be similar to step 615. In some embodiments, the electronic device can start interacting with the card reader again from the reply to ATQ. In some embodiments, the electronic device can also start interacting with the card reader again from the reply before receiving the card reader command. For example, when the electronic device fails to swipe the card because it does not receive the RATS sent by the card reader, it can start interacting with the card reader again from the reply to SAK. Another example is that when the electronic device fails to swipe the card because it does not receive the SELECT command containing the AID sent by the card reader, it can start interacting with the card reader again from the reply to ATS, and so on.
[0232] Exemplarily, assume that after a successful card swipe, the NFC controller sends HCI information to the electronic device DH as: E3019000F12B 9F02 06000000000000 5F2A 020156 9F79 06000000000050 9A03 2408319F21 03112419 9F1C 06102701034613. Then the electronic device DH can obtain the information: the transaction amount is 0 yuan, the balance is 50 yuan, the transaction date is August 31, 2024, the transaction time is 11:24:19, and the card reader number is 06102701034613. Exemplarily, the electronic device can report information such as its own model XX, the site of Wuhan Optics Valley Square, the card swipe information (back to, 20 cm, turnstile number 06102701034613), and the parameter group (B4, 20, 6) for a successful card swipe to the server. When a subsequent electronic device XX swipes the card at the Optics Valley Square subway station, with its back to a turnstile of the same type as the turnstile numbered 06102701034613 and at a distance of 20 cm from the turnstile, it can directly use the parameter group (B4, 20, 6) sent by the server to successfully swipe the card, which can not only further improve the card swipe speed, card swipe success rate and user experience, but also reduce unnecessary processing of the electronic device, achieving the purpose of saving energy consumption and improving the performance of the electronic device.
[0233] In some embodiments, when step 703 still fails to successfully swipe the card, step 702 can be executed again until the card swipe is successful. Exemplarily, assume that the parameter group used last time is parameter group 1 (x1, y1, z0) (x1 is the value of LMA, y1 is the noise value, and z0 is the value of FDT), and the card swipe gesture information corresponding to x1 and y1 completely matches the card swipe gesture information of the mobile phone, while the information of the card reader corresponding to z0 does not match the collected information of the card reader. Then, keeping the values of LMA and noise unchanged, the value of FDT can be further adjusted until the card swipe is successful.
[0234] In some embodiments, when the electronic device fails to swipe the card, the values of LMA and noise can be preferentially adjusted. When using the adjusted values and still failing, the electronic device can adjust the value of FDT until the card swipe is successful.
[0235] In some embodiments, the electronic device can directly obtain the optimal parameter group based on the results statistically calculated by the server over a period of time, ensuring that the user can quickly complete a card swipe successfully at one time and enhancing the user experience of various card swipe postures. It can be understood that the longer the server's statistics time, the higher the success rate of the user's card swipe and the better the experience.
[0236] Figure 8 Another example of an NFC-based communication method provided by the embodiments of the present application. The difference between this embodiment and Figure 6b the embodiment shown is that before the electronic device swipes the card, the communication method further includes:
[0237] Step 801: The electronic device activates the simulated NFC card, such as activating the user's transportation card.
[0238] Step 802: The electronic device requests a parameter group from the server. This parameter group can be a parameter group related to the model of this device and the type of the simulated NFC card.
[0239] For example, assume the model of the electronic device is XX and the type of the simulated NFC card is BB, then a parameter group related to XX and BB is requested from the server. In some embodiments, the electronic device can regularly / periodically request a parameter group related to the model of this device and the type of the simulated NFC card from the server, or the electronic device can request the server to regularly or periodically send a parameter group related to the model of this device and the type of the simulated NFC card.
[0240] Step 803: The server returns the corresponding parameter group to the electronic device. For example, this corresponding parameter group can be a parameter group related to the model of the electronic device and the type of the simulated NFC card.
[0241] In some embodiments, after the electronic device requests a parameter group related to the model of this device and the type of the simulated NFC card from the server once, the server can regularly or periodically send a parameter group related to the model of the electronic device and the type of the simulated NFC card to the electronic device. Exemplarily, the server can regularly or periodically send parameter groups of the same model at different stations and different card swipe postures to the electronic device.
[0242] Step 804: The electronic device saves the parameter group returned by the server. For example, the electronic device can save the parameter group sent by the server locally (such as saving it to the memory shown in the embodiments of the present application). When the server regularly or periodically sends a parameter group related to the model of the electronic device and the type of the simulated NFC card to the electronic device, the site information, card swipe posture information, and parameter group saved locally by the electronic device will be continuously updated, becoming richer, which is more conducive to improving the success rate and speed of card swiping and enhancing the user experience.
[0243] Exemplarily, the parameter group obtained by the electronic device from the server for the first time is shown in Table 3.
[0244]
[0245] It can be understood that the server may not send its model information to the electronic device, and the electronic device may not save its own model (the model column in Table 3 can be omitted), which can reduce the network load and save the storage space of the electronic device.
[0246] After one or more updates, the parameter group saved by the electronic device is shown in Table 4.
[0247]
[0248] It can be seen from Table 4 that there are more stored parameter groups, and the corresponding card-swiping postures are more diverse, which can match more card-swiping postures of users. Therefore, when the user uses the electronic device XX to simulate the card swiping of BB at Optics Valley Square, the optimal RF parameters for this card swiping can be obtained more quickly, resulting in a higher card-swiping success rate, achieving the effect of successful card swiping at one time quickly, and with a faster speed and better user experience.
[0249] After that, when the user uses the electronic device to swipe the card, the electronic device executes a process similar to the Figure 6b method shown.
[0250] Exemplarily, when the user uses the mobile phone XX with the BB transportation card enabled to swipe the card at the subway turnstile in Optics Valley Square Station, Wuhan, the mobile phone is 3 cm away from the turnstile, tilted 45° upward, with its back to the turnstile. The mobile phone DH selects the matching parameter value 3 from Table 4 (such as the LMA value is B4, the noise value is 20, and the FDT value is 6 ms), and sends it to the NFC chip in the mobile phone through the following code:
[0251] HW_RF_CONF_BLK={
[0252] # Open the channel
[0253] 20, 02, 7F, 05,
[0254] # Increase the LMA value for the 6A register
[0255] A0, 6A, 10, B4, 00, B4, 00, B4, 00, B4, 00, 1C, 02, 1C, 02, 1C, 02,1C, 02,
[0256] # Decrease the noise value for the 0E register
[0257] A0, 0E, 2C, F0, 00, 3E, 11, E4, E4, E4, 00, 00, 00, 00, 00, A7, 8E,FF, FF, 20, 20, 20, 20, 0A, 00, 00, 00, 00, 02, 00, 00, 01, 00, 10, 00, 04,00, 00, 00, 17, 40, FF, 07, 13, 07, 05, 13,
[0258] #FDT
[0259] A0, 28, 26, 00, 00, 00, 00, CB, 78, 00, 00, 88, FF, 00, F0, 00, 00,10, FF, 00, 68, 01, 00, 98, FE, 00, E0, 01, 00, 20, FE, 00, 58, 02, 00, A8,FD, 00, D0, 02, 00,
[0260] };
[0261] After the card swipe is successful, the mobile phone sends the following information (as shown in Table 5) to the server:
[0262]
[0263] After the server receives this information, it updates the information of this row for the successful card swipe times, or rather, updates the successful card swipe times corresponding to parameter group 3. For example, it adds 1 to the successful card swipe times corresponding to this parameter group 3 to further improve the success rate of the electronic device for card swiping.
[0264] Figure 9 This is a possible structural example of the electronic device provided by the embodiment of the present application.
[0265] Refer to Figure 9 , the device 900 may include a processor 901, a memory 902, and a communication interface 903. The processor 901, the memory 902, and the communication interface 903 are coupled to each other. Optionally, the memory 902 may be used to store instructions executed by the processor 901, or store input data required for the processor 901 to run instructions, or store data generated after the processor 901 runs instructions. The communication interface 903 may be a transceiver or an input / output interface. When the processor 901 reads and executes the instructions stored in the memory 902, the electronic device may implement any NFC-based communication method provided by the embodiment of the present application.
[0266] Optionally, refer to Figure 9, the processor 901, the memory 902, and the communication interface 903 are interconnected with each other through a bus 904. The bus 904 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 9 it is only represented by a thick line in Figure 9 , but it does not mean that there is only one bus or one type of bus.
[0267] The chip provided by the embodiment of the present application may be a chip or a chip system in the above-mentioned electronic device that has the function of implementing the NFC-based communication method provided by the embodiment of the present application. Exemplarily, the chip may integrate a processor, a communication interface, and a memory. A computer program or instruction is stored in the memory. The processor is connected to the memory through the communication interface, reads and executes the computer program or instruction stored in the memory, so as to implement any NFC-based communication method provided by the embodiment of the present application. In some embodiments, the memory may be omitted from the chip. In this case, the processor may call a computer program or instruction from an external storage device through the communication interface. In some embodiments, the chip system may be composed of chips. Exemplarily, the chip system may include a processor chip, a communication interface chip, and a memory chip. The processor chip is connected to the memory chip through the communication interface chip, reads and executes the computer program or instruction stored in the memory chip, so as to implement any NFC-based communication method provided by the embodiment of the present application. In other embodiments, the chip system may include a chip and other discrete devices.
[0268] It should be clear that the embodiments described in the present application are only some of the embodiments, not all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.
[0269] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "the", and "said" used in the embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. The term "and / or" used herein is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0270] In specific implementation, the present invention further provides a computer storage medium. The computer storage medium can store a program, and when the program is executed, it may include some or all of the steps in the embodiments of the NFC-based communication method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), or the like.
[0271] In specific implementation, the present invention further provides a computer program product. The computer program product includes executable instructions. When the executable instructions are executed on a computer, the computer is caused to execute some or all of the steps in the embodiments of the NFC-based communication method provided by the present invention.
[0272] Those skilled in the art can clearly understand that the technologies in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solutions in the embodiments of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of the present invention.
[0273] For the same or similar parts among the various embodiments in this specification, reference can be made to each other. In particular, for the device embodiments and the terminal embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
Claims
1. A communication method based on NFC, characterized in that, Applied to an NFC-enabled electronic device, the electronic device is used to simulate an NFC card, and the method includes: After the electronic device detects a card reader, collect information of the card reader and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader; Determine the FDT according to the information of the card reader, and determine the LMA and noise according to one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader, where the noise is clutter at the NFC operating frequency; Perform NFC communication with the card reader using the FDT, the LMA, and the noise.
2. The communication method according to claim 1, wherein In the case of NFC communication failure, the method further includes: According to the information of the card reader and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader, adjust the value of one or more of the LMA, the noise, and the FDT to obtain another set of radio frequency parameters; Perform NFC communication with the card reader using the another set of radio frequency parameters.
3. The communication method according to claim 1 or 2, characterized in that, Before collecting the information of the card reader and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader, further includes: Turn on the camera; Collecting the information of the card reader and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader includes: Obtain the information of the card reader and one or more of the following: the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader through the camera.
4. The communication method according to claim 2, wherein According to the information of the card reader and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader, adjusting the value of one or more of the LMA, the noise, and the FDT includes: Adjust the values of the LMA and the noise according to one or more of the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader; and / or, Adjust the value of the FDT according to the information of the card reader.
5. The communication method according to claim 1, wherein In the case of lack of the information of the card reader, the method further includes: During the NFC communication process, obtain the information of the card reader according to the type of the NFC card.
6. The method according to any one of claims 2 or 4, characterized in that, Adjusting one or more values among the LMA, the noise, and the FDT according to the information of the card reader and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader includes: Comparing the information of the card reader and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader with the card swiping information corresponding to the set of radio frequency parameters, and adjusting one or more values among the LMA, the noise, and the FDT according to the comparison result.
7. The method according to any one of claims 1, 2, 4, and 5, characterized in that Determining the FDT according to the information of the card reader includes: selecting the FDT from one or more pre-set FDTs according to the information of the card reader; Determining the LMA and the noise according to one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader includes: Selecting the LMA and the noise from one or more pre-set sets of LMA and noise according to one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader.
8. The method according to any one of claims 1, 2, 4, and 5, characterized in that, Before determining a set of LMA and noise values according to the information of the card reader and according to one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader, and determining the FDT according to the information of the card reader, further includes: Receiving one or more sets of FDT, LMA, and noise sent by the server; Determining the FDT according to the information of the card reader includes: selecting the FDT from one or more sets of FDT, LMA, and noise sent by the server; Determining the LMA and the noise according to one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader includes: Selecting the LMA and the noise from one or more sets of FDT, LMA, and noise sent by the server according to the information of the card reader and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, and the distance between the electronic device and the card reader.
9. The method according to any one of claims 1, 2, 4, and 5, characterized in that, In the case where the NFC communication is successful, report the information of the electronic device, the information of the card reader, and one or more of the following: the orientation of the electronic device, the tilt angle of the electronic device, the orientation of the screen of the electronic device relative to the card reader, the distance between the electronic device and the card reader, and the radio frequency parameters used for the successful NFC communication to the server.
10. The method according to claim 9, characterized in that Further included: Report one or more of the location information of the card reader and the card type of the NFC card to the server.
11. An electronic device, characterized in that, Included: One or more processors, a memory, and an NFC chip, the one or more processors are respectively coupled to the memory and the NFC chip, the memory is used to store computer program code, the computer program code includes computer instructions, when the one or more processors and the NFC chip execute the computer instructions, the electronic device executes the method according to any one of claims 1 to 10.
12. A chip, characterized in that, Included: A processor and a communication interface, the processor calls a computer program or instruction through the communication interface and executes the method according to any one of claims 1 to 10.
13. The chip according to claim 12, characterized in that, Further included is a memory, the memory stores the computer program or instruction and is connected to the processor through the communication interface, and the processor calls the computer program or instruction from the memory through the communication interface.
14. A computer program product, characterized in that, When the computer program product runs on a computer, the computer executes the method according to any one of claims 1 to 10 above.
15. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program runs on a computer, the computer executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Communication method and equipment based on NFC
CN112395894A
Communication method for near field communication device
CN116781112A