NFC-based communication method and electronic equipment
By detecting and adjusting RF parameters, combining the card swipe information obtained by the camera, the RF parameters are adaptively adjusted, which solves the problem of low card swipe success rate for NFC cards, and achieves a higher card swipe success rate and user experience.
Patent Information
- Application Number
- CN202411556648.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-11-04
AI Technical Summary
The success rate of existing NFC card simulation card swiping technology is low, and it is difficult to adapt to different users' card swiping postures and card reader types, resulting in card swiping failure.
By detecting and adjusting RF parameters such as load modulation amplitude (LMA), noise and frame delay time (FDT), combined with the card swipe information obtained by the camera, the RF parameters are adaptively adjusted to improve the card swipe success rate.
It improves the success rate of NFC card simulation card swiping, adapts to different users' card swiping postures and card reader types, reduces manual testing costs, and improves the production efficiency and user experience of electronic devices.
Smart Images

Figure CN119070857A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to near field communication (NFC) technology, and in particular to a communication method and electronic equipment based on NFC. Background Art
[0002] NFC technology is a short-range high-frequency wireless communication technology that allows contactless point-to-point data transmission between electronic devices within ten centimeters. This technology evolved from contactless radio frequency identification (RFID) and is backward compatible with RFID. The information exchanged in NFC technology is transmitted through electromagnetic induction coupling in the wireless frequency part of the spectrum, which has the characteristics of short distance, high bandwidth and low energy consumption.
[0003] In recent years, mobile phones with NFC functions have used card emulation technology to replace transportation cards, access cards, shopping cards and other NFC-based 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 instead of various NFC cards to swipe cards to take public transportation, shop, and authenticate identities.
[0004] However, the success rate of this simulated NFC card swiping needs to be improved to meet the user's card swiping experience. Summary of the invention
[0005] The embodiment of the present application provides a communication method and electronic device based on NFC, which improves the success rate of electronic devices simulating MFC card swiping by setting load modulation amplitude (LMA), noise and frame delay time (FDT) according to card swiping information and using LMA, noise and FDT for NFC communication. Among them, LMA, noise and FDT are NFC radio frequency parameters, which can be found in ISO / IEC14443-3 protocol for details.
[0006] In a first aspect, an embodiment of the present application provides a communication method based on NFC, which can be applied to an electronic device that supports 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, collecting card swiping information, wherein 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 information of the card reader; determining a set of radio frequency parameters based on the card swiping information, wherein the set of radio frequency parameters includes LMA, noise and FDT, and the noise is the interference of the NFC operating frequency; and using a set of radio frequency parameters to perform NFC communication with the card reader. Exemplarily, determining a set of RF parameters based on the card swiping information may include: selecting a set of RF parameters from one or more existing sets of RF parameters based on the card swiping information, or setting the values of LMA, noise and FDT based on the card swiping information, or setting the values of LMA, noise and FDT based on the card swiping information and the values of existing RF parameters (the values of existing RF parameters may correspond to the card swiping information, and when referring to them, the collected card swiping information may be matched with the card swiping information corresponding to the values of existing RF parameters) (the values of LMA, noise and FDT may be set according to the degree of matching).
[0007] Based on the above technical solution, the electronic device simulates the radio frequency parameters used for NFC card swiping, which can integrate the actual card swiping situation such as the user's card swiping action or habits, and help improve the success rate of card swiping.
[0008] In a possible implementation, when the above-mentioned NFC communication fails, the above-mentioned method may further include: adjusting the value of one or more items of LMA, noise and FDT according to the card swiping information to obtain another set of RF parameters; and using the other set of RF parameters to perform NFC communication with the card reader.
[0009] Based on the above technical solution, the communication method provided in the embodiment of the present application enables the electronic device to adaptively adjust the radio frequency parameters after the card swiping fails, so that the user can swipe the card successfully in different card swiping postures, further improving the card swiping success rate and user experience. For example, two mobile phones of the same model, users swipe the card using different card swiping postures, and both can swipe the card successfully. For another example, for the same transportation card and the same gate, when the user swipes the card with the same mobile phone in different card swiping postures, the mobile phone uses different radio frequency parameters (see the different parameter groups below for details) to interact with the card reader, and both can swipe the card successfully.
[0010] In a possible implementation, before collecting the card swiping information, the method may further include: turning on a camera. Accordingly, collecting the card swiping information may include: obtaining, through a camera, one or more of the orientation of the screen of the electronic device relative to the card reader (e.g., whether the screen of the electronic device is facing the card reader or facing away from the card reader), the distance between the electronic device and the card reader, and information of the card reader.
[0011] Based on the above technical solution, the communication method provided in the embodiment of the present application obtains card swiping information through a camera, which can make the method of obtaining card swiping information more diversified. In addition, the electronic device uses a camera to obtain card swiping information, so that the camera can be fully utilized, thereby improving the utilization rate of the camera.
[0012] In one possible implementation, the above-mentioned adjustment of one or more values of LMA, noise and FDT according to the card swiping information may include: adjusting the values of 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 FDT according to the information of the card reader.
[0013] Based on the above technical solution, the communication method provided in the embodiment of the present application adjusts the radio frequency parameters according to different card swiping information, which can make the value of the radio frequency parameters more accurate and is more conducive to improving the success rate of card swiping.
[0014] In a possible implementation, when the card swiping information lacks the card reader information, the method may further include: during the NFC communication process, obtaining the card reader information according to the card type of the NFC card.
[0015] Based on the above technical solution, the communication method provided in 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 above-mentioned adjustment of one or more values of LMA, noise and 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 LMA, noise and FDT according to the comparison result.
[0017] Based on the above technical solution, the communication method provided in 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 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 preset sets of radio frequency parameters according to the card swiping information.
[0019] Based on the above technical solution, the communication method provided in the embodiment of the present application can make the method of determining the 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 a 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 in the embodiment of the present application obtains radio frequency parameters from a server, so that the radio frequency parameters available for reference by the electronic device are richer, which helps to quickly determine the better radio frequency parameters, thereby further improving the success rate of card swiping.
[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 in the embodiment of the present application can enable the server to obtain richer radio frequency parameters by reporting relevant information of successful card swiping to the server, which helps to quickly determine better radio frequency parameters for electronic devices of the same type or model, thereby further improving the success rate of card swiping.
[0024] In a possible implementation manner, 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 in the embodiment of the present application reports the location information of the card reader and the type of NFC card to the server, so that the radio frequency parameters saved by the server correspond to more card swiping information, meet the needs of more card swiping scenarios, and also help to make it easier for electronic devices of the same style or model to match better radio frequency parameters, thereby further improving the success rate and efficiency of card swiping.
[0026] In a second aspect, an embodiment of the present application provides an electronic device. The electronic device may include: one or more processors, a memory, and an NFC chip, wherein the one or more processors are coupled to the memory and the NFC chip, respectively, the memory may be used to store computer program codes, the computer program codes may include computer instructions, and when the one or more processors and the NFC chip execute the computer instructions, the electronic device may execute the method provided in any one of the implementations 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, and the processor may call a computer program or instruction through the communication interface to execute the method provided in any one of the implementations of the first aspect.
[0028] In combination with the third aspect, as an implementation method, the chip may also include a memory, in which a computer program or instruction is stored, and the memory is connected to a processor through a communication interface. The processor may call and execute the computer program or instruction stored in the memory from the memory through the communication interface, and execute the method provided by any one of the implementation methods of 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 is run on a computer, the computer can execute the method provided in any one of the implementations of the first aspect.
[0030] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, the computer can execute any of the methods described in 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 following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0032] Figure 1 An example of an application scenario of the NFC-based communication method provided in an embodiment of the present application; Figure 2 An example of a hardware structure of an electronic device in an NFC-based communication method provided in an embodiment of the present application; Figure 3 An example of a structure of an electronic device in an NFC-based communication method provided in an embodiment of the present application; Figure 4 An example of a software structure of an electronic device in an NFC-based communication method provided in an embodiment of the present application; Figure 5 An example of an NFC-based communication method between an electronic device simulation card and a card reader provided in an embodiment of the present application; Figure 6a An example of a communication method based on NFC provided in an embodiment of the present application; Figure 6b Another example of a communication method based on NFC provided in an embodiment of the present application; Figure 6c Another example of a communication method based on NFC provided in an embodiment of the present application; Figure 7 Another example of a communication method based on NFC provided in an embodiment of the present application; Figure 8 Another example of a communication method based on NFC provided in an embodiment of the present application; Fig. 9 This is a possible structural example of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0034] The NFC-based communication method provided in the embodiment of the present application can be applied between an electronic device and a card reader. The electronic device can be a portable electronic device such as a mobile phone, tablet computer, personal digital assistant (PDA) with NFC function, or a wearable device such as a watch, bracelet, ring, etc. with NFC function. The electronic device can simulate an NFC card for transportation, shopping, membership consumption, identity authentication or authorization, etc. Figure 1 As shown, the user can use the mobile phone 10 to simulate a transportation card and swipe the card in the card swiping area of the subway gate 20 to take the subway. The card reader can be a point of sale (POS), access control, ticket checking machine, etc., and the POS machine can be a bus POS, bank POS, subway POS, etc. POS is a multi-functional terminal that can be installed in special merchants and acceptance outlets of credit cards, connected to a computer to form a network, realize automatic electronic fund transfer, and has functions such as supporting consumption, pre-authorization, balance inquiry and transfer, and is safe and fast to use.
[0035] An example of a structure of an electronic device is as follows Figure 2 shown.
[0036] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 11, an antenna 12, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker, a receiver, a microphone, an earphone interface, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0037] The audio module 170 may be used to convert digital audio information into analog audio signals, or may be used to convert analog audio into digital audio signals. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
[0038] The speaker is also called a "speaker" and can be used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker.
[0039] The receiver is also called a "earpiece" and can be used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver close to the human ear.
[0040] A microphone is also called a "microphone" or "microphone" and 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 other embodiments, the electronic device 100 can be provided with two microphones, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones to realize functions such as collecting sound signals, noise reduction, and directional recording.
[0041] The headphone jack is used to connect a wired headphone, and the headphone jack may be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface, or the like.
[0042] The electronic device 100 can implement audio functions through the audio module 170, speakers, receivers, microphones, headphone interfaces, and application processors, etc. The audio functions can be music playback, recording, etc.
[0043] The sensor module 180 may include a pressure sensor, a gyro sensor, an air 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, and the like.
[0044] The pressure sensor can be used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be arranged 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 touch operation intensity through the pressure sensor, or can calculate the touch position according to the detection signal of the pressure sensor. In some embodiments, when the touch operation acts 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 the 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.
[0045] 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., x, y, and z axes) can be determined by the gyroscope sensor. The gyroscope sensor can be used for anti-shake shooting. For example, when the camera shutter is pressed, the gyroscope sensor detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor can also be used in navigation and somatosensory game scenes.
[0046] The air pressure sensor can be used to measure air pressure. In some embodiments, the electronic device 100 can calculate the altitude based on the air pressure value measured by the air pressure sensor to assist positioning and navigation.
[0047] The magnetic sensor may include a Hall sensor. When the electronic device 100 is protected by a flip leather case, the magnetic sensor may 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 cover may be detected by the magnetic sensor, or the opening and closing of the folding phone may be detected. The electronic device 100 may also set functions such as automatic unlocking of the flip cover according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover.
[0048] The acceleration sensor can detect the magnitude of acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected, and the posture of the electronic device can be identified accordingly, so as to be applied to applications such as horizontal and vertical screen switching and pedometers.
[0049] The distance sensor can be used to measure the distance, and may include an infrared distance sensor, a laser distance sensor, an ultrasonic distance sensor, etc. For example, in a shooting scene, the electronic device 100 can use the distance sensor to measure the distance to achieve fast focusing.
[0050] The proximity light sensor may include a light-emitting diode (LED) and a light detector (such as a photodiode). The light-emitting diode may be an infrared light-emitting diode. For example, the electronic device 100 may emit infrared light outward through a light-emitting diode and use a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, the electronic device 100 may determine that there is an object nearby. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object nearby. The electronic device 100 may use the proximity light sensor to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor can also be used for automatic unlocking and locking of the screen in the leather case mode and pocket mode.
[0051] The ambient light sensor can be used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the brightness of the ambient light sensed by the ambient light sensor. The ambient light sensor can also be used to automatically adjust the white balance when taking pictures, and can also be used in conjunction with the proximity light sensor to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0052] The fingerprint sensor can be used to collect fingerprints. The electronic device 100 can use the fingerprint characteristics collected by the fingerprint sensor to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.
[0053] 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 a processor located 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 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
[0054] The 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 screen", with the display screen 194. The touch sensor is used to detect a touch operation acting on or near it. The touch sensor can transmit the detected touch operation 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 other embodiments, the touch sensor can also be disposed on the surface of the electronic device 100 at a different position from the display screen 194.
[0055] The bone conduction sensor can obtain vibration signals. In some embodiments, the bone conduction sensor can obtain vibration signals of the vibrating bones of the vocal part of the human body. The bone conduction sensor can also contact the human pulse to receive blood pressure pulse signals. The application processor can parse the heart rate information based on the blood pressure pulse signal obtained by the bone conduction sensor to realize the heart rate detection function. In some embodiments, the bone conduction sensor can also be set in the earphone and combined into a bone conduction earphone. The audio module 170 can parse the voice signal based on the vibration signal of the vibrating bones of the vocal part obtained by the bone conduction sensor to realize the voice function.
[0056] 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 processor (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. Different processing units may be independent devices or may be integrated in one or more chips or devices.
[0057] The controller is the control center of the electronic device 100, and can generate operation control signals according to instruction operation codes and timing signals to complete the control of instruction fetching and execution.
[0058] The processor 110 may also be provided with a memory (such as a cache memory) for storing instructions and data. The memory may store instructions or data that have just been used or are used cyclically by the processor 110. If the processor 110 needs to use the instruction or data again, it may be directly called from the 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.
[0059] In some embodiments, the processor 110 may include one or more interfaces. For example, the processor 110 may include an inter-integrated circuit (I2C) 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.
[0060] The I2C interface is a bidirectional synchronous serial bus, including 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 can be coupled to the sensor 180, the charger, the flash, the camera 193, etc. through different I2C interfaces. For example: the processor 110 can be coupled to the touch sensor through the I2C interface, so that the processor 110 communicates with the touch sensor through the I2C interface to realize the touch function of the electronic device 100. In some embodiments, the processor 110 can also be coupled to the wireless communication module 160 through the I2C interface to realize the wireless communication function of the electronic device 100.
[0061] 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 via the I2S interface to achieve 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 via the I2S interface to achieve the function of answering a call via a Bluetooth headset.
[0062] The PCM interface can be used to sample, quantize and encode the audio analog signal, and convert the audio analog signal into an audio digital signal. In some embodiments, the audio module 170 can be coupled to the wireless communication module 160 through the PCM interface, and transmit the audio signal to the wireless communication module 160 to realize the function of answering the phone through the Bluetooth headset.
[0063] The SPI interface is a secure hardware interface that can be used to provide a channel for transmitting data between an external device with security requirements and the processor 110 .
[0064] The UART interface is a universal serial data bus for asynchronous communication. The 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 generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 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.
[0065] The MIPI interface can be used to connect the processor 110 with 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 via the CSI interface to realize the shooting function of the electronic device 100. The processor 110 and the display screen 194 can communicate via the DSI interface to realize the display function of the electronic device 100.
[0066] The GPIO interface can be set to an output mode for controlling external devices, or set to an input / output mode for transmitting data signals, etc. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, 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.
[0067] The USB interface 130 is an interface that complies with the USB standard specification, and specifically 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 transmit data between the electronic device 100 and a peripheral device. For example, the USB interface 130 can be used to connect headphones so that the electronic device 100 plays audio through the headphones. The interface can also be used to connect other electronic devices, such as augmented reality (AR) devices, etc.
[0068] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only an exemplary description and does 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.
[0069] The charging management module 140 may be used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some embodiments, the charging management module 140 may receive wireless charging input via a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device via the power management module 141.
[0070] 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 input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0071] The communication function between the electronic device 100 and the outside world can be realized through the antenna 11, the antenna 12, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0072] Antenna 11 and antenna 12 can be used to transmit and receive electromagnetic waves. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 11 can be reused 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.
[0073] The mobile communication module 150 can provide wireless communication solutions including the second generation mobile communication technology (2nd-generation wireless telephone technology, 2G) / the third generation mobile communication technology (3rd-generation wireless telephone technology, 3G) / the fourth generation mobile communication technology (4th-generation wireless telephone technology, 4G) / the fifth generation mobile communication technology (5th-generation wireless telephone technology, 5G) / the sixth generation mobile communication technology (6th-generation wireless telephone technology, 6G) for applications on the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through the antenna 11, and filter, amplify, etc. the received electromagnetic waves, and 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 for radiation through the antenna 11. In some embodiments, some functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, some functional modules of the mobile communication module 150 and some modules of the processor 110 may be arranged in the same device.
[0074] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor can output a sound signal through an audio device (not limited to a speaker, a receiver, etc.), or can display an image or video through a display screen 194. In some embodiments, the modem processor can be an independent device. In other embodiments, the modem processor can be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0075] The wireless communication module 160 can provide wireless communication solutions for application in the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
[0076] The wireless communication module 160 receives electromagnetic waves via the antenna 12, modulates and filters the electromagnetic wave signals, and then sends them to the processor 110. The wireless communication module 160 can also receive signals to be sent from the processor 110, modulate and amplify them, and convert them into electromagnetic waves for radiation via the antenna 12.
[0077] 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 technology. The wireless communication technology 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 technology, 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 system (SBAS), etc.
[0078] 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 via an I2C interface to implement the NFC function of the electronic device 100. Specifically, the NFC chip may detect the RF field provided by the card reader (that is, detect the card reader) by receiving the RF signal sent by the card reader via the antenna 12, and receive the RF signal sent by the card reader. The wireless communication module 160 may also include an oscillating circuit. In some embodiments, when the antenna 12 receives the electromagnetic wave emitted by the NFC card reader, the oscillating circuit oscillates 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 the voltage. The NFC chip may also be used to modulate the information to be sent in the inductor coil inside the antenna (for example, regularly changing the impedance of the inductor coil) by using load modulation technology, thereby regularly changing the load of the inductor coil inside the antenna 12 in the card reader in the RF field and sending the RF signal. The card reader can read the information sent by the NFC chip according to the change in the load of the inductive coil detected to realize the transmission of information. In some embodiments, the NFC chip can be used to parse instructions based on the underlying protocol ISO / IEC 14443-3. For example, the NFC chip can be used to parse the request command (Request Command, REQ), the single device detection (Single Device Detection, SDD) command, the SELECT command, etc., and perform corresponding processing operations according to the parsing results, such as generating and sending the request response (Answer To Request, ATQ), the select acknowledgement (Select Acknowledge, SAK), etc. In some embodiments, the NFC chip can send the processed instruction to the processor 110 when receiving the instruction based on the upper layer protocol ISO / IEC 14443-4, and the processor 110 parses the instruction and performs the corresponding operation 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 to be sent based on the upper layer protocol ISO / IEC 14443-4, and send the signal to the NFC chip, which converts the signal into a radio frequency signal and sends it out via the antenna 12. The radio frequency signal is a high-frequency electromagnetic wave.
[0079] In some embodiments, the NFC chip may be further provided with an enhanced security element (eSE). The eSE is an electronic component that is resistant to physical attacks and may include independent physical hardware and an operating system to ensure the security of NFC cards simulated by electronic devices, such as transportation cards, bank cards, and their keys. Exemplarily, the eSE may include a microprocessor, storage, and encryption and decryption hardware. The storage hardware may store card information of the electronic device simulated card, such as a unique identifier (UID), account balance, card swipe records, and so on. Figure 3 As shown, in the NFC chip, the NFC controller (NFC controller, NFCC) is used to set routing and radio frequency parameters, and supports a variety of application scenarios and data exchange modes. The eSE and the NFC controller (NFC controller, NFCC) can interact through the single wire protocol (SWP). The NFC controller can interact with the rich execution environment (REE) in the device host (DH) through the I2C interface, and the eSE can be coupled with the trusted execution environment (TEE) in the device host through the SPI interface to ensure the security of important data (such as identity information, transaction information, etc.) during NFC communication. Among them, the device host can be the main processor of the electronic device 100, such as one or more of the processing units such as the controller and the application processor, which is mainly used to control and manage the communication process of the NFC chip. REE and TEE are two independent environments, which can be obtained by dividing the hardware and software resources of the electronic device 100. REE is open and extensible. It is a general execution environment for computer programs in electronic devices, such as a general operating system (such as Android ® 、iOS ® , Linux ®), applications (such as wallets, cameras, etc.), etc., providing all the functions of the device for upper-level applications. TEE can be protected by hardware mechanisms, isolated from REE, and can only communicate with TEE through specific entrances. TEE can access the memory of REE, but REE cannot access the hardware-protected TEE memory. TEE is suitable for 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, TEE may include a security processor and TEE software. Among them, the security processor is a specialized hardware that is usually embedded in devices such as mobile phones, tablets, smart cards, etc. It is independent of the main processor and has its own memory and processing power. The TEE software runs on the security processor, providing a protected execution environment that can run trusted applications. In some embodiments, eSE can be used independently or embedded in other devices to provide high-security services.
[0080] The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor, and can be used to perform mathematical and geometric calculations, and can also be used 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.
[0081] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be 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), MiniLED, MicroLED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device 100 may include multiple display screens 194.
[0082] The ISP may be used to process data fed back by the camera 193 .
[0083] The camera 193 may include a lens and a photosensitive element for capturing still images or videos. The object generates an optical image through the lens and is projected 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.
[0084] DSP can be used to process digital signals, and in addition to processing digital image signals, can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0085] Video codecs can be used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0086] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The photosensitive element converts the light 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 format (red green blue color mod, RGB), grayscale chromaticity (Luminance / Luma Chrominance / Chroma, YUV) and other formats. In some embodiments, the ISP can also perform algorithm optimization on the noise, brightness, and color of the image. In some embodiments, the ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0087] NPU is a neural network (NN) computing processor that can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain. The electronic device 100 can use NPU to implement applications such as intelligent cognition, such as image recognition, face recognition, voice recognition, and text understanding.
[0088] The external memory interface 120 can be used to connect an external memory card, such as a Micro Secure Digital Memory Card (SD) (Micro SD card for short), 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 a data storage function. For example, the electronic device 100 can save files such as music and videos in an external memory card through the external memory interface 120.
[0089] The internal memory 121 may 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. The program storage area may store an operating system, and applications required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area may store data (such as audio data, a phone book, etc.) created during the use of the electronic device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the program code stored in the internal memory 121 and / or the program code stored in the memory provided in the processor 110.
[0090] The button 190 may include a power button, a volume button, etc. The button 190 may be a mechanical button, a touch button, etc. The electronic device 100 may receive a button input through the button 190 and generate a button signal input related to user settings and function control of the electronic device 100.
[0091] Motor 191 can be used to generate vibration prompts. For example, 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 acting on different applications (such as taking pictures, audio playback, etc.), motor 191 can generate different vibration feedback effects accordingly. In some embodiments, for touch operations acting on different areas of the display screen 194, motor 191 can also generate different vibration feedback effects accordingly. In some embodiments, motor 191 can also generate different vibration feedback effects in different application scenarios (for example: time reminders, receiving information, alarm clocks, games, etc.). In some embodiments, the touch vibration feedback effect of motor 191 can also support customization.
[0092] The indicator 192 may be an indicator light for indicating charging status, power changes, messages, missed calls, notifications, etc.
[0093] The SIM card interface 195 can be used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. 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 multiple cards can be the same or different. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 can interact with the network through the SIM card to realize functions such as calls and data communications. 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.
[0094] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0095] like Figure 4 As shown in the figure, the software structure from top to bottom is application layer, application framework layer, Android ® Runtime (android ® The hardware abstraction layer (HAL) and kernel layer communicate with each other through software interfaces.
[0096] 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.
[0097] The application framework layer can be used to provide application programming interfaces (APIs) and services for applications in the application layer, which may include a window manager, content provider, view system, phone manager, location-based services (LBS) manager, NFC service manager, resource manager, notification manager, NFC Java native interface (JNI), etc.
[0098] The window manager can be used to manage window programs. For example, it can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0099] Content providers can be used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0100] The view system is mainly used to build application interfaces and provides a variety of 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 feature-rich, user-friendly application interfaces.
[0101] The phone manager can be used to provide communication functions, such as the management of call status (such as connected, hung up, etc.).
[0102] The LBS manager is used to provide location functions of the electronic device, such as determining the geographic fence of the electronic device.
[0103] The NFC service manager is used to provide NFC functions for electronic devices, such as determining the NFC radio frequency parameters currently used by the electronic device.
[0104] The resource manager can provide various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0105] The notification manager can be used to convey notification-type messages, so that applications can display notification information in the status bar. For example, the displayed notification information will automatically disappear after a short stay without user interaction. The notification manager can also be used to notify download completion, message reminders, etc. The notification manager can also display notifications in the top status bar of the system in the form of icons or scroll bar text. The notification can be a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. The notification can be in the form of a text message in the status bar, a prompt sound, vibration of the electronic device, flashing of the indicator light, etc.
[0106] NFC JNI can be used to expand and optimize the NFC functionality of electronic devices, such as allowing Java code to interact with native code (such as C or C++ code), which is beneficial for optimizing underlying hardware interaction or performance.
[0107] Android ® The runtime includes core libraries and a virtual machine responsible for Android ® Scheduling and management of the system.
[0108] The core library can contain two parts: one part is the function that needs to be called by the Java language, and the other part is the Android ® The core library.
[0109] The virtual machine can be used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection, and can execute the Java files of the application layer and the application framework layer as binary files. The application layer and the application framework layer can run in the virtual machine.
[0110] System libraries may include: NFC protocol stack, surface manager, media libraries, three-dimensional (3D) graphics processing library (such as OpenGL ES), two-dimensional (2D) graphics engine (such as SGL), etc. NFC protocol stack can be used to support NFC functions, such as determining NFC radio frequency parameters and completing NFC card swiping. Surface manager can be used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. Media library can support playback and recording of multiple commonly used audio and video formats, as well as static image files. The audio and video encoding formats supported by the media library include MPEG4, highly compressed digital video codec standard (H.264), moving picture experts group audiolayer III (MP3), advanced audio coding (AAC), adaptive multi-rate (AMR), joint photographic expert 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 a drawing engine for 2D drawing.
[0111] The hardware abstraction layer is the interface layer between the kernel layer and the hardware layer, which may include LBS interface, NFC interface, Bluetooth, and camera, etc.
[0112] The kernel layer can be used to provide basic functions of the operating system, such as process management, memory management, device drivers, network protocol stacks, etc. Among them, the device driver 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, SWP, etc.
[0113] It is to 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 shown in the figure, or combine certain components, or split certain components, or arrange the components differently. 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 shown in the figure, and each layer may also include more or fewer modules than shown in the figure.
[0114] In some embodiments, the electronic device may further include a security element (SE) (eg, Figure 4 As shown), the function is similar to that of eSE. SE can be set in the processor 110, in the SIM card, or independently.
[0115] In the embodiment of the present application, an electronic device equipped with SE or eSE can use a hardware-based virtual card emulation (VCE) mode to simulate an NFC card. When the electronic device uses a host-based card emulation (HCE) mode to simulate an NFC card, the above SE and eSE can be omitted.
[0116] Figure 5 This is an example of an NFC-based communication method between an electronic device simulation card and a card reader provided in an embodiment of the present application. Figure 5 As shown, when a user swipes a card using an electronic device, the electronic device enters the radio frequency field of the card reader and detects the card reader. Specifically, the card reader can continuously or periodically transmit a radio frequency signal with a frequency of 13.56 megahertz (MHz), thereby generating an electromagnetic field propagating through space near the card reader, that is, a radio frequency field. When the electronic device enters the radio frequency field, the oscillating circuit of the antenna generates a voltage under the influence of the radio frequency field, and the electronic device determines that the card reader is detected based on the voltage.
[0117] After receiving the REQ sent by the card reader, the electronic device 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 to a 13.56 MHz radio frequency signal and sent out continuously or periodically to obtain information such as the type of the card in the radio frequency field. ATQ may include the application and protocol selection (ATS) and SAK supported by the electronic device. In some embodiments, when the NFC card simulated by the electronic device is in a halt state, the card reader may 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 may be type A (type A) or type B (type B). When using the type A signal interface, the card reader may send a type A REQ (REQA, whose frame may be 0x26) to the electronic device, and accordingly, the electronic device replies with a type A ATQ (ATQA, whose frame may be 0x0400). When a Type B signal interface is used, the card reader may send a Type B REQ (REQB) to the electronic device, and accordingly, the electronic device replies with a Type B ATQ (ATQB).
[0118] When the NFC card simulated by the electronic device is in the ready state, bit anti-collision or other anti-collision methods may be used to enable the NFC card simulated by the electronic device to enter an active state.
[0119] Exemplarily, after receiving the ATQ sent by the electronic device, the card reader sends the first part of the anti-collision frame (also referred to as the anti-collision command). The anti-collision command may include at least two fields: select (SEL) and number of valid bits (NVB) (each field may be 1 byte long). Among them, the SEL field is used to indicate the cascade level n (Collision Avoidance Level n, CLn) of the UID, and the NVB field is used to indicate the number of valid bits, and is also used to indicate the separation position of the anti-collision frame into part 1 and part 2. In some embodiments, the anti-collision command may further include the UID. For example, when the anti-collision command is 0x9320, the SEL value is 93, indicating that the cascade level 1 is selected, that is, the length of the UID in an anti-collision frame is 4 bytes. The NVB value is 20, indicating that there is no UID in the anti-collision command, and there is no UID in the first part of the frame, and the electronic device needs to reply with a complete 4-byte length of UID as a response.
[0120] After receiving the anti-collision command, the electronic device sends the second part of the anti-collision frame to the card reader, which contains a 4-byte UID.
[0121] When there is no conflict, the card reader can send a select (SELECT) command to the electronic device. The SELECT command contains SEL, NVB and the complete UID. For example, 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.
[0122] After receiving the SELECT command, the electronic device switches from the ready state to the active state and returns a SAK, which indicates that the UID is complete. For example, a 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, identity authentication, and authorization.
[0123] For example, after receiving SAK, the card reader may send a select response request (RATS), which may include a proximity coupling device frame length integer (FSDI) and a card identifier (CID), and its frame may be 0xE080. For details, refer to ISO / IEC14443.
[0124] After receiving the RATS command, the electronic device returns an answer to select (ATS).
[0125] After receiving the ATS, the card reader sends a SELECT command containing the application identity (AID) according to the ATS content.
[0126] After receiving the SELECT command containing the AID, the electronic device can find the corresponding application (APP) according to the AID and activate it, so that the application can conduct subsequent NFC communication with the card reader. The application can be one of the NFC cards simulated by the card reader, such as a transportation card, membership card, shopping card, access card, social security card, etc.
[0127] The activated NFC card performs NFC communication with the card reader and sends corresponding information to the card reader.
[0128] The card reader performs operations such as deduction, identity authentication or authorization according to the information sent by the NFC card. After the operation is completed, a card swipe success message is sent to the electronic device, and the communication with the electronic device is terminated.
[0129] In an embodiment of the present application, the response content such as UID, SAK, ATS, etc. sent by the electronic device to the card reader can generate a radio frequency signal using the configured load modulation amplitude (LMA), noise and other radio frequency parameters, and send the generated radio frequency signal to the card reader using the configured frame delay time (FDT).
[0130] 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, the card swiping may fail. For example, if the LMA is too small, it will affect the key performance indicators (KPI) and card reader compatibility. In addition, the card reader is sensitive to LMA. If the LMA is too large, the card reader may not be able to demodulate the signal sent by the electronic device, causing the card swiping to fail.
[0131] 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 card reader's acquisition of effective information in the radio frequency signal, that is, affects the card reader's KPI performance, and may cause card swiping failure. For example, if the card reader's radio frequency field is interfered by noise (clutter), the noise is too large to affect the electronic device demodulation, resulting in card swiping failure.
[0132] FDT is the interval time from receiving a signal to sending a signal (or sending a signal to receiving a signal), for example, the interval time can be in the range of 9.43us*n-74ns to 9.43us*n+74ns. FDT can affect the compatibility of the card reader. For example, when the FDT configured by the electronic device is inconsistent with the FDT required by the card reader, the card reader may fail to receive the signal, causing the card swiping to fail.
[0133] Usually, electronic devices set the values of LMA, noise, and FDT according to the hardware structure. For example, each mobile phone sets the corresponding LMA and noise values according to the internal NFC chip model, antenna position, NFC chip volume, and Integrated Product Development (IPD) layout. For another example, electronic devices set the corresponding FDT value according to different card readers.
[0134] However, the values of LMA, noise and FDT also need to match the actual card swiping situation, or in other words, meet the actual card swiping situation to ensure the success of the card swiping. For example, when swiping a 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 the success of the card swiping. The card swiping habits of different users or the different card swiping actions of the same user each time may lead to differences in the direction of the NFC antenna in the electronic device, the distance between the NFC antenna and the card reader, etc., so that the LMA and noise set by the electronic device according to the hardware structure do not match the actual situation, resulting in card swiping failure. For example, when the electronic device is manufactured, the FDT value is set according to a known or existing card reader on the market. However, when the user uses the electronic device to swipe the card, he may face an unknown or new card reader, which causes the FDT to not match the card reader, resulting in card swiping failure.
[0135] For the convenience of description, the card swiping habit or card swiping action that affects the direction of the NFC antenna in the electronic device, the distance between the NFC antenna and the card reader, etc., is referred to as the card swiping posture. The card swiping posture 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 is facing the card reader or facing away from the card reader), etc. In the embodiment of the present application, the screen side of the electronic device can be regarded as the front of the electronic device, and the side of the electronic device facing away from 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. When the back of the electronic device faces the card reader, it can be regarded as the electronic device facing away from the card reader.
[0136] One way to improve the success rate of card swiping is to conduct actual card swiping tests on each electronic device for the NFC card simulated by the electronic device to obtain a better NFC radio frequency parameter value. For example, for the transportation card of each city simulated by the electronic device, multiple NFC radio frequency parameter (LMA, noise, FDT) combinations (parameter groups) are set for each electronic device for road testing. Then, based on the success rate of the road test, the relatively optimal parameter group for each electronic device is determined. Among them, multiple parameter groups represent multiple value combinations of LMA, noise and FDT. For example, parameter groups 1 to 6 in Table 1 can be expressed as (x1, y1, z1), (x2, y2, z2), ..., (x6, y6, z6) in turn, 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 parameters of LMA, noise and FDT may be the same. For example, parameter group 1 to parameter group 6 may also be (x1, y1, z1), (x2, y2, z1), …, (x6, y6, z1), or, may be expressed as (x1, y1, z2), (x2, y2, z2), …, (x6, y6, z2), and so on.
[0137]
[0138] As shown in Table 1, for the AA transportation card, the optimal NFC radio frequency parameters of the electronic device XX are parameter group 2, and the optimal NFC radio frequency parameters of the electronic device YY are parameter group 4. For the BB transportation card, the optimal NFC radio frequency parameters of the electronic device YY are parameter group 6. Then, the NFC radio frequency parameters of parameter group 2 can be preset in the electronic device XX, the NFC radio frequency parameters for simulating the AA transportation card can be preset in the electronic device YY as parameter group 4, and the NFC radio frequency parameters for BB transportation card can be preset as parameter group 6. When the user uses the electronic device XX preset with parameter group 2 to simulate the AA transportation card swipe, the card swiping success rate can be guaranteed, and the user's card swiping experience can be improved. When the user uses the electronic device YY preset with parameter group 4 to simulate the AA transportation card swipe, or when the user uses the electronic device YY preset with parameter group 6 to simulate the BB transportation card swipe, the card swiping success rate can be guaranteed, and the user's card swiping experience can be improved.
[0139] However, on the one hand, the actual card swiping test is a manual method, which is costly and inefficient. For example, for road testing, the scenarios are relatively complex, including subways, buses, small-amount consumption, taxi card consumption, bus and subway station recharge, subway ticket booth ticket status query and update, etc. Secondly, the test of each scenario is relatively cumbersome. For example, for subway road testing, it is necessary to fully cover the subway lines in each city, and test 3 to 4 stations (including stations that have failed the test before) on each line, with 2 in and 2 out of each station, for a total of 4 card swipes. In addition, retesting is required every time the NFC radio frequency parameters are adjusted. For bus road testing, 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, which requires about 120 card swiping. In addition, bus road testing includes single and multiple card swiping of the same bus POS, as well as segmented charging scenarios. In addition, road testing also includes testing of card swiping with the power off, smart flash card, interoperable card swiping in different places, station display, subway entry and exit status display, and consumption record display.
[0140]
[0141] As can be seen from Table 2, the actual card swipe test is costly and inefficient. In addition, when a single device uses a new NFC chip for the first time, more road tests are required than for an improved NFC chip, and the costs are correspondingly higher. The new NFC chip refers to the NFC chip from a new manufacturer.
[0142] On the other hand, the users of each electronic device vary greatly, resulting in different card swiping postures. For example, when different users use their mobile phones to simulate traffic card swiping, some are accustomed to facing the screen to the gate card swiping area, some are accustomed to facing the external camera area to the gate card swiping area, and some are accustomed to facing the middle of the back of the phone to the gate card swiping area, 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 the best for the tester himself, and may not be the best NFC radio frequency parameter for other different users. Therefore, when different users swipe the card with the optimal NFC radio frequency parameter value measured by the tester, the card swiping may fail.
[0143] On the other hand, the card reader used in the actual card swiping test may be different from the card reader encountered by the user when swiping the card. This will cause the optimal FDT value obtained in the actual card swiping test to be unsuitable for the card reader encountered by the user when swiping the card, resulting in card swiping failure.
[0144] In order to improve the success rate of card swiping, the present application embodiment provides a communication method based on NFC, such as Figure 6a As shown, the method can be applied to any electronic device supporting NFC provided in the embodiments of the present application, including: Step 601: After the electronic device detects the card reader, it collects the card swiping information.
[0145] 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.
[0146] In some embodiments, the method of collecting the card reader information may be: the electronic device prompts the user to inform the card reader information, and receives the user's voice through components such as a microphone and an audio module, and obtains the card reader information based on the voice. Alternatively, the electronic device senses the user's input operation through a touch screen to obtain the card reader information. In other embodiments, the method of collecting the card reader information may be: the electronic device obtains the card reader information based on the card reader image obtained by the camera. This method can not only reduce unnecessary user operations and improve the user's experience, but also improve the efficiency of collecting information. Accordingly, 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 electronic device's screen relative to the card reader, the distance between the electronic device and the card reader, and the card reader information through the camera.
[0147] In some embodiments, the method for collecting card swiping gesture information can be: the electronic device obtains the orientation of the electronic device through direction sensors such as acceleration sensors and gyroscope sensors, obtains the tilt angle of the electronic device through the level function in the application camera, and obtains the direction of the NFC antenna based on the orientation and tilt angle.
[0148] In some embodiments, collecting the card swiping gesture information may be: the electronic device obtains the distance between the electronic device and the card reader through the sensing of a distance sensor. In other embodiments, the distance between the electronic device and the card reader may be obtained by the electronic device based on an image obtained by a camera.
[0149] In some embodiments, this step may include: Figure 6b Step 611 and step 612 are shown.
[0150] Figure 6b Another example of a communication method based on NFC is provided in an embodiment of the present application. In this embodiment, the communication method includes: Step 611: After the electronic device enters the radio frequency field of the card reader, the card reader is detected by sensing the radio frequency signal.
[0151] In this embodiment, the electronic device can use the VCE mode or the HCE mode to simulate NFC cards such as transportation cards, shopping cards, membership cards or bank cards.
[0152] Step 612: The electronic device collects the card swiping information.
[0153] For example, the electronic device can turn on the camera to collect the information of the card reader, and obtain the distance between the electronic device and the card reader based on the image captured by the camera. It can also obtain the orientation of the electronic device through the acceleration sensor and the gyroscope, and obtain the inclination angle of the electronic device through the level. In some embodiments, when the electronic device is provided with cameras on the front and back, the camera on the back can be turned on, and when the electronic device is facing away from the card reader, the camera can capture the image of the card reader. In some embodiments, the electronic device can also turn on the camera on the front, and when the electronic device is facing the card reader, the camera can capture the image of the card reader. In other embodiments, the electronic device can turn on the front and back cameras at the same time, so that no matter whether the electronic device is facing the card reader or facing away from the card reader, the card reader image can be captured to obtain the information of the card reader, thereby improving the success rate of collecting the information of the card reader.
[0154] Step 602: Determine a set of radio frequency parameters according to the card swiping information.
[0155] A set of radio frequency parameters includes LMA, noise and FDT, and the noise is the clutter of the NFC operating frequency.
[0156] In some embodiments, the electronic device determines the value of one or more of LMA, noise and FDT based on the card swiping information as follows: 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 based on the card swiping information to obtain a better value of one or more of LMA, noise and FDT.
[0157] In other embodiments, the electronic device determines the value of one or more of LMA, noise and FDT according to the card swiping information in the following manner: the electronic device selects the group with the highest matching degree from one or more preset parameter groups as the optimal LMA, noise and FDT values according to the card swiping information. Specifically, the preset one or more parameter groups may be stored in the memory shown in the embodiment of the present application. In some embodiments, the preset one or more parameter groups may also be stored in an external device such as an external memory or a server. The electronic device may obtain the preset one or more parameter groups from an external device such as an external memory or a server periodically after detecting the card reader. In other embodiments, the server may periodically send parameter groups so that the electronic device obtains the preset one or more parameter groups.
[0158] In some embodiments, an external device such as an electronic device, an external memory or a server may set the index item of the preset one or more parameter groups as the card swiping information, or save the preset one or more parameter groups and the card swiping information through a mapping relationship.
[0159] In some embodiments, this step can be performed as follows Figure 6b Step 613 is shown.
[0160] Step 613: The electronic device determines the value of one or more of LMA, noise and FDT according to the card swiping information.
[0161] For example, the electronic device may determine the values of LMA and noise according to the orientation of the electronic device, the tilt angle, and the distance between the electronic device and 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 does not have a matching FDT value, the preset FDT value may be used as the determined FDT value for NFC communication. Wherein, the collected information of the card reader does not have a 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 (that is, the parameter group corresponding to the preset card swiping information that is closest to the collected card swiping information) from the preset parameter groups according to the card swiping information as the determined LMA, noise and FDT values.
[0162] In some embodiments, when the card swiping gesture information and the card reader information collected by the electronic device do not match the card swiping information corresponding to the preset parameter group, the electronic device may select the parameter group corresponding to the card swiping information with a higher matching degree for swiping the card. For example, when the preset parameter groups are parameter group 1 (x1, y1, z1) and parameter group 2 (x2, y2, z1), the card reader information corresponding to parameter group 1 and parameter group 2 is consistent, but the card swiping gesture information corresponding to parameter group 1 has a higher matching degree with the collected card swiping gesture information than parameter group 2, then parameter group 1 is selected as the determined parameter group. For another example, when the preset parameter groups are parameter group 1 (x1, y1, z1) and parameter group 2 (x2, y2, z2), the card swiping gesture information corresponding to parameter group 1 and parameter group 2 deviates greatly from the collected card swiping gesture information, and the card reader information corresponding to parameter group 2 matches the collected card reader information more, then parameter group 2 is selected as the determined parameter group, and so on.
[0163] Step 603: Use a set of radio frequency parameters to perform NFC communication with a card reader.
[0164] The technical solution provided in this embodiment collects one or more of the information of the card reader and the card swiping posture information through an electronic device, determines the value of one or more of LMA, noise and FDT according to the card swiping information, and performs NFC communication based on the determined values of LMA, noise and FDT. In this way, even if different users swipe the card or the same user swipes the card each time, LMA, noise and FDT can be matched with the hardware structure while having a better match with the actual card swiping situation, thereby improving the success rate of card swiping. In addition, the NFC-based communication method provided in the embodiment of the present application does not require manual testing such as road testing, which saves testing costs and improves the production efficiency of electronic devices.
[0165] In some embodiments, this step can be performed as follows Figure 6b Step 614 shown: the electronic device performs NFC communication with the card reader based on the determined LMA, noise and FDT.
[0166] For example, when an 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. Figure 6c As shown, including: Step 621: The card reader selects the electronic device, and Figure 5 The steps before the electronic device sends "data or information to be verified and authorized, etc." are similar.
[0167] Step 622: After the electronic device is selected, it performs a card swipe transaction with the card reader. For example, after the electronic device is selected, that is, the simulated NFC card is selected, the system application such as the wallet application in REE sends the card information to eSE through TEE, and eSE performs a security check on the card based on the card information and activates the card. Alternatively, NFCC sends the card information selected by the card reader directly to eSE to activate the card. After that, eSE exchanges information or data with the card reader through the Application Protocol Data Unit (APDU) instructions through NFCC to perform a card swipe transaction. After the card reader completes the relevant operations, it notifies the electronic device that the card swipe is successful.
[0168] When the camera in step 612 does not capture the card reader image, for example, when the electronic device opens the rear camera and faces the card reader, the electronic device can further find the corresponding NFC card information (such as UID) based on the AID sent by the card reader, and use the NFC card information to obtain the corresponding card reader information.
[0169] In some embodiments, when the card swipe is successful, the communication method may further include: Step 615: The electronic device reports the collected card swiping information, the adopted LMA, the noise and the FDT value to the server. When the server receives the information reported by the electronic device, it assumes that the card swiping is successful. In some embodiments, the electronic device may further report the card swiping result. In some embodiments, the server may be a cloud server.
[0170] In some embodiments, the electronic device may further report site information (i.e., location information of the card reader, such as subway station information, bus station information, office building information, shopping mall / mall information, gym information, hospital information, catering and entertainment venue information, etc.), its own hardware information, such as one or more of the model, serial number, and simulated card type, etc., to the server. 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 groups at various sites or card readers. 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 group, so that the electronic device can swipe the card successfully faster, and further improve the user experience.
[0171] In some embodiments, the server may send a more optimal parameter group of the same model to the electronic device. For example, the server counts the number of successful card swiping of electronic devices XX and YY at various sites or card readers using different parameter groups under different card swiping postures, and then sends the statistically preferred parameter group of XX at various sites or card readers using different card swiping postures to the electronic device XX, and sends the statistically preferred parameter group of YY at various sites or card readers using different card swiping postures to the electronic device YY.
[0172] In some embodiments, the communication method may further include: the electronic device stores one or more of the site information, the card reader information, the card type, the card swiping posture information, the parameter group used, and the card swiping result locally. Exemplarily, the electronic device may store the site information, the card reader information, the card type, the card swiping posture information, and the parameter group in the memory shown in the embodiment of the present application. For example, the electronic device may store the site information, the card reader information, the card type, the card swiping posture information, and the parameter group involved in each card swiping (successful card swiping) in one row, with the site information, the card reader information, or the card type as the index item.
[0173] In some embodiments, the electronic device may obtain site information through map point of interest (POI) information.
[0174] In some embodiments, when the electronic device fails to obtain the card 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 the card reader information from the NFC controller. Among them, HCI can be mainly used for the transmission and analysis of transaction information in the embodiment of the present application. For example, after the NFC controller obtains the gate number (such as 102702000899) according to the AID, it interacts with the DH of the electronic device through the HCI protocol and sends to the DH of the electronic device such as: E3019000F12B 9F02 06 000000000000 5F2A 02 0156 9F79 06 000000000CB29A03 240831 9F21 03 112425 9F1C 06 102702000899 Among them, E3019000F12B indicates HCI protocol information; 9F02 indicates the transaction amount, 06 indicates that the transaction amount field length is 6 bytes, and 000000000000 indicates that the transaction amount is 0; 5F2A indicates the currency symbol, 02 indicates the currency symbol field length is 2 bytes, and 0156 indicates the transaction currency symbol is yuan; 9F79 indicates the balance, 06 indicates that the balance field length is 6 bytes, and 000000000CB2 indicates that the balance is 3250; 9A03 indicates the transaction date, and 240831 indicates the transaction date is August 31, 24; 9F21 indicates the transaction time, 03 indicates that the actual transaction field length is 3 bytes, and 112425 indicates that the transaction time is 11:24:25; 9F1C indicates the terminal number, 06 indicates that the terminal number field length is 6 bytes, and 102702000899 is the gate number.
[0175] The electronic device DH obtains the gate number from the above data sent by the NFC controller.
[0176] Figure 7 Another example of a communication method based on NFC is provided in the embodiment of the present application. Figure 6b The difference of the illustrated embodiment is that the communication method further comprises: Step 701: The electronic device determines that the card swipe fails.
[0177] If the electronic device does not receive any of the anti-collision commands, SELECT commands, RATS commands, etc. sent by the card reader in step 614, it is determined that the card swiping has failed. Exemplarily, the electronic device may start timing at the moment when the card reader command should be received but is not received. When the timing reaches a threshold and the card reader command is still not received, it is determined that the card swiping has failed. One reason for the card swiping 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 group cannot meet the requirements of the card reader, that is, the parameter group determined by the electronic device is not suitable and needs to be further optimized to meet the requirements.
[0178] Step 702: The electronic device adjusts one or more values of LMA, noise and FDT according to the card swiping information to obtain another set of radio frequency parameters.
[0179] In some embodiments, this step includes: adjusting the values of LMA and noise based on 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 FDT based on information from the card reader.
[0180] For example, in step 613, when the electronic device selects the most matching parameter group from the preset parameter group based on the card swipe information, the card swipe information corresponding to the parameter group may not be similar to the collected card swipe information or may have a large deviation, resulting in the electronic device generating and sending a radio frequency signal based on the most matching parameter group, but the card reader still cannot demodulate the radio frequency signal sent by the electronic device, 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 group determined in step 613, and adjust the parameter group according to the comparison result.
[0181] In some embodiments, adjusting one or more values of LMA, noise and FDT according to the card swiping information includes: 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 LMA, noise and FDT according to the comparison result.
[0182] For example, when a user uses a mobile phone with a BB transportation card to swipe the card at the subway gate at Wuhan Guanggu Square subway station, the mobile phone detects the gate, collects the card swiping information, and determines the parameter group (64, 23, 6) based on the card swiping information, where the LMA value is 64, the noise value is 23, and the FDT value is 6ms. After that, the mobile phone DH sends the parameter group (64, 23, 6) to the NFC controller for configuration, as follows: #LMA, Noise, FDT HW_RF_CONF_BLK={ #Open the channel 20, 02, 7F, 05, #Adjust 6A register A0, 6A, 10, 64, 00, B4, 00, B4, 00, B4, 00, 1C, 02, 1C, 02, 1C, 02, / / Set the LMA value in register 6A to 64 #Adjust 0E register 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 register 0E to 23 #FDT 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", the value of FDT = 9.43 * (A8+FD+D0+02) = 9.43*631 =5950us=6ms }; The NFC controller interacts with the gate using the configured parameter group (64, 23, 6), causing the card swipe to fail.
[0183] Assume that the preset card swiping information corresponding to the parameter group (64, 23, 6) is: the phone is facing away from the gate, the distance between the phone and the gate is 5cm, and the gate model is 06102701034613. The card swiping information collected by the mobile phone is: the phone is facing away from the gate, the distance between the phone and the gate is 20cm, and the gate model is 06102701034613. After the mobile phone DH compares the two, it determines that the reason for the failure may be that the distance between the phone and the gate is too far. Therefore, the noise value is reduced accordingly (such as reduced to 20) to reduce clutter, and the LMA value is increased (such as increased to B4) to strengthen the signal, and another set of RF parameters (LMA=B4, noise=20, FDT=6) is obtained, and the parameter group is reconfigured as (B4, 20, 6), as follows: HW_RF_CONF_BLK={ #Open the channel 20, 02, 7F, 05, #Increase the value of LMA for register 6A A0, 6A, 10, B4, 00, B4, 00, B4, 00, B4, 00, 1C, 02, 1C, 02, 1C, 02,1C, 02, #Reduce the noise value for the 0E register 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, #FDT 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, }; In some embodiments, the reason for the card swiping failure may be that the value of FDT is not optimal, such as when the preset parameter groups are parameter group 1 (x1, y1, z1) and parameter group 2 (x2, y2, z1) (assuming that x1 and x2 are LMA values, y1 and y2 are noise values, and z1 is the value of FDT), and the card swiping gesture information corresponding to x1 and y1 completely matches the card swiping gesture information of the mobile phone, and the card reader information corresponding to z1 does not match the collected card reader information, 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.
[0184] 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.
[0185] This step may be similar to step 615. In some embodiments, the electronic device may start by replying ATQ and interact with the card reader again. In some embodiments, the electronic device may also start by replying before receiving the card reader command and interact with the card reader again. For example, when the electronic device fails to swipe the card because it does not receive the RATS sent by the card reader, it may start by replying SAK and interact with the card reader again. For another example, 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 may start by replying ATS and interact with the card reader again, and so on.
[0186] For example, assuming that after the card is swiped successfully, the NFC controller sends the HCI information to the electronic device DH as follows: E3019000F12B 9F02 06000000000000 5F2A 020156 9F79 06000000000050 9A03 2408319F21 03112419 9F1C 06102701034613. Then the electronic device DH can obtain the following information: the transaction amount is 0 yuan, the balance is 50 yuan, the transaction date is August 31, 24 years, the transaction time is 11:24:19, and the card reader number is 06102701034613. For example, the electronic device can report its own model such as XX, station Wuhan Optics Valley Plaza, card swiping information (back to back, 20cm, gate number 06102701034613), parameter group (B4, 20, 6) and other information to the server. When an electronic device XX is subsequently at Optics Valley Plaza subway station, with its back facing the same type of gate numbered 06102701034613, and swiping the card 20cm away from the gate, the parameter group (B4, 20, 6) sent by the server can be directly used to successfully swipe the card, which can not only further improve the card swiping speed, card swiping success rate and user experience, but also reduce unnecessary processing of the electronic device, thereby saving energy and improving the performance of the electronic device.
[0187] In some embodiments, when step 703 still fails to swipe the card successfully, step 702 may be performed again until the card swipe is successful. For example, assuming 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 swiping gesture information corresponding to x1 and y1 completely matches the card swiping gesture information of the mobile phone, and the card reader information corresponding to z0 does not match the collected card reader information, then the values of LMA and noise continue to remain unchanged, and the value of FDT may be further adjusted until the card swiping is successful.
[0188] In some embodiments, when the electronic device fails to swipe the card, the values of LMA and noise may be adjusted preferentially. When the adjusted values fail again, the electronic device may adjust the value of FDT until the card swiping succeeds.
[0189] In some embodiments, the electronic device can directly obtain the optimal parameter group based on the statistical results of the server over a period of time, ensuring that the user can swipe the card quickly and successfully at one time, and improving the user's experience of various card swiping gestures. It is understandable that the longer the server statistics time, the higher the user's card swiping success rate and the better the experience.
[0190] Figure 8 Another example of a communication method based on NFC is provided in the embodiment of the present application. Figure 6bThe difference of the illustrated embodiment is that before the electronic device swipes the card, the communication method further includes: Step 801: The electronic device activates a simulated NFC card, such as activating a user's transportation card.
[0191] Step 802: The electronic device requests a parameter group from the server. The parameter group may be a parameter group related to the model of the electronic device and the type of the simulated NFC card.
[0192] For example, assuming that the model of the electronic device is XX and the type of the simulated NFC card is BB, a parameter group related to XX and BB is requested from the server. In some embodiments, the electronic device may regularly / periodically request a parameter group related to the model of the electronic device and the type of the simulated NFC card from the server, or the electronic device may request the server to regularly or periodically send a parameter group related to the model of the electronic device and the type of the simulated NFC card.
[0193] Step 803: The server returns a corresponding parameter group to the electronic device. For example, the corresponding parameter group may be a parameter group related to the electronic device model and the type of the simulated NFC card.
[0194] In some embodiments, after the electronic device requests a parameter group related to the electronic device model and the card type of the simulated NFC card from the server once, the server may periodically or cyclically send the parameter group related to the electronic device model and the card type of the simulated NFC card to the electronic device. For example, the server may periodically or cyclically send the parameter group of the same model at different sites and different card swiping postures to the electronic device.
[0195] 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 embodiment of the present application). When the server regularly or periodically sends the parameter group related to the electronic device model and the card type of the simulated NFC card to the electronic device, the site information, card swiping posture information and parameter group locally saved by the electronic device will be continuously updated and will be richer, which is more conducive to improving the card swiping success rate, speed and user experience.
[0196] Exemplarily, the parameter group obtained by the electronic device from the server for the first time is shown in Table 3.
[0197]
[0198] It is understandable that the server may not send its model information to the electronic device, and the electronic device may not save its own model (such as the model column can be omitted in Table 3), which can reduce the network load and save the storage space of the electronic device.
[0199] After one or more updates, the parameter group saved by the electronic device is shown in Table 4.
[0200]
[0201] As can be seen from Table 4, there are more parameter groups stored, and the corresponding card swiping gestures are also richer, which can match more card swiping gestures of users. Therefore, when the user uses the electronic device XX to simulate BB to swipe the card at Optics Valley Plaza, it can more quickly obtain the optimal RF parameters for this card swiping, making the card swiping success rate higher, achieving the effect of one-time quick card swiping success, and the speed is faster and the user experience is better.
[0202] Afterwards, when the user uses the electronic device to swipe the card, the electronic device executes the same Figure 6b The process is similar to the method shown.
[0203] For example, when a user uses a mobile phone XX with a BB transportation card to swipe the card at the subway gate at Wuhan Guanggu Square subway station, the mobile phone is 3 cm away from the gate, tilted 45 degrees upward, and facing away from the gate. The mobile phone DH selects the matching parameter value 3 (such as LMA value B4, noise value 20, FDT value 6ms) from Table 4 and sends it to the NFC chip in the mobile phone through the following code: HW_RF_CONF_BLK={ #Open the channel 20, 02, 7F, 05, #Increase the value of LMA for register 6A A0, 6A, 10, B4, 00, B4, 00, B4, 00, B4, 00, 1C, 02, 1C, 02, 1C, 02,1C, 02, #Reduce the noise value for the 0E register 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, #FDT 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, }; After the card is swiped successfully, the mobile phone sends the following information (as shown in Table 5) to the server:
[0204] After receiving the information, the server updates the row of information for the number of successful card swiping, or in other words, updates the number of successful card swiping corresponding to parameter group 3, such as adding 1 to the number of successful card swiping corresponding to parameter group 3, to further improve the success rate of electronic device card swiping.
[0205] Fig. 9 This is a possible structural example of an electronic device provided in an embodiment of the present application.
[0206] refer to Fig. 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 to store input data required for the processor 901 to run instructions, or to 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 in the embodiments of the present application.
[0207] Alternatively, see Fig. 9 The processor 901, the memory 902 and the communication interface 903 are interconnected via a bus 904. The bus 904 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0208] The chip provided in the embodiment of the present application may be a chip or chip system in the above-mentioned electronic device, having a function that can realize the communication method based on NFC provided in 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, and the processor is connected to the memory through the communication interface, and reads and executes the computer program or instruction stored in the memory to realize any communication method based on NFC provided in the embodiment of the present application. In some embodiments, the memory may also be omitted in the chip, in which case the processor may call the computer program or instruction from an external storage device through the communication interface. In some embodiments, the chip system may be composed of a chip. Exemplarily, the chip system may include a processor chip, a communication interface chip and a memory chip, and the processor chip is connected to the memory chip through the communication interface chip, and reads and executes the computer program or instruction stored in the memory chip to realize any communication method based on NFC provided in the embodiment of the present application. In other embodiments, the chip system may include a chip and other discrete devices.
[0209] It should be clear that the embodiments described in this application are only some embodiments, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0210] 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", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. The term "and / or" used in this article is merely an association relationship describing associated objects, indicating that three relationships may exist, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0211] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment 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) or a random access memory (RAM), etc.
[0212] In a specific implementation, the present invention further provides a computer program product, wherein the computer program product includes executable instructions, and when the executable instructions are executed on a computer, the computer executes part or all of the steps in each embodiment of the NFC-based communication method provided by the present invention.
[0213] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.
[0214] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. A communication method based on NFC, characterized in that: Applied to an electronic device supporting NFC, the electronic device is used to simulate an NFC card, and the method includes: After the electronic device detects the card reader, it collects card swiping information, wherein 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 information about the card reader; Determining a set of radio frequency parameters according to the card swiping information, wherein the set of radio frequency parameters includes LMA, noise, and FDT, and the noise is a clutter of the NFC operating frequency; Perform NFC communication with the card reader using the set of radio frequency parameters.
2. The communication method according to claim 1, wherein: In the event that the NFC communication fails, the method further includes: Adjust one or more values of the LMA, the noise, and the FDT according to the card swiping information to obtain another set of radio frequency parameters; Perform NFC communication with the card reader using the other set of radio frequency parameters.
3. The communication method according to claim 1 or 2, characterized in that: Before collecting the card swiping information, the following steps are also included: Turn on the camera; The collection of card swiping information includes: 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 information of the card reader are acquired through the camera.
4. The communication method according to claim 2, wherein: The adjusting one or more values of the LMA, the noise, and the FDT according to the card swiping information includes: 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, The value of the FDT is adjusted according to the information of the card reader.
5. The communication method according to claim 1, wherein: In the case where the card swiping information lacks the card reader information, the method further includes: During the NFC communication process, the information of the card reader is obtained according to the card type of the NFC card.
6. The method according to any one of claims 2 or 4, characterized in that The adjusting one or more values of the LMA, the noise, and the FDT according to the card swiping information includes: The card swiping information is compared with the card swiping information corresponding to the set of radio frequency parameters, and one or more values of the LMA, noise and FDT are adjusted according to the comparison result.
7. The method according to any one of claims 1, 2, 4 and 5, characterized in that: The determining a set of radio frequency parameters according to the card swiping information includes: According to the card swiping information, a set of radio frequency parameters is selected from one or more preset sets of radio frequency parameters.
8. The method according to any one of claims 1, 2, 4 and 5, characterized in that: Before determining a set of radio frequency parameters according to the card swiping information, the method further includes: Receive one or more sets of radio frequency parameters sent by the server; The determining a set of radio frequency parameters according to the card swiping information includes: According to the card swiping information, a set of radio frequency parameters is selected from the one or more sets of radio frequency parameters sent by the server.
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, the information of the electronic device, the card swiping information, and the radio frequency parameters used for the successful NFC communication are reported to the server.
10. The method according to claim 9, characterized in that Also includes: 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: include: One or more processors, a memory, and an NFC chip, the one or more processors being coupled to the memory and the NFC chip, respectively, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the one or more processors and the NFC chip execute the computer instructions, the electronic device performs the method according to any one of claims 1 to 10.
12. A chip, characterized in that: include: A processor and a communication interface, wherein the processor calls a computer program or instruction through the communication interface to execute the method according to any one of claims 1 to 10.
13. The chip according to claim 12, characterized in that It also includes a memory, which stores the computer program or instruction and is connected to the processor through the communication interface. 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 is run on a computer, the computer executes the method according to any one of claims 1 to 10.
15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program. When the computer program is run on a computer, the computer executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Load modulation method and device for NFC (Near Field Communication)
CN107844725A
Communication method and equipment based on NFC
CN112395894A
Frame delay time adjusting method and device for near field communication
CN115720349A
Communication method for near field communication device
CN116781112A
Card linking method and terminal
EP3693911A1
Cited By
NFC chip network parameter self-adaptive matching method and system and electronic equipment
CN120568370A
