WO2023221429A1 - Card emulation method, and nfc chip and electronic device - Google Patents

Card emulation method, and nfc chip and electronic device Download PDF

Info

Publication number
WO2023221429A1
WO2023221429A1 PCT/CN2022/131950 CN2022131950W WO2023221429A1 WO 2023221429 A1 WO2023221429 A1 WO 2023221429A1 CN 2022131950 W CN2022131950 W CN 2022131950W WO 2023221429 A1 WO2023221429 A1 WO 2023221429A1
Authority
WO
WIPO (PCT)
Prior art keywords
hardware
electronic device
hardware characteristic
parameters
nfc
Prior art date
Application number
PCT/CN2022/131950
Other languages
French (fr)
Chinese (zh)
Inventor
王子仪
孔庆尧
胡继云
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Publication of WO2023221429A1 publication Critical patent/WO2023221429A1/en

Links

Images

Classifications

    • H04B5/77
    • 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/10118Methods 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 the sensing being preceded by at least one preliminary step
    • 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

Landscapes

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

Abstract

The embodiments of the present application relate to the field of NFC. Provided are a card emulation method, and an NFC chip and an electronic device. The method comprises: selecting a set of hardware feature parameters from a plurality of sets of hardware feature parameters as a first hardware feature parameter; and if an NFC chip fails to communicate with a second electronic device after the chip is configured with the first hardware feature parameter, switching the first hardware feature parameter to a second hardware feature parameter, and communicating with the second electronic device again according to the second hardware feature parameter. The method provided in the embodiments of the present application facilitates the compatibility of an NFC device, which is working in a CE mode, with different card-reading devices, such that the stability and compatibility of the NFC device, which is working in the CE mode, can be improved.

Description

