WO2022252792A1 - 一种基于nfc的数据交互方法及设备 - Google Patents

一种基于nfc的数据交互方法及设备 Download PDF

Info

Publication number
WO2022252792A1
WO2022252792A1 PCT/CN2022/084673 CN2022084673W WO2022252792A1 WO 2022252792 A1 WO2022252792 A1 WO 2022252792A1 CN 2022084673 W CN2022084673 W CN 2022084673W WO 2022252792 A1 WO2022252792 A1 WO 2022252792A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
nfc
tag
card
nfc tag
Prior art date
Application number
PCT/CN2022/084673
Other languages
English (en)
French (fr)
Inventor
吕森
姚振栋
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP22814839.1A priority Critical patent/EP4336874A1/en
Publication of WO2022252792A1 publication Critical patent/WO2022252792A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • G06K7/10297Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves arrangements for handling protocols designed for non-contact record carriers such as RFIDs NFCs, e.g. ISO/IEC 14443 and 18092
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/70Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes
    • H04B5/77Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes for interrogation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/20Near-field transmission systems, e.g. inductive or capacitive transmission systems characterised by the transmission technique; characterised by the transmission medium
    • H04B5/24Inductive coupling

Definitions

  • NFC technology is used by more and more electronic devices as a bridge carrier for rapid data exchange due to its convenience and security.
  • the NFC tag can store data, and when the NFC tag is close to the electronic device supporting the NFC card reader, the electronic device can read the information of the NFC tag.
  • the embodiment of the present application provides an NFC-based data interaction method and device.
  • the card reader device can read the information of the silent tag after determining that the tag device is approaching through the NFC private card search request command, and then even if the tag device and the card reader The device is always in close proximity, the card reader device can also read the information of other NFC tags, and the NFC function of the card reader device can work normally.
  • the embodiment of the present application provides a data interaction method, which is applied to a system including a first electronic device and a first near field communication NFC tag, and the method includes: the first electronic device sends a first card search request instruction. After receiving the first card-finding request instruction from the first electronic device, the first NFC tag sends a first card-finding response instruction to the first electronic device. After receiving the first card-finding response instruction from the first NFC tag, the first electronic device reads the information of the first NFC tag. After the first electronic device reads the information of the first NFC tag, the first electronic device continues to send the first card search request command, continues to receive the card search response command from the first NFC tag, and does not read the information of the first NFC tag .
  • the method further includes: after the first electronic device continues to send the first card-finding request instruction: if the first electronic device does not receive the first card-finding request from the first NFC tag within a preset time card response instruction, the first electronic device changes the value of the first identification from the second value to the first value; if the first electronic device receives the first card search response instruction from the first NFC tag within the preset duration, Then the value of the first identifier remains as the second value.
  • the method further includes: increasing the time interval for the first electronic device to continue sending the first card search request instruction.
  • the first electronic device may indicate that the first NFC tag continues to be on-position. At this time, the first electronic device can detect whether the first NFC tag is continuously in place frequently and in real time without using the first card search request instruction, so the time interval for sending the first card search request instruction can be increased to save the first NFC tag. Power consumption of electronic equipment.
  • the system further includes a second NFC tag
  • the method further includes: the first electronic device sends a second card-seeking request instruction; If the first electronic device receives the second card search response instruction from the second NFC tag, the second card search response instruction is the second NFC tag's response to the second card search request instruction, then read the information of the second NFC tag .
  • the first electronic device may perform anti-counterfeit verification of the charger and/or configure charging parameters based on NFC.
  • the information of the first NFC tag may include an anti-counterfeit identification of the charger and/or charging optimization parameters.
  • the first NFC tag is obtained by emulating an NFC chip.
  • the first NFC tag is set in other electronic devices.
  • the embodiment of the present application provides a data interaction method, which can be applied to the first electronic device supporting the NFC card reading function of near field communication.
  • the method includes: the first electronic device sends a first card search request instruction.
  • the first electronic device receives a first card search response instruction from the first NFC tag, where the first card search response instruction is a response of the first NFC tag to the first card search request instruction.
  • the first electronic device After receiving the first card-finding response instruction from the first NFC tag, the first electronic device reads the information of the first NFC tag.
  • the first electronic device continues to send the first card search request command, continues to receive the card search response command from the first NFC tag, and does not read the information of the first NFC tag .
  • the first electronic device will no longer read the information of the first NFC tag, so that it will not continue In the data reading process, it can normally monitor and send NFC card-seeking commands, including standard card-seeking commands and private card-seeking commands, so that it can normally read the information of other NFC tags, making NFC card reading, card swiping and P2P functions able to proceed normally.
  • NFC card-seeking commands including standard card-seeking commands and private card-seeking commands
  • the first NFC tag will respond and activate based on the private NFC first card search request command, so that the first electronic device can read the information, and the standard-based NFC card search request command will not respond and activate, so it is not easy to cause Unnecessary data reading can realize on-demand triggering and on-demand reading of data.
  • the first electronic device is provided with a first identification, and the first identification indicates whether the first electronic device detects the first NFC tag; Before the card response instruction, the value of the first identification is the first value, and the first value indicates that the first electronic device has not detected the first NFC tag; the first electronic device receives the first card-finding response instruction from the first NFC tag Afterwards, the first electronic device changes the value of the first identifier from the first value to a second value, and the second value indicates that the first electronic device detects the first NFC tag.
  • the method further includes: after the first electronic device continues to send the first card search request instruction: if the first electronic device does not receive the first card search response command, the first electronic device will change the value of the first identification from the second value to the first value; if the first electronic device receives the first card search response command from the first NFC tag within the preset duration , then the value of the first identifier remains as the second value.
  • the method further includes: increasing the time interval for the first electronic device to continue sending the first card search request instruction.
  • the method further includes: the first electronic device sends a second card search request instruction;
  • the second card-finding response command of the second NFC tag, the second card-finding response command is the response of the second NFC tag to the second card-finding request command, and the information of the second NFC tag is read.
  • the method further includes: the first electronic device performs service processing according to the information of the first NFC tag.
  • the first electronic device performs business processing according to the information of the first NFC tag, including: the first electronic device performs the service processing for the second electronic device according to the identification information of the second electronic device in the first NFC tag. Charge.
  • the first electronic device performs business processing according to the information of the first NFC tag, including: the first electronic device switches the theme of the first electronic device according to the information of the first NFC tag.
  • the embodiment of the present application provides a data interaction device, the device is included in the first electronic device, and the device has the function of realizing the behavior of the first electronic device in any one of the above aspects and any possible implementation .
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • Hardware or software includes one or more modules or units corresponding to the functions described above. For example, a sending module or unit, a receiving module or unit, a reading module or unit, a processing module or unit, etc.
  • an embodiment of the present application provides a device, the device includes at least one memory, at least one processor, at least one processor is coupled to at least one memory, and reads instructions in at least one memory and makes the device according to the instructions Execute the NFC-based data interaction method executed by the first electronic device in any one of the foregoing aspects and any possible implementation manner.
  • the device may specifically be a chip, a component, or a module.
  • an embodiment of the present application provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to execute the NFC-based data interaction method.
  • an embodiment of the present application provides a data interaction system
  • the system may include a first electronic device and a first NFC tag
  • the first electronic device and the first NFC tag may be used to perform any of the above aspects and any An NFC-based data interaction method among possible implementations of the item.
  • FIG. 1A is a schematic diagram of a working mode of an NFC chip provided by the prior art
  • FIG. 1B is a schematic diagram of a processing flow for an NFC tag provided by an NFC chip in the prior art
  • FIG. 2A is a schematic diagram of wireless charging provided by the prior art
  • FIG. 3 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application.
  • FIG. 4A is a schematic diagram of a working mode of an NFC module provided in an embodiment of the present application.
  • FIG. 4C is a schematic diagram of a processing flow of an NFC module for a silent tag provided in an embodiment of the present application
  • FIG. 4D is an instruction interaction flowchart corresponding to phase 2 and phase 3 of an NFC chip provided in the embodiment of the present application;
  • FIG. 5 is a flow chart of an NFC-based data interaction method provided in an embodiment of the present application.
  • FIG. 6B is a schematic diagram of a custom theme based on NFC switching provided by the embodiment of the present application.
  • FIG. 7A is a flow chart of another NFC-based data interaction method provided by the embodiment of the present application.
  • the process flow describes the interaction process between the NFC chip in the card reader device and the first NFC tag, including the following 3 stages (stage 1-stage 3) and 3 states (state 1-state 3 ). It can be understood that the interaction process between the NFC chip and the first NFC tag is also the interaction process between the card reader device where the NFC chip is located and the tag device where the first NFC tag is located.
  • Phase 2 The first NFC tag is close to the card reader device, the NFC chip in the card reader device is activated by radio frequency with the first NFC tag, and the NFC chip reads the first NFC tag according to the NFC-A protocol process.
  • Stage 3 The first NFC tag and the card reader device continue to approach, and this stage is always in the detection process of the card being in place.
  • the NFC chip sends a standard card search request (request, REQ) command.
  • the first NFC tag and the NFC chip can receive the standard card search request command REQ within the communication range of the NFC radio frequency signal, and send the card search response command ATQ to the NFC chip.
  • the NFC chip After receiving the card search response command ATQ sent by the first NFC tag, the NFC chip determines that the first NFC tag is in place.
  • the presence status of the first NFC tag includes presence or absence.
  • On-site means that the distance between the card reader device and the NFC tag is relatively close. Within the radio frequency communication range of NFC, the NFC chip can detect the NFC tag, and the NFC tag can be discovered by the NFC chip. Absence means that the distance between the card reader device and the NFC tag is relatively long, and the NFC chip cannot detect the NFC tag.
  • the card activation command is generated according to the anti-collision response command received by the NFC chip, and is used to determine which NFC tag is activated for this communication. For example, the card activation instruction is used to instruct activation of the first NFC tag.
  • CL2 indicates that the series level of Type A is 2.
  • the first NFC tag After receiving the read command Read CMD, the first NFC tag sends a read response command Read RSP to the NFC chip.
  • the activated first NFC tag After the activated first NFC tag receives the read command Read CMD, it sends a read response command Read RSP command to the NFC chip, and carries the information of the first NFC tag. In this way, the NFC chip has just read the information of the first NFC tag.
  • the instruction interaction process corresponding to stage 3 shown in FIG. 1B includes:
  • the NFC chip sends a card detection instruction to the first NFC tag.
  • the card detection instruction is used to detect whether the first NFC tag is in place continuously.
  • the first NFC tag After receiving the card detection instruction, the first NFC tag sends a card detection response instruction to the NFC chip.
  • the NFC chip After receiving the card detection response command, the NFC chip sends a read command Read CMD to the first NFC tag.
  • the NFC chip After the NFC chip receives the card detection response command sent by the first NFC, it determines that the first NFC tag is continuously in place (that is, the first NFC tag and the card reader device are in a continuous close state), so it sends a read command to the first NFC tag, To read the information of the first NFC tag again, so as to execute the data reading process again.
  • the NFC tag After receiving the read command Read CMD, the NFC tag sends a read response command Read RSP.
  • stage 3 the first NFC tag is in the active mode, and the first NFC tag and the card reader device are always in a close state, that is, the first NFC is always in place, and the NFC chip and the first NFC tag perform steps 109-112 cyclically. In this way, the NFC chip will continuously read the information of the first NFC tag, resulting in a large power consumption of the NFC chip.
  • the NFC chip triggers a reset command, thereby repeatedly executing the above steps 101-108 with the first NFC tag, and the NFC chip continuously reads the first NFC tag multiple times. Tag information, resulting in a large power consumption of the NFC chip.
  • the NFC chip cannot discover other NFC tags and perform data interaction, and cannot perform normal NFC card swiping, card reading, or P2P interaction functions, and the NFC function of the NFC chip fails or is seriously affected.
  • NFC tags can be understood as traditional NFC tags, and can be called NFC universal tags, NFC universal cards, or NFC standard tags. Different from NFC general tags, there is still a kind of NFC silent tags, which can also be called NFC silent cards, or NFC private cards.
  • the silent tag is in the silent state by default. Only after receiving a specific NFC private card search request command, the silent tag responds, so that the card reader device can read the information of the silent tag. When the card reader device sends the NFC standard card search request command according to the NFC protocol, the silent tag does not respond, and the card reader device cannot read the information of the silent tag.
  • NFC data interaction can be realized through the cooperation of silent tags and trigger devices such as Hall sensors.
  • the card reader device is a mobile phone
  • the tag device is a mobile phone case.
  • the silent tag is silent by default, and the mobile phone sends NFC standard commands, and the silent tag will not respond.
  • the Hall sensor is triggered to work.
  • the Hall detector of the mobile phone detects that the mobile phone case is on, and the mobile phone is started to send the NFC private card search request command and read command, and perform data interaction with the silent tag. After the data interaction is completed or the mobile phone case is removed, the mobile phone stops sending private card search request commands and read commands, and closes the silent tag reading process.
  • the card reader device is a mobile phone
  • the tag device is a wireless charger.
  • the magnet of the wireless charger is attracted to the mobile phone, and the mobile phone detects that the wireless charger is in the correct charging position through the Hall sensor.
  • the Hall sensor transmits the detection result to the NFC chip, and the NFC chip sets the state of the relevant chip, starts the silent tag sending process and sends a private card search request command and a read command, and the mobile phone stops the private card search request command after reading the information of the silent tag and the sending of the read command, closing the silent tag reading process.
  • the NFC chip sends the read information to the charging anti-counterfeiting module, analyzes the device identification and performs anti-counterfeiting identification verification, and starts the wireless charging function after the verification is passed. If the wireless charger is removed and is in the silent tag reading process, close the silent tag reading process.
  • the embodiment of the present application provides an NFC-based data interaction method, which can be applied to data interaction between an NFC card reader device and a tag device.
  • the card reader device supports the function of an NFC card reader
  • the tag device supports the function of a silent tag.
  • the card reader device can read the information of the silent tag through the NFC private card search request command.
  • the tag device will respond and activate based on the NFC private card search request command, which is not easy to cause unnecessary data reading, and can realize on-demand triggering and on-demand data reading.
  • the card reader device can read the information of the silent tag after the silent tag is switched from not in position to in position; or, the card reader device can also switch the silent tag from not in position after reading the information of the silent tag For the reign.
  • the embodiment of the present application does not limit the sequence of switching the in-position state and reading information.
  • the card reader device After reading the information of the silent tag, the card reader device stops the data reading process. Even if the tag device is always in place, the card reader device will not read the information of the silent tag again, so the power consumption caused by the continuous reading of the information of the silent tag by the card reader device can be saved.
  • the card reader device After reading the information of the silent tag, the card reader device enters the listen mode and the polling mode of stage 1 according to the working cycle, so that it can poll and send NFC card search request commands, including sending NFC standard card search request commands and NFC Private card search request command to identify other NFC tags and perform data interaction.
  • NFC card search request commands including sending NFC standard card search request commands and NFC Private card search request command to identify other NFC tags and perform data interaction.
  • the card reader device can also read the information of other NFC tags, and the NFC function of the card reader device will not be invalidated or affected, and NFC card swiping, card reading or P2P interaction can be performed normally. Function.
  • the solution provided by the embodiment of the present application achieves the above-mentioned purpose through the NFC protocol interaction process, the realization process is simple, the real-time performance is strong, and it has versatility and wide application range; and it does not need additional devices such as Hall sensors, so it can Save the hardware space of the card reader device and the tag device, simplify the hardware design, and reduce the cost of the device.
  • the card reader device in the embodiment of the present application can be an electronic device with the function of reading NFC tags, for example, it can be a mobile phone, a tablet computer, a wearable device, a smart home device, a vehicle device, an augmented reality (augmented reality, AR) /Virtual reality (virtual reality, VR) equipment, notebook computer, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook, personal digital assistant (personal digital assistant, PDA), point of sale (Point of sales, POS)
  • augmented reality augmented reality, AR
  • VR Virtual reality
  • notebook computer notebook computer
  • ultra-mobile personal computer ultra-mobile personal computer
  • UMPC ultra-mobile personal computer
  • netbook personal digital assistant
  • PDA personal digital assistant
  • Point of sales, POS point of sale
  • the embodiment of the present application does not impose any limitation on the specific device type of the card reader device.
  • the silent tag in this embodiment of the present application may be an active tag, a passive tag, or a tag simulated by an NFC chip, without limitation.
  • Tag devices have silent tags.
  • tag devices can be mobile phone cases, wireless chargers, smart watches, access cards, mobile phones, tablet computers, wearable devices, or vehicle-mounted devices.
  • a silent tag itself may also be called a tag device if it is not integrated into other devices.
  • some electronic devices can be both card reader devices and tag devices.
  • the electronic device is a card reader device, at least it supports the NFC card reader function, and may also support the NFC universal tag function or the silent tag function;
  • the electronic device is a tag device, it supports at least the NFC silent tag function, and may also support the NFC universal tag function label function.
  • FIG. 3 shows a schematic structural diagram of the electronic device 100 .
  • the electronic device 100 may be a card reader device or a tag device.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, And a subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller may be the nerve center and command center of the electronic device 100 .
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 is charging the battery 142 , it can also provide power for electronic devices through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • the wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100.
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 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.
  • Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband code division Multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM , and/or IR technology, etc.
  • GNSS can include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou satellite navigation system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi-zenith) satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou satellite navigation system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quasi-zenith satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the wireless communication module 160 includes an NFC module.
  • the NFC module may be an NFC chip, may also be an integrated circuit, or may be a combination of circuits and components, etc., and is not limited.
  • the NFC module has NFC reader functionality and/or card emulation functionality.
  • the electronic device 110 is a card reader device
  • the NFC module has at least the function of an NFC card reader
  • the electronic device 110 is a tag device
  • the NFC module has at least a card simulation function, which can simulate the function of an NFC silent tag.
  • the NFC module when the electronic device 100 is a card reader device with an NFC module, the NFC module has a tag reading and writing function, and has a sending port and a receiving port, and has the ability to send and receive signals.
  • control Send standard card search request command and private card search request command After the NFC module determines that the tag device is switched from not in position to in position through the private card search request command, the NFC module can read the information of the silent tag in the tag device, so as to determine whether the tag device supports wireless charging according to the information, and obtain the tag device anti-counterfeiting marks, obtain optimized parameters for wireless charging, or obtain customized theme information and other information. Then, even if the silent tag continues to be in place, the NFC module stops reading the information of the silent tag.
  • the NFC module can also increase the sending interval of the private card search request command after the tag data is read.
  • the electronic device 100 When the electronic device 100 is a tag device, the electronic device 100 may have an NFC module, and the NFC module may simulate a silent tag; or the electronic device 100 may have a silent tag without an NFC module. Preset information is written in the silent label, such as customized theme information, whether to support wireless charging, anti-counterfeiting marks or charging optimization parameters, etc.
  • the silent tag is silent by default. After detecting the NFC private card search request command, the silent tag is activated and allows the card reader device to read information.
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 may display customized themes, or information related to wireless charging, and the like.
  • 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 (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED active matrix organic light emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed
  • quantum dot light emitting diodes quantum
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • 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.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 .
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 110 performs business processing by running instructions stored in the internal memory 121, and can perform data communication with the NFC module or with a silent tag, and can determine whether to send a private card search request instruction according to an event reported by the NFC module .
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
  • the electronic device 100 when the electronic device 100 is a clamshell machine, the electronic device 100 can detect opening and closing of the clamshell according to the magnetic sensor 180D.
  • Hall sensors may be used to detect the proximity of an NFC tag.
  • Touch sensor 180K also known as "touch panel”.
  • the touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the electronic device 100 when it is a card reader device and a tag device in different roles, it may include more or fewer components than shown in the figure, or combine some components, or split some components, or different Part placement.
  • the processor 110 executes the instructions stored in the internal memory 121, so that the NFC module can send the NFC private card search request instruction to find the silent tag, and Read the information of the silent tag in the tag device.
  • the tag device will respond and activate based on the NFC private card search request command, which is not easy to cause unnecessary data reading, and can realize on-demand triggering and on-demand data reading.
  • the card reader device after reading the information of the silent tag, even if the tag device is always in place, the card reader device will not read the information of the silent tag again, thus saving power consumption caused by continuous reading of data.
  • the card reader device can enter the listen mode and the polling mode of stage 1 according to the working cycle, and poll and send NFC card search request commands, including standard card search request commands and private card search commands Request commands to identify and read information from other NFC tags. Therefore, even if the tag device is always in place, the card reader device can also read the information of other NFC tags, and the NFC function of the card reader device will not fail or be affected.
  • the display screen 194 can display customized themes or information related to wireless charging, etc.
  • the electronic device 100 When the electronic device 100 is a tag device, preset information is written in the silent tag, such as customized theme information, whether to support wireless charging, anti-counterfeit identification or charging optimization parameters, and the like.
  • the processor 110 runs the instructions stored in the internal memory 121, so that the silent tag is in a silent state by default. After detecting the NFC private card search request instruction, the silent tag is activated and allows the card reader device to read information.
  • the NFC module in the card reader device adjusts the existing polling mode, and adds a private card search request command in the polling cycle of the polling mode, It is used to discover silent tags and read the information of silent tags.
  • the NFC module stops the data reading process, enters the listen mode and the polling mode of stage 1 according to the working cycle, and polls and sends NFC card search request commands (including standard card search request commands and private card search request command), so that the power consumption of the NFC module is low when the silent tag is in place, and the card reader device can also read the information of other NFC tags, and the normal read and write functions of the NFC module are not Affected, functions such as NFC card swiping, card reading, or P2P interaction can be performed normally.
  • NFC card search request commands including standard card search request commands and private card search request command
  • the NFC module can combine the presence flag corresponding to the silent tag to realize data interaction with the silent tag.
  • the processor of the card reader device may add a configuration attribute, which may be called an in-position flag, and is used to indicate whether the silent tag is in-position.
  • the configuration property can be configured as a first state or a second state.
  • the configuration attribute may be configured as the first state by default.
  • the in-position identifier may be a first identifier, and the first identifier is used to indicate whether the NFC module has detected a silent tag.
  • the first identifier may include a first value and a second value, respectively corresponding to the first state and the second state. If the silent tag is not detected, the silent tag is not in place, and the first identification is the first value; if the silent tag is detected, the silent tag is in place, and the first identification is set to the second value.
  • each kind of private card search request command may correspond to an in-position flag, which is used to indicate whether the silent tag that can respond to this kind of private card search request command is in position.
  • the combination of the in-position flag and the private card search request command can make the power consumption of the NFC module low and the NFC function normal when the silent tag is in place continuously.
  • the processor of the card reader device can also configure the registers of the NFC module by issuing NFC control interface (NFC controller interface, NCI) commands, thereby controlling the sending of NFC standard card search request commands and NFC private card search request commands. type and period.
  • NFC control interface NFC controller interface, NCI
  • the presence flag may also be set in the NFC module, and the embodiment of the present application does not limit the specific location where the presence flag is set.
  • Fig. 4A shows that based on the NFC-A protocol, the NFC module adds the NFC-A-PR working stage in the polling cycle, and adds the NFC-A-PR working phase in the NFC card search request command in the polling cycle.
  • REQ-A-PR is a customized private card search request command. Only type A silent tags can respond to this command, and NFC general tags cannot respond to this command.
  • REQ-A-PR is only a representation of the private card search request instruction provided by the embodiment of the present application, and other representations or names may also be used without limitation.
  • FIG. 4B is a schematic diagram of a working mode after the NFC module adds a private card search request instruction REQ-B-PR corresponding to the NFC-B-PR working phase in the polling cycle based on the NFC-B protocol.
  • there may be one kind of private card search request instruction corresponding to each NFC protocol such as NFC-A protocol
  • the following will take the private card search request command corresponding to the NFC-A protocol as an example for illustration.
  • the silence label presence judgment logic includes:
  • the NFC module in the card reader After the NFC module in the card reader sends the REQ-A-PR command, it receives the private card search response command ATQ-A-PR sent by the silent tag, and the NFC module reports the tag in-position event, and it is judged that the tag is in position. bit.
  • the NFC module After the NFC module sends the REQ-A-PR command, it does not receive a private card search response command within the first preset time period, and the NFC module reports the tag not in position event, and determines that the tag is not in position.
  • the configuration and change logic of the in-position flag corresponding to the silent label includes:
  • In-position flag switching logic 1 the silent tag is not close to the card reader device, and the in-position flag corresponding to the silent tag is in the first state, for example, the first state is false.
  • In-position flag switching logic 2 The silent tag has never been close to the silent tag to the card reader device. After the information of the silent tag is read, the in-position flag corresponding to the silent tag is switched to the second state, for example, the second state is true ( true).
  • In-position flag switching logic 3 The silent tag is always in the state of being close to the card reader device, and the in-position flag corresponding to the silent tag remains true.
  • In-position flag switching logic 4 The in-position flag corresponding to the silent tag switches to false when the silent tag changes from being close to the card reader device to being far away from the card reader device.
  • FIG. 4C is a schematic diagram of the processing flow of the NFC module in the embodiment of the present application for the type A silent tag of the NFC-A protocol.
  • the processing flow of the NFC module for silent tags corresponding to protocols such as NFC-B/F/V is similar to the processing flow for type A silent tags, and will not be described one by one.
  • the processing flow describes the following 4 states (state 1-state 4) and 3 stages (stage 1-stage 3) included in the interaction process between the NFC module and the first silent tag.
  • the NFC module sends a private card search request command REQ-A-PR, and after receiving the private card search response command ATQ-A-PR from the first silent tag, the NFC module starts First silent tag reading process.
  • the first silent tag approaches the card reader device, and the card reader device reads the information of the first silent tag.
  • the card reader device reads the information of the silent tag; or, after the card reader reads the information of the silent tag, the first silent tag is switched from absent to In place, not limited.
  • the presence flag corresponding to the first silent label is set to true.
  • the NFC module closes the data reading process of the first silent tag. The NFC module continues to receive the private card-seeking response command from the first silent tag, and the first silent tag is always in place.
  • State 3 Consistent with State 2, the NFC module enters the polling state of Phase 1 from Phase 3.
  • the NFC module enters the listen mode and the polling mode of phase 1 according to the working cycle, and polls and sends NFC card search request commands, including standard card search request commands and private card search request commands.
  • the first silent tag is far away from the card reader device, the NFC module cannot receive the private card search response command of the first silent tag, and the presence flag corresponding to the first silent tag is set to false.
  • the NFC module enters the polling state of phase 1 from phase 3.
  • the NFC module enters the listen mode and the polling mode of phase 1 according to the working cycle, and polls and sends NFC card search request commands, including standard card search request commands and private card search request commands.
  • Phase 1 Polling status of the NFC module.
  • the NFC module enters the listen mode and the polling mode of stage 1 according to the working cycle, and polls and sends each standard card search request command and each private card search request command, including the private card search request command REQ-A-PR.
  • the first silent tag is not close to the card reader device, and the presence flag corresponding to the first silent tag in the card reader device is false.
  • Phase 2 The first silent tag is close to the card reader device, the NFC module and the first silent tag are activated by radio frequency, and after receiving the private card search request command REQ-A-PR, the first silent tag sends a private card search response command ATQA- A-PR.
  • the NFC module determines that the first silent tag is not in place before the in-position flag is false, and according to the private card search response command, it can be determined that the first silent tag has switched from the absent state to the in-position state. At this time, the NFC module initiates the first silent tag. data reading process.
  • the first silent tag reading process of stage 2 includes:
  • the NFC module sends a card search request instruction, including a standard card search request instruction and a private card search request instruction.
  • the private card search request command is used to detect silent tags.
  • different NFC protocols correspond to different card search request commands such as REQA/B/F/V.
  • the type A protocol corresponds to the private card search request command REQ-A-PR.
  • the NFC module of the card reader device can periodically poll and send various standard card search request commands such as REQ-A/B/F/V and various private card search request commands through radio frequency signals. Include REQ-A-PR to detect whether there are NFC universal tags or silent tags corresponding to various NFC protocols.
  • the first silent tag After receiving the private card search request instruction, the first silent tag sends a private card search response instruction to the NFC module.
  • the in-position flag corresponding to the private card search request command that the first silent tag can respond to is false, that is, the in-position flag corresponding to the first silent tag is false.
  • the first silent tag After the first silent tag is close to the NFC module, it can receive a private card search request command such as REQ-A-PR within the NFC radio frequency communication range, so it can send a private card search response command such as ATQ-A-PR to the NFC module.
  • a private card search request command such as REQ-A-PR within the NFC radio frequency communication range
  • the NFC module can determine that the first silent tag is not in place before the presence flag is false, and at this time, the NFC module initiates the data reading process of the first silent tag after receiving the private card search response command sent by the first silent tag.
  • the NFC module can switch the first silent tag from not present to present, and the presence flag corresponding to the first silent tag is set to true.
  • the NFC module sends a card anti-collision detection command AC/SDD_REQ (CL1).
  • the first silent tag After receiving the anti-collision detection command AC/SDD_REQ (CL1), the first silent tag sends an anti-collision response command. SAK.
  • the NFC module sends a card activation command AC/SDD_REQ (CL2).
  • the first silent tag After receiving the card activation command AC/SDD_REQ (CL2), the first silent tag sends a card activation response command SAK.
  • the NFC module sends a read command Read CMD to the first silent tag.
  • the first silent tag After receiving the read command Read CMD, the first silent tag sends a read response command Read RSP.
  • steps 403-408 For descriptions of steps 403-408, reference may be made to relevant descriptions of steps 103-108 above, and details are not repeated here.
  • the NFC module after receiving the private card search response instruction sent by the first silent tag, the NFC module can first switch the first silent tag from not in position to in position, and then read the information of the first silent tag; or The NFC module can first read the information of the first silent tag, and then switch the first silent tag from not present to present, without limitation.
  • Phase 3 shown in Figure 4C is as follows:
  • Stage 3 In this stage, after reading the information of the first silent tag, the communication of REQ-A-PR single command will be carried out, and the information of the first silent tag will not be read again.
  • the command interaction process in stage 3 includes steps 409-410 that are executed cyclically:
  • the NFC module sends a card search request instruction, including a standard card search request instruction and a private card search request instruction.
  • the first silent tag After receiving the private card search request instruction, the first silent tag sends a private card search response instruction to the NFC module.
  • the NFC module sends a private card search request command to determine whether the first silent tag is still in place according to whether the card search response command is received. If the NFC module receives the private card-seeking response command of the first silent tag, and the presence flag corresponding to the first silent tag is true, it is determined that the first silent tag continues to be in place, rather than switching from the not-in-position state to the in-position state , the NFC module has read the information of the first silent tag.
  • the interval at which the NFC module of the card reader device sends the private card search request instruction corresponding to the first silent tag can be adjusted.
  • the NFC module can detect whether the first silent tag continues to be in place frequently and in real time without using the private card search request instruction, so that the private card search request instruction The sending interval can be increased to save the power consumption of the NFC module.
  • the NFC module when the first silent tag is continuously in place, can increase the sending of the private card search request instruction after the first silent tag is continuously in place for a duration greater than or equal to the second preset duration interval. In some other technical solutions, when the first silent tag is continuously in place, the NFC module may increase the sending interval of the private card search request command after receiving the private card search response command for a number of times greater than or equal to the preset number of times.
  • the sending interval of the private card search request command may not be too large, so that the presence status of the tag device can be determined in time through the private card search request command, and correspondingly processed.
  • the NFC module After the NFC module reads the information of the first silent tag and after a long period of time, the relative state of the card reader device and the tag device has basically stabilized. If the status of the tag device changes, it is likely that the user explicitly Want to separate the reader device from the tag device (like the user wants to detach the wireless charger from the phone). Therefore, even if the NFC module detects that there is a delay in the change of the on-position state through the private card search request command with a large interval, the impact is not significant, and the power consumption of the card reader device can also be saved.
  • the NFC module After the NFC module reads the information of the first silent tag for the first time, it sends a private card search request command in each polling cycle, and receives the private card search command corresponding to the private card search request command for the fifth time. After the response command, send a private card search request command every 2 polling cycles; after receiving the private card search response command for the 10th time, send a private card search request command every 3 polling cycles, and so on, Until the private card search request command is sent every 5 polling cycles, keep sending at this interval.
  • the actions performed by the NFC module shown in FIGS. 4A-4D are also actions performed by the card reader device where the NFC module is located.
  • the above process can include:
  • the card reader device polls and sends card search request commands, including standard card search request commands and private card search request commands.
  • the presence flag corresponding to the first silent tag is false.
  • the card reader device receives a private card-seeking response command from the first silent tag.
  • the card reader device reads the information of the first silent tag according to the presence flag corresponding to the first silent tag being false and receiving the private card search response command from the first silent tag.
  • the card reader device determines that the first silent tag switches from not being in position to being in position, and the presence flag corresponding to the first silent tag is set to true. After the information reading of the first silent tag is completed, the process of reading the data of the first silent tag is no longer executed, so as to save the power consumption of the card reader device.
  • the first silent tag responds and activates only based on the private card search request command, which is not easy to cause unnecessary data reading, and can realize on-demand triggering and on-demand data reading.
  • the card reader device sets the in-position flag corresponding to the first silent tag to false, so as to determine whether the first silent tag is switched from not in place to in-position according to the in-position flag next time. bit, so as to determine whether to execute the data reading process of the first silent tag.
  • embodiments of the present application provide an NFC-based data interaction method, which can enable the card reader device to read the content in the silent tag of the tag device, and make the card reader The power consumption of the device is low, and the NFC reading and writing functions are not affected, and functions such as NFC card swiping, card reading and P2P interaction can be performed normally.
  • the NFC-related functions of the card reader device involved in the method can be implemented based on the NFC module and processing flow shown in FIGS. 4A-4D .
  • the method may include:
  • the card reader device sends a first private card search request instruction.
  • the card reader device can be operated according to the instruction of the user, and send the first private card-finding request instruction through a radio frequency signal.
  • the card reader device may send the first private card search request command through a radio frequency signal after the user turns on the NFC function (such as the wireless charging function) corresponding to the first private card search request command on the card reader device.
  • the card reader device enters the listen mode and the polling mode of stage 1 according to the working cycle of the NFC module, and polls and sends NFC card search request commands, including sending NFC standard card search request commands and NFC private search request commands.
  • the NFC private card search request instruction includes a first private card search request instruction.
  • the embodiment of the present application does not limit the timing for the card reader device to send the first private card search request instruction.
  • the first tag device After receiving the first private card search request instruction, the first tag device sends a private card search response instruction to the card reader device.
  • the first tag device After the first tag device approaches the card reader device, it may receive a first private card search request instruction. If the first tag device determines that the supported first silent tag can respond to the first private card search request instruction, it sends a private card search response instruction to the card reader device. The private card search response instruction corresponds to the first private card search request instruction. After the first tag device receives other types of card search request instructions, it will not respond, and will not send a card search response instruction to the card reader device.
  • the card reader device determines that the first tag device is switched from absent to active, and reads the information of the first silent tag in the first tag device.
  • the card reader device determines that the first tag device is close to the card reader device after receiving the private card search response instruction. As shown in Figure 4C, the card reader device is in state 1, enters stage 2 from stage 1, and reads the information of the first silent tag. Refer to FIG. 4D for an instruction interaction process for the card reader device to read the information of the first silent tag.
  • the card reader device may be provided with an in-position flag corresponding to the silent tag that can respond to the first private card search request instruction, that is, an in-position flag corresponding to the first silent tag is set.
  • the presence of the silent tag can also be understood as the presence of the tag device; correspondingly, the absence of the silent tag can also be understood as the absence of the tag device. Therefore, the presence status of the tag device also includes presence or absence.
  • the in-position flag corresponding to the silent tag can also be understood as the in-position flag corresponding to the label device where the silent tag is located.
  • the in-position flag corresponding to the first tag device is in the first state (it may be the default first state, or switched to the first state after switching to the second state before, not limited), then after receiving the first tag After the private card search response command sent by the device, read the information of the first silent tag.
  • the first tag device is switched from absent to present, and the card reader device switches the presence flag corresponding to the first tag device from the first state to the second state.
  • the in-position flag corresponding to the first tag device is the in-position flag corresponding to the first silent tag in the first tag device.
  • the card reader device performs service processing according to the information of the first silent tag.
  • the card reader device can perform related business processing according to the information of the first silent tag, for example, the business can be customized theme or wireless charging.
  • the card reader device After reading the information of the first silent tag, the card reader device stops reading the information of the first silent tag, and sends a first private card search request instruction.
  • the card reader device no longer sends the read instruction for the first silent tag, and stops reading the information of the first silent tag, thereby saving the continuous reading of the card reader device.
  • the power consumption caused by the information of the first silent tag is caused by the information of the first silent tag.
  • the card reader device may send a first private card search request command to determine whether the first tag device is continuously in place.
  • the card reader device enters phase 3 from phase 2 as shown in FIG. 4C , and is in state 2 .
  • step 505 the method also includes:
  • step 506 If the card reader device determines that the first tag device continues to be present according to the private card search response command sent by the first tag device, continue to send the first private card search request command, and execute step 506 in a loop.
  • the card reader device After receiving the private card search response command sent by the first tag device, the card reader device determines that the first tag device is continuously in position, rather than just switching from being out of position, according to the presence flag corresponding to the first tag device is in the second state In place, and the card reader device has read the information of the first silent tag, so the data reading process of the first silent tag is no longer executed. The card reader device keeps the presence flag corresponding to the first tag device as true. And, the card reader device continues to send the first private card search request command, so as to continue to detect whether the first tag device continues to be in place.
  • the method may further include: the card reader device adjusting the sending period of the first private card search request command when the first tag device is continuously in place.
  • the card reader device increases the sending interval of the first private card search request command, so as to further save the power consumption of the card reader device; for this process, please refer to the specific description about increasing the sending interval above, and details will not be repeated.
  • the card reader device is in state 3 as shown in FIG. 4C .
  • the card reader device can also send other card-finding request commands other than the first private card-finding request command under the condition that the first tag device continues to be in place.
  • the card reader device can perform data interaction with other NFC tags (including general tags and silent tags) through other card search request instructions, and read the information of other NFC tags, so that when the first tag device is continuously in place, Ensure that the card reader device performs normal functions such as NFC card swiping, card reading and P2P interaction.
  • the card reader device can also send a second private card search request command, if it receives a private card search response command from the second tag device (with the second private card search command) corresponding to the request instruction), and it is determined that the second tag device is switched from not in position to in position, then read the information of the second silent tag in the second tag device.
  • the card reader device can also send the first standard card search request command, if it receives the card search response command from the third tag device (with the first standard card search command) corresponding to the request instruction), then read the information of the NFC tag in the third tag device.
  • the card reader device After the information reading of the first silent tag is completed, and the first tag device continues to be in place, as shown in FIG. 4C , the card reader device enters stage 1 from stage 3 .
  • the card reader device enters the listen mode and the polling mode of phase 1 according to the working cycle of the NFC module, and polls to send multiple standard card search request commands and private card search request commands, so that it can communicate with other NFC tags other than the first silent tag Interact to ensure the normal function of NFC card swiping, card reading or P2P interaction.
  • the method may also include:
  • step 501 If the card reader device does not receive the private card search response command sent by the first tag device within the first preset time period, determine that the first tag device is switched from being present to not being present, and then perform step 501.
  • the card reader device does not receive the private card search response command sent by the first tag device within the first preset time period, the first tag device will leave, the first tag device will switch from being in position to not being in position, and the first tag device will The corresponding in-bit flag is set to false. At this point, the card reader device is in state 4 shown in FIG. 4C and enters phase 1.
  • the card reader device can read the first silent tag in the first tag device after determining that the first tag device is switched from not in position to in position through the first private card search request command. information.
  • the first tag device responds and activates only based on the first private card-finding request instruction, which is not easy to cause unnecessary data reading, and can realize on-demand triggering and on-demand data reading.
  • the privatization of the card search request command it can realize customized features, provide a high-security solution, and meet the privatization and security of customized scenarios.
  • the card reader device After the card reader device reads the information of the first silent tag, even if the first tag device is always in place, the card reader device will not read the information of the first silent tag again, thus saving the cost of the card reader.
  • the card reader device can poll and send NFC card search request commands, including NFC standard card search request commands and NFC private card search request commands, to identify other NFC tags and read them. Get its information. In this way, even if the first tag device is always in place, the NFC function of the card reader device will not fail or be affected, and NFC card swiping or card reading can be performed normally.
  • NFC card search request commands including NFC standard card search request commands and NFC private card search request commands
  • the solution provided by the embodiment of the present application achieves the above purpose through the NFC protocol interaction process, the realization process is simple, real-time, and universal; and does not require additional devices such as Hall sensors, thus saving card readers
  • the hardware space of the equipment and the first label equipment is simplified, the hardware design is simplified, and the equipment cost is reduced.
  • the NFC data interaction method provided in steps 501-507 above can be applied to various business scenarios, and can have various application forms.
  • the following example illustrates the business scenario.
  • the card reader device may be a mobile phone
  • the first tag device may be a mobile phone case (or a theme case).
  • the mobile phone case supports a first silent tag
  • the first silent tag can be an active tag, a passive tag or a tag simulated by an NFC module.
  • Customized theme information is stored in the first silent tag.
  • the first silent tag is in a silent state by default, and can respond to the first private card search request instruction.
  • the NFC-based data interaction method provided by the embodiment of the present application may include:
  • the mobile phone sends a first private card search request instruction.
  • the mobile phone may operate according to the user's instruction, and send the first private card-finding request instruction through a radio frequency signal.
  • the mobile phone can periodically poll and send the NFC card search request command in the polling mode shown in Figure 4C.
  • the NFC card search request command includes a standard card search request command and a private card search request command.
  • the private card search request command Including the first private card search request instruction.
  • the embodiment of the present application does not limit the timing for the mobile phone to send the first private card search request instruction.
  • the mobile phone case After receiving the first private card search request command, the mobile phone case sends a private card search response command to the mobile phone.
  • the presence flag corresponding to the first silent label in the mobile phone is false.
  • the first private card search request instruction can be received. If the mobile phone case determines that the supported first silent tag can respond to the first private card search request command, then send a private card search response command to the mobile phone.
  • the mobile phone After the mobile phone receives the private card search response command sent by the mobile phone case, it determines that the mobile phone case is switched from absent to active, and reads the information of the first silent tag in the mobile case, which includes customized theme information.
  • the customized subject information may be encrypted information or unencrypted information, which is not limited.
  • the customized theme information is used as encrypted information as an example for illustration.
  • the mobile phone switches the current theme to a customized theme according to the information in the first silent label.
  • the NFC module of the mobile phone reports the read customized theme information to the theme module of the mobile phone, and the theme module decrypts the theme information, and then switches the current theme to the customized theme.
  • a customized theme for example, it can be a cool theme, a VIP theme, or a theme that cannot be downloaded from the official website, etc.
  • the mobile phone After reading the information of the first silent tag, the mobile phone stops reading the information of the first silent tag, and sends a first private card search request instruction.
  • the mobile phone no longer sends the read instruction for the first silent tag, and the mobile phone no longer reads the information of the first silent tag, thus saving the mobile phone from continuously reading the first silent tag.
  • the power consumption caused by the information is caused by the information.
  • the mobile phone can also send a first private card search request command to determine whether the mobile phone case remains in place.
  • step 606 If the mobile phone determines that the mobile phone case is still in place according to the private card search response command sent by the mobile phone case, continue to send the first private card search request command, and execute step 606 cyclically.
  • the mobile phone After the mobile phone receives the private card search response command sent by the mobile phone case, according to the presence flag corresponding to the first silent tag is true, it is determined that the mobile phone case continues to be in place, and the mobile phone has read the information of the first silent tag, so it is no longer Read the information of the first silent tag, and keep the presence flag corresponding to the first silent tag as true. And, the mobile phone continues to send the first private card-seeking request command to continue to detect whether the mobile phone case is still in place.
  • the method may further include: after the mobile phone determines that the mobile phone case remains in place, increasing the sending interval of the first private card finding request command, so as to further save power consumption of the mobile phone.
  • the mobile phone can also send other card-finding request commands other than the first private card-finding request command while the mobile phone case is still in place.
  • the mobile phone can perform data interaction with other NFC tags (including general tags and silent tags) through other card search request commands, and read the information of other NFC tags, so as to ensure the normal operation of the mobile phone when the mobile phone case is in place.
  • NFC swiping and reading For example, in the polling mode shown in FIG. 4C , the mobile phone periodically polls and sends standard card search request commands and private card search request commands.
  • step 605 the method also includes:
  • the phone If the mobile phone does not receive the private card search response command sent by the mobile phone case within the first preset time period, the first silent label will leave, the mobile phone will switch from being present to not being present, and the presence flag corresponding to the first silent label will be set to false . At this point, the phone can switch the custom theme back to the default theme.
  • the first preset time length is longer than the sending interval of the first private card search request command.
  • the mobile phone does not receive the private card search response command sent by the mobile phone shell after sending two first private card search request commands.
  • the case may have been left, and the mobile phone determines that the mobile phone case is switched from being in place to not being in place.
  • the solutions described in steps 601-607 may specifically include:
  • the mobile phone polls and sends the NFC card search request instruction according to the working cycle of the NFC module, including a standard card search request instruction and a private card search request instruction, and the private card search request instruction includes the first private card search request instruction.
  • the presence flag corresponding to the first silent label is false.
  • the mobile phone receives a private card search response command from the first silent tag.
  • the mobile phone reads the customized theme information stored in the first silent label according to the presence flag corresponding to the first silent label is false, and receives a private card search response command from the first silent label, and switches the current theme to a customized theme; And, the mobile phone switches the first silent label from not present to present.
  • the mobile phone polls and sends standard card search request commands and private card search request commands according to the working cycle of the NFC module so as to perform data interaction with other NFC tags.
  • the private card search request commands include the first private card search request command.
  • the interval of the card search request instruction corresponding to the first silent tag sent by the mobile phone can be increased.
  • the phone sets the presence flag corresponding to the first silent label to false and switches back to the default theme.
  • FIG. 6B a schematic diagram of switching customized themes based on NFC between the mobile phone and the mobile phone case can be referred to FIG. 6B .
  • the mobile phone can read the first silent tag stored in the mobile phone case after determining that the mobile phone case is switched from not in place to in place (for example, the mobile phone case is put on the mobile phone) through the first private card search request command.
  • Customized theme information, etc. to achieve one-touch switching theme.
  • the mobile phone case will respond and activate based on the first private card search request command, which is not easy to cause unnecessary data reading, and can realize on-demand triggering and on-demand data reading.
  • the mobile phone After the mobile phone reads the information of the first silent label, even if the mobile phone shell is always in place (that is, the mobile phone shell is always placed on the mobile phone), the mobile phone will not read the information of the first silent label again, thereby saving the mobile phone.
  • the mobile phone can poll and send NFC card search request commands, including NFC standard card search request commands and NFC private card search request commands, to identify other NFC tags and read their information .
  • NFC card search request commands including NFC standard card search request commands and NFC private card search request commands
  • the solution provided by the embodiment of the present application achieves the above-mentioned purpose through the NFC protocol interaction process, and the realization process is simple, real-time, and universal; and does not require additional devices such as Hall sensors, thus saving mobile phones and mobile phones.
  • the hardware space of the shell simplifies the hardware design and reduces the equipment cost.
  • the card reader device may be a mobile phone
  • the first tag device may be a wireless charger (or charging case).
  • the wireless charger supports a first silent tag
  • the first silent tag may be an active tag, a passive tag or a tag simulated by an NFC module.
  • Information such as charger anti-counterfeit identification and/or charging optimization parameters is stored in the first silent label.
  • the first silent tag is in a silent state by default, and can respond to the first private card search request instruction.
  • the NFC-based data interaction method may include:
  • the mobile phone sends a first private card search request instruction.
  • the wireless charger After receiving the first private card search request instruction, the wireless charger sends a private card search response instruction to the mobile phone.
  • steps 701-702 is similar to the implementation process of steps 601-602, and reference may be made to the relevant description above, and details are not repeated here.
  • the mobile phone After the mobile phone receives the private card search response command sent by the wireless charger, it determines that the wireless charger is switched from not in place to in place, and reads the information of the first silent label in the wireless charger.
  • the information includes the anti-counterfeiting of the charger Identification and/or charging optimization parameters.
  • the mobile phone After the mobile phone receives the private card search response command sent by the wireless charger, it can set the presence flag corresponding to the first silent tag to true.
  • the mobile phone performs anti-counterfeiting verification according to the information of the first silent tag, and/or configures and charges according to optimized parameters.
  • the NFC module of the mobile phone reports the information such as the anti-counterfeit identification of the charger and/or charging optimization parameters read to the charging module of the mobile phone, and the charging module performs anti-counterfeiting verification, and/or configures and charges according to the optimized parameters. In this way, when the mobile phone is close to the wireless charger, the anti-counterfeiting verification of the charging can be quickly performed or the charging can be performed with optimized parameters, and the user experience is better.
  • the mobile phone After reading the information of the first silent tag, the mobile phone stops reading the information of the first silent tag, and sends a first private card search request instruction.
  • step 706 If the mobile phone determines that the wireless charger continues to be in place according to the private card search response command sent by the wireless charger, then continue to send the first private card search request command, and execute step 706 cyclically.
  • steps 705-706 is similar to the implementation process of steps 605-606, and reference may be made to the relevant description above, and details are not repeated here.
  • the method may further include: after the mobile phone determines that the wireless charger is continuously in place, increasing the sending interval of the first private card finding request command, so as to further save power consumption of the mobile phone.
  • the mobile phone may also send other card-finding request commands other than the first private card-finding request command when the wireless charger is continuously in place.
  • the mobile phone can perform data interaction with other NFC tags (including general tags and silent tags) through other card search request commands, and read the information of other NFC tags, so as to ensure the normal operation of the mobile phone when the wireless charger is continuously in place.
  • NFC card swiping and card reading For example, in the polling mode shown in FIG. 4C , the mobile phone periodically polls and sends various standard card search request commands and private card search request commands.
  • step 705 the method also includes:
  • the mobile phone does not receive a private card-finding response command sent by the wireless charger within the first preset time period, determine that the wireless charger is switched from on-site to off-site, and then execute the above step 701.
  • the mobile phone does not receive the private card search response command sent by the wireless charger within the first preset time period, the first silent tag will leave, the wireless charger will switch from being in place to not being in place, and the presence flag corresponding to the first silent tag will set to false. At this point, the phone can stop charging.
  • the solutions described in steps 701-707 may include:
  • the mobile phone polls according to the working cycle of the NFC module to send a card search request command, including a standard card search request command and a private card search request command, and the private card search request command includes a first private card search request command.
  • a card search request command including a standard card search request command and a private card search request command
  • the private card search request command includes a first private card search request command.
  • the mobile phone reads the anti-counterfeit identification and/or optimization parameters stored in the first silent tag according to the presence flag corresponding to the first silent tag is false, and receives the private card search response command from the first silent tag, and performs anti-counterfeiting verification and/or charging optimization; and, the phone switches the first silent label from not present to present. After the reading of the information of the first silent tag is completed, the process of reading the data of the first silent tag is no longer executed.
  • the mobile phone polls and sends a standard card search request command and a private card search request command according to the working cycle, so as to perform data interaction with other NFC tags, and the private card search request command includes the first private card search request command.
  • the interval of the card search request instruction corresponding to the first silent tag sent by the mobile phone can be increased.
  • the mobile phone sets the presence flag corresponding to the first silent label to false, and stops wireless charging.
  • FIG. 7B a schematic diagram of wireless charging of a mobile phone and a wireless charger based on NFC can be referred to in FIG. 7B .
  • the mobile phone can read the first silence in the wireless charger after determining that the wireless charger is switched from not in place to in place (for example, the wireless charger is close to the mobile phone) through the first private card search request command.
  • the information such as anti-counterfeit identification and/or charging optimization parameters stored in the tag realizes one-touch optimized charging.
  • the wireless charger responds and activates only based on the first private card search request command, which is not easy to cause unnecessary data reading, and can realize on-demand triggering and on-demand data reading.
  • the mobile phone after the mobile phone has finished reading the information of the first silent tag, even if the wireless charger is always in place (that is, the wireless charger is always close to the mobile phone), the mobile phone will not read the information of the first silent tag again, thus saving The power consumption caused by the mobile phone continuously reading the information of the first silent tag.
  • the mobile phone can poll and send NFC card search request commands, including NFC standard card search request commands and NFC private card search request commands, to identify other NFC tags and read their information .
  • NFC card search request commands including NFC standard card search request commands and NFC private card search request commands
  • the solution provided by the embodiment of the present application achieves the above-mentioned purpose through the NFC protocol interaction process, which is simple, real-time, and versatile; and does not require additional devices such as Hall sensors, thus saving mobile phones and wireless devices.
  • the hardware space of the charger simplifies the hardware design and reduces the equipment cost.
  • Scenario 3 The scenario of starting reverse charging:
  • the card reader device may be a mobile phone
  • the first tag device may be a smart watch (hereinafter referred to as a watch).
  • the watch supports a first silent tag
  • the first silent tag may be an active tag, a passive tag or a tag simulated by an NFC module.
  • the watch is provided with an NFC chip, which can simulate the first silent tag.
  • the watch does not need to be additionally provided with a first silent tag.
  • Information such as identification information of the watch is stored in the first silent tag.
  • the first silent tag is in a silent state by default, and can respond to the first private card search request instruction.
  • the NFC-based data interaction method may include:
  • the mobile phone sends a first private card search request instruction.
  • the watch After receiving the first private card search request instruction, the watch sends a private card search response instruction to the mobile phone.
  • steps 801-802 is similar to the implementation process of steps 601-602, and reference may be made to the relevant description above, which will not be repeated here.
  • the mobile phone After receiving the private card search response command sent by the watch, the mobile phone determines that the watch is switched from absent to active, and reads the information of the first silent tag in the watch, which includes the identification information of the watch.
  • the mobile phone After the mobile phone receives the private card search response command sent by the watch, it can set the presence flag corresponding to the first silent label to true.
  • the mobile phone determines whether to start reverse charging according to the information on the first silent tag.
  • the NFC module of the mobile phone reports the read information such as the identification information of the watch to the charging module of the mobile phone.
  • the charging module maintains a list of identification information supported by charging.
  • the charging module determines whether the watch supports wireless charging according to the identification information of the watch and the list of identification information. If it is supported, the mobile phone starts the reverse charging function to charge the watch; if it does not support it, the mobile phone does not start the reverse charging function. In this way, the reverse charging can be quickly turned on when the mobile phone is close to the watch. Compared with the current need to manually turn on the reverse charging function of the mobile phone, the user experience is much improved, and it can also save a lot of user operation steps and reduce user learning costs.
  • the charging coil used for reverse charging on the mobile phone can be closer to the antenna used for NFC communication, so that the mobile phone can turn on reverse charging through NFC when the watch is at the same position. And it is charged through the charging coil to avoid repeatedly adjusting the position of the watch.
  • the mobile phone After reading the information of the first silent tag, the mobile phone stops reading the information of the first silent tag, and sends a first private card search request instruction.
  • step 806 If the mobile phone determines that the watch is still in place according to the private card search response command sent by the watch, then continue to send the first private card search request command, and execute step 806 cyclically.
  • steps 805-806 is similar to the implementation process of steps 605-606, and reference may be made to the relevant description above, and details are not repeated here.
  • the method may further include: after the mobile phone determines that the watch remains on, increasing the sending interval of the first private card search request command, so as to further save power consumption of the mobile phone.
  • the mobile phone can also send other card-finding request commands other than the first private card-finding request command when the watch is still on.
  • the mobile phone can perform data interaction with other NFC tags (including general tags and silent tags) through other card search request commands, and read the information of other NFC tags, so as to ensure that the mobile phone performs normal NFC when the watch is continuously in place. Swipe and read cards.
  • the mobile phone periodically polls and sends various standard card search request commands and private card search request commands.
  • step 805 the method also includes:
  • the solutions described in steps 801-807 may include:
  • the mobile phone polls according to the working cycle of the NFC module to send a card search request command, including a standard card search request command and a private card search request command, and the private card search request command includes a first private card search request command.
  • a card search request command including a standard card search request command and a private card search request command
  • the private card search request command includes a first private card search request command.
  • the mobile phone determines that the watch is switched from not in position to in position, thereby reading the watch stored in the first silent tag Determine whether to enable reverse charging according to the identity information; and set the presence flag corresponding to the first silent tag to true. After the information reading of the first silent tag is completed, the data reading process of the first silent tag is no longer executed.
  • the mobile phone polls and sends standard card search request instructions and private card search request instructions according to the working cycle of the NFC module, so that the information of other NFC tags can be read, and the private card search request instructions include the first private card search request instruction.
  • the interval of the card search request instruction corresponding to the first silent tag sent by the mobile phone can be increased.
  • the phone sets the presence flag corresponding to the first silent label to false, and stops reverse charging.
  • FIG. 8B a schematic diagram of reverse charging of a mobile phone and a watch based on NFC can be referred to FIG. 8B .
  • the mobile phone can read the watch’s identity stored in the first silent tag in the watch after determining that the watch is switched from not in place to in place (for example, the watch is close to the mobile phone) through the first private card search request command Information such as information, so as to determine whether to start reverse charging, and realize reverse charging with one touch.
  • the watch will respond and activate based on the first private card-seeking request command, which will not easily lead to unnecessary data reading, and can realize on-demand triggering and on-demand data reading.
  • the mobile phone After the mobile phone finishes reading the information of the first silent tag, even if the watch is always in place (that is, the watch is always close to the mobile phone), the mobile phone will not read the information of the first silent tag again, thus saving the mobile phone from continuously reading the first The power consumption caused by silencing the tag's information.
  • the mobile phone can poll and send NFC card search request commands, including NFC standard card search request commands and NFC private card search request commands, to identify other NFC tags and read their information .
  • NFC card search request commands including NFC standard card search request commands and NFC private card search request commands
  • the solution provided by the embodiment of the present application achieves the above-mentioned purpose through the NFC protocol interaction process, which is simple, real-time, and versatile; and does not require additional devices such as Hall sensors, thus saving mobile phones and watches.
  • the hardware space is simplified, the hardware design is simplified, and the equipment cost is reduced.
  • another embodiment of the present application provides a data interaction method, which can be applied to a first electronic device supporting a card reader function and a first NFC tag.
  • the method may include:
  • the first electronic device sends a first card finding request instruction.
  • the first card search request instruction is a private card search request instruction, which is used to find a silent tag, and the silent tag can interact with the first electronic device in response to the first card search request instruction, so that the first electronic device can read the Silent label information.
  • the first card search request instruction may be REQ-A-PR in the above embodiment.
  • the first NFC tag After receiving the first card-finding request instruction from the first electronic device, the first NFC tag sends a first card-finding response instruction to the first electronic device.
  • the first NFC tag may reply the first card-finding response instruction to the first electronic device.
  • the first electronic device After receiving the first card-finding response instruction from the first NFC tag, the first electronic device reads the information of the first NFC tag.
  • the first electronic device receives the first card search response instruction from the first NFC tag, it is possible that the first NFC tag and the first electronic device have just moved away from each other and approached each other. After the first electronic device detects the first NFC tag, The first electronic device can read information of the first NFC tag.
  • the information of the first NFC tag may include customized theme information, charger anti-counterfeit identification, charging optimization parameters or device identification information and other content.
  • the first electronic device Before the first electronic device receives the first card-finding response command from the first NFC tag, the first electronic device is not in place; after the first electronic device receives the first card-finding response command from the first NFC tag, the first The electronic device detects the first NFC tag, and the first NFC tag is switched on.
  • the first electronic device After the first electronic device reads the information of the first NFC tag, the first electronic device continues to send the first card search request command, continues to receive the card search response command from the first NFC tag, and does not read the first NFC tag Information.
  • the first electronic device After the first electronic device reads the information of the first NFC tag, if it continues to receive the first card search response instruction from the first NFC tag, it is possible that the first NFC tag continues to be in a state close to the first electronic device. An NFC tag remains in place, and the first electronic device no longer reads the information of the first NFC tag.
  • the first electronic device no longer reads the information of the first NFC tag, so that it will not continue to be in the data reading process and can normally monitor and send the NFC card search instruction, Including standard card search command and private card search command, so that the information of other NFC tags can be read normally, so that the functions of NFC card reading, card swiping and P2P can be carried out normally.
  • the first electronic device no longer reads the information of the first NFC tag, which can save power consumption of the electronic device.
  • the first electronic device reads is the information of the silent tag that can respond to the first card-seeking request instruction, rather than any general-purpose NFC tag, so it is not easy to cause unnecessary data reading, and can realize on-demand triggering and pressing Data needs to be read.
  • the solution does not need to combine additional components such as Hall sensors to read the data of the silent tag, thus saving the hardware space of the first electronic device and the silent tag, simplifying hardware design, and reducing equipment cost.
  • the electronic device includes hardware and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the functional modules of the electronic device may be divided according to the above method example.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules may be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • the embodiment of the present application also provides an electronic device, which may be the above-mentioned card reader device or tag device.
  • an electronic device which may be the above-mentioned card reader device or tag device.
  • FIG. 10 it includes: one or more processors 1001 , memory 1002 , and one or more computer programs 1003 , and the above devices can be connected through one or more communication buses 1004 .
  • the one or more computer programs 1003 are stored in the above-mentioned memory 1002 and configured to be executed by the one or more processors 1001, the one or more computer programs 1003 include instructions, and the above-mentioned instructions can be used to perform the above-mentioned implementation
  • the various steps performed by the card reader device or the various steps performed by the tag device wherein, all relevant content of each step involved in the above method embodiment can be referred to the functional description of the corresponding physical device, and will not be repeated here.
  • the foregoing processor 1001 may specifically be the processor 110 shown in FIG. 3
  • the foregoing memory 1002 may specifically be the internal memory 121 shown in FIG. 3 .
  • the embodiment of the present application also provides an electronic device, including one or more processors and one or more memories.
  • the one or more memories are coupled with one or more processors, the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs The above related method steps implement the NFC-based data interaction method in the above embodiment.
  • Embodiments of the present application also provide a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are run on the electronic device, the electronic device executes the card reader device in the above-mentioned related method
  • the executed steps, or the steps executed by the silent tag in the above-mentioned related methods implement the NFC-based data interaction method in the above-mentioned embodiments.
  • the embodiment of the present application also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to perform the steps performed by the card reader device in the above related method, or perform the steps performed by the silent tag in the above related method. step, realizing the NFC-based data interaction method in the above embodiment.
  • an embodiment of the present application also provides a device, which may specifically be a chip (such as an NFC chip), a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, When the device is running, the processor can execute the computer-executable instructions stored in the memory, so that the device executes the steps performed by the card reader device in the above-mentioned related methods, or executes the steps performed by the silent tag in the above-mentioned related methods, so as to realize the above-mentioned embodiments. NFC-based data interaction method.
  • the embodiment of the present application also provides an NFC tag, which can execute the steps performed by the silent tag above, and implement the NFC-based data interaction method in the above embodiment.
  • the NFC tag can be simulated by an NFC chip.
  • the NFC tag can be an independent card, or it can be set into an electronic device.
  • the electronic equipment, computer-readable storage medium, computer program product, device or NFC tag provided in this embodiment are all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the above The beneficial effects of the corresponding method provided herein will not be repeated here.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be Incorporation or may be integrated into another device, or some features may be omitted, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or may be distributed to multiple different places . Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Toxicology (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本申请实施例提供一种基于NFC的数据交互方法及设备,涉及电子技术领域,读卡器设备通过私有寻卡请求指令确定标签设备靠近后,读取标签设备的静默标签的信息,标签设备持续在位时不再读取静默标签的信息,可使得读卡器设备的NFC功能正常。该方案包括:第一电子设备发送第一寻卡请求指令;第一电子设备接收到来自第一NFC标签的第一寻卡应答指令之后,读取第一NFC标签的信息;在第一电子设备读取第一NFC标签的信息后,第一电子设备继续发送第一寻卡请求指令,继续接收来自第一NFC标签的寻卡应答指令,不读取第一NFC标签的信息。本申请实施例用于读取NFC标签。

Description

一种基于NFC的数据交互方法及设备
本申请要求于2021年06月04日提交国家知识产权局、申请号为202110626646.0、申请名称为“一种基于NFC的数据交互方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及电子技术领域,尤其涉及一种基于近场通信(near field communication,NFC)的数据交互方法及设备。
背景技术
在家庭或办公等场景下,用户使用的智能电子设备越来越多。电子设备之间的数据通信能够进一步提升用户体验。越来越多的无线技术也逐步应用到电子设备间的通信和数据交换当中。其中,NFC技术以其便捷、安全等属性,被越来越多的电子设备作为桥接载体,进行快速地数据交换。
在NFC技术中,NFC标签可以存储有数据,在NFC标签与支持NFC读卡器的电子设备靠近时,电子设备可以读取NFC标签的信息。
然而,按照NFC协议和处理流程,当NFC标签与支持NFC读卡器的电子设备一直处于靠近状态时,电子设备无法读取其他NFC标签的信息,导致电子设备的NFC功能失效。
发明内容
本申请实施例提供一种基于NFC的数据交互方法及设备,读卡器设备可以通过NFC私有寻卡请求指令,确定标签设备靠近后读取静默标签的信息,而后即便该标签设备与读卡器设备一直处于靠近状态,读卡器设备也可以读取其他NFC标签的信息,读卡器设备的NFC功能能够正常进行。
为达到上述目的,本申请实施例采用如下技术方案:
一方面,本申请实施例提供一种数据交互方法,应用于包括第一电子设备和第一近场通信NFC标签的系统,该方法包括:第一电子设备发送第一寻卡请求指令。第一NFC标签接收到来自第一电子设备的第一寻卡请求指令后,向第一电子设备发送第一寻卡应答指令。第一电子设备接收到来自第一NFC标签的第一寻卡应答指令之后,读取第一NFC标签的信息。在第一电子设备读取第一NFC标签的信息后,第一电子设备继续发送第一寻卡请求指令,继续接收来自第一NFC标签的寻卡应答指令,不读取第一NFC标签的信息。
基于该方案,在第一电子设备继续接收到来自第一NFC标签的第一寻卡应答指令后,第一NFC标签持续在位的情况下,第一电子设备不再读取第一NFC标签的信息,从而不会持续处于数据读取流程中而可以正常监听和发送NFC寻卡指令,包括标准寻卡指令和私有寻卡指令,从而可以正常读取其他NFC标签的信息,使得NFC的读卡、刷卡和P2P等功能能够正常进行。而且,在第一NFC标签持续在位的情况下,第一电 子设备不再读取第一NFC标签的信息可以节省电子设备的功耗。并且,第一电子设备读取的是可以响应第一寻卡请求指令的静默标签的信息,而不是任意的通用NFC标签,因而不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。
在一种可能的设计中,第一NFC标签的初始在位状态为不在位,该方法还包括:第一电子设备设置有第一标识,第一标识指示第一电子设备是否检测到第一NFC标签;在第一电子设备接收到来自第一NFC标签的第一寻卡应答指令之前,第一标识的值为第一值,第一值指示第一电子设备没有检测到第一NFC标签;在第一电子设备接收到来自第一NFC标签的第一寻卡应答指令之后,第一电子设备将第一标识的值由第一值变更为第二值,第二值指示第一电子设备检测到第一NFC标签。
这样,第一电子设备可以通过第一标识来表示是否检测到第一NFC标签。第一电子设备在接收到第一寻卡应答指令之前,确定未检测到第一NFC标签;第一电子设备在接收到第一寻卡应答指令之后,确定检测到第一NFC标签。
在一种可能的设计中,该方法还包括:在第一电子设备继续发送第一寻卡请求指令后:若第一电子设备在预设时长内未接收到来自第一NFC标签的第一寻卡应答指令,则第一电子设备将第一标识的值由第二值变更为第一值;若第一电子设备在预设时长内接收到来自第一NFC标签的第一寻卡应答指令,则第一标识的值维持为第二值。
在该方案中,在第一电子设备继续发送第一寻卡请求指令后,若第一电子设备在预设时长内未接收到来自第一NFC标签的第一寻卡应答指令,则第一NFC标签与第一电子设备可能已经远离,第一NFC标签的在位状态切换为不在位,第一电子设备检测不到第一NFC标签,第一标识设置为第一值。若第一电子设备在该预设时长内接收到来自第一NFC标签的第一寻卡应答指令,则第一NFC标签与第一电子设备仍然处于靠近状态,第一电子设备仍然能够检测到第一NFC标签,第一标识设置保持为第二值。
在另一种可能的设计中,该方法还包括:第一电子设备增大继续发送第一寻卡请求指令的时间间隔。
其中,若第一NFC标签的在位状态为在位,且第一电子设备接收到来自第一NFC标签的第一寻卡应答指令,则可以表明第一NFC标签持续在位。此时,第一电子设备可以不用通过第一寻卡请求指令频繁地、实时地检测第一NFC标签是否持续在位,因而可以增大发送第一寻卡请求指令的时间间隔,以节省第一电子设备的功耗。
在另一种可能的设计中,该系统还包括第二NFC标签,在第一电子设备读取第一NFC标签的信息后,该方法还包括:第一电子设备发送第二寻卡请求指令;若第一电子设备接收到来自第二NFC标签的第二寻卡应答指令,第二寻卡应答指令是第二NFC标签对第二寻卡请求指令的响应,则读取第二NFC标签的信息。
这样,在第一电子设备读取完第一NFC标签的信息后,即便在第一NFC标签持续在位的情况下,第一电子设备也可以读取其他NFC标签的数据,第一电子设备的NFC功能也可以正常进行。
在另一种可能的设计中,在第一电子设备读取完第一NFC标签的信息后,该方法还包括:第一电子设备根据第一NFC标签的信息,进行业务处理。
也就是说,第一电子设备可以根据读取的第一NFC标签的信息,进行相关的业务 处理。
在另一种可能的设计中,第一NFC标签的信息包括第一NFC标签所在第二电子设备的标识信息。第一电子设备根据第一NFC标签的信息,进行业务处理,包括:第一电子设备根据第一NFC标签中第二电子设备的标识信息,为第二电子设备充电。
也就是说,第一电子设备可以基于NFC启动反向充电。
在另一种可能的设计中,第一电子设备根据第一NFC标签的信息,进行业务处理,包括:第一电子设备根据第一NFC标签的信息,切换第一电子设备的主题。
也就是说,第一电子设备可以基于NFC切换主题。例如,第一NFC标签的信息可以包括定制主题信息。
在另一种可能的设计中,第一NFC标签的信息包括充电器防伪标识和/或充电优化参数;第一电子设备根据第一NFC标签的信息,进行业务处理,包括:第一电子设备根据第一NFC标签的信息,进行充电器防伪校验和/或配置充电参数。
也就是说,第一电子设备可以基于NFC进行充电器防伪校验和/或配置充电参数。例如,第一NFC标签的信息可以包括充电器防伪标识和/或充电优化参数。
在另一种可能的设计中,第一NFC标签通过NFC芯片模拟获得。
在另一种可能的设计中,第一NFC标签设置于其他电子设备中。
另一方面,本申请实施例提供了一种数据交互方法,可以应用于支持近场通信NFC读卡功能的第一电子设备。该方法包括:第一电子设备发送第一寻卡请求指令。第一电子设备接收来自第一NFC标签的第一寻卡应答指令,第一寻卡应答指令是第一NFC标签对第一寻卡请求指令的响应。第一电子设备接收到来自第一NFC标签的第一寻卡应答指令之后,读取第一NFC标签的信息。在第一电子设备读取第一NFC标签的信息后,第一电子设备继续发送第一寻卡请求指令,继续接收来自第一NFC标签的寻卡应答指令,不读取第一NFC标签的信息。
基于该方法,在第一电子设备继续接收到第一寻卡应答指令后,第一NFC标签持续在位的情况下,第一电子设备不再读取第一NFC标签的信息,从而不会持续处于数据读取流程中而可以正常监听和发送NFC寻卡指令,包括标准寻卡指令和私有寻卡指令,从而可以正常读取其他NFC标签的信息,使得NFC的读卡、刷卡和P2P等功能能够正常进行。而且,在第一NFC标签持续在位的情况下,第一电子设备不再读取第一NFC标签的信息可以节省电子设备的功耗。并且,第一NFC标签基于私有的NFC第一寻卡请求指令才会响应和激活,从而供第一电子设备读取信息,基于标准的NFC寻卡请求指令不会响应和激活,因而不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。
在一种可能的设计中,第一电子设备设置有第一标识,第一标识指示第一电子设备是否检测到第一NFC标签;在第一电子设备接收到来自第一NFC标签的第一寻卡应答指令之前,第一标识的值为第一值,第一值指示第一电子设备没有检测到第一NFC标签;第一电子设备在接收到来自第一NFC标签的第一寻卡应答指令之后,第一电子设备将第一标识的值由第一值变更为第二值,第二值指示第一电子设备检测到第一NFC标签。
在另一种可能的设计中,该方法还包括:在第一电子设备继续发送第一寻卡请求 指令后:若第一电子设备在预设时长内未接收到来自第一NFC标签的第一寻卡应答指令,则第一电子设备将第一标识的值由第二值变更为第一值;若第一电子设备在预设时长内接收到来自第一NFC标签的第一寻卡应答指令,则第一标识的值维持为第二值。
在另一种可能的设计中,该方法还包括:第一电子设备增大继续发送第一寻卡请求指令的时间间隔。
在另一种可能的设计中,在第一电子设备读取第一NFC标签的信息后,该方法还包括:第一电子设备发送第二寻卡请求指令;若第一电子设备接收到来自第二NFC标签的第二寻卡应答指令,第二寻卡应答指令是第二NFC标签对第二寻卡请求指令的响应,则读取第二NFC标签的信息。
在另一种可能的设计中,在第一电子设备读取第一NFC标签的信息后,该方法还包括:第一电子设备根据第一NFC标签的信息,进行业务处理。
在另一种可能的设计中,第一电子设备根据第一NFC标签的信息,进行业务处理,包括:第一电子设备根据第一NFC标签中第二电子设备的标识信息,为第二电子设备充电。
在另一种可能的设计中,第一电子设备根据第一NFC标签的信息,进行业务处理,包括:第一电子设备根据第一NFC标签的信息,切换第一电子设备的主题。
在另一种可能的设计中,第一电子设备根据第一NFC标签的信息,进行业务处理,包括:第一电子设备根据第一NFC标签的信息,进行充电器防伪校验和/或配置充电参数。
另一方面,本申请实施例提供了一种数据交互装置,该装置包含在第一电子设备中,该装置具有实现上述任一方面及任一项可能的实现方式中第一电子设备行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。例如,发送模块或单元、接收模块或单元、读取模块或单元、处理模块或单元等。
另一方面,本申请实施例提供了一种装置,该装置包括至少一个存储器,至少一个处理器,至少一个处理器和至少一个存储器耦合,并读取至少一个存储器中的指令并根据指令使得装置执行上述任一方面及任一项可能的实现方式中第一电子设备执行的基于NFC的数据交互方法。例如,该装置具体可以是芯片、组件或模块等。
另一方面,本申请实施例提供了一种电子设备,一个或多个处理器;存储器;以及一个或多个计算机程序,其中一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令,当指令被电子设备执行时,使得电子设备执行上述任一方面及任一项可能的实现方式中第一电子设备执行的基于NFC的数据交互方法。
另一方面,本申请实施例提供了一种计算机可读存储介质,包括计算机指令,当计算机指令在第一电子设备上运行时,使得第一电子设备执行上述任一方面及任一项可能的实现方式中的基于NFC的数据交互方法。
另一方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述任一方面及任一项可能的实现方式中第一电子设备执行的基于NFC的数据交互方法。
另一方面,本申请实施例提供了一种数据交互系统,该系统可以包括第一电子设 备和第一NFC标签,第一电子设备和第一NFC标签可以用于执行上述任一方面及任一项可能的实现方式中的基于NFC的数据交互方法。
其中,关于其他方面的有益效果,可以参考关于第一电子设备执行的方法方面的有益效果,这里不再赘述。
附图说明
图1A为现有技术提供的一种NFC芯片的工作模式示意图;
图1B为现有技术提供的一种NFC芯片针对NFC标签的处理流程示意图;
图1C为现有技术提供的一种NFC芯片的阶段2和阶段3对应的指令交互流程图;
图2A为现有技术提供的一种无线充电示意图;
图2B为现有技术提供的一种无线充电流程图;
图3为本申请实施例提供的一种电子设备的硬件结构示意图;
图4A为本申请实施例提供的一种NFC模块的工作模式示意图;
图4B为本申请实施例提供的另一种NFC模块的工作模式示意图;
图4C为本申请实施例提供的一种NFC模块针对静默标签的处理流程示意图;
图4D为本申请实施例提供的一种NFC芯片的阶段2和阶段3对应的指令交互流程图;
图5为本申请实施例提供的一种基于NFC的数据交互方法流程图;
图6A为本申请实施例提供的另一种基于NFC的数据交互方法流程图;
图6B为本申请实施例提供的一种基于NFC切换定制主题的示意图;
图7A为本申请实施例提供的另一种基于NFC的数据交互方法流程图;
图7B为本申请实施例提供的一种基于NFC进行无线充电的示意图;
图8A为本申请实施例提供的另一种基于NFC的数据交互方法流程图;
图8B为本申请实施例提供的一种基于NFC开启反向充电的示意图;
图9为本申请实施例提供的一种数据交互方法流程图;
图10为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
为了便于理解,示例的给出了部分与本申请实施例相关概念的说明以供参考。如下所示:
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不 应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
目前,NFC技术的使用场景越来越多,基于NFC技术可实现的业务也越来越多。NFC技术涉及到NFC标签(TAG)和NFC读卡器两端。NFC标签也可以称为NFC卡片或NFC卡。NFC读卡器可以读取NFC标签的信息。在本申请的实施例中,支持NFC读卡器的设备可以称为读卡器设备,支持NFC标签的设备可以称为标签设备。读卡器设备与标签设备靠近能够完成简单的数据交互,在此基础上可以进行丰富的业务呈现,如一碰传音,一碰投屏,或一碰传图片等等。
当前NFC技术在实际应用过程中存在一定的问题。比如,NFC标签一直处于激活状态,当读卡器设备靠近标签设备时,按照NFC协议和接口,NFC标签的信息很容易被读卡器设备读取到,从而导致不必要的数据读取。当读卡器设备与标签设备一直处于靠近状态时,读卡器设备会持续读取NFC标签的信息,从而导致读卡器设备的功耗较大。而且,读卡器设备持续读取当前NFC标签的信息的过程中,无法检测其他NFC标签从而无法与其他NFC标签进行数据交互,因而会导致读卡器设备正常的NFC功能失效或受到严重影响。
例如,NFC读卡器可以通过NFC芯片来实现。如图1A所示,NFC芯片包括两种工作模式,即监听(listen)模式和轮询(polling)模式。比如,NFC芯片的每个工作周期可以包括约300ms的监听周期(与listen模式对应)以及约20ms的轮询周期(与polling模式对应)。listen模式为NFC芯片的卡模拟模式,polling模式包括NFC芯片的点对点(point to point,P2P)模式和读卡器模式。
其中,P2P对应NFC-主动控制调制(active control modulation,ACM)工作阶段,读卡器模式包括不同NFC协议NFC-A/B/F/V分别对应的不同工作阶段。在polling模式下,NFC芯片按照NFC协议轮询发送NFC标准寻卡请求指令。该NFC标准寻卡请求指令包括各工作阶段分别对应的标准寻卡请求指令,例如包括NFC-ACM对应的寻卡请求指令(用于在P2P模式下发现对端设备从而进行数据交互),以及不同NFC协议NFC-A/B/F/V分别对应的寻卡请求指令REQ-A/B/F/V(用于发现NFC-A/B/F/V对应的NFC标签)等。可以理解的是,NFC芯片每个工作周期的时长,每个工作周期内各工作模式的时长,每个工作模式包括的工作阶段,各工作阶段的时长,以及发送的寻卡请求指令的类型和周期,可以预先设置,也可以根据需求进行调整。
图1B所示为NFC芯片针对NFC-A协议对应的NFC标签(即A类型(type A)NFC标签)的处理流程示意图。NFC芯片针对NFC-B/F/V等其他NFC协议对应的type B/F/V NFC标签的处理流程,与针对type A NFC标签的处理流程类似,不再一一说明。
如图1B所示,该处理流程描述了在读卡器设备中的NFC芯片与第一NFC标签交互过程中,包括如下3个阶段(阶段1-阶段3)和3个状态(状态1-状态3)。可以理解的是,NFC芯片与第一NFC标签之间的交互过程,也是NFC芯片所在的读卡器设备与第一NFC标签所在的标签设备之间的交互过程。
关于图1B所示的状态切换描述如下:
状态1:第一NFC标签靠近读卡器设备,NFC芯片从阶段1进入阶段2。
状态2:第一NFC标签与读卡器设备持续靠近,未离开,NFC芯片从阶段2进入 阶段3。
状态3:第一NFC标签离开读卡器设备,NFC芯片从阶段3进入阶段1。
关于图1B所示各阶段的描述如下:
阶段1:第一NFC标签未靠近读卡器设备,读卡器设备中的NFC芯片按照预设的工作周期分别进入listen模式和polling模式。在polling模式下,根据轮询周期正常对外发送轮询(polling)信号,该polling信号包括NFC标准寻卡请求指令。该NFC标准寻卡请求指令为NFC协议规定的通用寻卡请求指令。该NFC标准寻卡请求指令包括polling模式下不同工作阶段分别对应的标准寻卡请求指令。例如,在每个轮询周期内,NFC芯片分别发送NFC-ACM对应的标准寻卡请求指令,NFC-A对应的标准寻卡请求指令,NFC-B对应的标准寻卡请求指令,NFC-F对应的标准寻卡请求指令,以及NFC-V对应的标准寻卡请求指令。可以理解的是,NFC芯片的polling模式还可以包括其他NFC协议对应的工作阶段,NFC芯片还可以在轮询周期内发送其他NFC协议对应的标准寻卡请求指令,不予限定。
阶段2:第一NFC标签靠近读卡器设备,读卡器设备中的NFC芯片与第一NFC标签射频激活,NFC芯片按照NFC-A协议流程读取第一NFC标签。
阶段3:第一NFC标签与读卡器设备持续靠近,此阶段一直处于卡在位的检测流程。
其中,参见图1C,图1B所示的阶段2对应的指令交互流程包括:
101、NFC芯片发送标准寻卡请求(request,REQ)指令。
其中,该标准寻卡请求指令REQ为NFC协议规定的指令,用于检测NFC标签。不同NFC协议对应不同的寻卡请求指令,例如可以有REQA/B/F/V等标准寻卡请求指令。读卡器设备的NFC芯片可以通过射频信号,周期性地轮询发送REQA/B/F/V等不同的标准寻卡请求指令,以检测各类NFC标签是否靠近。
102、第一NFC标签接收到寻卡请求指令REQ后,向NFC芯片发送寻卡应答(answer to request,ATQ)指令。
第一NFC标签与读卡器设备靠近后,第一NFC标签与NFC芯片在NFC射频信号的通信范围内,能够接收到标准寻卡请求指令REQ,并向NFC芯片发送寻卡应答指令ATQ。
NFC芯片接收到第一NFC标签发送的寻卡应答指令ATQ后,确定第一NFC标签在位。
其中,第一NFC标签的在位状态包括在位或不在位。在位是指,读卡器设备与NFC标签距离较近,在NFC的射频通信范围内,NFC芯片可以检测到NFC标签,NFC标签可以被NFC芯片备发现。不在位是指,读卡器设备与NFC标签距离较远,NFC芯片检测不到NFC标签。
103、NFC芯片发送卡片防冲突检测指令AC/SDD_REQ(CL1)。
该指令用于在NFC芯片检测到多个NFC标签(即多个NFC标签在位)时,确定与哪个NFC标签进行数据交互,从而读取该NFC标签的信息。CL1表示Type A的串联级(cascade level)为1。
104、第一NFC标签接收到防冲突检测指令AC/SDD_REQ(CL1)后,向NFC芯片 发送防冲突应答(select acknowledge,SAK)指令。
105、NFC芯片发送卡激活指令AC/SDD_REQ(CL2)。
卡激活指令根据NFC芯片接收到的防冲突应答指令产生,用于确定此次通信激活哪个NFC标签。例如,卡激活指令用于指示激活第一NFC标签。CL2表示Type A的串联级为2。
106、第一NFC标签接收到卡激活指令AC/SDD_REQ(CL2)后,向NFC芯片发送卡激活应答指令SAK。
107、NFC芯片向第一NFC标签发送读指令(Read command,Read CMD)。
NFC芯片接收到卡激活应答指令后,向激活的第一NFC标签发送读指令Read CMD,该指令用于读取第一NFC标签的信息。
108、第一NFC标签接收到读指令Read CMD后,向NFC芯片发送读应答指令Read RSP。
激活后的第一NFC标签接收到读指令Read CMD后,向NFC芯片发送读应答指令Read RSP指令,并携带第一NFC标签的信息。这样,NFC芯片就读取到了第一NFC标签的信息。
在一些技术方案中,参见图1C,图1B所示的阶段3对应的指令交互流程包括:
109、NFC芯片向第一NFC标签发送卡检测指令。
该卡检测指令用于检测第一NFC标签是否持续在位。
110、第一NFC标签接收到卡检测指令后,向NFC芯片发送卡检测应答指令。
111、NFC芯片接收到卡检测应答指令后,向第一NFC标签发送读指令Read CMD。
NFC芯片接收到第一NFC发送的卡检测应答指令后,确定第一NFC标签持续在位(即第一NFC标签与读卡器设备处于持续靠近状态),因而向第一NFC标签发送读指令,以再次读取第一NFC标签的信息,从而再次执行数据读取流程。
112、NFC标签接收到读指令Read CMD后,发送读应答指令Read RSP。
在阶段3,第一NFC标签处于激活模式,第一NFC标签与读卡器设备一直处于靠近的状态,即第一NFC持续在位,NFC芯片与第一NFC标签循环执行步骤109-112。这样,NFC芯片会不断地读取第一NFC标签的信息,从而导致NFC芯片的功耗较大。
在另一些技术方案中,在图1B所示的阶段3,NFC芯片触发复位reset指令,从而与第一NFC标签之间重复执行上述步骤101-108,NFC芯片持续地多次读取第一NFC标签的信息,从而导致NFC芯片的功耗较大。
并且,如果第一NFC标签持续在位,则NFC芯片一直处于卡片在位检测过程或一直读取第一NFC标签的信息,而无法进入listen模式和阶段1的polling模式。因而,NFC芯片无法发现其他NFC标签并进行数据交互,无法进行正常的NFC刷卡、读卡或P2P交互等功能,NFC芯片的NFC功能失效或受到严重影响。
上述NFC标签可理解为传统的NFC标签,可以称为NFC通用标签,NFC通用卡片,或NFC标准标签等。区别于NFC通用标签,目前还存在一种NFC静默标签,也可以称为NFC静默卡片,或NFC私有卡片等。静默标签默认处于静默状态,只有接收到特定的NFC私有寻卡请求指令后,静默标签才进行响应,才能使得读卡器设备读 取静默标签的信息。当读卡器设备按照NFC协议发送NFC标准寻卡请求指令时,静默标签不进行响应,读卡器设备无法读取静默标签的信息。
在一种技术方案中,通过静默标签和霍尔传感器等触发器件相配合,可以实现NFC数据交互。例如,参见图2A,读卡器设备为手机,标签设备为手机壳。静默标签默认处于静默状态,手机发送NFC标准指令,静默标签不会响应。当手机壳套上手机后,触发霍尔传感器工作。手机的霍尔检测器检测到手机壳套上,启动手机发送NFC私有寻卡请求指令和读指令,与静默标签进行数据交互。在数据交互完成或手机壳拿开后,手机停止私有寻卡请求指令和读指令的发送,关闭静默标签读取流程。
再例如,参见图2B,读卡器设备为手机,标签设备为无线充电器。无线充电器靠近手机后,无线充电器的磁铁吸附到手机上,手机通过霍尔传感器检测到无线充电器处于正确的充电位置。霍尔传感器将检测结果传递给NFC芯片,NFC芯片设置相关芯片状态,启动静默标签发送流程并发送私有寻卡请求指令和读指令,手机读取到静默标签的信息后,停止私有寻卡请求指令和读指令的发送,关闭静默标签读取流程。NFC芯片将读取信息发送给充电防伪模块,解析设备标识并进行防伪标识校验,校验通过后启动无线充电功能。如果无线充电器拿开,且处于静默标签的读取流程中,则关闭静默标签读取流程。
图2A和图2B所示方案需要借助霍尔传感器,需要读卡器设备和标签设备同时支持传感器功能,对读卡器设备和标签设备的硬件设计有约束,因而应用场景具有局限性,且硬件成本高,硬件设计复杂。并且,该种方案涉及到多模块间的交互,实现流程复杂,约束条件较多,实时性较差,不具备通用性。
本申请实施例提供了一种基于NFC的数据交互方法,可以应用于NFC读卡器设备与标签设备之间的数据交互。该读卡器设备支持NFC读卡器的功能,该标签设备支持静默标签的功能。读卡器设备可以通过NFC私有寻卡请求指令,读取静默标签的信息。这样,标签设备基于NFC私有寻卡请求指令才会响应和激活,不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。
其中,读卡器设备可以在静默标签从不在位切换到在位后,读取静默标签的信息;或者,读卡器设备也可以在读取静默标签的信息后,将静默标签由不在位切换为在位。本申请实施例对在位状态的切换和读取信息的先后顺序不予限定。
读卡器设备在静默标签的信息读取完成后,停止数据读取流程。即便标签设备一直在位,读卡器设备也不会再次读取静默标签的信息,因而可以节省读卡器设备持续读取静默标签的信息导致的功耗。
而且,读卡器设备在静默标签的信息读取完成之后,按照工作周期进入listen模式和阶段1的polling模式,从而可以轮询发送NFC寻卡请求指令,包括发送NFC标准寻卡请求指令和NFC私有寻卡请求指令,以识别其他NFC标签并进行数据交互。这样,即便标签设备一直在位,读卡器设备也可以读取其他NFC标签的信息,读卡器设备的NFC功能也不会失效或受到影响,能够正常进行NFC刷卡、读卡或P2P交互等功能。
此外,本申请实施例提供的方案通过NFC协议交互流程来达到上述目的,实现流程简单,实时性强,且具有通用性,应用面宽;而且不需要借助霍尔传感器等额外的 器件,因而可以节省读卡器设备和标签设备的硬件空间,简化硬件设计,降低设备成本。
本申请实施例中的读卡器设备,可以是具有读取NFC标签功能的电子设备,例如可以是手机、平板电脑、可穿戴设备、智能家居设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、销售点(Point of sales,POS)机或智能门锁等电子设备,本申请实施例对读卡器设备的具体设备类型不作任何限制。
本申请实施例中的静默标签可以是有源标签、无源标签,或NFC芯片模拟的标签,不予限制。标签设备具有静默标签,例如标签设备可以是手机壳、无线充电器、智能手表、门禁卡、手机、平板电脑、可穿戴设备或车载设备等设备。此外,若静默标签未集成到其他设备中,则静默标签本身也可以称为标签设备。
其中,一些电子设备既可以是读卡器设备,也可以是标签设备。当电子设备为读卡器设备时,至少支持NFC读卡器功能,还可能支持NFC通用标签功能或静默标签功能;当电子设备为标签设备时,至少支持NFC静默标签功能,还可能支持NFC通用标签功能。
示例性的,图3示出了电子设备100的一种结构示意图。该电子设备100可以是读卡器设备,也可以是标签设备。该电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
在本申请的一些实施例中,无线通信模块160包括NFC模块。该NFC模块可以是NFC芯片,也可以是集成电路,也可以是电路和部件的组合等,不予限定。NFC模块具有NFC读卡器功能和/或卡模拟功能。当电子设备110为读卡器设备时,NFC模块至少具有NFC读卡器功能;当电子设备为标签设备时,NFC模块至少具有卡模拟功能,能够模拟NFC静默标签的功能。
具体的,当电子设备100为具有NFC模块的读卡器设备时,NFC模块具备标签读写功能,且具有发送端口和接收端口,具备收发信号的能力,能够根据处理器110的配置参数,控制发送标准寻卡请求指令和私有寻卡请求指令。在NFC模块通过私有寻 卡请求指令,确定标签设备从不在位切换到在位之后,NFC模块可以读取标签设备中静默标签的信息,从而根据该信息确定标签设备是否支持无线充电,获取标签设备的防伪标识,获取无线充电的优化参数,或者获取定制主题信息等信息。而后,即便静默标签持续在位,NFC模块也停止读取静默标签的信息。NFC模块还可以在标签数据读取完成后,增大私有寻卡请求指令的发送间隔。
当电子设备100为标签设备时,电子设备100可以具有NFC模块,NFC模块可以模拟静默标签;或者电子设备100可以具有静默标签而不包括NFC模块。静默标签中写入有预设的信息,例如定制主题信息,是否支持无线充电,防伪标识或充电优化参数等。静默标签默认处于静默状态,在检测到NFC私有寻卡请求指令后,静默标签激活并允许读卡器设备读取信息。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。例如,显示屏194可以显示定制主题,或无线充电的相关信息等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
在一些实施例中,处理器110通过运行存储在内部存储器121的指令进行业务处理,能够与NFC模块或与静默标签进行数据通信,能够根据NFC模块上报的事件,确定是否发送私有寻卡请求指令。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。在一些实施例中,霍尔传感器可以用于检测NFC标签是否靠近。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
并且,当电子设备100为读卡器设备和标签设备中不同的角色时,可以分别包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。
在本申请实施例中,当电子设备100为读卡器设备时,处理器110通过运行存储在内部存储器121的指令,从而使得NFC模块可以发送NFC私有寻卡请求指令,以发现静默标签,并读取标签设备中静默标签的信息。这样,标签设备基于NFC私有寻卡请求指令才会响应和激活,不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。而且,在静默标签的信息读取完成后,即便标签设备一直在位,读卡器设备也不会再次读取静默标签的信息,因而可以节省持续读取数据导致的功耗。并且,读卡器设备在静默标签的信息读取完成之后,可以按照工作周期进入listen模式和阶段1的polling模式,并轮询发送NFC寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令,以识别并读取其他NFC标签的信息。因而,即便标签设备一直在位,读卡器设备也可以读取其他NFC标签的信息,读卡器设备的NFC功能也不会失效或受到影响。显示屏194可以显示定制主题或无线充电相关信息等。
当电子设备100为标签设备时,静默标签中写入有预设的信息,例如定制主题信息,是否支持无线充电,防伪标识或充电优化参数等。处理器110通过运行存储在内部存储器121的指令,使得静默标签默认处于静默状态,在检测到NFC私有寻卡请求指令后,静默标签激活并允许读卡器设备读取信息。
在本申请实施例提供的基于NFC的数据交互方法中,读卡器设备中的NFC模块对现有polling模式进行了调整,在polling模式的轮询周期内新增了发送私有寻卡请求指令,用于发现静默标签,从而读取静默标签的信息。在静默标签的信息读取完成后,NFC模块即停止数据读取流程,按照工作周期进入listen模式和阶段1的polling模式,并轮询发送NFC寻卡请求指令(包括标准寻卡请求指令和私有寻卡请求指令),从而可以在静默标签持续在位的情况下,使得NFC模块的功耗较低,且读卡器设备也可以读取其他NFC标签的信息,NFC模块的正常读写功能不受影响,能够正常进行NFC刷卡、读卡或P2P交互等功能,。
在一些实施例中,NFC模块可以结合静默标签对应的在位标志,来实现与静默标签的数据交互。例如,在一些技术方案中,读卡器设备的处理器可新增一个配置属性,该配置属性可以称为在位标志,用于表示静默标签是否在位。该配置属性可配置为第 一状态或第二状态。该配置属性可默认配置为第一状态。该在位标识可以为第一标识,该第一标识用于指示NFC模块是否检测到静默标签。该第一标识可以包括第一值和第二值,分别和第一状态以及第二状态相对应。若未检测到静默标签,则静默标签不在位,第一标识为第一值;若检测到静默标签,则静默标签在位,第一标识设置为第二值。
其中,每种私有寻卡请求指令可以对应一个在位标志,用于表示可以响应该种私有寻卡请求指令的静默标签是否在位。在位标志与私有寻卡请求指令相结合,可以使得在静默标签持续在位的情况下,NFC模块的功耗较低且NFC的功能正常。
另外,读卡器设备的处理器还可以通过下发NFC控制接口(NFC controller interface,NCI)指令,配置NFC模块的寄存器,从而控制发送的NFC标准寻卡请求指令和NFC私有寻卡请求指令的类型和周期。
在另一些技术方案中,该在位标志也可以设置在NFC模块中,本申请实施例对在位标志设置的具体位置不予限定。
以下基于对NFC模块的改进,对基于NFC的数据交互流程进行阐述。
示例性的,图4A所示为基于NFC-A协议,NFC模块在轮询周期内增加了 NFC-A-PR工作阶段,在轮询周期内的NFC寻卡请求指令中增加了NFC-A-PR对应的NFC私有寻卡请求指令REQ-A-PR后的工作模式示意图。其中,REQ-A-PR为定制的私有寻卡请求指令,此指令只有type A静默标签可以响应,NFC通用标签不能响应此指令。并且,REQ-A-PR仅为本申请实施例提供的私有寻卡请求指令的一种表示方式,也可以采用其他的表示方式或名称,不予限制。
需要说明的是,本申请实施例提供的方法不局限于增加NFC-A协议对应的私有寻卡请求指令,还可以增加NFC-B/F/V或其他NFC协议对应的私有寻卡请求指令,不予限制。示例性的,图4B所示为基于NFC-B协议,NFC模块在轮询周期内还增加了NFC-B-PR工作阶段对应的私有寻卡请求指令REQ-B-PR后的工作模式示意图。可以理解的是,每种NFC协议(例如NFC-A协议)对应的私有寻卡请求指令,可以有一种,也可以有多种,不予限定。以下将以NFC-A协议对应的私有寻卡请求指令为例进行说明。
其中,静默标签在位判断逻辑包括:
在位判定:读卡器设备中的NFC模块发送REQ-A-PR指令后,接收到静默标签发送的私有寻卡应答指令ATQ-A-PR,NFC模块上报标签在位事件,判定为标签在位。
不在位判定:NFC模块发送REQ-A-PR指令后,在第一预设时长内未接收到私有寻卡应答指令,NFC模块上报标签不在位事件,判定为标签不在位。
参见图4C,静默标签对应的在位标志的配置和变化逻辑包括:
在位标志切换逻辑1:静默标签未靠近读卡器设备,静默标签对应的在位标志为第一状态,例如第一状态为false。
在位标志切换逻辑2:静默标签从未靠近静默标签到靠近读卡器设备,静默标签的信息读取完成后,静默标签对应的在位标志切换为第二状态,例如第二状态为真(true)。
在位标志切换逻辑3:静默标签一直处于靠近读卡器设备的状态,未拿开,静默 标签对应的在位标志保持为true。
在位标志切换逻辑4:静默标签从靠近读卡器设备到远离读卡器设备,静默标签对应的在位标志切换为false。
图4C所示为本申请实施例中的NFC模块,针对NFC-A协议的type A静默标签的处理流程示意图。NFC模块针对NFC-B/F/V等协议对应的静默标签的处理流程,与针对type A静默标签的处理流程类似,不再一一说明。
如图4C所示,该处理流程描述了NFC模块与第一静默标签交互过程中包括的如下4个状态(状态1-状态4)和3个阶段(阶段1-阶段3)。
其中,关于图4C所示各状态的描述如下:
状态1:第一静默标签未靠近读卡器设备时,读卡器设备中第一静默标签对应的在位标志为false。其中,即第一静默标签对应的在位标志,为第一静默标签可响应的第一私有寻卡请求指令对应的在位标志。第一静默标签从远处靠近读卡器设备,NFC模块发送私有寻卡请求指令REQ-A-PR,NFC模块接收到来自第一静默标签的私有寻卡应答指令ATQ-A-PR后,启动第一静默标签读取流程。
状态2:第一静默标签靠近读卡器设备,读卡器设备读取第一静默标签的信息。其中,在第一静默标签由不在位切换到在位后,读卡器设备读取静默标签的信息;或者,在读卡器设备读取静默标签的信息后,第一静默标签由不在位切换到在位,不予限定。与第一静默标签切换为在位相对应,第一静默标签对应的在位标志设置为true。在第一静默标签的信息读取完成后,NFC模块关闭第一静默标签的数据读取流程。NFC模块持续接收到来自第一静默标签的私有寻卡应答指令,第一静默标签持续在位。
状态3:和状态2一致,NFC模块从阶段3进入阶段1的轮询状态。NFC模块按照工作周期进入listen模式和阶段1的polling模式,并轮询发送NFC寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令。
状态4:第一静默标签远离读卡器设备,NFC模块接收不到第一静默标签的私有寻卡应答指令,第一静默标签对应的在位标志设置为false。NFC模块从阶段3进入阶段1的轮询状态。NFC模块按照工作周期进入listen模式和阶段1的polling模式,并轮询发送NFC寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令。
关于图4C所示各阶段的描述如下:
阶段1:NFC模块的轮询状态。NFC模块按照工作周期进入listen模式和阶段1的polling模式,轮询发送各标准寻卡请求指令和各私有寻卡请求指令,包括私有寻卡请求指令REQ-A-PR。第一静默标签未靠近读卡器设备,读卡器设备中第一静默标签对应的在位标志为false。
阶段2:第一静默标签靠近读卡器设备,NFC模块与第一静默标签进行射频激活,第一静默标签接收到私有寻卡请求指令REQ-A-PR后,发送私有寻卡应答指令ATQA-A-PR。NFC模块根据在位标志为false确定第一静默标签之前不在位,又根据该私有寻卡应答指令可以确定第一静默标签由不在位状态切换到了在位状态,此时NFC模块发起第一静默标签的数据读取流程。
其中,参见图4D,阶段2的第一静默标签读取流程包括:
401、NFC模块发送寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令。
其中,私有寻卡请求指令用于检测静默标签。其中,不同的NFC协议对应有REQA/B/F/V等不同的寻卡请求指令。例如,type A协议对应私有寻卡请求指令REQ-A-PR。读卡器设备的NFC模块可以通过射频信号,周期性地轮询发送REQ-A/B/F/V等各种标准寻卡请求指令和各种私有寻卡请求指令,该私有寻卡请求指令包括REQ-A-PR,以检测是否存在各种NFC协议对应的NFC通用标签或静默标签。
402、第一静默标签接收到私有寻卡请求指令后,向NFC模块发送私有寻卡应答指令。
在type A第一静默标签未靠近NFC模块时,第一静默标签可响应的私有寻卡请求指令对应的在位标志为false,即第一静默标签对应的在位标志为false。
第一静默标签与NFC模块靠近后,在NFC射频通信范围内,能够接收到私有寻卡请求指令如REQ-A-PR,因而可以向NFC模块发送私有寻卡应答指令如ATQ-A-PR。
NFC模块可以根据在位标志为false确定第一静默标签之前不在位,此时接收到第一静默标签发送的私有寻卡应答指令,则NFC模块发起第一静默标签的数据读取流程。
并且,NFC模块在接收到第一静默标签发送的私有寻卡应答指令后,可以将第一静默标签由不在位切换到在位,第一静默标签对应的在位标志设置为true。
403、NFC模块发送卡片防冲突检测指令AC/SDD_REQ(CL1)。
404、第一静默标签接收到防冲突检测指令AC/SDD_REQ(CL1)后,发送防冲突应答指令。SAK。
405、NFC模块发送卡激活指令AC/SDD_REQ(CL2)。
406、第一静默标签接收到卡激活指令AC/SDD_REQ(CL2)后,发送卡激活应答指令SAK。
407、NFC模块向第一静默标签发送读指令Read CMD。
408、第一静默标签接收到读指令Read CMD后,发送读应答指令Read RSP。
关于步骤403-408的描述,可以参见上述步骤103-108的相关说明,此处不予赘述。
在一些实施例中,在接收到第一静默标签发送的私有寻卡应答指令后,NFC模块可以先将第一静默标签由不在位切换到在位,再读取第一静默标签的信息;或者NFC模块可以先读取第一静默标签的信息,再将将第一静默标签由不在位切换到在位,不予限定。
关于图4C所示的阶段3的描述如下:
阶段3:此阶段在读取第一静默标签的信息之后,进行REQ-A-PR单指令的通信,不会再次读取第一静默标签的信息。参见图4D,阶段3的指令交互流程包括循环执行的步骤409-410:
409、NFC模块发送寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令。
410、第一静默标签接收到私有寻卡请求指令后,向NFC模块发送私有寻卡应答指令。
NFC模块读取完第一静默标签的信息后,关闭第一静默标签的读取流程,不再像现有技术那样重复发送读指令,从而不再执行第一静默标签的读取流程,因而可以节省读卡器设备的功耗。
在阶段3,第一静默标签的信息读取完成后,NFC模块发送私有寻卡请求指令,以根据是否接收到寻卡应答指令来判断第一静默标签是否持续在位。若NFC模块收到第一静默标签的私有寻卡应答指令,且第一静默标签对应的在位标志为true,则判定第一静默标签持续在位,而不是由不在位状态切换到了在位状态,NFC模块已经读取了第一静默标签的信息。因而,NFC模块不再执行第一静默标签的数据读取流程,且第一静默标签对应的在位标志保持为true,NFC模块继续发送私有寻卡请求指令,以继续检测第一静默标签是否持续在位。也就是说,NFC模块在第一静默标签持续在位的情况下,可以不断发送私有寻卡请求指令,而不再发送读指令,NFC模块与第一静默标签之间持续进行私有寻卡请求指令的应答流程。
若NFC模块在第一预设时长内未接收到来自第一静默标签的私有寻卡应答指令,则第一静默标签超时未响应,判定为第一静默标签不在位,NFC模块上报第一静默标签离开事件,第一静默标签对应的在位标志设置为false。
具体的,在第一静默标签一直在位的情况下,NFC模块可以按照工作周期进入listen模式和阶段1的polling模式,并周期性地轮询发送寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令。也可以理解为,NFC模块此时进入了阶段1的轮询状态。NFC模块通过寻卡请求指令检测到其他NFC标签后,可以与其他NFC标签进行交互,从而读取其他NFC标签的信息。这样,在第一静默标签持续在位(也称常在位)的情况下,读卡器设备的NFC功能不受影响,能够进行正常的NFC刷卡、读卡或P2P交互等功能。比如,在手机靠近无线充电器进行无线充电时,还可以与笔记本电脑进行一碰传图,或者进行POS机刷卡等。
在一些实施例中,在第一静默标签的信息读取完成后,读卡器设备的NFC模块发送第一静默标签对应的私有寻卡请求指令的间隔可以进行调整。在一些实施例中,在第一静默标签的信息读取完成后,NFC模块可以不用通过私有寻卡请求指令频繁地、实时地检测第一静默标签是否持续在位,因而私有寻卡请求指令的发送间隔可以增大,以节省NFC模块的功耗。
在一些技术方案中,在第一静默标签持续在位的情况下,NFC模块可以在第一静默标签持续在位的时长大于或者等于第二预设时长后,增大私有寻卡请求指令的发送间隔。在另一些技术方案中,第一静默标签持续在位的情况下,NFC模块可以在收到私有寻卡应答指令的次数大于或者等于预设次数后,增大私有寻卡请求指令的发送间隔。
在另一些技术方案中,在第一静默标签持续在位的情况下,该私有寻卡请求指令的发送间隔可以随着在位时长的增大而逐步增大。比如,在读卡器设备与标签设备靠近时,用户可能没有很快调整好读卡器设备与标签设备的位置(比如用户没有一下子在手机上套好无线充电器),读卡器设备与标签设备的相对位置会继续变化。在NFC模块刚读取了第一静默标签的信息后,读卡器设备与标签设备的相对位置可能发生了变动,读卡器设备与标签设备可能发生了在位和不在位的切换。此时,私有寻卡请求指令的发送间隔可以不太大,以便能及时地通过私有寻卡请求指令来确定标签设备的在位状态,并进行相应地处理。在NFC模块读取了第一静默标签的信息并经过较长时间之后,读卡器设备与标签设备的相对状态已经基本稳定,如果标签设备的在位状态 发生变化,则很可能是用户明确地想将读卡器设备与标签设备分开(比如用户想从手机上拆下无线充电器)。因而,即便NFC模块通过间隔较大的私有寻卡请求指令检测到在位状态的变化有延迟也影响不大,还可以节省读卡器设备的功耗。
示例性的,NFC模块在首次读取了第一静默标签的信息之后,在每个轮询周期内发送一次私有寻卡请求指令,在第5次接收到私有寻卡请求指令对应的私有寻卡应答指令后,每2个轮询周期发送一次私有寻卡请求指令;在第10次接收到该私有寻卡应答指令后,每3个轮询周期发送一次私有寻卡请求指令,以此类推,直到每5个轮询周期发送一次私有寻卡请求指令后,保持该间隔进行发送。
可以理解的是,上述图4A-图4D所示的NFC模块执行的动作,也是NFC模块所在读卡器设备执行的动作。因而,从读卡器设备和标签设备的角度来说,上述过程可以包括:
读卡器设备轮询发送寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令。第一静默标签未靠近读卡器设备时,第一静默标签对应的在位标志为false。第一静默标签与读卡器设备靠近后,读卡器设备接收到来自第一静默标签的私有寻卡应答指令。读卡器设备根据第一静默标签对应的在位标志为false,以及接收到来自第一静默标签的私有寻卡应答指令,读取第一静默标签的信息。并且,读卡器设备确定第一静默标签从不在位切换到在位,第一静默标签对应的在位标志设置为true。在第一静默标签的信息读取完成后,不再执行第一静默标签的数据读取流程,以节省读卡器设备的功耗。
并且,在第一静默标签的信息读取完成后,读卡器设备可以按照NFC模块的工作周期进入listen模式和阶段1的polling模式,并轮询发送NFC寻卡请求指令,该NFC寻卡请求指令包括标准寻卡请求指令和私有寻卡请求指令,以便读卡器设备可以读取其他NFC标签的内容。因而,读卡器设备的NFC刷卡、读卡以及P2P交互等功能能够正常进行。而且,在第一静默标签持续在位时,读卡器设备发送的第一静默标签对应的寻卡请求指令的间隔可以增大,以进一步节省读卡器设备的功耗。
此外,第一静默标签基于私有寻卡请求指令才会响应和激活,不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。在第一静默标签离开读卡器设备后,读卡器设备将第一静默标签对应的在位标志设置为false,以便下次根据该在位标志确定第一静默标签是否由不在位切换到在位,从而确定是否执行第一静默标签的数据读取流程。
另外,本申请其他实施例提供了一种基于NFC的数据交互方法,能够使得读卡器设备读取标签设备的静默标签中的内容,并在静默标签持续在位的情况下,使得读卡器设备的功耗较低,且NFC读写功能不受影响,能够正常进行NFC刷卡、读卡和P2P交互等功能。
在一些实施例中,该方法涉及的读卡器设备的NFC相关功能,可以基于图4A-图4D所示的NFC模块及处理流程来实现。
以下将结合附图,以读卡器设备为具有图3所示结构的电子设备,标签设备支持静默标签为例,对本申请实施例提供的方法进行说明。参见图5,该方法可以包括:
501、读卡器设备发送第一私有寻卡请求指令。
其中,读卡器设备可以根据用户的指示操作,通过射频信号发送第一私有寻卡请求指令。例如,读卡器设备可以在用户打开读卡器设备上第一私有寻卡请求指令对应的NFC功能(例如无线充电功能)后,通过射频信号发送第一私有寻卡请求指令。
或者,如图4C所示,读卡器设备按照NFC模块的工作周期进入listen模式和阶段1的polling模式,并轮询发送NFC寻卡请求指令,包括发送NFC标准寻卡请求指令和NFC私有寻卡请求指令。该NFC私有寻卡请求指令包括第一私有寻卡请求指令。
本申请实施例对读卡器设备发送第一私有寻卡请求指令的时机不予限定。
502、第一标签设备接收到第一私有寻卡请求指令后,向读卡器设备发送私有寻卡应答指令。
第一标签设备靠近读卡器设备后,可以接收到第一私有寻卡请求指令。若第一标签设备确定所支持的第一静默标签可以响应第一私有寻卡请求指令,则向读卡器设备发送私有寻卡应答指令。该私有寻卡应答指令与第一私有寻卡请求指令相对应。第一标签设备接收到其他类型的寻卡请求指令后,则不进行响应,不会向读卡器设备发送寻卡应答指令。
503、读卡器设备接收到私有寻卡应答指令后,确定第一标签设备由不在位切换到在位,并读取第一标签设备中的第一静默标签的信息。
读卡器设备接收到私有寻卡应答指令后,确定第一标签设备靠近读卡器设备。如图4C所示,读卡器设备处于状态1,由阶段1进入阶段2,并读取第一静默标签的信息。读卡器设备读取第一静默标签的信息的指令交互流程可以参见图4D。
在一些实施例中,读卡器设备中可以设置有可以响应第一私有寻卡请求指令的静默标签对应的在位标志,即设置有第一静默标签对应的在位标志。
可以理解的是,由于静默标签集成在标签设备中,因而静默标签在位也可以理解为标签设备在位;相应的,静默标签不在位,也可以理解为标签设备不在位。因此,标签设备的在位状态也包括在位或不在位。静默标签对应的在位标志,也可以理解为静默标签所在标签设备对应的在位标志。
若第一标签设备对应的在位标志为第一状态(可能是默认的第一状态,或者之前切换为第二状态后又切换到了第一状态,不予限定),则在接收到第一标签设备发送的私有寻卡应答指令后,读取第一静默标签的信息。并且,第一标签设备由不在位切换为在位,读卡器设备将第一标签设备对应的在位标志由第一状态切换为第二状态。其中,第一标签设备对应的在位标志即为第一标签设备中第一静默标签对应的在位标志。
504、读卡器设备根据第一静默标签的信息进行业务处理。
读卡器设备可以根据第一静默标签的信息进行相关业务处理,比如该业务可以是定制主题或无线充电等。
505、读卡器设备在第一静默标签的信息读取完成后,停止读取第一静默标签的信息,并发送第一私有寻卡请求指令。
其中,读卡器设备在第一静默标签的信息读取完成后,不再发送针对第一静默标签的读指令,停止读取第一静默标签的信息,从而可以节省读卡器设备持续读取第一静默标签的信息导致的功耗。
在第一静默标签的信息读取完成后,读卡器设备可以发送第一私有寻卡请求指令,以确定第一标签设备是否持续在位。
例如,读卡器设备由如图4C所示的阶段2进入阶段3,处于状态2。
另外,在步骤505之后,该方法还包括:
506、若读卡器设备根据第一标签设备发送的私有寻卡应答指令,确定第一标签设备持续在位,则继续发送第一私有寻卡请求指令,并循环执行该步骤506。
读卡器设备接收到第一标签设备发送的私有寻卡应答指令后,根据第一标签设备对应的在位标志为第二状态,确定第一标签设备持续在位,而不是刚由不在位切换到在位,且读卡器设备已经读取过第一静默标签的信息,因而不再执行第一静默标签的数据读取流程。读卡器设备保持第一标签设备对应的在位标志为true。并且,读卡器设备继续发送第一私有寻卡请求指令,以继续检测第一标签设备是否持续在位。
在一些实施例中,该方法还可以包括:读卡器设备在第一标签设备持续在位的情况下,调整第一私有寻卡请求指令的发送周期。例如,读卡器设备增大第一私有寻卡请求指令的发送间隔,以进一步节省读卡器设备的功耗;该过程可以参见上文关于增大该发送间隔的具体描述,不予赘述。
其中,若第一标签设备持续在位,则读卡器设备处于如图4C所示的状态3。
另外,读卡器设备在第一静默标签的信息读取完成后,在第一标签设备持续在位的情况下,还可以发送第一私有寻卡请求指令以外的其他寻卡请求指令。这样,读卡器设备可以通过其他寻卡请求指令与其他NFC标签(包括通用标签和静默标签)进行数据交互,读取其他NFC标签的信息,从而在第一标签设备持续在位的情况下,保证读卡器设备进行正常的NFC刷卡、读卡和P2P交互等功能。
例如,在第一标签设备持续在位的情况下,读卡器设备还可以发送第二私有寻卡请求指令,若接收到来自第二标签设备的私有寻卡应答指令(与第二私有寻卡请求指令对应),且确定第二标签设备由不在位切换到在位,则读取第二标签设备中第二静默标签的信息。再例如,在第一标签设备持续在位的情况下,读卡器设备还可以发送第一标准寻卡请求指令,若接收到来自第三标签设备的寻卡应答指令(与第一标准寻卡请求指令对应),则读取第三标签设备中NFC标签的信息。
在一些实施例中,在第一静默标签的信息读取完成后,在第一标签设备持续在位的情况下,如图4C所示,读卡器设备由阶段3进入阶段1。读卡器设备按照NFC模块的工作周期进入listen模式和阶段1的polling模式,并轮询发送多个标准寻卡请求指令和私有寻卡请求指令,以便可以与第一静默标签以外的其他NFC标签进行交互,保证正常进行NFC刷卡、读卡或P2P交互等功能。
在步骤505之后,该方法还可以包括:
507、若读卡器设备在第一预设时长内未接收到第一标签设备发送的私有寻卡应答指令,则确定第一标签设备由在位切换为不在位,而后执行步骤501。
若读卡器设备在第一预设时长内未接收到第一标签设备发送的私有寻卡应答指令,则第一标签设备离开,第一标签设备由在位切换为不在位,第一标签设备对应的在位标志设置为false。此时,读卡器设备处于图4C所示的状态4,并进入阶段1。
在步骤501-507描述的方案中,读卡器设备可以通过第一私有寻卡请求指令,确 定第一标签设备从不在位切换到在位之后,读取第一标签设备中第一静默标签的信息。这样,第一标签设备基于第一私有寻卡请求指令才会响应和激活,不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。另外,基于寻卡请求指令的私有化,可以实现定制化特性,提供高安全性的解决方案,满足定制场景的私有化和安全性。
并且,读卡器设备在第一静默标签的信息读取完成后,即便第一标签设备一直在位,读卡器设备也不会再次读取第一静默标签的信息,因而可以节省读卡器设备持续读取第一静默标签的信息所导致的功耗。
而且,读卡器设备在第一静默标签的信息读取完成之后,可以轮询发送NFC寻卡请求指令,包括NFC标准寻卡请求指令和NFC私有寻卡请求指令,以识别其他NFC标签并读取其信息。这样,即便第一标签设备一直在位,读卡器设备的NFC功能也不会失效或受到影响,能够正常进行NFC刷卡或读卡。
此外,本申请实施例提供的方案通过NFC协议交互流程来达到上述目的,实现流程简单,实时性强,且具有通用性;而且不需要借助霍尔传感器等额外的器件,因而可以节省读卡器设备和第一标签设备的硬件空间,简化硬件设计,降低设备成本。
上述步骤501-507提供的NFC数据交互方法,可以应用于多种业务场景,可以具有多样化的应用形态。以下对该业务场景进行举例说明。
场景示例一、手机壳定制主题场景:
示例性的,在该场景下,读卡器设备可以为手机,第一标签设备可以为手机壳(或称主题壳)。该手机壳支持第一静默标签,该第一静默标签可以为有源标签、无源标签或NFC模块模拟的标签。第一静默标签中存储有定制主题信息。第一静默标签默认处于静默状态,可以响应于第一私有寻卡请求指令。
在手机壳定制主题场景下,参见图6A,本申请实施例提供的基于NFC的数据交互方法可以包括:
601、手机发送第一私有寻卡请求指令。
例如,手机可以根据用户的指示操作,通过射频信号发送第一私有寻卡请求指令。或者,手机可以在图4C所示的polling模式下周期性地轮询发送NFC寻卡请求指令,该NFC寻卡请求指令包括标准寻卡请求指令和私有寻卡请求指令,该私有寻卡请求指令包括第一私有寻卡请求指令。
本申请实施例对手机发送第一私有寻卡请求指令的时机不予限定。
602、手机壳接收到第一私有寻卡请求指令后,向手机发送私有寻卡应答指令。
在手机壳靠近手机之前,手机中第一静默标签对应的在位标志为false。手机壳靠近手机之后,可以接收到第一私有寻卡请求指令。若手机壳确定支持的第一静默标签可以响应该第一私有寻卡请求指令,则向手机发送私有寻卡应答指令。
603、手机接收到手机壳发送的私有寻卡应答指令后,确定手机壳由不在位切换到在位,并读取手机壳中的第一静默标签的信息,该信息包括定制主题信息。
其中,该定制主题信息可以是加密信息,也可以未加密信息,不予限定。本申请实施例中以定制主题信息为加密信息为例进行说明。手机在接收到手机壳发送的私有寻卡应答指令后,可以将第一静默标签对应的在位标志设置为true。
604、手机根据第一静默标签的信息,将当前主题切换为定制主题。
手机的NFC模块将读取的定制主题信息上报给手机的主题模块,主题模块解密主题信息,然后将当前主题切换到定制主题。这样,手机与手机壳靠近即可快速切换到定制主题(例如可以是炫酷的主题、VIP主题或官网下载不到的主题等),用户体验较好。
605、手机在第一静默标签的信息读取完成后,停止读取第一静默标签的信息,并发送第一私有寻卡请求指令。
其中,手机在第一静默标签的信息读取完成后,不再发送针对第一静默标签的读指令,手机不再读取第一静默标签的信息,因而可以节省手机持续读取第一静默标签的信息导致的功耗。
在第一静默标签的信息读取完成后,手机还可以发送第一私有寻卡请求指令,以确定手机壳是否持续在位。
606、若手机根据手机壳发送的私有寻卡应答指令,确定手机壳持续在位,则继续发送第一私有寻卡请求指令,并循环执行该步骤606。
手机接收到手机壳发送的私有寻卡应答指令后,根据第一静默标签对应的在位标志为true,确定手机壳持续在位,且手机已经读取过第一静默标签的信息,因而不再读取第一静默标签的信息,保持第一静默标签对应的在位标志为true。并且,手机继续发送第一私有寻卡请求指令,以继续检测手机壳是否持续在位。
在一些实施例中,该方法还可以包括:手机确定手机壳持续在位后,增大第一私有寻卡请求指令的发送间隔,以进一步节省手机的功耗。
另外,手机在第一静默标签的信息读取完成后,在手机壳持续在位的情况下,还可以发送第一私有寻卡请求指令以外的其他寻卡请求指令。这样,手机可以通过其他寻卡请求指令与其他NFC标签(包括通用标签和静默标签)进行数据交互,读取其他NFC标签的信息,从而在手机壳持续在位的情况下,保证手机进行正常的NFC刷卡和读卡。例如,手机在图4C所示的polling模式下,周期性地轮询发送标准寻卡请求指令和私有寻卡请求指令。
在步骤605之后,该方法还包括:
607、若手机在第一预设时长内未接收到手机壳发送的私有寻卡应答指令,则确定手机壳由在位切换为不在位,而后执行上述步骤601。
若手机在第一预设时长内未接收到手机壳发送的私有寻卡应答指令,则第一静默标签离开,手机由在位切换为不在位,第一静默标签对应的在位标志设置为false。此时,手机可以将定制主题切换回默认主题。
例如,第一预设时长大于第一私有寻卡请求指令的发送间隔,这样手机在发送两条第一私有寻卡请求指令后,也未接收到手机壳发送的私有寻卡应答指令,则手机壳可能已经离开,手机确定手机壳由在位切换为不在位。
需要说明的是,关于步骤601-607与图4A-图4D的对应关系,可以参考步骤501-507与图4A-图4D的对应关系的描述,这里不再赘述。
在一些实施例中,基于图4A-图4D所示的NFC处理流程,步骤601-607描述的方案具体可以包括:
手机按照NFC模块的工作周期轮询发送NFC寻卡请求指令,包括标准寻卡请求 指令和私有寻卡请求指令,该私有寻卡请求指令包括第一私有寻卡请求指令。手机壳未靠近手机时,第一静默标签对应的在位标志为false。手机壳与手机靠近后,手机接收到来自第一静默标签的私有寻卡应答指令。手机根据第一静默标签对应的在位标志为false,且接收到来自第一静默标签的私有寻卡应答指令,读取第一静默标签中存储的定制主题信息,将当前主题切换为定制主题;并且,手机将第一静默标签从不在位切换到在位。在第一静默标签的信息读取完成后,不再执行第一静默标签的数据读取流程。手机按照NFC模块的工作周期轮询发送标准寻卡请求指令和私有寻卡请求指令,以便可以与其他NFC标签进行数据交互,该私有寻卡请求指令包括第一私有寻卡请求指令。此外,在第一静默标签持续在位时,手机发送的第一静默标签对应的寻卡请求指令的间隔可以增大。在手机壳离开手机后,手机将第一静默标签对应的在位标志设置为false,并切换回默认主题。示例性的,手机与手机壳基于NFC切换定制主题的示意图可以参见图6B。
在场景示例一描述的方案中,手机可以通过第一私有寻卡请求指令,确定手机壳从不在位切换到在位(例如手机壳套上手机)之后,读取手机壳中第一静默标签存储的定制主题信息等,实现一碰切换主题。这样,手机壳基于第一私有寻卡请求指令才会响应和激活,不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。
并且,手机在第一静默标签的信息读取完成后,即便手机壳一直在位(即手机壳一直套在手机上),手机也不会再次读取第一静默标签的信息,因而可以节省手机持续读取第一静默标签的信息所导致的功耗。
而且,手机在第一静默标签的信息读取完成之后,可以轮询发送NFC寻卡请求指令,包括NFC标准寻卡请求指令和NFC私有寻卡请求指令,以识别其他NFC标签并读取其信息。这样,即便手机壳一直在位,手机的NFC功能也不会失效或受到影响,能够正常进行NFC刷卡或读卡。
此外,本申请实施例提供的方案通过NFC协议交互流程来达到上述目的,实现流程简单,实时性强,且具有通用性;而且不需要借助霍尔传感器等额外的器件,因而可以节省手机和手机壳的硬件空间,简化硬件设计,降低设备成本。
场景示例二、设备防伪和参数优化场景:
示例性的,在该场景下,读卡器设备可以为手机,第一标签设备可以为无线充电器(或称充电壳)。该无线充电器支持第一静默标签,该第一静默标签可以为有源标签、无源标签或NFC模块模拟的标签。第一静默标签中存储有充电器防伪标识和/或充电优化参数等信息。第一静默标签默认处于静默状态,可以响应于第一私有寻卡请求指令。
在设备防伪和参数优化场景下,参见图7A,本申请实施例提供的基于NFC的数据交互方法可以包括:
701、手机发送第一私有寻卡请求指令。
702、无线充电器接收到第一私有寻卡请求指令后,向手机发送私有寻卡应答指令。
其中,步骤701-702的实现过程与步骤601-602的实现过程类似,可以参见上述相关说明,这里不予赘述。
703、手机接收到无线充电器发送的私有寻卡应答指令后,确定无线充电器由不在 位切换到在位,并读取无线充电器中的第一静默标签的信息,该信息包括充电器防伪标识和/或充电优化参数。
手机接收到无线充电器发送的私有寻卡应答指令后,可以将第一静默标签对应的在位标志设置为true。
704、手机根据第一静默标签的信息,进行防伪校验,和/或按照优化参数进行配置并充电。
手机的NFC模块将读取的充电器防伪标识和/或充电优化参数等信息,上报给手机的充电模块,充电模块进行防伪校验,和/或按照优化参数进行配置并充电。这样,手机与无线充电器靠近即可快速进行充电防伪校验或采用优化参数进行充电,用户体验较好。
705、手机在第一静默标签的信息读取完成后,停止读取第一静默标签的信息,并发送第一私有寻卡请求指令。
706、若手机根据无线充电器发送的私有寻卡应答指令,确定无线充电器持续在位,则继续发送第一私有寻卡请求指令,并循环执行该步骤706。
其中,步骤705-706的实现过程与步骤605-606的实现过程类似,可以参见上述相关说明,这里不予赘述。
在一些实施例中,该方法还可以包括:手机确定无线充电器持续在位后,增大第一私有寻卡请求指令的发送间隔,以进一步节省手机的功耗。
另外,手机在第一静默标签的信息读取完成后,在无线充电器持续在位的情况下,还可以发送第一私有寻卡请求指令以外的其他寻卡请求指令。这样,手机可以通过其他寻卡请求指令与其他NFC标签(包括通用标签和静默标签)进行数据交互,读取其他NFC标签的信息,从而在无线充电器持续在位的情况下,保证手机进行正常的NFC刷卡和读卡。例如,手机在图4C所示的polling模式下,周期性地轮询发送各种标准寻卡请求指令和私有寻卡请求指令。
在步骤705之后,该方法还包括:
707、若手机在第一预设时长内未接收到无线充电器发送的私有寻卡应答指令,则确定无线充电器由在位切换为不在位,而后执行上述步骤701。
若手机在第一预设时长内未接收到无线充电器发送的私有寻卡应答指令,则第一静默标签离开,无线充电器由在位切换为不在位,第一静默标签对应的在位标志设置为false。此时,手机可以停止充电。
需要说明的是,关于步骤701-707与图4A-图4D的对应关系,可以参考步骤501-507与图4A-图4D的对应关系的描述,这里不再赘述。
在一些实施例中,基于图4A-图4D所示的NFC处理流程,步骤701-707描述的方案可以包括:
手机按照NFC模块的工作周期轮询发送寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令,该私有寻卡请求指令包括第一私有寻卡请求指令。无线充电器未靠近手机时,第一静默标签对应的在位标志为false。无线充电器与手机靠近后,手机接收到来自第一静默标签的私有寻卡应答指令。手机根据第一静默标签对应的在位标志为false,且接收到来自第一静默标签的私有寻卡应答指令,读取第一静默标签中存 储的防伪标识和/或优化参数,进行防伪校验和/或充电优化;并且,手机将第一静默标签从不在位切换到在位。在第一静默标签的信息读取完成后,不再执行第一静默标签的数据读取流程。手机按照工作周期轮询发送标准寻卡请求指令和私有寻卡请求指令,以便可以与其他NFC标签进行数据交互,该私有寻卡请求指令包括第一私有寻卡请求指令。此外,在第一静默标签持续在位时,手机发送的第一静默标签对应的寻卡请求指令的间隔可以增大。在无线充电器离开手机后,手机将第一静默标签对应的在位标志设置为false,并停止无线充电。示例性的,手机与无线充电器基于NFC进行无线充电的示意图可以参见图7B。
在场景示例二描述的方案中,手机可以通过第一私有寻卡请求指令,确定无线充电器从不在位切换到在位(例如无线充电器靠近手机)之后,读取无线充电器中第一静默标签存储的防伪标识和/或充电优化参数等信息,实现一碰优化充电。这样,无线充电器基于第一私有寻卡请求指令才会响应和激活,不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。
并且,手机在第一静默标签的信息读取完成后,即便无线充电器一直在位(即无线充电器与手机一直靠近),手机也不会再次读取第一静默标签的信息,因而可以节省手机持续读取第一静默标签的信息所导致的功耗。
而且,手机在第一静默标签的信息读取完成之后,可以轮询发送NFC寻卡请求指令,包括NFC标准寻卡请求指令和NFC私有寻卡请求指令,以识别其他NFC标签并读取其信息。这样,即便无线充电器一直在位,手机的NFC功能也不会失效或受到影响,能够正常进行NFC刷卡或读卡。
此外,本申请实施例提供的方案通过NFC协议交互流程来达到上述目的,实现流程简单,实时性强,且具有通用性;而且不需要借助霍尔传感器等额外的器件,因而可以节省手机和无线充电器的硬件空间,简化硬件设计,降低设备成本。
场景示例三、启动反向充电的场景:
示例性的,在该场景下,读卡器设备可以为手机,第一标签设备可以为智能手表(以下简称手表)。该手表支持第一静默标签,该第一静默标签可以为有源标签、无源标签或NFC模块模拟的标签。一般来说,手表中设置有NFC芯片,可以模拟第一静默标签,该种情况下,手表不需要再额外设置一个第一静默标签。第一静默标签中存储有手表的标识信息等信息。第一静默标签默认处于静默状态,可以响应于第一私有寻卡请求指令。
在启动反向充电的场景下,参见图8A,本申请实施例提供的基于NFC的数据交互方法可以包括:
801、手机发送第一私有寻卡请求指令。
802、手表接收到第一私有寻卡请求指令后,向手机发送私有寻卡应答指令。
其中,步骤801-802的实现过程与步骤601-602的实现过程类似,可以参见上述相关说明,这里不予赘述。
803、手机接收到手表发送的私有寻卡应答指令后,确定手表由不在位切换到在位,并读取手表中的第一静默标签的信息,该信息包括手表的标识信息。
手机接收到手表发送的私有寻卡应答指令后,可以将第一静默标签对应的在位标 志设置为true。
804、手机根据第一静默标签的信息,确定是否启动反向充电。
手机的NFC模块将读取到的手表的标识信息等信息,上报给手机的充电模块。充电模块维护有充电支持的标识信息列表。充电模块根据手表的标识信息和该标识信息列表,确定该手表是否支持无线充电。若支持,则手机启动反向充电功能,为手表充电;若不支持,则手机不启动反向充电功能。这样,手机与手表靠近即可快速开启反向充电,相比现在需要手动去打开手机反向充电功能,用户体验要提升很多,也能节省很多用户操作步骤,减少用户学习成本。
并且,在该方案中,手机上用于进行反向充电的充电线圈,与用于进行NFC通信的天线可以离得较近,以使得手表在同一位置时手机即可以通过NFC开启反向充电,并通过充电线圈进行充电,避免反复调整手表的位置。
805、手机在第一静默标签的信息读取完成后,停止读取第一静默标签的信息,并发送第一私有寻卡请求指令。
806、若手机根据手表发送的私有寻卡应答指令,确定手表持续在位,则继续发送第一私有寻卡请求指令,并循环执行该步骤806。
其中,步骤805-806的实现过程与步骤605-606的实现过程类似,可以参见上述相关说明,这里不予赘述。
在一些实施例中,该方法还可以包括:手机确定手表持续在位后,增大第一私有寻卡请求指令的发送间隔,以进一步节省手机的功耗。
另外,手机在第一静默标签的信息读取完成后,在手表持续在位的情况下,还可以发送第一私有寻卡请求指令以外的其他寻卡请求指令。这样,手机可以通过其他寻卡请求指令与其他NFC标签(包括通用标签和静默标签)进行数据交互,读取其他NFC标签的信息,从而在手表持续在位的情况下,保证手机进行正常的NFC刷卡和读卡。例如,手机在图4C所示的polling模式下,周期性地轮询发送各种标准寻卡请求指令和私有寻卡请求指令。
在步骤805之后,该方法还包括:
807、若手机在第一预设时长内未接收到手表发送的私有寻卡应答指令,则确定手表由在位切换为不在位,而后执行上述步骤801。
需要说明的是,关于步骤801-807与图4A-图4D的对应关系,可以参考步骤501-507与图4A-图4D的对应关系的描述,这里不再赘述。
在一些实施例中,基于图4A-图4D所示的NFC处理流程,步骤801-807描述的方案可以包括:
手机按照NFC模块的工作周期轮询发送寻卡请求指令,包括标准寻卡请求指令和私有寻卡请求指令,该私有寻卡请求指令包括第一私有寻卡请求指令。手表未靠近手机时,第一静默标签对应的在位标志为false。手表与手机靠近后,手机接收到来自第一静默标签的私有寻卡应答指令。手机根据第一静默标签对应的在位标志为false,以及接收到来自第一静默标签的私有寻卡应答指令,确定手表从不在位切换到在位,从而读取第一静默标签中存储的手表的身份信息,根据身份信息确定是否开启反向充电;并且,将第一静默标签对应的在位标志设置为true。在第一静默标签的信息读取完成 后,不再执行第一静默标签的数据读取流程。手机按照NFC模块的工作周期轮询发送标准寻卡请求指令和私有寻卡请求指令,以便可以读取其他NFC标签的信息,该私有寻卡请求指令包括第一私有寻卡请求指令。此外,在第一静默标签持续在位时,手机发送的第一静默标签对应的寻卡请求指令的间隔可以增大。在手表离开手机后,手机将第一静默标签对应的在位标志设置为false,并停止反向充电。示例性的,手机与手表基于NFC进行反向充电的示意图可以参见图8B。
在场景示例三描述的方案中,手机可以通过第一私有寻卡请求指令,确定手表从不在位切换到在位(例如手表靠近手机)之后,读取手表中第一静默标签存储的手表的标识信息等信息,从而确定是否启动反向充电,实现一碰开启反向充电。这样,手表基于第一私有寻卡请求指令才会响应和激活,不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。
手机在第一静默标签的信息读取完成后,即便手表一直在位(即手表与手机一直靠近),手机也不会再次读取第一静默标签的信息,因而可以节省手机持续读取第一静默标签的信息所导致的功耗。
并且,手机在第一静默标签的信息读取完成之后,可以轮询发送NFC寻卡请求指令,包括NFC标准寻卡请求指令和NFC私有寻卡请求指令,以识别其他NFC标签并读取其信息。这样,即便手表一直在位,手机的NFC功能也不会失效或受到影响,能够正常进行NFC刷卡或读卡。
此外,本申请实施例提供的方案通过NFC协议交互流程来达到上述目的,实现流程简单,实时性强,且具有通用性;而且不需要借助霍尔传感器等额外的器件,因而可以节省手机和手表的硬件空间,简化硬件设计,降低设备成本。
需要说明的是,上述业务场景以及业务场景中涉及的读卡器设备和标签设备仅为举例说明,本申请实施例提供的NFC数据交互方法还可以应用于其他电子设备或其他业务场景,此处不予一一列举。
另外,结合上述实施例及相应的附图,本申请另一实施例提供一种数据交互方法,可以应用于支持读卡器功能的第一电子设备以及第一NFC标签。参见图9,该方法可以包括:
901、第一电子设备发送第一寻卡请求指令。
其中,第一寻卡请求指令为私有寻卡请求指令,用于发现静默标签,该静默标签可以响应于第一寻卡请求指令与第一电子设备进行交互,以便第一电子设备可以读取该静默标签的信息。例如,第一寻卡请求指令可以为上述实施例中的REQ-A-PR。
902、第一NFC标签接收到来自第一电子设备的第一寻卡请求指令后,向第一电子设备发送第一寻卡应答指令。
若第一NFC标签支持响应第一寻卡请求指令,则可以向第一电子设备回复第一寻卡应答指令。
903、第一电子设备接收到来自第一NFC标签的第一寻卡应答指令之后,读取第一NFC标签的信息。
如果第一电子设备接收到来自第一NFC标签的第一寻卡应答指令,则可能第一NFC标签与第一电子设备刚从远离到相互靠近,第一电子设备检测到第一NFC标签后, 第一电子设备可以读取第一NFC标签的信息。例如,第一NFC标签的信息可以包括定制主题信息、充电器防伪标识、充电优化参数或设备标识信息等内容。
在第一电子设备接收到来自第一NFC标签的第一寻卡应答指令之前,第一电子设备不在位;第一电子设备接收到来自第一NFC标签的第一寻卡应答指令后,第一电子设备检测到第一NFC标签,第一NFC标签切换为在位。
904、在第一电子设备读取第一NFC标签的信息后,第一电子设备继续发送第一寻卡请求指令,继续接收来自第一NFC标签的寻卡应答指令,不读取第一NFC标签的信息。
第一电子设备读取第一NFC标签的信息后,如果继续接收到来自第一NFC标签的第一寻卡应答指令,则可能第一NFC标签持续处于与第一电子设备相互靠近的状态,第一NFC标签持续在位,第一电子设备不再读取第一NFC标签的信息。
这样,在第一NFC标签持续在位的情况下,第一电子设备不再读取第一NFC标签的信息,从而不会持续处于数据读取流程中而可以正常监听和发送NFC寻卡指令,包括标准寻卡指令和私有寻卡指令,从而可以正常读取其他NFC标签的信息,使得NFC的读卡、刷卡和P2P等功能能够正常进行。
而且,在第一NFC标签持续在位的情况下,第一电子设备不再读取第一NFC标签的信息可以节省电子设备的功耗。
并且,第一电子设备读取的是可以响应第一寻卡请求指令的静默标签的信息,而不是任意的通用NFC标签,因而不容易导致不必要的数据读取,可以实现按需触发和按需读取数据。
此外,该方案不需要结合霍尔传感器等额外的部件来读取静默标签的数据,因而可以节省第一电子设备和静默标签的硬件空间,简化硬件设计,降低设备成本。
可以理解的是,为了实现上述功能,电子设备包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用对应各个功能划分各个功能模块的情况下,上述实施例中涉及的电子设备100的一种可能的组成示意图,该电子设备可以包括:发送单元、接收单元、读取单元和处理单元等。需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
本申请实施例还提供一种电子设备,该电子设备可以是上述读卡器设备或标签设备。如图10所示,包括:一个或多个处理器1001,存储器1002,以及一个或多个计算机程序1003,上述各器件可以通过一个或多个通信总线1004连接。其中该一个或 多个计算机程序1003被存储在上述存储器1002中并被配置为被该一个或多个处理器1001执行,该一个或多个计算机程序1003包括指令,上述指令可以用于执行上述实施例中,读卡器设备执行的各个步骤或标签设备执行的各个步骤。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应实体器件的功能描述,在此不再赘述。
示例性的,上述处理器1001具体可以为图3所示的处理器110,上述存储器1002具体可以为图3所示的内部存储器121。
本申请实施例还提供一种电子设备,包括一个或多个处理器以及一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述相关方法步骤实现上述实施例中的基于NFC的数据交互方法。
本申请的实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法中读卡器设备执行的步骤,或者执行上述相关方法中静默标签执行的步骤,实现上述实施例中的基于NFC的数据交互方法。
本申请的实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关方法中读卡器设备执行的步骤,或者执行上述相关方法中静默标签执行的步骤,实现上述实施例中的基于NFC的数据交互方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片(例如NFC芯片),组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使装置执行上述相关方法中读卡器设备执行的步骤,或者执行上述相关方法中静默标签执行的步骤,实现上述实施例中的基于NFC的数据交互方法。
另外,本申请实施例还提供了一种NFC标签,可以执行上述静默标签执行的步骤,实现上述实施例中的基于NFC的数据交互方法。该NFC标签可以通过NFC芯片来模拟。该NFC标签可以是独立的卡片,也可以设置到电子设备中。
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品、装置或NFC标签,均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些 接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (20)

  1. 一种数据交互方法,其特征在于,应用于包括第一电子设备和第一近场通信NFC标签的系统,所述方法包括:
    所述第一电子设备发送第一寻卡请求指令;
    所述第一NFC标签接收到来自所述第一电子设备的所述第一寻卡请求指令后,向所述第一电子设备发送第一寻卡应答指令;
    所述第一电子设备接收到来自所述第一NFC标签的第一寻卡应答指令之后,读取所述第一NFC标签的信息;
    在所述第一电子设备读取所述第一NFC标签的信息后,所述第一电子设备继续发送所述第一寻卡请求指令,继续接收来自所述第一NFC标签的寻卡应答指令,不读取所述第一NFC标签的信息。
  2. 根据权利要求1所述的方法,其特征在于,所述第一电子设备设置有第一标识,所述第一标识指示所述第一电子设备是否检测到所述第一NFC标签;
    在所述第一电子设备接收到来自所述第一NFC标签的第一寻卡应答指令之前,所述第一标识的值为第一值,所述第一值指示所述第一电子设备没有检测到所述第一NFC标签;
    在所述第一电子设备接收到来自所述第一NFC标签的第一寻卡应答指令之后,所述第一电子设备将所述第一标识的值由所述第一值变更为第二值,所述第二值指示所述第一电子设备检测到所述第一NFC标签。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    在所述第一电子设备继续发送所述第一寻卡请求指令后:
    若所述第一电子设备在预设时长内未接收到来自所述第一NFC标签的第一寻卡应答指令,则所述第一电子设备将所述第一标识的值由所述第二值变更为所述第一值;
    若所述第一电子设备在所述预设时长内接收到来自所述第一NFC标签的第一寻卡应答指令,则所述第一标识的值维持为所述第二值。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:
    所述第一电子设备增大所述继续发送所述第一寻卡请求指令的时间间隔。
  5. 根据权利要求1-4任一项所述的方法,所述系统还包括第二NFC标签,其特征在于,在所述第一电子设备读取所述第一NFC标签的信息后,所述方法还包括:
    所述第一电子设备发送第二寻卡请求指令;
    若所述第一电子设备接收到来自所述第二NFC标签的第二寻卡应答指令,所述第二寻卡应答指令是所述第二NFC标签对所述第二寻卡请求指令的响应,则读取所述第二NFC标签的信息。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述第一NFC标签通过NFC芯片模拟获得。
  7. 一种数据交互方法,应用于支持近场通信NFC读卡功能的第一电子设备,其特征在于,所述方法包括:
    所述第一电子设备发送第一寻卡请求指令;
    所述第一电子设备接收来自第一NFC标签的第一寻卡应答指令,所述第一寻卡应 答指令是所述第一NFC标签对所述第一寻卡请求指令的响应;
    所述第一电子设备接收到来自所述第一NFC标签的第一寻卡应答指令之后,读取所述第一NFC标签的信息;
    在所述第一电子设备读取所述第一NFC标签的信息后,所述第一电子设备继续发送所述第一寻卡请求指令,继续接收来自所述第一NFC标签的寻卡应答指令,不读取所述第一NFC标签的信息。
  8. 根据权利要求7所述的方法,其特征在于,所述第一电子设备设置有第一标识,所述第一标识指示所述第一电子设备是否检测到所述第一NFC标签;
    在所述第一电子设备接收到来自所述第一NFC标签的第一寻卡应答指令之前,所述第一标识的值为第一值,所述第一值指示所述第一电子设备没有检测到所述第一NFC标签;
    所述第一电子设备在接收到来自所述第一NFC标签的第一寻卡应答指令之后,所述第一电子设备将所述第一标识的值由所述第一值变更为第二值,所述第二值指示所述第一电子设备检测到所述第一NFC标签。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    在所述第一电子设备继续发送所述第一寻卡请求指令后:
    若所述第一电子设备在预设时长内未接收到来自所述第一NFC标签的第一寻卡应答指令,则所述第一电子设备将所述第一标识的值由所述第二值变更为所述第一值;
    若所述第一电子设备在所述预设时长内接收到来自所述第一NFC标签的第一寻卡应答指令,则所述第一标识的值维持为所述第二值。
  10. 根据权利要求7-9任一项所述的方法,其特征在于,所述方法还包括:
    所述第一电子设备增大所述继续发送所述第一寻卡请求指令的时间间隔。
  11. 根据权利要求7-10任一项所述的方法,其特征在于,在所述第一电子设备读取所述第一NFC标签的信息后,所述方法还包括:
    所述第一电子设备发送第二寻卡请求指令;
    若所述第一电子设备接收到来自第二NFC标签的第二寻卡应答指令,所述第二寻卡应答指令是所述第二NFC标签对所述第二寻卡请求指令的响应,则读取所述第二NFC标签的信息。
  12. 根据权利要求7-11任一项所述的方法,其特征在于,在所述第一电子设备读取所述第一NFC标签的信息后,所述方法还包括:
    所述第一电子设备根据所述第一NFC标签的信息,进行业务处理。
  13. 根据权利要求12所述的方法,其特征在于,所述第一电子设备根据所述第一NFC标签的信息,进行业务处理,包括:
    所述第一电子设备根据所述第一NFC标签中所述第二电子设备的标识信息,为所述第二电子设备充电。
  14. 根据权利要求12所述的方法,其特征在于,所述第一电子设备根据所述第一NFC标签的信息,进行业务处理,包括:
    所述第一电子设备根据所述第一NFC标签的信息,切换所述第一电子设备的主题。
  15. 根据权利要求12所述的方法,其特征在于,所述第一电子设备根据所述第一 NFC标签的信息,进行业务处理,包括:
    所述第一电子设备根据所述第一NFC标签的信息,进行充电器防伪校验和/或配置充电参数。
  16. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储器;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行如权利要求1-15中任一项所述的第一电子设备执行的数据交互方法。
  17. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在计算机上运行时,使得所述计算机执行如权利要求1-15中任一项所述的第一电子设备执行的数据交互方法。
  18. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-15中任一项所述的第一电子设备执行的数据交互方法。
  19. 一种装置,其特征在于,所述装置包括至少一个存储器,至少一个处理器,所述至少一个处理器和所述至少一个存储器耦合,并读取所述至少一个存储器中的指令并根据所述指令使得所述装置执行权利要求7-15中任一项所述的方法。
  20. 一种数据交互系统,其特征在于,包括第一电子设备和第一近场通信NFC标签,所述第一电子设备和所述第一NFC标签用于执行如权利要求1-15中任一项所述的数据交互方法。
PCT/CN2022/084673 2021-06-04 2022-03-31 一种基于nfc的数据交互方法及设备 WO2022252792A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22814839.1A EP4336874A1 (en) 2021-06-04 2022-03-31 Nfc-based data interaction method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110626646.0 2021-06-04
CN202110626646.0A CN115442780A (zh) 2021-06-04 2021-06-04 一种基于nfc的数据交互方法及设备

Publications (1)

Publication Number Publication Date
WO2022252792A1 true WO2022252792A1 (zh) 2022-12-08

Family

ID=84240589

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/084673 WO2022252792A1 (zh) 2021-06-04 2022-03-31 一种基于nfc的数据交互方法及设备

Country Status (3)

Country Link
EP (1) EP4336874A1 (zh)
CN (1) CN115442780A (zh)
WO (1) WO2022252792A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115379049A (zh) * 2022-08-19 2022-11-22 Oppo广东移动通信有限公司 近场通信交互方法、终端、近场通信芯片与终端外壳
CN117395639B (zh) * 2023-12-12 2024-05-14 荣耀终端有限公司 设备寻找方法及电子设备

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100127829A1 (en) * 2008-11-26 2010-05-27 At&T Intellectual Property I, L.P. Radio frequency identification readers, methods and computer program products for adjusting a query command slot-counter parameter q
CN102215050A (zh) * 2010-04-02 2011-10-12 国民技术股份有限公司 一种带低频磁通信的射频sim卡冲突检测方法
CN103049769A (zh) * 2012-02-24 2013-04-17 深圳中科讯联科技有限公司 可防止射频卡冲突的通信方法
CN104081679A (zh) * 2012-10-25 2014-10-01 华为终端有限公司 近场通信方法和近场通信设备
CN104268494A (zh) * 2014-10-20 2015-01-07 浪潮电子信息产业股份有限公司 一种基于二叉树的rfid防碰撞算法
CN106056014A (zh) * 2015-11-10 2016-10-26 天地融科技股份有限公司 身份证读卡方法、系统和读卡器
CN108288008A (zh) * 2018-02-08 2018-07-17 飞天诚信科技股份有限公司 一种卡片激活的方法及装置
CN112395894A (zh) * 2019-08-16 2021-02-23 华为技术有限公司 基于nfc的通信方法及装置
US20210073488A1 (en) * 2019-09-11 2021-03-11 RadicalID, Inc. Multipurpose rfid transponder and a system for reading it

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100127829A1 (en) * 2008-11-26 2010-05-27 At&T Intellectual Property I, L.P. Radio frequency identification readers, methods and computer program products for adjusting a query command slot-counter parameter q
CN102215050A (zh) * 2010-04-02 2011-10-12 国民技术股份有限公司 一种带低频磁通信的射频sim卡冲突检测方法
CN103049769A (zh) * 2012-02-24 2013-04-17 深圳中科讯联科技有限公司 可防止射频卡冲突的通信方法
CN104081679A (zh) * 2012-10-25 2014-10-01 华为终端有限公司 近场通信方法和近场通信设备
CN104268494A (zh) * 2014-10-20 2015-01-07 浪潮电子信息产业股份有限公司 一种基于二叉树的rfid防碰撞算法
CN106056014A (zh) * 2015-11-10 2016-10-26 天地融科技股份有限公司 身份证读卡方法、系统和读卡器
CN108288008A (zh) * 2018-02-08 2018-07-17 飞天诚信科技股份有限公司 一种卡片激活的方法及装置
CN112395894A (zh) * 2019-08-16 2021-02-23 华为技术有限公司 基于nfc的通信方法及装置
US20210073488A1 (en) * 2019-09-11 2021-03-11 RadicalID, Inc. Multipurpose rfid transponder and a system for reading it

Also Published As

Publication number Publication date
CN115442780A (zh) 2022-12-06
EP4336874A1 (en) 2024-03-13

Similar Documents

Publication Publication Date Title
CN110020569B (zh) 自动选择nfc模拟卡的方法、电子设备及通信系统
CN113596810B (zh) 基于双卡的网络制式切换方法及终端设备
WO2022252792A1 (zh) 一种基于nfc的数据交互方法及设备
US10299210B2 (en) Method and apparatus for reducing power consumption of electronic device
WO2021031856A1 (zh) 基于nfc的通信方法及装置
WO2021052421A1 (zh) 近距离无线通信的方法和电子设备
KR102194301B1 (ko) 전자 장치들의 통신 연결 방법 및 장치
WO2021185105A1 (zh) SIM卡和eSIM卡的切换方法及电子设备
CN110839096A (zh) 一种具有折叠屏的设备的触控方法与折叠屏设备
WO2022100238A1 (zh) 定位方法、装置、系统、电子设备及存储介质
US20150065053A1 (en) Method of controlling short-range wireless communication and apparatus supporting the same
US20230117194A1 (en) Communication Service Status Control Method, Terminal Device, and Readable Storage Medium
CN110780929B (zh) 调用硬件接口的方法及电子设备
CN112130788A (zh) 一种内容分享方法及其装置
EP4243556A1 (en) Method for monitoring link and terminal device
CN112445276A (zh) 一种折叠屏显示应用方法及电子设备
WO2022048453A1 (zh) 解锁方法及电子设备
CN111492678B (zh) 一种文件传输方法及电子设备
CN114741039A (zh) 设备控制方法和终端设备
WO2022068646A1 (zh) 一种数据传输方法及电子设备
EP4145875A1 (en) Smart card sharing method, electronic device, and computer-readable storage medium
WO2023134522A1 (zh) 一种通信系统、通信方法及设备
CN115175164B (zh) 通信控制方法及相关装置
WO2022228065A1 (zh) 功能跳转方法及电子设备
CN113542315B (zh) 通信框架、业务事件处理方法及装置

Legal Events

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

Ref document number: 22814839

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022814839

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022814839

Country of ref document: EP

Effective date: 20231205

NENP Non-entry into the national phase

Ref country code: DE