卡模拟方法、NFC芯片及电子设备Card emulation method, NFC chip and electronic equipment
本申请要求于2022年05月19日提交中国专利局、申请号为202210557712.8、申请名称为“卡模拟方法、NFC芯片及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on May 19, 2022, with the application number 202210557712.8 and the application name "Card Simulation Method, NFC Chip and Electronic Device", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本申请实施例涉及NFC领域,尤其涉及一种卡模拟方法、NFC芯片及电子设备。Embodiments of the present application relate to the field of NFC, and in particular, to a card simulation method, NFC chip and electronic device.
背景技术Background technique
近场通信(Near Field Communication,NFC)作为一种通信技术,已经在人们的生活中被大量使用。其中,NFC设备的工作模式主要包括两种,卡模拟(Card Emulation,CE)模式及读卡(Reader/Writer,RW)模式。可以理解的是,NFC设备是具有NFC芯片的电子设备,当NFC设备处于CE模式下,该处于CE模式下的NFC设备具有卡模拟功能,此时,处于CE模式下的NFC设备可以模拟为一张NFC芯片卡,例如,门禁卡、交通卡、银行卡等,用于被读卡设备进行读写。而当NFC设备处于RW模式下,该处于RW模式下的NFC设备可以主动发射射频信号去识别和读写其他处于CE模式下的NFC设备,此时,处于RW模式下的NFC设备可以认为是一个NFC读卡器,如同POS机、门禁、闸机等。Near Field Communication (NFC), as a communication technology, has been widely used in people's lives. Among them, the working modes of NFC devices mainly include two types, card emulation (Card Emulation, CE) mode and card reader (Reader/Writer, RW) mode. It can be understood that an NFC device is an electronic device with an NFC chip. When the NFC device is in CE mode, the NFC device in CE mode has a card simulation function. At this time, the NFC device in CE mode can be simulated as a card. An NFC chip card, such as access control card, transportation card, bank card, etc., is used to be read and written by the card reading device. When the NFC device is in RW mode, the NFC device in RW mode can actively transmit radio frequency signals to identify, read and write other NFC devices in CE mode. At this time, the NFC device in RW mode can be considered as a NFC card readers, such as POS machines, access control, gates, etc.
工作在CE模式下的不同的NFC设备可以配置不同的芯片卡硬件特征参数(Hardware Feature Parameter),硬件特征参数影响了NFC指令交互的成功率。通常,工作在CE模式下的NFC设备会预先配置一种芯片卡硬件特征参数。因此,工作在CE模式下的NFC设备难以兼容不同的读卡设备,其中,读卡设备可以包括上述工作在RW模式下的NFC设备,也可以包括普通的射频识别(Radio Frequency Identification,RFID)设备,由此会出现工作在CE模式下的NFC设备与读卡设备通信失败的情况,例如,门禁打不开,POS扣款失败等。Different NFC devices working in CE mode can be configured with different chip card hardware feature parameters (Hardware Feature Parameter). The hardware feature parameters affect the success rate of NFC command interaction. Usually, NFC devices operating in CE mode are pre-configured with a chip card hardware characteristic parameter. Therefore, NFC devices working in CE mode are difficult to be compatible with different card reading devices. Among them, card reading devices can include the above-mentioned NFC devices working in RW mode, or ordinary radio frequency identification (Radio Frequency Identification, RFID) devices. , there will be situations where the NFC device working in CE mode fails to communicate with the card reader device, for example, the access control cannot be opened, POS deduction fails, etc.
发明内容Contents of the invention
本申请实施例提供了一种卡模拟方法、NFC芯片及电子设备,有助于工作在CE模式下的NFC设备兼容不同的读卡设备,从而可以提高工作在CE模式下的NFC设备的稳定性和兼容性。The embodiment of the present application provides a card simulation method, NFC chip and electronic device, which helps the NFC device working in CE mode to be compatible with different card reading devices, thereby improving the stability of the NFC device working in CE mode. and compatibility.
第一方面,本申请实施例提供了一种卡模拟方法,应用于第一电子设备,该第一电子设备具有NFC芯片,该NFC芯片工作在CE模式,该第一电子设备预设多套硬件特征参数,包括:In the first aspect, embodiments of the present application provide a card emulation method, which is applied to a first electronic device. The first electronic device has an NFC chip. The NFC chip works in CE mode. The first electronic device is preset with multiple sets of hardware. Characteristic parameters, including:
选取多套硬件特征参数中的一套硬件特征参数作为第一硬件特征参数;Select one set of hardware feature parameters among the multiple sets of hardware feature parameters as the first hardware feature parameter;
若NFC芯片配置第一硬件特征参数后,与第二电子设备通信失败,则将第一硬件 特征参数切换为第二硬件特征参数,并根据第二硬件特征参数与第二电子设备再次进行通信。If the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameters, it switches the first hardware characteristic parameters to the second hardware characteristic parameters, and communicates with the second electronic device again according to the second hardware characteristic parameters.
本申请实施例中,通过在工作在CE模式下的NFC设备中预设多套硬件特征参数,在使用硬件特征参数与读卡设备通信失败后,切换硬件特征参数并再次进行通信,由此可以有助于工作在CE模式下的NFC设备兼容不同的读卡设备,从而可以提高工作在CE模式下的NFC设备的稳定性和兼容性。In the embodiment of the present application, multiple sets of hardware feature parameters are preset in the NFC device working in CE mode. After the communication with the card reading device fails using the hardware feature parameters, the hardware feature parameters are switched and communication is carried out again, so that the communication can be carried out again. It helps NFC devices working in CE mode to be compatible with different card reading devices, thereby improving the stability and compatibility of NFC devices working in CE mode.
其中一种可能的实现方式中,多套硬件特征参数中的每套硬件特征参数与NFC模式、NFC技术及比特率的组合具有映射关系。In one possible implementation manner, each set of hardware feature parameters among multiple sets of hardware feature parameters has a mapping relationship with a combination of NFC mode, NFC technology, and bit rate.
本申请实施例中,通过将不同的硬件特征参数与NFC模式、NFC技术及比特率的组合进行映射,可以使得第一电子设备较快的根据NFC模式、NFC技术及比特率的组合选取硬件特征参数,由此可以提高通信的效率。In the embodiment of the present application, by mapping different hardware feature parameters to the combination of NFC mode, NFC technology and bit rate, the first electronic device can quickly select hardware features based on the combination of NFC mode, NFC technology and bit rate. parameters, thereby improving the efficiency of communication.
其中一种可能的实现方式中,第一硬件特征参数与第二硬件特征参数对应的NFC技术和/或比特率不同。In one possible implementation manner, the NFC technology and/or bit rate corresponding to the first hardware characteristic parameter and the second hardware characteristic parameter are different.
本申请实施例可以实现在对应不同NFC技术和/或比特率的硬件特征参数之间进行切换。Embodiments of the present application can implement switching between hardware feature parameters corresponding to different NFC technologies and/or bit rates.
其中一种可能的实现方式中,第一硬件特征参数与第二硬件特征参数对应的NFC技术和比特率相同,参数值不同。In one possible implementation manner, the NFC technology and bit rate corresponding to the first hardware characteristic parameter and the second hardware characteristic parameter are the same, but the parameter values are different.
本申请实施例可以实现在对应相同NFC技术及相同比特率的硬件特征参数内进行切换。Embodiments of the present application can implement switching within hardware feature parameters corresponding to the same NFC technology and the same bit rate.
其中一种可能的实现方式中,第一硬件特征参数由兼容性和/或覆盖率确定。In one possible implementation manner, the first hardware characteristic parameter is determined by compatibility and/or coverage.
本申请实施例中,通过兼容性和/或覆盖率选取第一硬件特征参数,优先选取对于读卡设备具较高有兼容性和/或覆盖率的硬件特征参数,可以提高通信的成功率。In the embodiment of the present application, the first hardware feature parameters are selected based on compatibility and/or coverage, and hardware feature parameters with higher compatibility and/or coverage for the card reading device are selected first, which can improve the success rate of communication.
其中一种可能的实现方式中,若NFC芯片配置第一硬件特征参数后,与第二电子设备通信失败,则将第一硬件特征参数切换为第二硬件特征参数包括:In one possible implementation, if the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameters, switching the first hardware characteristic parameters to the second hardware characteristic parameters includes:
当定时器超时后,若NFC芯片配置第一硬件特征参数后,与第二电子设备通信失败,则将第一硬件特征参数切换为第二硬件特征参数,定时器在检测到外部存在第二电子设备的情况下启动。After the timer times out, if the NFC chip fails to communicate with the second electronic device after configuring the first hardware feature parameters, the first hardware feature parameters are switched to the second hardware feature parameters. The timer detects the presence of the second electronic device outside. device is started.
本申请实施例中,通过定时器触发硬件特征参数的切换,由此可以避免通信失败后的长时间的等待,从而可以尽快的进入休眠,以节省功耗。In the embodiment of the present application, a timer is used to trigger the switching of hardware feature parameters, thereby avoiding a long wait after communication failure, so that the device can enter sleep as soon as possible to save power consumption.
其中一种可能的实现方式中,若NFC芯片配置第一硬件特征参数后,与第二电子设备通信失败,则将第一硬件特征参数切换为第二硬件特征参数包括:In one possible implementation, if the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameters, switching the first hardware characteristic parameters to the second hardware characteristic parameters includes:
响应于检测到的外部电磁场的快速减弱,将第一硬件特征参数切换为第二硬件特征参数。In response to the detected rapid weakening of the external electromagnetic field, the first hardware characteristic parameter is switched to the second hardware characteristic parameter.
本申请实施例中,通过检测外部电磁场的强度触发硬件特征参数的切换,由此可以在通信失败后尽快发起再次通信,从而可以提高通信效率。In the embodiment of the present application, the intensity of the external electromagnetic field is detected to trigger the switching of hardware characteristic parameters, so that re-communication can be initiated as soon as possible after communication failure, thereby improving communication efficiency.
其中一种可能的实现方式中,将第一硬件特征参数切换为第二硬件特征参数之前,上述方法还包括:In one possible implementation manner, before switching the first hardware characteristic parameter to the second hardware characteristic parameter, the above method further includes:
使NFC芯片进入休眠;Put the NFC chip into sleep;
将第一硬件特征参数切换为第二硬件特征参数包括:Switching the first hardware characteristic parameter to the second hardware characteristic parameter includes:
当休眠结束后,唤醒NFC芯片,并将第一硬件特征参数切换为第二硬件特征参数。After the sleep is completed, the NFC chip is awakened and the first hardware characteristic parameters are switched to the second hardware characteristic parameters.
本申请实施例中,在硬件特征参数进行切换前,将NFC芯片进行休眠态,可以降低整个NFC系统的功耗。In the embodiment of the present application, before the hardware feature parameters are switched, the NFC chip is put into a sleep state, which can reduce the power consumption of the entire NFC system.
第二方面,本申请实施例还提供了一种卡模拟方法,应用于第一电子设备,该第一电子设备具有NFC芯片,该NFC芯片工作在CE模式,该第一电子设备预设多套硬件特征参数,包括:In a second aspect, embodiments of the present application also provide a card simulation method, which is applied to a first electronic device. The first electronic device has an NFC chip. The NFC chip works in CE mode. The first electronic device presets multiple sets of cards. Hardware characteristic parameters, including:
在多套硬件特征参数中选取一套硬件特征参数作为第一硬件特征参数,并使用第一硬件特征参数对外部电磁场进行硬件检测;Select one set of hardware feature parameters from multiple sets of hardware feature parameters as the first hardware feature parameters, and use the first hardware feature parameters to perform hardware detection of the external electromagnetic field;
若第一硬件特征参数与外部电磁场适配,将所述NFC芯片配置为第一硬件特征参数,以使得第一电子设备基于第一硬件特征参数与第二电子设备进行通信;If the first hardware characteristic parameters are adapted to the external electromagnetic field, configure the NFC chip as the first hardware characteristic parameters so that the first electronic device communicates with the second electronic device based on the first hardware characteristic parameters;
若第一硬件特征参数与外部电磁场不适配,将第一硬件特征参数切换为第二硬件特征参数,并使用第二硬件特征参数对外部电磁场再次进行硬件检测。If the first hardware characteristic parameter does not match the external electromagnetic field, the first hardware characteristic parameter is switched to the second hardware characteristic parameter, and the second hardware characteristic parameter is used to perform hardware detection of the external electromagnetic field again.
本申请实施例中,在一个TD内通过硬件检测手段使用硬件特征参数进行适配,并在适配后根据适配的硬件特征参数进行软件配置,由此可以避免软件运行时因硬件特征参数在多个TD内的切换引起的硬件特征参数的多次配置导致的效率降低,从而可以提高通信的效率。In the embodiment of the present application, hardware characteristic parameters are used for adaptation within a TD through hardware detection means, and after adaptation, software configuration is performed according to the adapted hardware characteristic parameters. This can avoid the problem of hardware characteristic parameters being changed when the software is running. Switching within multiple TDs causes efficiency reduction due to multiple configurations of hardware feature parameters, thereby improving communication efficiency.
第三方面,本申请实施例提供了一种NFC芯片,包括:选取模块和通信模块,该选取模块和通信模块用于执行第一方面提供的任意一种的卡模拟方法。In a third aspect, embodiments of the present application provide an NFC chip, including: a selection module and a communication module, the selection module and communication module being used to execute any of the card simulation methods provided in the first aspect.
第四方面,本申请实施例还提供了一种NFC芯片,包括:检测模块、通信模块和切换模块,该检测模块、通信模块和切换模块用于执行第二方面提供的任意一种的卡模拟方法。In the fourth aspect, embodiments of the present application also provide an NFC chip, including: a detection module, a communication module and a switching module. The detection module, communication module and switching module are used to perform any card simulation provided in the second aspect. method.
第五方面,本申请实施例提供了一种电子设备,包括:处理器和存储器,存储器用于存储计算机程序;处理器用于运行计算机程序,执行如第一方面和第二方面所述的卡模拟方法。In a fifth aspect, embodiments of the present application provide an electronic device, including: a processor and a memory. The memory is used to store a computer program; the processor is used to run the computer program and perform card simulation as described in the first and second aspects. method.
第六方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机实现如第一方面和第二方面所述的卡模拟方法。In a sixth aspect, embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is run on a computer, the computer implements the tasks described in the first and second aspects. The card simulation method described above.
附图说明Description of the drawings
图1为本申请提供的卡模拟方法一个实施例的流程示意图;Figure 1 is a schematic flow chart of an embodiment of the card simulation method provided by this application;
图2为本申请实施例提供的一个TD的示意图;Figure 2 is a schematic diagram of a TD provided by the embodiment of the present application;
图3为本申请实施例提供的TD间硬件特征参数切换的示意图;Figure 3 is a schematic diagram of hardware feature parameter switching between TDs provided by an embodiment of the present application;
图4为本申请提供的卡模拟方法另一个实施例的流程示意图;Figure 4 is a schematic flow chart of another embodiment of the card simulation method provided by this application;
图5a-图5c为本申请实施例提供的硬件检测场景下的TD示意图;Figures 5a-5c are schematic diagrams of TD in the hardware detection scenario provided by the embodiment of the present application;
图6为本申请提供的NFC芯片一个实施例的结构示意图;Figure 6 is a schematic structural diagram of an embodiment of the NFC chip provided by this application;
图7为本申请提供的NFC芯片另一个实施例的结构示意图;Figure 7 is a schematic structural diagram of another embodiment of the NFC chip provided by this application;
图8为本申请实施例提供的电子设备的硬件结构示意图。FIG. 8 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例中,除非另有说明,字符“/”表示前后关联对象是一种或的关系。例如,A/B可以表示A或B。“和/或”描述关联对象的关联关系,表示可以存在三种关系。 例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。In the embodiment of this application, unless otherwise specified, the character "/" indicates that the related objects are an or relationship. For example, A/B can mean A or B. "And/or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.
需要指出的是,本申请实施例中涉及的“第一”、“第二”等词汇,仅用于区分描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量,也不能理解为指示或暗示顺序。It should be pointed out that the words "first", "second" and other words involved in the embodiments of this application are only used for differentiation and description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. The quantities are not to be construed as indicating or implying an order.
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。此外,“以下至少一项(个)”或者其类似表达,是指的这些项中的任意组合,可以包括单项(个)或复数项(个)的任意组合。例如,A、B或C中的至少一项(个),可以表示:A,B,C,A和B,A和C,B和C,或A、B和C。其中,A、B、C中的每个本身可以是元素,也可以是包含一个或多个元素的集合。In the embodiments of this application, "at least one" refers to one or more, and "multiple" refers to two or more. In addition, "at least one of the following" or similar expressions thereof refers to any combination of these items, which may include any combination of a single item (items) or a plurality of items (items). For example, at least one item (item) of A, B or C can represent: A, B, C, A and B, A and C, B and C, or A, B and C. Among them, each of A, B, and C can itself be an element, or it can be a set containing one or more elements.
本申请实施例中,“示例的”、“在一些实施例中”、“在另一实施例中”等用于表示作例子、例证或说明。本申请中被描述为“示例”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用示例的一词旨在以具体方式呈现概念。In the embodiments of this application, "exemplary", "in some embodiments", "in another embodiment", etc. are used to express examples, illustrations or explanations. Any embodiment or design described herein as "example" is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of the word example is intended to present a concept in a concrete way.
本申请实施例中的“的(of)”、“相应的(corresponding,relevant)”和“对应的(corresponding)”有时可以混用,应当指出的是,在不强调其区别时,所要表达的含义是一致的。本申请实施例中,通信、传输有时可以混用,应当指出的是,在不强调其区别时,其所表达的含义是一致的。例如,传输可以包括发送和/或接收,可以为名词,也可以是动词。In the embodiments of this application, "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be pointed out that when the difference is not emphasized, the meaning to be expressed is are consistent. In the embodiments of this application, communication and transmission can sometimes be used interchangeably. It should be noted that when the difference is not emphasized, the meanings expressed are consistent. For example, transmission can include sending and/or receiving, and can be a noun or a verb.
本申请实施例中涉及的等于可以与大于连用,适用于大于时所采用的技术方案,也可以与小于连用,适用于小于时所采用的技术方案。需要说明的是,当等于与大于连用时,不能与小于连用;当等于与小于连用时,不与大于连用。The equals involved in the embodiments of this application can be used in conjunction with greater than, and are applicable to the technical solution adopted when it is greater than, and can also be used in conjunction with less than, and are applicable to the technical solution adopted when it is less than. It should be noted that when equal is used with greater than, it cannot be used with less than; when equal to is used with less than, it is not used with greater than.
目前,工作在CE模式下的NFC设备具有NFC芯片,该NFC芯片具有卡模拟功能,例如,可以将工作在CE模式下的NFC设备模拟为一张卡片,该NFC芯片可以配置不同的硬件特征参数,用于与读卡设备进行通信。其中,硬件特征参数可以对应不同的NFC技术,例如,A、B、F及V等NFC技术,因此,根据NFC技术进行划分,硬件特征参数通常可以包括:CEA硬件特征参数、CEB硬件特征参数、CEF硬件特征参数及CEV硬件特征参数,也就是说,工作在CE模式下的NFC设备可以预先配置上述CEA硬件特征参数、CEB硬件特征参数、CEF硬件特征参数及CEV硬件特征参数中的任一硬件特征参数进行卡模拟。读卡设备通常也可以预先配置硬件特征参数,其中,读卡设备中的硬件特征参数可以包括:RWA硬件特征参数、RWB硬件特征参数、RWF硬件特征参数及RWV硬件特征参数等。读卡设备可以根据预先预置的硬件特征参数进行寻卡。可以理解的是,硬件特征参数影响了NFC指令交互的成功率。当工作在CE模式下的NFC设备的硬件特征参数与读卡设备的硬件特征参数适配时,可以较好的完成工作在CE模式下的NFC设备与读卡设备之间的通信。Currently, NFC devices working in CE mode have NFC chips, and the NFC chips have card simulation functions. For example, NFC devices working in CE mode can be simulated as a card, and the NFC chip can be configured with different hardware feature parameters. , used to communicate with card reading devices. Among them, the hardware characteristic parameters can correspond to different NFC technologies, such as NFC technologies A, B, F, and V. Therefore, according to the NFC technology, the hardware characteristic parameters can usually include: CEA hardware characteristic parameters, CEB hardware characteristic parameters, CEF hardware characteristic parameters and CEV hardware characteristic parameters, that is to say, the NFC device working in CE mode can be pre-configured with any of the above CEA hardware characteristic parameters, CEB hardware characteristic parameters, CEF hardware characteristic parameters and CEV hardware characteristic parameters. Characteristic parameters are used for card simulation. The card reading device can usually also be pre-configured with hardware feature parameters, where the hardware feature parameters in the card reading device can include: RWA hardware feature parameters, RWB hardware feature parameters, RWF hardware feature parameters, RWV hardware feature parameters, etc. The card reading device can search for cards based on preset hardware feature parameters. It is understandable that hardware characteristic parameters affect the success rate of NFC command interaction. When the hardware characteristic parameters of the NFC device working in CE mode are adapted to the hardware characteristic parameters of the card reading device, communication between the NFC device working in CE mode and the card reading device can be better completed.
然而,在实际应用过程中,由于工作在CE模式下的不同的NFC设备可以预先配置不同NFC技术的硬件特征参数,对于某一个工作在CE模式下的NFC设备来说,其有固定的硬件特征参数,也就是说,配置某一NFC技术的硬件特征参数的工作在CE模式下的NFC设备与某一个读卡设备可以较好的完成通信,而另一个读卡设备会会预先配置不同的硬件特征参数,由此会发生与另一个读卡设备通信失败的情况,从而导 致工作在CE模式下的不同的NFC设备难以兼容不同的读卡设备。However, in actual application process, since different NFC devices working in CE mode can be pre-configured with hardware characteristic parameters of different NFC technologies, for a certain NFC device working in CE mode, it has fixed hardware characteristics. Parameters, that is to say, configuring the hardware feature parameters of a certain NFC technology. An NFC device working in CE mode can communicate well with a certain card reading device, while another card reading device will be pre-configured with different hardware. Characteristic parameters, resulting in communication failure with another card reading device, making it difficult for different NFC devices working in CE mode to be compatible with different card reading devices.
例如,若工作在CE模式下的NFC设备配置的是CEA硬件特征参数中的其中一套参数值,读卡设备配置的是RWA硬件特征参数中的其中一套参数值。虽然工作在CE模式下的NFC设备与读卡设备采用的技术相同,然而CEA硬件特征参数中选取的参数值与RWA硬件特征参数中选取的参数值不适配,此时,会发生通信失败,也就是说,当前的工作在CE模式下的NFC设备无法兼容当前的读卡设备。For example, if the NFC device working in CE mode is configured with one set of parameter values in the CEA hardware feature parameters, the card reading device is configured with one set of parameter values in the RWA hardware feature parameters. Although the NFC device working in CE mode uses the same technology as the card reading device, the parameter values selected in the CEA hardware feature parameters do not match the parameter values selected in the RWA hardware feature parameters. At this time, communication failure will occur. In other words, current NFC devices working in CE mode are not compatible with current card reading devices.
基于上述问题,本申请实施例提出了一种卡模拟方法,应用于电子设备,其中,电子设备可以是具有NFC卡模拟功能的终端,例如,手机、平板电脑、可穿戴设备等;本申请实施例对电子设备的形式不作特殊限定。通过本申请实施例的方法,可以有助于工作在CE模式下的NFC设备兼容不同的读卡设备,从而可以提高工作在CE模式下的NFC设备的稳定性和兼容性。Based on the above problems, the embodiment of the present application proposes a card simulation method, which is applied to electronic devices. The electronic device can be a terminal with NFC card simulation function, such as a mobile phone, a tablet computer, a wearable device, etc.; the implementation of this application For example, there are no special restrictions on the form of electronic equipment. Through the method of the embodiment of the present application, it can help the NFC device working in the CE mode to be compatible with different card reading devices, thereby improving the stability and compatibility of the NFC device working in the CE mode.
现结合图1对本申请实施例提供的卡模拟方法进行说明。The card simulation method provided by the embodiment of the present application will now be described with reference to FIG. 1 .
如图1所示为本申请提供的卡模拟方法一个实施例的流程示意图,该卡模拟方法应用于第一电子设备,该第一电子设备具有NFC芯片,该NFC芯片工作在CE模式,该第一电子设备预设多套硬件特征参数,具体包括以下步骤:Figure 1 is a schematic flow chart of an embodiment of a card simulation method provided by the present application. The card simulation method is applied to a first electronic device. The first electronic device has an NFC chip. The NFC chip works in CE mode. An electronic device presets multiple sets of hardware feature parameters, specifically including the following steps:
步骤101,选取多套硬件特征参数中的一套硬件特征参数作为第一硬件特征参数。Step 101: Select one set of hardware feature parameters from multiple sets of hardware feature parameters as the first hardware feature parameter.
具体地,第一电子设备中可以预先存储多套硬件特征参数,该硬件特征参数可以用于对NFC芯片进行配置,以便NFC芯片基于配置后的硬件特征参数与第二电子设备进行通信。其中,第二电子设备为读卡设备,该第二电子设备可以是工作在RW模式下的NFC设备,也可以是普通的RFID设备,本申请实施例对第二电子设备的具体形式不作特殊限定。上述多套硬件特征参数可以预先存储在NFC芯片中,也可以存储在第一电子设备的存储器或其他硬件电路中,也可以存储在服务器中,以便用户可以远程更新在第一电子设备预设的硬件特征参数。本申请实施例对上述多套硬件特征参数的存储方式不作特殊限定。Specifically, multiple sets of hardware feature parameters can be pre-stored in the first electronic device, and the hardware feature parameters can be used to configure the NFC chip so that the NFC chip communicates with the second electronic device based on the configured hardware feature parameters. The second electronic device is a card reading device. The second electronic device may be an NFC device operating in RW mode or an ordinary RFID device. The embodiment of the present application does not specifically limit the specific form of the second electronic device. . The above multiple sets of hardware feature parameters can be stored in the NFC chip in advance, or in the memory or other hardware circuits of the first electronic device, or in the server, so that the user can remotely update the settings preset in the first electronic device. Hardware characteristic parameters. The embodiment of the present application does not place special limitations on the storage method of the above-mentioned sets of hardware feature parameters.
可以理解的是,在将上述多套硬件特征参数存储在第一电子设备中时,还可以检测第一电子设备的存储空间,若第一电子设备的存储空间足够存储上述多套硬件特征参数,则可以直接将上述多套硬件特征参数存储在第一电子设备中,若第一电子设备的存储空间不足够存储上述多套硬件特征参数,则可以提示用户释放第一电子设备中的部分存储空间,以便存储上述多套硬件特征参数。It can be understood that when storing the above-mentioned multiple sets of hardware characteristic parameters in the first electronic device, the storage space of the first electronic device can also be detected. If the storage space of the first electronic device is sufficient to store the above-mentioned multiple sets of hardware characteristic parameters, Then the multiple sets of hardware feature parameters can be directly stored in the first electronic device. If the storage space of the first electronic device is not enough to store the multiple sets of hardware feature parameters, the user can be prompted to release part of the storage space in the first electronic device. , in order to store the above multiple sets of hardware characteristic parameters.
其中,每套硬件特征参数可以预先与NFC模式、NFC技术及比特率的组合形成映射关系。每套硬件特征参数可以包括M个参数,M为大于或等于1的正整数。其中,NFC模式用于表征NFC芯片的工作模式,示例性的,NFC模式可以包括CE和RW两种模式;NFC技术用于表征NFC芯片所采用的技术,其中,NFC技术可以包括A、B、F和V;比特率用于表征NFC芯片的数据速率。以NFC技术为A、B和F为例,表1示例性的示出了硬件特征参数的组成形式。可以理解的是,上述示例仅示例性的示出了A、B及F等NFC技术,但并不构成对本申请实施例的限定,在一些实施例中,还可以包括更多的NFC技术,例如:V。Among them, each set of hardware feature parameters can form a mapping relationship with a combination of NFC mode, NFC technology and bit rate in advance. Each set of hardware feature parameters may include M parameters, where M is a positive integer greater than or equal to 1. Among them, the NFC mode is used to characterize the working mode of the NFC chip. For example, the NFC mode can include two modes: CE and RW. The NFC technology is used to characterize the technology used by the NFC chip. The NFC technology can include A, B, F and V; bit rate is used to characterize the data rate of the NFC chip. Taking NFC technologies A, B, and F as an example, Table 1 exemplarily shows the composition of hardware characteristic parameters. It can be understood that the above examples only illustrate NFC technologies A, B, and F, but do not constitute a limitation on the embodiments of the present application. In some embodiments, more NFC technologies may also be included, such as :V.
表1Table 1
Figure PCTCN2022131950-appb-000001
Figure PCTCN2022131950-appb-000001
Figure PCTCN2022131950-appb-000002
Figure PCTCN2022131950-appb-000002
如表1所示,可以包括12套硬件特征参数,其中,包括5套CE-A硬件特征参数、5套CE-B的硬件特征参数及2套CE-F的硬件特征参数。可以理解的是,上述12套硬件特征参数为待选的硬件特征参数,用户可以在上述12套硬件特征参数中选取多套硬件特征参数后,可以将用户选取的多套硬件特征参数预先存储在第一电子设备中。上述12套硬件特征参数仅为示例性说明,并不构成对本申请实施例的限定,在一些实施例中,还可以包括更多或更少的待选硬件特殊参数。As shown in Table 1, it can include 12 sets of hardware feature parameters, including 5 sets of CE-A hardware feature parameters, 5 sets of CE-B hardware feature parameters, and 2 sets of CE-F hardware feature parameters. It can be understood that the above 12 sets of hardware feature parameters are hardware feature parameters to be selected. After the user selects multiple sets of hardware feature parameters from the above 12 sets of hardware feature parameters, the multiple sets of hardware feature parameters selected by the user can be stored in advance. in the first electronic device. The above 12 sets of hardware characteristic parameters are only illustrative and do not limit the embodiments of the present application. In some embodiments, more or less special parameters of the candidate hardware may be included.
参考表1,“ON”用于表征该参数可用,此时,用户可以对该参数预先设置相应的参数值,“OFF”用于表征该参数禁用,此时,用户不可以对该参数预先设置相应的参数值。通过“ON”和“OFF”等标志位,可以在用户对参数进行设置参数值时进行校验,由此可以对硬件特征参数的完整性进行校验,避免硬件特征参数中的某些参数为空值。此外,在用户对参数设置参数值时,还可以对参数值进行取值范围校验,例如,对任一参数的取值范围进行预先设定,若任一参数的参数值超过了预设的预置范围,则可以报错,由此可以对参数值的正确性进行校验,从而可以避免参数值由于人为疏忽导致设置错误。Refer to Table 1. "ON" is used to indicate that the parameter is available. At this time, the user can preset the corresponding parameter value for the parameter. "OFF" is used to indicate that the parameter is disabled. At this time, the user cannot preset the parameter. corresponding parameter values. Through flag bits such as "ON" and "OFF", it can be verified when the user sets the parameter value. This can verify the integrity of the hardware feature parameters and avoid certain parameters in the hardware feature parameters. NULL value. In addition, when users set parameter values for parameters, they can also perform value range verification on the parameter values. For example, the value range of any parameter is preset. If the value of any parameter exceeds the preset value, If the preset range is set, an error can be reported, so that the correctness of the parameter value can be verified, thereby avoiding parameter value setting errors due to human negligence.
通过不同的NFC模式、NFC技术及比特率的组合与硬件特征参数的映射,可以得到多套不同的硬件特征参数。其中,不同的NFC模式、NFC技术及比特率的组合可以包括例如:NFC技术相同,比特率不同;又例如:比特率相同,NFC技术不同;再例如,比特率不同,NFC技术不同;再例如,NFC技术相同,比特率相同,参数值不同。可以理解的是,上述NFC模式、NFC技术及比特率的组合中,对于第一电子设备来说,NFC模式均为CE模式。Through the mapping of different combinations of NFC modes, NFC technologies and bit rates and hardware feature parameters, multiple sets of different hardware feature parameters can be obtained. Among them, different combinations of NFC modes, NFC technologies and bit rates may include, for example: the same NFC technology but different bit rates; another example: the same bit rate but different NFC technologies; another example: different bit rates but different NFC technologies; another example , the NFC technology is the same, the bit rate is the same, and the parameter values are different. It can be understood that among the above combinations of NFC mode, NFC technology and bit rate, for the first electronic device, the NFC mode is the CE mode.
表2示例性的示出了用户选取的多套硬件特征参数的组合示意图。Table 2 exemplarily shows a schematic diagram of the combination of multiple sets of hardware feature parameters selected by the user.
表2Table 2
编号serial number NFC模式NFC mode NFC技术NFC technology 比特率bitrate 参数1Parameter 1 参数2Parameter 2 参数3Parameter 3 参数M-1Parameter M-1 参数MParameterM
11 CECE AA 106k106k a 11 a 11 a 12 a 12 OFFOFF OFFOFF OFFOFF
22 CECE AA 106k106k OFFOFF a 22 a 22 OFFOFF OFFOFF a 2M a 2M
33 CECE BB 106k106k a 31 a 31 OFFOFF OFFOFF OFFOFF OFFOFF
44 CECE BB 212k212k OFFOFF a 42 a 42 OFFOFF OFFOFF a 4M a 4M
55 CECE FF 212k212k a 51 a 51 a 52 a 52 OFFOFF OFFOFF a 5M a 5M
66 CECE FF 424k424k OFFOFF OFFOFF OFFOFF a 6M-1 a 6M-1 OFFOFF
参考表2,以比特率为106k的CE-B硬件特征参数及比特率为212k的CE-B硬件特征参数为例,比特率为106k的CE-B硬件特征参数及比特率为212k的CE-B硬件特征参数之间NFC技术相同,比特率不同;以比特率为106k的CE-A硬件特征参数及比特率为106k的CE-B硬件特征参数为例,比特率为106k的CE-A硬件特征参数及比特率为106k的CE-B硬件特征参数之间比特率相同,NFC技术不同;以比特率为106k的CE-A硬件特征参数及比特率为212k的CE-B硬件特征参数为例,比特率为106k的CE-A硬件特征参数及比特率为212k的CE-B硬件特征参数之间比特率不同,NFC技术不同;以编号1的比特率为106k的CE-A硬件特征参数及编号2的比特率为106k的CE-A硬件特征参数为例,编号1的比特率为106k的CE-A硬件特征参数及编号2的比特率为106k的CE-A硬件特征参数之间NFC技术相同,比特率相同,参数值不同。其中,参数值不同可以是具有不同的参数,例如,编号1的比特率为106k的CE-A硬件特征参数具有参数1,编号2的比特率为106k的CE-A硬件特征参数不具有参数1;或者,参数值不同也可以是具有相同的参数,但是相同的参数对应的参数值不同,例如,编号1的比特率为106k的CE-A硬件特征参数中的参数2的参数值为a 12,而编号2的比特率为106k的CE-A硬件特征参数中的参数2的参数值为a 22,其中,a 12与a 22不同。 Refer to Table 2, taking the CE-B hardware characteristic parameters with a bit rate of 106k and the CE-B hardware characteristic parameters with a bit rate of 212k as an example. The CE-B hardware characteristic parameters with a bit rate of 106k and the CE-B bit rate as 212k The NFC technology between B hardware characteristic parameters is the same, but the bit rate is different; taking the CE-A hardware characteristic parameters with a bit rate of 106k and the CE-B hardware characteristic parameters with a bit rate of 106k as an example, the CE-A hardware with a bit rate of 106k The characteristic parameters and the CE-B hardware characteristic parameters with a bit rate of 106k have the same bit rate, but the NFC technology is different; take the CE-A hardware characteristic parameters with a bit rate of 106k and the CE-B hardware characteristic parameters with a bit rate of 212k as an example. , the bit rate is different between the CE-A hardware characteristic parameters with a bit rate of 106k and the CE-B hardware characteristic parameters with a bit rate of 212k, and the NFC technology is different; the CE-A hardware characteristic parameters with a bit rate of 106k and For example, the CE-A hardware characteristic parameters with the bit rate of No. 2 is 106k. The CE-A hardware characteristic parameters with the bit rate of No. 1 are 106k. The NFC technology between the CE-A hardware characteristic parameters with the bit rate of No. 2 is 106k. Same, same bitrate, different parameter values. Different parameter values may mean having different parameters. For example, the CE-A hardware feature parameter numbered 1 with a bit rate of 106k has parameter 1, and the CE-A hardware feature parameter numbered 2 with a bit rate of 106k does not have parameter 1. ; Or, different parameter values can also mean having the same parameters, but the same parameters correspond to different parameter values. For example, the parameter value of parameter 2 in the CE-A hardware feature parameters of number 1 with a bit rate of 106k is a 12 , and the parameter value of parameter 2 in the CE-A hardware feature parameter number 2 with a bit rate of 106k is a 22 , where a 12 is different from a 22 .
可以理解的是,NFC芯片在上电或复位后,NFC芯片会处于空闲(Idle)态,该空闲态可以对应于NFC控制器接口(NFC Controller Interface,NCI)规范中的RFST_IDLE态,具体的RFST_IDLE态的描述可以参考NCI规范,在此不再赘述。在空闲态下,NFC芯片可以认为正处于休眠中,不会与第二电子设备进行通信,由此可以降低第一电子设备中整个NFC系统的功耗。It is understandable that after the NFC chip is powered on or reset, the NFC chip will be in an idle state. This idle state can correspond to the RFST_IDLE state in the NFC Controller Interface (NCI) specification. The specific RFST_IDLE The description of the state can refer to the NCI specification and will not be repeated here. In the idle state, the NFC chip can be considered to be sleeping and will not communicate with the second electronic device, thereby reducing the power consumption of the entire NFC system in the first electronic device.
当NFC芯片休眠结束后,可以进入发现(Discover)态,该发现态可以对应于NCI规范中的RFST_DISCOVERY态。具体的RFST_DISCOVERY态的描述可以参考NCI规范,在此不再赘述。在发现态,第一电子设备可以在预先存储的多套硬件特征参数中选取一套硬件特征参数作为第一硬件特征参数,并可以使用该第一硬件特征参数与第二电子设备进行通信。When the NFC chip ends sleeping, it can enter the discovery state, which can correspond to the RFST_DISCOVERY state in the NCI specification. The specific description of the RFST_DISCOVERY state can refer to the NCI specification and will not be repeated here. In the discovery state, the first electronic device can select one set of hardware feature parameters as the first hardware feature parameters from multiple sets of pre-stored hardware feature parameters, and can use the first hardware feature parameters to communicate with the second electronic device.
需要说明的是,该第一硬件特征参数可以是初始选取的硬件特征参数,也就是第一电子设备首次选取的硬件特征参数,也可以是切换后的硬件特征参数。It should be noted that the first hardware characteristic parameters may be the initially selected hardware characteristic parameters, that is, the hardware characteristic parameters selected by the first electronic device for the first time, or may be the hardware characteristic parameters after switching.
其中,第一硬件特征参数可以在第一电子设备中预先存储的多套硬件特征参数中随机选取。优选地,第一硬件特征参数的具体选取方式还可以例如是:基于兼容性和/或覆盖率确定第一硬件特征参数。其中,兼容性用于表征NFC技术和比特率的兼容市面上第二电子设备的程度,覆盖率用于表征NFC技术和比特率对市面上的第二电子设备的覆盖范围。可以理解的是,若覆盖率越高,说明NFC技术和比特率被较多的第二电子设备覆盖,因此,可以选取该NFC技术和比特率对应的硬件特征参数,由此可以增加通信成功的概率。示例性的,以表2为例,假设编号1的比特率为106k的CE-A硬件特征参数能覆盖市面上70%的第二电子设备,编号2的比特率为106k的CE-A硬 件特征参数能覆盖市面上30%的第二电子设备,且A技术的覆盖率高于其他NFC技术,则可以选取编号1的比特率为106k的CE-A硬件特征参数作为第一硬件特征参数。也就是说,上述第一硬件特征参数的兼容性和/或覆盖率大于等于切换后的第二硬件特征参数。通过优先选取对于读卡设备具较高有兼容性和/或覆盖率的硬件特征参数,可以提高通信的成功率,提升通信效率。The first hardware characteristic parameters may be randomly selected from multiple sets of hardware characteristic parameters pre-stored in the first electronic device. Preferably, the specific selection method of the first hardware characteristic parameter may also be, for example: determining the first hardware characteristic parameter based on compatibility and/or coverage. Among them, compatibility is used to characterize the degree to which NFC technology and bit rate are compatible with second electronic devices on the market, and coverage is used to characterize the coverage of NFC technology and bit rate for second electronic devices on the market. It can be understood that if the coverage rate is higher, it means that the NFC technology and bit rate are covered by more second electronic devices. Therefore, the hardware characteristic parameters corresponding to the NFC technology and bit rate can be selected, thereby increasing the probability of successful communication. Probability. For example, taking Table 2 as an example, assume that the CE-A hardware feature parameters numbered 1 with a bit rate of 106k can cover 70% of the second electronic devices on the market, and the CE-A hardware feature numbered 2 with a bit rate of 106k If the parameters can cover 30% of the second electronic devices on the market, and the coverage of A technology is higher than other NFC technologies, then the CE-A hardware characteristic parameters numbered 1 with a bit rate of 106k can be selected as the first hardware characteristic parameters. That is to say, the compatibility and/or coverage rate of the above-mentioned first hardware characteristic parameters is greater than or equal to the second hardware characteristic parameters after switching. By preferentially selecting hardware feature parameters with higher compatibility and/or coverage for card reading devices, the success rate of communication can be improved and communication efficiency can be improved.
步骤102,若NFC芯片配置初始硬件特征参数后,与第二电子设备通信失败,则将第一硬件特征参数切换为第二硬件特征参数,并根据第二硬件特征参数与第二电子设备再次进行通信。Step 102: If the NFC chip fails to communicate with the second electronic device after configuring the initial hardware characteristic parameters, switch the first hardware characteristic parameters to the second hardware characteristic parameters, and communicate with the second electronic device again according to the second hardware characteristic parameters. communication.
具体地,当确定第一硬件特征参数后,可以基于第一硬件特征参数对NFC芯片进行配置,由此可以使得第一电子设备基于配置后的第一硬件特征参数与第二电子设备进行通信。可以理解的是,若通信成功,第一电子设备与第二电子设备可以基于NFC方式进行业务交互,例如,刷门禁,进行移动支付等。Specifically, after the first hardware characteristic parameters are determined, the NFC chip can be configured based on the first hardware characteristic parameters, so that the first electronic device can communicate with the second electronic device based on the configured first hardware characteristic parameters. It can be understood that if the communication is successful, the first electronic device and the second electronic device can conduct business interactions based on NFC, such as swiping access control, making mobile payments, etc.
若通信失败,也就是说,NFC芯片无法使用第一硬件特征参数对第二电子设备发送的数据帧进行解码,则第一电子设备可以将第一硬件特征参数切换为第二硬件特征参数,并可以根据切换后的第二硬件特征参数与第二电子设备再次进行通信。If the communication fails, that is, the NFC chip cannot use the first hardware characteristic parameters to decode the data frame sent by the second electronic device, the first electronic device can switch the first hardware characteristic parameters to the second hardware characteristic parameters, and Communication with the second electronic device can be performed again according to the switched second hardware characteristic parameters.
在具体实现时,上述对硬件特征参数进行切换的触发方式可以例如是:当定时器超时后,若NFC芯片配置第一硬件特征参数后,与第二电子设备通信失败,则可以触发对硬件特征参数的切换,其中,定时器可以在检测到外部存在第二电子设备的情况下启动,并可以在第一电子设备与第二电子设备成功通信后关闭,检测外部存在第二电子设备的具体方式可以是:若检测到外部有电磁场,则可以认为检测到第二电子设备。可以理解的是,若定时器未超时,第一电子设备与第二电子设备通信成功,则NFC芯片可以基于已配置的第一硬件特征参数与第二电子和设备进行业务交互,无需再进行硬件特征参数的切换,并可以在通信完成后进入休眠。In specific implementation, the above-mentioned triggering method for switching the hardware feature parameters may be, for example: after the timer times out, if the NFC chip fails to communicate with the second electronic device after configuring the first hardware feature parameters, it may trigger the switching of the hardware feature parameters. Switching of parameters, wherein the timer can be started when the external presence of the second electronic device is detected, and can be closed after the first electronic device successfully communicates with the second electronic device, and the specific method of detecting the external presence of the second electronic device It can be: if an external electromagnetic field is detected, it can be considered that the second electronic device is detected. It can be understood that if the timer does not time out and the first electronic device communicates successfully with the second electronic device, the NFC chip can perform business interaction with the second electronic device based on the configured first hardware feature parameters, without the need for further hardware Switching of characteristic parameters, and can enter sleep after the communication is completed.
可选地,对硬件特征参数进行切换的触发方式还可以是:对外部的电磁场进行检测,根据检测结果进行硬件特征参数的切换。当检测到外部电磁场快速减弱后,将第一硬件特征参数切换为第二硬件特征参数。例如,若NFC芯片配置第一硬件特征参数,并与第二电子设备成功通信后,当第一电子设备远离第二电子设备时,可以触发对硬件特征参数的切换,在这种场景中,可以认为是虚假的通信成功,此时,第一电子设备可以将硬件特征参数进行切换,并与第二电子设备再次通信;又例如,在NFC芯片配置第一硬件特征参数,与第二电子设备的通信过程中,当检测到外部电磁场快速减弱后,例如,用户将第一电子设备远离第二电子设备,第一电子设备可以进行硬件特征参数的切换。Optionally, the triggering method for switching the hardware characteristic parameters may also be: detecting the external electromagnetic field, and switching the hardware characteristic parameters according to the detection results. When it is detected that the external electromagnetic field weakens rapidly, the first hardware characteristic parameter is switched to the second hardware characteristic parameter. For example, if the NFC chip configures the first hardware characteristic parameters and successfully communicates with the second electronic device, when the first electronic device is far away from the second electronic device, it can trigger the switching of the hardware characteristic parameters. In this scenario, it can If the communication is considered to be false and successful, at this time, the first electronic device can switch the hardware characteristic parameters and communicate with the second electronic device again; for another example, configure the first hardware characteristic parameters on the NFC chip and communicate with the second electronic device. During the communication process, when it is detected that the external electromagnetic field weakens rapidly, for example, the user moves the first electronic device away from the second electronic device, the first electronic device can switch hardware feature parameters.
此外,将第一硬件特征参数切换为第二硬件特征参数的具体方式可以包括以下几种:In addition, specific ways of switching the first hardware characteristic parameters to the second hardware characteristic parameters may include the following:
方式1,将第一硬件特征参数切换为第二硬件特征参数,其中,第一硬件特征参数与第二硬件特征参数对应的NFC技术和/或比特率不同。Method 1: Switch the first hardware characteristic parameter to the second hardware characteristic parameter, where the NFC technology and/or bit rate corresponding to the first hardware characteristic parameter and the second hardware characteristic parameter are different.
以表2为例,若第一硬件特征参数为比特率为106k的CE-B硬件特征参数,则通信失败后,可以将第一硬件特征参数切换为第二硬件特征参数,其中,第二硬件特征参数为比特率为212k的CE-B硬件特征参数,比特率为106k的CE-B硬件特征参数与 比特率为212k的CE-B硬件特征参数之间NFC技术相同,比特率不同。Taking Table 2 as an example, if the first hardware characteristic parameter is a CE-B hardware characteristic parameter with a bit rate of 106k, then after the communication fails, the first hardware characteristic parameter can be switched to the second hardware characteristic parameter, where the second hardware characteristic parameter The characteristic parameters are CE-B hardware characteristic parameters with a bit rate of 212k. The NFC technology is the same between the CE-B hardware characteristic parameters with a bit rate of 106k and the CE-B hardware characteristic parameters with a bit rate of 212k, but the bit rates are different.
或者,若第一硬件特征参数为编号2的比特率为106k的CE-A硬件特征参数,则通信失败后,可以将第一硬件特征参数切换为第二硬件特征参数,其中,第二硬件特征参数为比特率为106k的CE-B硬件特征参数,编号2的比特率为106k的CE-A硬件特征参数与比特率为106k的CE-B硬件特征参数之间比特率相同,NFC技术不同。Alternatively, if the first hardware characteristic parameter is the CE-A hardware characteristic parameter numbered 2 with a bit rate of 106k, then after the communication fails, the first hardware characteristic parameter can be switched to the second hardware characteristic parameter, where the second hardware characteristic parameter The parameters are CE-B hardware characteristic parameters with a bit rate of 106k. The CE-A hardware characteristic parameters with a bit rate of 2 are the CE-B hardware characteristic parameters with a bit rate of 106k. The bit rates are the same, but the NFC technology is different.
又或者,若第一硬件特征参数为编号2的比特率为106k的CE-A硬件特征参数,则通信失败后,可以将第一硬件特征参数切换为第二硬件特征参数,其中,第二硬件特征参数为比特率为212k的CE-B硬件特征参数,编号2的比特率为106k的CE-A硬件特征参数与比特率为212k的CE-B硬件特征参数之间比特率不同,NFC技术不同。Or, if the first hardware characteristic parameter is the CE-A hardware characteristic parameter numbered 2 with a bit rate of 106k, then after the communication fails, the first hardware characteristic parameter can be switched to the second hardware characteristic parameter, where the second hardware characteristic parameter The characteristic parameters are CE-B hardware characteristic parameters with a bit rate of 212k. The CE-A hardware characteristic parameters numbered 2 with a bit rate of 106k and the CE-B hardware characteristic parameters with a bit rate of 212k have different bit rates and different NFC technologies. .
方式2,将第一硬件特征参数切换为第二硬件特征参数,其中,第一硬件特征参数与第二硬件特征参数对应的NFC技术和比特率相同,参数值不同。Method 2: Switch the first hardware characteristic parameter to the second hardware characteristic parameter, where the first hardware characteristic parameter and the second hardware characteristic parameter correspond to the same NFC technology and bit rate, but different parameter values.
以表2为例,若第一硬件特征参数为编号1的比特率为106k的CE-A硬件特征参数,则通信失败后,可以将第一硬件特征参数切换为第二硬件特征参数,其中,第二硬件特征参数为编号2的比特率为106k的CE-A硬件特征参数,编号1的比特率为106k的CE-A硬件特征参数与编号2的比特率为106k的CE-A硬件特征参数之间比特率相同,NFC技术相同,参数值不同。Taking Table 2 as an example, if the first hardware feature parameter is the CE-A hardware feature parameter numbered 1 with a bit rate of 106k, then after the communication fails, the first hardware feature parameter can be switched to the second hardware feature parameter, where, The second hardware feature parameter is the CE-A hardware feature parameter numbered 2 with a bit rate of 106k, the CE-A hardware feature parameter numbered 1 with a bit rate of 106k and the CE-A hardware feature parameter numbered 2 with a bit rate of 106k The bit rate is the same, the NFC technology is the same, and the parameter values are different.
可选地,在将第一硬件特征参数进行切换前,还可以将NFC芯片进入休眠,由此可以节省第一电子设备中整个NFC系统的功耗。可以理解的是,当休眠结束后,第一电子设备可以唤醒NFC芯片,并可以在唤醒NFC芯片后将第一硬件特征参数切换为第二硬件特征参数。Optionally, before switching the first hardware feature parameter, the NFC chip can also be put into sleep, thereby saving the power consumption of the entire NFC system in the first electronic device. It can be understood that after the sleep is completed, the first electronic device can wake up the NFC chip, and can switch the first hardware characteristic parameter to the second hardware characteristic parameter after waking up the NFC chip.
本申请实施例中,通过在工作在CE模式下的NFC设备中预设多套硬件特征参数,在使用硬件特征参数与读卡设备通信失败后,切换硬件特征参数并再次进行通信,由此可以有助于工作在CE模式下的NFC设备兼容不同的读卡设备,从而可以提高工作在CE模式下的NFC设备的稳定性和兼容性。In the embodiment of the present application, multiple sets of hardware feature parameters are preset in the NFC device working in CE mode. After the communication with the card reading device fails using the hardware feature parameters, the hardware feature parameters are switched and communication is carried out again, so that the communication can be carried out again. It helps NFC devices working in CE mode to be compatible with different card reading devices, thereby improving the stability and compatibility of NFC devices working in CE mode.
接着,结合图2对本申请实施例提供的卡模拟方法进行进一步说明。Next, the card simulation method provided by the embodiment of the present application will be further described with reference to FIG. 2 .
图2为NFC完整工作周期(Total Duration,TD)的示意图。如图2所示,一个TD可以包括一个空闲期和一个发现期,其中,在空闲期内,NFC芯片可以处于空闲态,此时,NFC芯片不与第二电子设备通信,也就是说,NFC芯片处于省电状态。在发现期,NFC芯片处于发现态,NFC芯片可以与第二电子设备进行通信,例如,可以检测电磁场,用于发现第二电子设备,并可以接收第二电子设备发送的数据帧进行解码。可以理解的是,若解码成功,则可以认为通信成功,若解码失败,则可以认为通信失败。Figure 2 is a schematic diagram of the complete working cycle (Total Duration, TD) of NFC. As shown in Figure 2, a TD may include an idle period and a discovery period. During the idle period, the NFC chip may be in an idle state. At this time, the NFC chip does not communicate with the second electronic device. That is to say, the NFC chip The chip is in power saving state. During the discovery period, the NFC chip is in the discovery state, and the NFC chip can communicate with the second electronic device. For example, it can detect the electromagnetic field for discovering the second electronic device, and can receive and decode the data frame sent by the second electronic device. It can be understood that if the decoding is successful, the communication can be considered successful, and if the decoding fails, the communication can be considered failed.
现结合图3,并以第一电子设备预设6套硬件特征参数为例进行说明,其中,上述6套硬件特征参数可以分别表示为CEA1、CEA2、CEB1、CEB2、CEF1及CEF2,上述6套硬件特征参数的具体创建方式可以参考上述实施例,在此不再赘述。示例性的,CEA1可以对应表2中的编号1的比特率为106k的CE-A硬件特征参数,CEA2可以对应表2中的编号2的比特率为106k的CE-A硬件特征参数,CEB1可以对应表2中的比特率为106k的CE-B硬件特征参数,CEB2可以对应表2中的比特率为212k的CE-B硬件特征参数,CEF1可以对应表2中的比特率为212k的CE-F硬件特征参数, CEF2可以对应表2中的比特率为424k的CE-F硬件特征参数。Now, with reference to Figure 3, the description will be given by taking the first electronic device's preset 6 sets of hardware characteristic parameters as an example. The above 6 sets of hardware characteristic parameters can be respectively represented as CEA1, CEA2, CEB1, CEB2, CEF1 and CEF2. The above 6 sets of hardware characteristic parameters The specific creation method of the hardware characteristic parameters may refer to the above embodiment, and will not be described again here. For example, CEA1 may correspond to the CE-A hardware feature parameter number 1 in Table 2 with a bit rate of 106k, CEA2 may correspond to the CE-A hardware feature parameter number 2 in Table 2 with a bit rate of 106k, and CEB1 may Corresponding to the CE-B hardware characteristic parameters with a bit rate of 106k in Table 2, CEB2 can correspond to the CE-B hardware characteristic parameters with a bit rate of 212k in Table 2, and CEF1 can correspond to the CE-B with a bit rate of 212k in Table 2. F hardware characteristic parameters, CEF2 can correspond to the CE-F hardware characteristic parameters with a bit rate of 424k in Table 2.
当NFC芯片上电后,可以对NFC芯片进行初始化,例如,可以将NFC芯片设置为工作在CE模式下,且可以将CE模式下的各项NFC技术使能,由此可以使得NFC芯片可以使用已使能的NFC技术。此时,NFC芯片处于空闲态。可以理解的是,本申请实施例以使能的A、B和F的NFC技术组合为例进行示例性说明,但并不构成对本申请的限定,在一些实施例中,也可以包含更多或更少的其他技术或技术组合,例如,A技术,或A和F的技术组合,或B和F的技术组合,或A和B技术组合,或A、B、F和V的技术组合等。After the NFC chip is powered on, the NFC chip can be initialized. For example, the NFC chip can be set to work in CE mode, and various NFC technologies in CE mode can be enabled, so that the NFC chip can be used Enabled NFC technology. At this time, the NFC chip is in idle state. It can be understood that the embodiments of the present application take the enabled NFC technology combination of A, B, and F as an example for illustrative description, but this does not constitute a limitation of the present application. In some embodiments, more or more may be included. There are even fewer other technologies or technology combinations, for example, A technology, or the technology combination of A and F, or the technology combination of B and F, or the technology combination of A and B, or the technology combination of A, B, F and V, etc.
当NFC芯片进入第一个TD后,NFC芯片进入第一个TD的发现期,也就是处于发现态。此时,NFC芯片可以在上述多套硬件特征参数中选取一套硬件特征参数作为首套硬件特征参数。然后,NFC芯片基于首套硬件特征参数进行配置,并通过已配置的首套硬件特征参数与第二电子设备进行通信。以首套硬件特征参数为CEA1为例,NFC芯片可以在A技术下,通过CEA1硬件特征参数与第二电子设备进行通信。若在第一个TD的发现期内通信成功,则NFC芯片使用CEA1硬件特征参数与第二电子设备进一步进行NFC指令交互,以完成本次业务。若在第一个TD的发现期内通信失败,则NFC芯片进入第一个TD的空闲期,由此可以进入休眠,从而可以节省第一电子设备整个NFC系统的功耗。在具体实现时,在发现期内,当NFC芯片检测到外部存在第二电子设备的情况时可以启动定时器,示例性的,该定时器的时长可以为100ms,也可以是其他数值,本申请实施例对此不作特殊限定发现期;当定时器超时后,可以认为定时器结束,若此时第一电子设备仍未与第二电子设备通信成功,则可以进入休眠。可以理解的是,若定时器未超时,且第一电子设备与第二电子设备通信成功,则第一电子设备可以关闭定时器,并与第二电子设备进一步进行NFC指令交互,以完成本次业务,并在完成本次业务后进入休眠。需要说明的是,第一电子设备还可以通过检测外部电磁场的方式触发硬件特征参数的切换,若检测到外部电磁场快速减弱,则可以停止与第二电子设备的通信,并进入休眠。When the NFC chip enters the first TD, the NFC chip enters the discovery period of the first TD, that is, it is in the discovery state. At this time, the NFC chip can select one set of hardware feature parameters as the first set of hardware feature parameters among the above multiple sets of hardware feature parameters. Then, the NFC chip is configured based on the first set of hardware characteristic parameters, and communicates with the second electronic device through the configured first set of hardware characteristic parameters. Taking the first set of hardware characteristic parameters as CEA1 as an example, the NFC chip can communicate with the second electronic device through the CEA1 hardware characteristic parameters under A technology. If the communication is successful during the discovery period of the first TD, the NFC chip uses the CEA1 hardware characteristic parameters to further interact with the NFC command with the second electronic device to complete this business. If communication fails during the discovery period of the first TD, the NFC chip enters the idle period of the first TD and can enter sleep, thereby saving the power consumption of the entire NFC system of the first electronic device. In specific implementation, during the discovery period, when the NFC chip detects the presence of a second electronic device externally, the timer can be started. For example, the duration of the timer can be 100ms or other values. This application The embodiment does not specifically limit the discovery period; when the timer times out, the timer can be considered to have ended. If the first electronic device has not successfully communicated with the second electronic device at this time, it can enter sleep. It can be understood that if the timer does not time out and the first electronic device communicates successfully with the second electronic device, the first electronic device can turn off the timer and further interact with the NFC command with the second electronic device to complete this time. business, and enter hibernation after completing this business. It should be noted that the first electronic device can also trigger the switching of hardware characteristic parameters by detecting external electromagnetic fields. If it detects that the external electromagnetic field weakens rapidly, it can stop communication with the second electronic device and enter sleep.
当休眠结束后,NFC芯片进入第二个TD的发现期。可以理解的是,休眠结束指的是空闲期结束。此时,第一电子设备可以重新唤醒NFC芯片,NFC芯片再次进入发现态。接着,第一电子设备可以将上述首套硬件特征参数进行切换,由此可以将首套硬件特征参数(也就是CEA1)切换至另一套硬件特征参数,例如,CEA2。然后,NFC芯片可以基于切换后的硬件特征参数(例如,CEA2)进行配置,并通过已配置的硬件特征参数与第二电子设备进行通信。以切换后的硬件特征参数为CEA2为例,NFC芯片可以在A技术下,通过CEA2硬件特征参数与第二电子设备进行通信。若在第二个TD的发现期内通信成功,则第一电子设备与第二电子设备进一步进行NFC指令交互,以完成本次业务,并在完成本次业务后进入休眠。若在第二个TD的发现期内通信失败,则NFC芯片进入第二个TD的空闲期,再次进入休眠。When the dormancy ends, the NFC chip enters the second TD discovery period. It can be understood that the end of sleep refers to the end of the idle period. At this time, the first electronic device can wake up the NFC chip again, and the NFC chip enters the discovery state again. Then, the first electronic device can switch the above-mentioned first set of hardware feature parameters, thereby switching the first set of hardware feature parameters (that is, CEA1) to another set of hardware feature parameters, for example, CEA2. Then, the NFC chip can be configured based on the switched hardware characteristic parameters (for example, CEA2), and communicate with the second electronic device through the configured hardware characteristic parameters. Taking the switched hardware characteristic parameter as CEA2 as an example, the NFC chip can communicate with the second electronic device through the CEA2 hardware characteristic parameter under A technology. If communication is successful during the discovery period of the second TD, the first electronic device and the second electronic device further interact with NFC commands to complete this service, and enter sleep after completing this service. If communication fails during the discovery period of the second TD, the NFC chip enters the idle period of the second TD and enters sleep again.
当休眠结束后,NFC芯片进入第三个TD的发现期。此时,第一电子设备可以重新唤醒NFC芯片,NFC芯片再次进入发现态。接着,第一电子设备可以将上述切换后的硬件特征参数(例如,CEA2)再次进行切换。以本次切换的硬件特征参数为CEB1为例,第一电子设备可以将CEA2切换为CEB1。然后,NFC芯片基于切换后的硬件 特征参数(例如,CEB1)进行配置,并通过已配置的硬件特征参数与第二电子设备进行通信。若在第三个TD的发现期内通信成功,则第一电子设备与第二电子设备进一步进行NFC指令交互,以完成本次业务,并在完成本次业务后进入休眠。若在第三个TD的发现期内通信失败,则NFC芯片进入第三个TD的空闲期,再次进入休眠。When the dormancy ends, the NFC chip enters the third TD discovery period. At this time, the first electronic device can wake up the NFC chip again, and the NFC chip enters the discovery state again. Then, the first electronic device may switch the above-switched hardware characteristic parameter (for example, CEA2) again. Taking the hardware characteristic parameter of this switching as CEB1 as an example, the first electronic device can switch CEA2 to CEB1. Then, the NFC chip is configured based on the switched hardware characteristic parameters (for example, CEB1), and communicates with the second electronic device through the configured hardware characteristic parameters. If communication is successful during the discovery period of the third TD, the first electronic device and the second electronic device further interact with NFC commands to complete this service, and enter sleep after completing this service. If communication fails during the discovery period of the third TD, the NFC chip enters the idle period of the third TD and enters sleep again.
当休眠结束后,NFC芯片进入第四个TD的发现期。此时,第一电子设备可以重新唤醒NFC芯片,NFC芯片再次进入发现态。接着,第一电子设备可以将切换后的硬件特征参数(例如,CEB1)进行再次切换。由此可以将切换后的硬件特征参数(也就是CEB1)再次进行切换,例如,切换至CEB2。然后,NFC芯片基于切换后的硬件特征参数(例如,CEB2)进行配置,并通过已配置的硬件特征参数与第二电子设备进行通信。以切换后的硬件特征参数为CEB2为例,NFC芯片可以在B技术下,通过CEB2硬件特征参数与第二电子设备进行通信。若在第四个TD的发现期内通信成功,则第一电子设备与第二电子设备进一步进行NFC指令交互,以完成本次业务,并在完成本次业务后进入休眠。若在第四个TD的发现期内通信失败,则NFC芯片进入第四个TD的空闲期,再次进入休眠。When the dormancy ends, the NFC chip enters the fourth TD discovery period. At this time, the first electronic device can wake up the NFC chip again, and the NFC chip enters the discovery state again. Then, the first electronic device can switch the switched hardware characteristic parameter (for example, CEB1) again. In this way, the switched hardware characteristic parameters (that is, CEB1) can be switched again, for example, to CEB2. Then, the NFC chip is configured based on the switched hardware characteristic parameters (for example, CEB2), and communicates with the second electronic device through the configured hardware characteristic parameters. Taking the switched hardware characteristic parameter as CEB2 as an example, the NFC chip can communicate with the second electronic device through the CEB2 hardware characteristic parameter under B technology. If communication is successful during the discovery period of the fourth TD, the first electronic device and the second electronic device further interact with NFC commands to complete this service, and enter sleep after completing this service. If communication fails during the discovery period of the fourth TD, the NFC chip enters the idle period of the fourth TD and enters sleep again.
当休眠结束后,NFC芯片进入第五个TD的发现期。此时,第一电子设备可以重新唤醒NFC芯片,NFC芯片再次进入发现态。接着,第一电子设备可以将上述切换后的硬件特征参数(例如,CEB2)再次进行切换。以本次切换的硬件特征参数为CEF1为例,第一电子设备可以将CEB2切换为CEF1。然后,NFC芯片基于切换后的硬件特征参数(例如,CEF1)进行配置,并通过已配置的硬件特征参数与第二电子设备进行通信。若在第五个TD的发现期内通信成功,则第一电子设备与第二电子设备进一步进行NFC指令交互,以完成本次业务,并在完成本次业务后进入休眠。若在第五个TD的发现期内通信失败,则NFC芯片进入第五个TD的空闲期,再次进入休眠。When the dormancy ends, the NFC chip enters the fifth TD discovery period. At this time, the first electronic device can wake up the NFC chip again, and the NFC chip enters the discovery state again. Then, the first electronic device can switch the above-switched hardware characteristic parameters (for example, CEB2) again. Taking the hardware characteristic parameter of this switching as CEF1 as an example, the first electronic device can switch CEB2 to CEF1. Then, the NFC chip is configured based on the switched hardware characteristic parameters (for example, CEF1), and communicates with the second electronic device through the configured hardware characteristic parameters. If communication is successful during the discovery period of the fifth TD, the first electronic device and the second electronic device further interact with NFC commands to complete this service, and enter sleep after completing this service. If communication fails during the discovery period of the fifth TD, the NFC chip enters the idle period of the fifth TD and enters sleep again.
当休眠结束后,NFC芯片进入第六个TD的发现期。此时,第一电子设备可以重新唤醒NFC芯片,NFC芯片再次进入发现态。接着,第一电子设备可以将切换后的硬件特征参数(例如,CEF1)进行再次切换。由此可以将切换后的硬件特征参数(也就是CEF1)再次进行切换,例如,切换至CEF2。然后,NFC芯片基于切换后的硬件特征参数(例如,CEF2)进行配置,并通过已配置的硬件特征参数与第二电子设备进行通信。以切换后的硬件特征参数为CEF2为例,NFC芯片可以在F技术下,通过CEF2硬件特征参数与第二电子设备进行通信。若在第六个TD的发现期内通信成功,则第一电子设备与第二电子设备进一步进行NFC指令交互,以完成本次业务,并在完成本次业务后进入休眠。若在第六个TD的发现期内通信失败,则NFC芯片进入第六个TD的空闲期,再次进入休眠。When the dormancy ends, the NFC chip enters the sixth TD discovery period. At this time, the first electronic device can wake up the NFC chip again, and the NFC chip enters the discovery state again. Then, the first electronic device can switch the switched hardware characteristic parameter (for example, CEF1) again. In this way, the switched hardware characteristic parameters (that is, CEF1) can be switched again, for example, to CEF2. Then, the NFC chip is configured based on the switched hardware characteristic parameters (for example, CEF2), and communicates with the second electronic device through the configured hardware characteristic parameters. Taking the switched hardware characteristic parameter as CEF2 as an example, the NFC chip can communicate with the second electronic device through the CEF2 hardware characteristic parameter under F technology. If communication is successful during the discovery period of the sixth TD, the first electronic device and the second electronic device further interact with NFC commands to complete this service, and enter sleep after completing this service. If communication fails during the discovery period of the sixth TD, the NFC chip enters the idle period of the sixth TD and enters sleep again.
可以理解的是,当第一电子设备尝试过所有预设的硬件特征参数后,仍无法与第二电子设备成功通信,此时,可以重新执行上述第一个TD至第六个TD的步骤。It can be understood that when the first electronic device still cannot successfully communicate with the second electronic device after trying all the preset hardware feature parameters, at this time, the above-mentioned steps of the first TD to the sixth TD can be re-executed.
接着,结合图4、图5a、图5b和图5c对本申请实施例提供的卡模拟方法进行进一步说明。Next, the card simulation method provided by the embodiment of the present application will be further described with reference to FIG. 4, FIG. 5a, FIG. 5b, and FIG. 5c.
如图4所示为本申请提供的卡模拟方法另一个实施例的流程示意图,该卡模拟方法应用于第一电子设备,第一电子设备具有NFC芯片,NFC芯片工作在CE模式,第一电子设备预设多套硬件特征参数,具体包括以下步骤:Figure 4 is a schematic flow chart of another embodiment of a card simulation method provided by the present application. The card simulation method is applied to a first electronic device. The first electronic device has an NFC chip. The NFC chip works in CE mode. The first electronic device The device presets multiple sets of hardware feature parameters, including the following steps:
步骤401,在多套硬件特征参数中选取一套硬件特征参数作为第一硬件特征参数,并使用第一硬件特征参数对外部电磁场进行硬件检测。Step 401: Select one set of hardware feature parameters from multiple sets of hardware feature parameters as the first hardware feature parameters, and use the first hardware feature parameters to perform hardware detection of the external electromagnetic field.
具体地,NFC芯片的TD中的发现期可以用于进行硬件检测和/或配置硬件特征参数。当NFC芯片进入TD后,可以进行硬件检测。其中,执行硬件检测的硬件可以是NFC芯片、或NFC芯片中的模组、或外围硬件电路,本申请实施例对执行硬件检测的硬件类型不作特殊限定。Specifically, the discovery period in the TD of the NFC chip can be used to perform hardware detection and/or configure hardware feature parameters. When the NFC chip enters the TD, hardware detection can be performed. The hardware that performs hardware detection may be an NFC chip, a module in the NFC chip, or a peripheral hardware circuit. The embodiment of the present application does not specifically limit the type of hardware that performs hardware detection.
执行硬件检测的具体方式可以是:在多套硬件特征参数中选取一套硬件特征参数作为第一硬件特征参数,并使用第一硬件特征参数对外部电磁场进行硬件检测。其中,外部电磁场可以是第二电子设备的射频场。可以理解的是,第一硬件特征参数的选取方式具体可以参考上述实施例,在此不再赘述。A specific method of performing hardware detection may be: selecting one set of hardware feature parameters from multiple sets of hardware feature parameters as the first hardware feature parameters, and using the first hardware feature parameters to perform hardware detection of the external electromagnetic field. The external electromagnetic field may be a radio frequency field of the second electronic device. It can be understood that the specific selection method of the first hardware characteristic parameter may refer to the above embodiment, and will not be described again here.
步骤402,若第一硬件特征参数与外部电磁场适配,将NFC芯片配置为第一硬件特征参数,以使得第一电子设备基于第一硬件特征参数与第二电子设备进行通信;若第一硬件特征参数与外部电磁场不适配,将第一硬件特征参数切换为第二硬件特征参数,并使用第二硬件特征参数对外部电磁场再次进行硬件检测。Step 402: If the first hardware characteristic parameter matches the external electromagnetic field, configure the NFC chip as the first hardware characteristic parameter so that the first electronic device communicates with the second electronic device based on the first hardware characteristic parameter; if the first hardware If the characteristic parameter does not match the external electromagnetic field, the first hardware characteristic parameter is switched to the second hardware characteristic parameter, and the second hardware characteristic parameter is used to perform hardware detection of the external electromagnetic field again.
具体地,若第一硬件特征参数与外部电磁场适配,也就是说,若通过硬件检测确定第一硬件特征参数与第二电子设备适配后,NFC芯片可以在当前TD的发现期内配置硬件特征参数,例如,硬件可以通知软件当前适配的第一硬件特征参数对应的NFC技术、比特率以及参数值,,由此可以使得在软件运行时,第一电子设备根据通知的第一硬件特征参数对应的NFC技术、比特率以及参数值进行配置,并可以基于配置的第一硬件特征参数与第二电子设备进行通信。若第一硬件特征参数与外部电磁场不适配,第一电子设备可以将第一硬件特征参数切换为第二硬件特征参数,并使用切换后的第二硬件特征参数对外部电磁场进行再次检测。可以理解的是,若第二硬件特征参数仍适配失败,可以进一步进行硬件特征参数的切换,并基于切换后的硬件特征参数再次进行硬件检测,直至将电子设备中预先存储的所有硬件特征参数适配完为止,由此可以在一个TD内完成所有硬件特征的参数的适配,避免软件在多个TD内配置硬件特征参数与第二电子设备通信导致的效率减低。其中,硬件特征参数的具体切换方式可以参考上述实施例,在此不再赘述。Specifically, if the first hardware characteristic parameters are adapted to the external electromagnetic field, that is, if it is determined through hardware detection that the first hardware characteristic parameters are adapted to the second electronic device, the NFC chip can configure the hardware within the discovery period of the current TD. Feature parameters, for example, the hardware can notify the software of the NFC technology, bit rate and parameter value corresponding to the currently adapted first hardware feature parameter, thereby enabling the first electronic device to use the notified first hardware feature when the software is running. The NFC technology, bit rate and parameter values corresponding to the parameters are configured, and communication can be performed with the second electronic device based on the configured first hardware feature parameters. If the first hardware characteristic parameter does not match the external electromagnetic field, the first electronic device can switch the first hardware characteristic parameter to the second hardware characteristic parameter, and use the switched second hardware characteristic parameter to detect the external electromagnetic field again. It can be understood that if the second hardware characteristic parameters still fail to adapt, the hardware characteristic parameters can be further switched, and the hardware detection can be performed again based on the switched hardware characteristic parameters until all the hardware characteristic parameters pre-stored in the electronic device are Until the adaptation is completed, the adaptation of all hardware feature parameters can be completed in one TD, thus avoiding the reduction in efficiency caused by software configuring hardware feature parameters in multiple TDs to communicate with the second electronic device. The specific switching method of the hardware feature parameters may refer to the above embodiment, and will not be described again here.
接着,结合图5a图5c对上述硬件检测场景进行示例性说明。其中,图5a为硬件检测示意图。如图5a所示,NFC芯片可以在任一TD(例如,第一TD)内的发现期内使用首个硬件特征参数进行硬件检测,其中,首个硬件特征参数的选取方式可以参考上述实施例,在此不再赘述。若首个硬件特征参数与外部电磁场适配,则可以在如图5b所示的当前TD内基于首个硬件特征参数对NFC芯片进行配置,以使得NFC芯片基于配置的硬件特征参数与第二电子设备进行通信。若首个硬件特征参数与外部电磁场不适配,则可以在如图5c所示的当前TD内进行硬件特征参数的切换,并基于切换后的硬件特征参数再次进行硬件检测,直至在当前TD内将所有的硬件特征参数适配完为止。Next, the above hardware detection scenario will be exemplarily explained with reference to Figures 5a and 5c. Among them, Figure 5a is a schematic diagram of hardware detection. As shown in Figure 5a, the NFC chip can use the first hardware feature parameter to perform hardware detection during the discovery period in any TD (for example, the first TD). The selection method of the first hardware feature parameter can refer to the above embodiment. I won’t go into details here. If the first hardware characteristic parameter is adapted to the external electromagnetic field, the NFC chip can be configured based on the first hardware characteristic parameter within the current TD as shown in Figure 5b, so that the NFC chip based on the configured hardware characteristic parameter is consistent with the second electronic field. devices communicate. If the first hardware characteristic parameters are not suitable for the external electromagnetic field, the hardware characteristic parameters can be switched within the current TD as shown in Figure 5c, and the hardware detection can be performed again based on the switched hardware characteristic parameters until it is within the current TD. Until all hardware feature parameters are adapted.
本申请实施例中,在硬件检测阶段,可以在同一个TD内尝试不同的硬件特征参数与读卡设备进行适配,并在适配成功后将适配的硬件特征参数直接配置给NFC芯片,由此可以在一个TD内通过硬件检测手段完成硬件特征参数的适配,从而可以避免软 件运行时因硬件特征参数在多个TD内的切换引起的硬件特征参数的多次配置,进而可以提高软件的执行效率。In the embodiment of this application, during the hardware detection phase, different hardware feature parameters can be tried in the same TD to adapt to the card reading device, and after the adaptation is successful, the adapted hardware feature parameters will be directly configured to the NFC chip. In this way, the adaptation of hardware characteristic parameters can be completed within one TD through hardware detection means, thereby avoiding multiple configurations of hardware characteristic parameters caused by switching of hardware characteristic parameters in multiple TDs when the software is running, thereby improving the software execution efficiency.
图6为本申请提供的NFC芯片一个实施例的结构示意图,如图6所示,上述NFC芯片60应用于第一电子设备,即第一电子设备具有该NFC芯片60,NFC芯片工作在CE模式,第一电子设备预设多套硬件特征参数,NFC芯片60可以包括:选取模块61及通信模块62;其中,Figure 6 is a schematic structural diagram of an embodiment of the NFC chip provided by the present application. As shown in Figure 6, the above-mentioned NFC chip 60 is applied to the first electronic device, that is, the first electronic device has the NFC chip 60, and the NFC chip works in CE mode. , the first electronic device presets multiple sets of hardware feature parameters, and the NFC chip 60 may include: a selection module 61 and a communication module 62; wherein,
选取模块61,用于选取多套硬件特征参数中的一套硬件特征参数作为第一硬件特征参数;The selection module 61 is used to select one set of hardware feature parameters among multiple sets of hardware feature parameters as the first hardware feature parameter;
通信模块62,用于若NFC芯片配置第一硬件特征参数后,与第二电子设备通信失败,则将第一硬件特征参数切换为第二硬件特征参数,并根据第二硬件特征参数与第二电子设备再次进行通信。The communication module 62 is used to switch the first hardware characteristic parameters to the second hardware characteristic parameters if the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameters, and communicate with the second hardware characteristic parameters according to the second hardware characteristic parameters. The electronic devices communicate again.
其中一种可能的实现方式中,多套硬件特征参数中的每套硬件特征参数与NFC模式、NFC技术及比特率的组合具有映射关系。In one possible implementation manner, each set of hardware feature parameters among multiple sets of hardware feature parameters has a mapping relationship with a combination of NFC mode, NFC technology, and bit rate.
其中一种可能的实现方式中,第一硬件特征参数与第二硬件特征参数对应的NFC技术和/或比特率不同。In one possible implementation manner, the NFC technology and/or bit rate corresponding to the first hardware characteristic parameter and the second hardware characteristic parameter are different.
其中一种可能的实现方式中,第一硬件特征参数与第二硬件特征参数对应的NFC技术和比特率相同,参数值不同。In one possible implementation manner, the NFC technology and bit rate corresponding to the first hardware characteristic parameter and the second hardware characteristic parameter are the same, but the parameter values are different.
其中一种可能的实现方式中,第一硬件特征参数由兼容性和/或覆盖率确定。In one possible implementation manner, the first hardware characteristic parameter is determined by compatibility and/or coverage.
其中一种可能的实现方式中,上述通信模块62具体用于当定时器超时后,若NFC芯片配置第一硬件特征参数后,与第二电子设备通信失败,则将第一硬件特征参数切换为第二硬件特征参数,定时器在检测到外部存在第二电子设备的情况下启动。In one possible implementation manner, the above-mentioned communication module 62 is specifically used to switch the first hardware characteristic parameter to the second electronic device if the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameter after the timer times out. The second hardware characteristic parameter is that the timer is started when the second electronic device is detected externally.
其中一种可能的实现方式中,上述通信模块62还用于响应于检测到的外部电磁场的快速减弱,将第一硬件特征参数切换为第二硬件特征参数In one possible implementation, the above-mentioned communication module 62 is also used to switch the first hardware characteristic parameter to the second hardware characteristic parameter in response to the detected rapid weakening of the external electromagnetic field.
其中一种可能的实现方式中,上述通信模块62具体用于使NFC芯片进入休眠;In one possible implementation, the above-mentioned communication module 62 is specifically used to put the NFC chip into sleep;
当休眠结束后,唤醒NFC芯片,并将第一硬件特征参数切换为第二硬件特征参数。After the sleep is completed, the NFC chip is awakened and the first hardware characteristic parameters are switched to the second hardware characteristic parameters.
可以理解的是,本申请实施例中的芯片60的有益效果具体可以参考上述方法实施例的有益效果,在此不再赘述。It can be understood that the beneficial effects of the chip 60 in the embodiments of the present application can be specifically referred to the beneficial effects of the above method embodiments, and will not be described again here.
图7为本申请提供的NFC芯片另一个实施例的结构示意图,如图7所示,上述NFC芯片70应用于第一电子设备,即第一电子设备具有NFC芯片70,NFC芯片工作在CE模式,第一电子设备预设多套硬件特征参数,NFC芯片70可以包括:检测模块71、通信模块72及切换模块73;其中,Figure 7 is a schematic structural diagram of another embodiment of the NFC chip provided by the present application. As shown in Figure 7, the above-mentioned NFC chip 70 is applied to the first electronic device, that is, the first electronic device has the NFC chip 70, and the NFC chip works in the CE mode. , the first electronic device presets multiple sets of hardware feature parameters. The NFC chip 70 may include: a detection module 71, a communication module 72 and a switching module 73; wherein,
检测模块71,用于在多套硬件特征参数中选取一套硬件特征参数作为第一硬件特征参数,并使用第一硬件特征参数对外部电磁场进行硬件检测;The detection module 71 is used to select one set of hardware feature parameters as the first hardware feature parameters from multiple sets of hardware feature parameters, and use the first hardware feature parameters to perform hardware detection of the external electromagnetic field;
通信模块72,用于若第一硬件特征参数与外部电磁场适配,将NFC芯片配置为第一硬件特征参数,以使得第一电子设备基于第一硬件特征参数与第二电子设备进行通信;The communication module 72 is used to configure the NFC chip as the first hardware characteristic parameter if the first hardware characteristic parameter is adapted to the external electromagnetic field, so that the first electronic device communicates with the second electronic device based on the first hardware characteristic parameter;
切换模块73,用于若第一硬件特征参数与外部电磁场不适配,将第一硬件特征参数切换为第二硬件特征参数,并使用第二硬件特征参数对外部电磁场再次进行硬件检测。The switching module 73 is used to switch the first hardware characteristic parameter to the second hardware characteristic parameter if the first hardware characteristic parameter does not match the external electromagnetic field, and use the second hardware characteristic parameter to perform hardware detection of the external electromagnetic field again.
可以理解的是,本申请实施例中的芯片70的有益效果具体可以参考上述方法实施例的有益效果,在此不再赘述。It can be understood that the beneficial effects of the chip 70 in the embodiment of the present application can be specifically referred to the beneficial effects of the above method embodiments, and will not be described again here.
图8为本申请实施例提供的一种电子设备800的结构示意图,上述电子设备800可以包括:至少一个处理器;以及与上述处理器通信连接的至少一个存储器。上述电子设备800可以为NFC设备。上述存储器存储有可被上述处理器执行的程序指令,处理器可调用上述程序指令能够执行本申请实施例提供的NFC设备执行的动作。FIG. 8 is a schematic structural diagram of an electronic device 800 provided by an embodiment of the present application. The electronic device 800 may include: at least one processor; and at least one memory communicatively connected to the processor. The above-mentioned electronic device 800 may be an NFC device. The above-mentioned memory stores program instructions that can be executed by the above-mentioned processor, and the processor can call the above-mentioned program instructions to perform actions performed by the NFC device provided by the embodiment of the present application.
如图8所示,电子设备800可以以通用计算设备的形式表现。电子设备800的组件可以包括但不限于:一个或者多个处理器810,存储器820,连接不同系统组件(包括存储器820和处理器810)的通信总线840及通信接口830。As shown in Figure 8, electronic device 800 may take the form of a general-purpose computing device. The components of the electronic device 800 may include, but are not limited to: one or more processors 810, memory 820, a communication bus 840 and a communication interface 830 connecting different system components (including the memory 820 and the processor 810).
通信总线840表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry Standard Architecture,ISA)总线,微通道体系结构(Micro Channel Architecture,MAC)总线,增强型ISA总线、视频电子标准协会(Video Electronics Standards Association,VESA)局域总线以及外围组件互连(Peripheral Component Interconnection,PCI)总线。 Communications bus 840 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics accelerated port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (Video Electronics Standards) Association, VESA) local bus and Peripheral Component Interconnection (PCI) bus.
电子设备800典型地包括多种计算机系统可读介质。这些介质可以是任何能够被电子设备800访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。 Electronic device 800 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 800, including volatile and nonvolatile media, removable and non-removable media.
存储器820可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory,RAM)和/或高速缓存存储器。电子设备800可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。尽管图8中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如:光盘只读存储器(Compact Disc Read Only Memory,CD-ROM)、数字多功能只读光盘(Digital Video Disc Read Only Memory,DVD-ROM)或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与通信总线840相连。存储器820可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本申请各实施例的功能。 Memory 820 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and/or cache memory. Electronic device 800 may further include other removable/non-removable, volatile/non-volatile computer system storage media. Although not shown in FIG. 8, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") may be provided, as well as a disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disk read-only memory). Disc Read Only Memory (CD-ROM), Digital Video Disc Read Only Memory (DVD-ROM) or other optical media). In these cases, each drive may be connected to communications bus 840 through one or more data media interfaces. The memory 820 may include at least one program product having a set (eg, at least one) program module configured to perform the functions of various embodiments of the present application.
具有一组(至少一个)程序模块的程序/实用工具,可以存储在存储器820中,这样的程序模块包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块通常执行本申请所描述的实施例中的功能和/或方法。A program/utility having a set of (at least one) program modules may be stored in memory 820. Such program modules include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. In these examples, Each of these, or some combination thereof, may include the implementation of a network environment. Program modules typically perform functions and/or methods in the embodiments described herein.
电子设备800也可以与一个或多个外部设备(例如键盘、指向设备、显示器等)通信,还可与一个或者多个使得用户能与该电子设备800交互的设备通信,和/或与使得该电子设备800能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过通信接口830进行。并且,电子设备800还可以通过网络适配器(图8中未示出)与一个或者多个网络(例如局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN)和/或公共网络,例如因特网)通信,上述网络适配器可以通过通信总线840与电子设备的其它模块通信。应当明白, 尽管图8中未示出,可以结合电子设备800使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、磁盘阵列(Redundant Arrays of Independent Drives,RAID)系统、磁带驱动器以及数据备份存储系统等。 Electronic device 800 may also communicate with one or more external devices (e.g., keyboard, pointing device, display, etc.), may also communicate with one or more devices that enable a user to interact with electronic device 800, and/or with one or more devices that enable the user to interact with electronic device 800. Electronic device 800 can communicate with any device (eg, network card, modem, etc.) that communicates with one or more other computing devices. This communication may occur through communication interface 830. Moreover, the electronic device 800 can also communicate with one or more networks (such as a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN)) and/or a public network through a network adapter (not shown in Figure 8), such as Internet) communication, the above-mentioned network adapter can communicate with other modules of the electronic device through the communication bus 840. It should be understood that, although not shown in Figure 8, other hardware and/or software modules may be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Drives (RAID) systems, tape drives and data backup storage systems, etc.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the above description of the embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated as needed. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working processes of the systems, devices and units described above, reference can be made to the corresponding processes in the foregoing method embodiments, which will not be described again here.
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。Each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage device. The medium includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be covered by the protection scope of the present application. . Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (12)

  1. 一种卡模拟方法,其特征在于,应用于第一电子设备,所述第一电子设备具有近场通信NFC芯片,所述NFC芯片工作在卡模拟CE模式,所述第一电子设备预设多套硬件特征参数,所述方法包括:A card simulation method, characterized in that it is applied to a first electronic device, the first electronic device has a near field communication NFC chip, the NFC chip works in the card simulation CE mode, and the first electronic device presets multiple A set of hardware characteristic parameters, the method includes:
    选取所述多套硬件特征参数中的一套硬件特征参数作为第一硬件特征参数;Selecting one set of hardware feature parameters among the plurality of sets of hardware feature parameters as the first hardware feature parameter;
    若所述NFC芯片配置所述第一硬件特征参数后,与第二电子设备通信失败,则将所述第一硬件特征参数切换为第二硬件特征参数,并根据所述第二硬件特征参数与所述第二电子设备再次进行通信。If the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameters, the first hardware characteristic parameters are switched to the second hardware characteristic parameters, and the NFC chip is configured with the second hardware characteristic parameters according to the second hardware characteristic parameters and the second electronic device. The second electronic device communicates again.
  2. 根据权利要求1所述的方法,其特征在于,所述多套硬件特征参数中的每套硬件特征参数与NFC模式、NFC技术及比特率的组合具有映射关系。The method according to claim 1, characterized in that each set of hardware characteristic parameters in the plurality of sets of hardware characteristic parameters has a mapping relationship with a combination of NFC mode, NFC technology and bit rate.
  3. 根据权利要求2所述的方法,其特征在于,所述第一硬件特征参数与所述第二硬件特征参数对应的NFC技术和/或比特率不同。The method according to claim 2, characterized in that the NFC technology and/or bit rate corresponding to the first hardware characteristic parameter and the second hardware characteristic parameter are different.
  4. 根据权利要求2所述的方法,其特征在于,所述第一硬件特征参数与所述第二硬件特征参数对应的NFC技术和比特率相同,参数值不同。The method according to claim 2, characterized in that the NFC technology and bit rate corresponding to the first hardware characteristic parameter and the second hardware characteristic parameter are the same, but the parameter values are different.
  5. 根据权利要求4所述的方法,其特征在于,所述第一硬件特征参数由兼容性和/或覆盖率确定。The method of claim 4, wherein the first hardware characteristic parameter is determined by compatibility and/or coverage.
  6. 根据权利要求1所述的方法,其特征在于,所述若所述NFC芯片配置所述第一硬件特征参数后,与第二电子设备通信失败,则将所述第一硬件特征参数切换为第二硬件特征参数包括:The method according to claim 1, characterized in that if the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameter, the first hardware characteristic parameter is switched to the second electronic device. 2. Hardware characteristic parameters include:
    当定时器超时后,若所述NFC芯片配置所述第一硬件特征参数后,与第二电子设备通信失败,则将所述第一硬件特征参数切换为第二硬件特征参数,所述定时器在检测到外部存在所述第二电子设备的情况下启动。When the timer times out, if the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameters, the first hardware characteristic parameters are switched to the second hardware characteristic parameters, and the timer Started when the external presence of the second electronic device is detected.
  7. 根据权利要求1所述的方法,其特征在于,所述若所述NFC芯片配置所述第一硬件特征参数后,与第二电子设备通信失败,则将所述第一硬件特征参数切换为第二硬件特征参数包括:The method according to claim 1, characterized in that if the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameter, the first hardware characteristic parameter is switched to the second electronic device. 2. Hardware characteristic parameters include:
    响应于检测到的外部电磁场的快速减弱,将所述第一硬件特征参数切换为第二硬件特征参数。In response to the detected rapid weakening of the external electromagnetic field, the first hardware characteristic parameter is switched to a second hardware characteristic parameter.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述将所述第一硬件特征参数切换为第二硬件特征参数之前,所述方法还包括:The method according to any one of claims 1 to 7, characterized in that before switching the first hardware characteristic parameter to the second hardware characteristic parameter, the method further includes:
    使所述NFC芯片进入休眠;Put the NFC chip into sleep;
    所述将所述第一硬件特征参数切换为第二硬件特征参数包括:The switching of the first hardware characteristic parameter to the second hardware characteristic parameter includes:
    当休眠结束后,唤醒所述NFC芯片,并将所述第一硬件特征参数切换为第二硬件特征参数。After the sleep is completed, the NFC chip is awakened and the first hardware characteristic parameters are switched to the second hardware characteristic parameters.
  9. 一种卡模拟方法,其特征在于,应用于第一电子设备,所述第一电子设备具有近场通信NFC芯片,所述NFC芯片工作在卡模拟CE模式,所述第一电子设备预设多套硬件特征参数,所述方法包括:A card simulation method, characterized in that it is applied to a first electronic device, the first electronic device has a near field communication NFC chip, the NFC chip works in the card simulation CE mode, and the first electronic device presets multiple A set of hardware characteristic parameters, the method includes:
    在所述多套硬件特征参数中选取一套硬件特征参数作为第一硬件特征参数,并使用所述第一硬件特征参数对外部电磁场进行硬件检测;Select one set of hardware characteristic parameters from the plurality of sets of hardware characteristic parameters as the first hardware characteristic parameters, and use the first hardware characteristic parameters to perform hardware detection of the external electromagnetic field;
    若所述第一硬件特征参数与所述外部电磁场适配,将所述NFC芯片配置为所述第 一硬件特征参数,以使得所述第一电子设备基于所述第一硬件特征参数与第二电子设备进行通信;If the first hardware characteristic parameter is adapted to the external electromagnetic field, the NFC chip is configured as the first hardware characteristic parameter, so that the first electronic device interacts with the second hardware characteristic parameter based on the first hardware characteristic parameter. electronic devices for communication;
    若所述第一硬件特征参数与所述外部电磁场不适配,将所述第一硬件特征参数切换为第二硬件特征参数,并使用所述第二硬件特征参数对外部电磁场再次进行硬件检测。If the first hardware characteristic parameter does not match the external electromagnetic field, the first hardware characteristic parameter is switched to the second hardware characteristic parameter, and the second hardware characteristic parameter is used to perform hardware detection of the external electromagnetic field again.
  10. 一种NFC芯片,其特征在于,应用于第一电子设备,所述NFC芯片工作在卡模拟CE模式,所述第一电子设备预设多套硬件特征参数,所述NFC芯片包括:An NFC chip, characterized in that it is applied to a first electronic device. The NFC chip works in a card simulation CE mode. The first electronic device presets multiple sets of hardware feature parameters. The NFC chip includes:
    选取模块,用于选取所述多套硬件特征参数中的一套硬件特征参数作为第一硬件特征参数;A selection module for selecting one set of hardware feature parameters among the plurality of sets of hardware feature parameters as the first hardware feature parameter;
    通信模块,用于若所述NFC芯片配置所述第一硬件特征参数后,与第二电子设备通信失败,则将所述第一硬件特征参数切换为第二硬件特征参数,并根据所述第二硬件特征参数与所述第二电子设备再次进行通信。A communication module configured to, if the NFC chip fails to communicate with the second electronic device after configuring the first hardware characteristic parameters, switch the first hardware characteristic parameters to the second hardware characteristic parameters, and configure the NFC chip according to the first hardware characteristic parameters. The two hardware characteristic parameters are communicated with the second electronic device again.
  11. 一种NFC芯片,其特征在于,应用于第一电子设备,所述NFC芯片工作在卡模拟CE模式,所述第一电子设备预设多套硬件特征参数,所述NFC芯片包括:An NFC chip, characterized in that it is applied to a first electronic device. The NFC chip works in a card simulation CE mode. The first electronic device presets multiple sets of hardware feature parameters. The NFC chip includes:
    检测模块,用于在所述多套硬件特征参数中选取一套硬件特征参数作为第一硬件特征参数,并使用所述第一硬件特征参数对外部电磁场进行硬件检测;A detection module, configured to select one set of hardware feature parameters as the first hardware feature parameters among the multiple sets of hardware feature parameters, and use the first hardware feature parameters to perform hardware detection of the external electromagnetic field;
    通信模块,用于若所述第一硬件特征参数与所述外部电磁场适配,将所述NFC芯片配置为所述第一硬件特征参数,以使得所述第一电子设备基于所述第一硬件特征参数与第二电子设备进行通信;A communication module configured to configure the NFC chip as the first hardware characteristic parameter if the first hardware characteristic parameter is adapted to the external electromagnetic field, so that the first electronic device is based on the first hardware The characteristic parameters are communicated with the second electronic device;
    切换模块,用于若所述第一硬件特征参数与所述外部电磁场不适配,将所述第一硬件特征参数切换为第二硬件特征参数,并使用所述第二硬件特征参数对外部电磁场再次进行硬件检测。A switching module, configured to switch the first hardware characteristic parameters to second hardware characteristic parameters if the first hardware characteristic parameters are not suitable for the external electromagnetic field, and use the second hardware characteristic parameters to detect the external electromagnetic field. Perform hardware detection again.
  12. 一种电子设备,其特征在于,包括:处理器和存储器,所述存储器用于存储计算机程序;所述处理器用于运行计算机程序,执行如权利要求1-8任一项所述的卡模拟方法,或执行如权利要求9所述的卡模拟方法。An electronic device, characterized in that it includes: a processor and a memory, the memory is used to store a computer program; the processor is used to run the computer program and execute the card simulation method according to any one of claims 1-8 , or perform the card emulation method as claimed in claim 9.
PCT/CN2022/131950 2022-05-19 2022-11-15 Card emulation method, and nfc chip and electronic device WO2023221429A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210557712.8A CN115001540B (en) 2022-05-19 2022-05-19 Card simulation method, NFC chip and electronic equipment
CN202210557712.8 2022-05-19

Publications (1)

Publication Number Publication Date
WO2023221429A1 true WO2023221429A1 (en) 2023-11-23

Family

ID=83028067

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/131950 WO2023221429A1 (en) 2022-05-19 2022-11-15 Card emulation method, and nfc chip and electronic device

Country Status (2)

Country Link
CN (1) CN115001540B (en)
WO (1) WO2023221429A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115001540B (en) * 2022-05-19 2023-11-24 深圳市汇顶科技股份有限公司 Card simulation method, NFC chip and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10631177B1 (en) * 2017-03-31 2020-04-21 Sprint Communications Company L.P. Mobile phone chipset parameter adaptation framework
WO2021031856A1 (en) * 2019-08-16 2021-02-25 华为技术有限公司 Nfc-based communication method and device
CN113297020A (en) * 2021-05-20 2021-08-24 山东云海国创云计算装备产业创新中心有限公司 Method, device and equipment for testing hardware module in chip and readable storage medium
CN113704043A (en) * 2021-08-30 2021-11-26 地平线(上海)人工智能技术有限公司 Chip function verification method and device, readable storage medium and electronic equipment
CN115001540A (en) * 2022-05-19 2022-09-02 深圳市汇顶科技股份有限公司 Card simulation method, NFC chip and electronic device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106487426B (en) * 2016-11-19 2021-07-13 福州大学 Capacitive coupling type human body communication transceiver aided design system and method
CN111176924B (en) * 2019-12-21 2022-07-22 苏州浪潮智能科技有限公司 GPU card dropping simulation method, system, terminal and storage medium
CN113329379B (en) * 2020-02-29 2023-04-18 华为技术有限公司 Communication method, device and system based on NFC
CN114202333A (en) * 2020-09-17 2022-03-18 Oppo广东移动通信有限公司 Near field communication control method and device, electronic equipment and storage medium
CN112069848B (en) * 2020-11-12 2021-04-30 深圳市汇顶科技股份有限公司 Card selection method, chip, terminal and storage medium for NFC card simulation mode

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10631177B1 (en) * 2017-03-31 2020-04-21 Sprint Communications Company L.P. Mobile phone chipset parameter adaptation framework
WO2021031856A1 (en) * 2019-08-16 2021-02-25 华为技术有限公司 Nfc-based communication method and device
CN113297020A (en) * 2021-05-20 2021-08-24 山东云海国创云计算装备产业创新中心有限公司 Method, device and equipment for testing hardware module in chip and readable storage medium
CN113704043A (en) * 2021-08-30 2021-11-26 地平线(上海)人工智能技术有限公司 Chip function verification method and device, readable storage medium and electronic equipment
CN115001540A (en) * 2022-05-19 2022-09-02 深圳市汇顶科技股份有限公司 Card simulation method, NFC chip and electronic device

Also Published As

Publication number Publication date
CN115001540B (en) 2023-11-24
CN115001540A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
US20200249744A1 (en) Methods and apparatus for running and booting an inter-processor communication link between independently operable processors
US9563368B2 (en) Embedded multimedia card and method of operating the same
EP2901245B1 (en) Efficient low power exit sequence for peripheral devices
US20180046399A1 (en) Storage Partitioning Method and Terminal
CN112181499A (en) Reliable start system for computer device
TWI660306B (en) Operating method of data storage device
WO2023221429A1 (en) Card emulation method, and nfc chip and electronic device
CN104205755A (en) Method, device, and system for delaying packets during a network-triggered wake of a computing device
US9514067B2 (en) Interface arbitration for a wired tag
US20200260277A1 (en) Method for wireless access authentication
KR20170013882A (en) A multi-host power controller (mhpc) of a flash-memory-based storage device
WO2023221427A1 (en) Card searching method, nfc chip, and electronic device
TW202013135A (en) A computer-implemented method, computing device, and non-transitory computer-readable storage medium for managing a computing system
US20090037610A1 (en) Electronic device interface control system
WO2015158264A1 (en) Method for controlling memory chip, chip controller, and memory controller
US10645166B2 (en) Network interface card
US7434014B2 (en) System and method for the self-mirroring storage drives
CN110187872A (en) A kind of BIOS development approach, system and electronic equipment and storage medium
US11231881B2 (en) Raid data storage device multi-step command coordination system
CN109086181A (en) A kind of BIOS framework, self checking method, system and storage medium
CN110297595B (en) Host memory buffer configuration method, storage device and control circuit unit
CN116601620A (en) Message notification method and device
CN110096366A (en) A kind of configuration method, device and the server of isomery memory system
US11662793B2 (en) Selectively disabling power delivery to a grouping of memory devices of an information handling system
US10540108B2 (en) Systems and methods for booting from virtual volume spanned across unknown number of storage devices by constructing a virtual logical unit based on metadata of the storage resources and by responding to I/O commands with data associated with a dummy logical unit

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: 22942450

Country of ref document: EP

Kind code of ref document: A1