Method for enhancing card simulation function, NFC transaction method and electronic equipment

By acquiring the NFC antenna and chip status, an activation command is sent to the card reader to enhance the signal detection amplitude, solving the problem of poor communication between POS machines and other devices in card emulation mode, and achieving NFC transactions with higher reliability and success rate.

CN121745127APending Publication Date: 2026-03-27FUJIAN LANDI COMMERCIAL EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In NFC-based payment scenarios, when a POS machine is read by a mobile phone in card emulation mode, it is difficult to be effectively triggered and reliably read, resulting in short communication distance, low success rate, slow interaction speed, and difficulties in chip adaptation and software reuse.

Method used

By acquiring the RF near-field state of the NFC antenna and the current card simulation state of the NFC chip, an activation command is sent to the card reader to enhance the detection amplitude of the NFC signal by the card reader. An active activation mechanism is adopted to optimize communication conditions when communication is not smooth, including the combination of RF state judgment, timer mechanism and remote communication interface.

Benefits of technology

It significantly improves the reliability and transaction success rate of card emulation communication, enhances user experience, resolves the performance disadvantage of card emulation caused by non-ideal antenna design, and improves the success rate and stability of initial link establishment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121745127A_ABST
    Figure CN121745127A_ABST
Patent Text Reader

Abstract

The invention provides a method for enhancing a card simulation function, an NFC transaction method and electronic equipment, the method is applied to the electronic equipment, an NFC antenna and an NFC chip are arranged in the electronic equipment, and the method comprises the following steps: acquiring a radio frequency near field state from the NFC antenna and a current card simulation state from the NFC chip; sending an activation instruction to a card reading device based on the radio frequency near field state of the NFC antenna and the current card simulation state of the NFC chip; wherein the activation instruction is configured to trigger the card reading equipment to enhance the detection amplitude of the card reading equipment on the NFC signal. Through an active intervention mechanism, the communication reliability is effectively improved, and stable and reliable card simulation communication is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of short-range wireless communication technology, and in particular to a method for enhancing card emulation functionality, an NFC transaction method, and an electronic device. Background Technology

[0002] In NFC-based payment scenarios, there is an application requirement that the POS machine needs to be read by the mobile phone as a card emulation mode.

[0003] In practical applications, it is difficult to be effectively triggered and reliably read by mobile phones. Summary of the Invention

[0004] Near Field Communication (NFC) technology has been widely used in mobile payments, access control systems, and device interconnection. Among these applications, card emulation, which allows devices (acting as tags) to interact with external readers, is one of its core application modes.

[0005] The technical problem to be solved by this invention is to provide a method for enhancing card emulation functionality, an NFC transaction method, and an electronic device to achieve stable and reliable card emulation communication.

[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for enhancing card emulation functionality, applied to an electronic device, the electronic device having an NFC antenna and an NFC chip, the method comprising the following steps: Acquire the radio frequency near-field state from the NFC antenna and the current card emulation state from the NFC chip; An activation command is sent to a card reader based on the radio frequency near-field state of the NFC antenna and the current card emulation state of the NFC chip. The activation command is configured to trigger the card reader to enhance its detection amplitude for NFC signals.

[0007] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: An NFC transaction method, applied to electronic devices, includes: Receive transaction processing requests; In response to the transaction processing request, perform the method for enhancing card emulation functionality as described in any one of claims 1 to 8; In card emulation mode, payment data is sent to the mobile terminal, which acts as a card reader. The payment data is used to drive the mobile terminal to initiate a payment process for the electronic device.

[0008] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the method as described in any of the preceding claims.

[0009] The beneficial effects of this invention are as follows: This application acquires the radio frequency near-field state from the NFC antenna and the current card emulation state from the NFC chip; based on the radio frequency near-field state of the NFC antenna and the current card emulation state of the NFC chip, it sends an activation command to a card reader; wherein, the activation command is configured to trigger the card reader to enhance the detection amplitude of the NFC signal. This method improves the reliability of card emulation communication. Addressing the performance disadvantages of card emulation caused by non-ideal antenna design, this invention breaks through the traditional passive response mode and innovatively introduces an active activation mechanism based on joint state judgment. This method intelligently senses the establishment status of the communication link. When it detects that the card reader is close but communication is not smooth, it actively sends an activation command to the card reader to enhance the detection amplitude of the NFC signal and optimize communication conditions. This mechanism significantly improves the initial link establishment success rate and stability, thereby improving the overall user experience and transaction success rate of the card emulation function. Attached Figure Description

[0010] Figure 1 A flowchart illustrating the steps of a method for enhancing card emulation functionality provided in an embodiment of the present invention; Figure 2 An NFC module initialization flowchart is provided for an embodiment of the present invention; Figure 3 A flowchart illustrating card simulation interaction is provided as an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0011] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.

[0012] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0013] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0014] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0015] In related technologies, devices that implement NFC card emulation mainly follow two technical paths, but both have inherent defects and are difficult to meet the complex requirements of specific embedded devices (such as commercial POS machines): Embedded device card emulation solutions based on traditional single chips: These devices (such as early POS machines) typically use a single NFC chip, but their antenna system design prioritizes the performance of the reader / writer in master mode, often sacrificing the card emulation performance in slave mode. This directly results in mobile phones and other devices struggling to effectively activate and stably read the emulated card when acting as a reader / writer, exhibiting short communication distances, low success rates, and slow interaction speeds. Furthermore, they also face the inherent problems of chip compatibility difficulties and the inability to reuse software.

[0016] To address the aforementioned problems, this application provides a method for enhancing card emulation functionality, an NFC transaction method, and an electronic device. The method for enhancing card emulation functionality is described in detail below.

[0017] The method for enhancing card emulation functionality described in this application can be used in various applications. The electronic device in this application can be an electronic device that needs to emulate an NFC tag for communication, such as a POS machine, vending machine, access control card reader, smart bracelet, or other electronic device.

[0018] The following describes in detail a method for enhancing card emulation functionality according to the present invention, with reference to the appendix. Figure 1 This includes steps 110-130.

[0019] Step 110: Obtain the radio frequency near-field status from the NFC antenna and the current card emulation status from the NFC chip. The processor of the electronic device obtains the radio frequency near-field status by reading the relevant registers or signal levels of the NFC antenna detection circuit. This status indicates the presence and intensity trend of the external radio frequency field. Simultaneously, the processor obtains the current card emulation status by accessing the control status register of the NFC chip. This status indicates whether the chip has been activated by the external card reader's radio frequency near-field and has entered the data exchange phase.

[0020] Step 120: Based on the RF near-field state of the NFC antenna and the current card simulation state of the NFC chip, an activation command is sent to a card reader. The processor performs a joint logic judgment on the two state information obtained in step 110. When the judgment logic confirms that there is a scenario where it is difficult to establish a communication link, the processor generates a control signal to drive the NFC chip or related communication module to send an activation command to the card reader.

[0021] Step 130: The activation command is configured to trigger the card reader to enhance its detection amplitude of the NFC signal. After the card reader receives and parses the command, it will prompt the card reader to adjust the operating parameters of its NFC radio frequency front-end, specifically by increasing the gain or sensitivity threshold of the signal detection circuit, thereby improving its ability to identify and demodulate the incident NFC signal.

[0022] This embodiment acquires the radio frequency near-field state from the NFC antenna and the current card emulation state from the NFC chip; based on the radio frequency near-field state of the NFC antenna and the current card emulation state of the NFC chip, it sends an activation command to a card reader; wherein, the activation command is configured to trigger the card reader to enhance the detection amplitude of the NFC signal. This method improves the reliability of card emulation communication. Addressing the performance disadvantages of card emulation caused by non-ideal antenna design, this invention breaks through the traditional passive response mode and innovatively introduces an active activation mechanism based on joint state judgment. This method intelligently senses the establishment status of the communication link; when it detects that the card reader is close but communication is not smooth, it actively sends an activation command to the card reader to enhance the detection amplitude of the NFC signal and optimize communication conditions. This mechanism significantly improves the initial link establishment success rate and stability, thereby improving the overall user experience and transaction success rate of the card emulation function.

[0023] In one embodiment of this application, step 120, which involves sending an activation command to a card reader based on the radio frequency near-field state and the current card emulation state, includes steps 121 to 124.

[0024] Step 121: Determine whether at least two transitions in the RF near-field state are detected within a preset first time window. Based on the continuous state acquisition in step 110, the processor sets a timing window of length T1, typically 500 milliseconds. This window length is based on the standard polling mechanism of a mobile phone as an NFC reader, where the phone typically sends polling commands at approximately 200 millisecond intervals. A 500-millisecond window fully covers two complete mobile phone polling cycles, ensuring the system reliably captures the phone's continuous polling behavior. Within this window, the processor monitors the number of transitions in the RF near-field state. A transition refers to a change in field strength energy level exceeding a preset threshold; this condition is used to confirm a continuous, non-transient interaction intent.

[0025] While executing step 121, step 122 is also executed to determine whether the current card emulation state remains inactive within the first time window. Within the same timing window T1 as step 121, the processor synchronously checks the card emulation state. It needs to confirm that despite the interaction intent of the external device, the NFC chip has consistently failed to establish a protocol-level connection, i.e., the state remains inactive.

[0026] Step 123: When at least two transitions in the RF near-field state are detected within the first time window and the current card emulation state remains inactive, a timer is started. After the conditions in steps 121 and 122 are simultaneously met, the processor starts a timer with a duration of T2, typically 100 milliseconds. This timer duration is based on the standard activation time of the NFC tag, which usually takes about 20 milliseconds to complete the protocol layer activation process. The 100-millisecond timer provides ample time margin for normal tag activation while ensuring timely intervention in case of activation failure.

[0027] Step 124: If the card emulation state is still inactive after the timer expires, an activation command is sent to a card reader. During the execution of timer T2, the system continuously monitors the card emulation state. If the card state is still inactive at the time of T2 expiration, it is finally confirmed that the communication link cannot be established on its own, and the processor then executes the core operation of step 120, sending the activation command.

[0028] This embodiment sets clear preconditions and execution procedures for sending activation commands. By requiring both dynamic radio frequency activity and continuous protocol non-response to be met simultaneously within a specific time window, it effectively eliminates momentary interference and false triggering in already successfully connected scenarios. The subsequently introduced timer mechanism provides a brief observation window for the natural establishment of the NFC communication protocol, executing the activation operation only after communication confirmation failure. This two-level decision-making mechanism of preliminary judgment and delayed confirmation ensures the effectiveness of intervention while minimizing unnecessary system power consumption and potential signal interference. In summary, related technologies suffer from a long-standing core contradiction that has not been effectively resolved: in embedded devices that require support for multiple NFC chip collaboration and have inherent performance limitations in antenna design, there is a lack of a software architecture and interactive control method that can systematically solve the core problem of the difficulty in establishing card emulation connections. The technical approach originating from the consumer electronics field, which simply combines single-chip driving with passive response protocols, has shown serious inadequacy in such complex industrial scenarios, urgently requiring an innovative and fundamental solution to overcome this technical bottleneck. When a connection establishment difficulty is detected, the control electronic device actively sends a specific command to enable the card reader to improve signal detection sensitivity in order to read the NFC tag information simulated by the electronic device.

[0029] In one embodiment of this application, step 120, which involves sending an activation command to a card reader based on the radio frequency near-field state and the current card emulation state, further includes step 125.

[0030] Step 125: If the current card emulation state has been activated after the timer expires, stop the timer and stop sending activation commands. If the card emulation state has changed to activated before timer T2 expires, it indicates that the communication link has been established naturally within the delay period. The processor will stop the timer and cancel the subsequent activation command sending process.

[0031] This embodiment adds an intelligent termination mechanism to the activation process. It ensures that if the communication status spontaneously improves before the system has decided to intervene but has not yet executed, unnecessary operations can be immediately cancelled. This further optimizes system resource utilization, avoids redundant activation signal transmissions, reduces overall power consumption, and minimizes electromagnetic interference that invalid signals may cause to surrounding NFC devices. This makes the entire card emulation interaction process more efficient and environmentally friendly.

[0032] In one embodiment of this application, step 120, which involves sending an activation command to a card reader, includes steps 1241-1242.

[0033] Step 1241: Control the NFC chip to switch from card emulation mode to reader mode and generate a radio frequency field (RF field) as an activation command. The processor configures the NFC chip's control register to temporarily switch its operating mode from card emulation mode to reader mode. After the mode switch, the chip actively emits an RF field. This RF field, actively generated by the electronic device, acts as a strong physical layer stimulus signal, which is sensed by the card reader, triggering it to adjust its communication strategy.

[0034] Step 1242: Control the NFC chip to switch to card emulation mode. The processor reinitializes or resets the card emulation function of the NFC chip through a specific sequence. During this process, the chip responds to external fields in a specific way, which can be interpreted as a hint or instruction requiring enhanced interaction from a card reader.

[0035] This embodiment provides two specific implementation methods for achieving activation functionality within the NFC protocol framework. One method generates a clear radio frequency field signal through active mode switching, directly altering the communication environment and providing a strong physical layer stimulus to the card reader. The other method generates a specific timing response through a re-initialization process, guiding the card reader to adjust its communication parameters in a gentler manner. Both implementations are based on the standard functions of existing NFC chips and do not require additional hardware circuitry. The former achieves activation by providing energy stimulus and a clear role-switching signal, while the latter utilizes the reset process of the protocol state machine to transmit control information. Together, they constitute a flexible and low-cost activation command implementation scheme, enabling the system to adapt to different application scenarios and power consumption requirements.

[0036] In one embodiment of this application, step 120, which involves sending an activation command to a card reader, includes step 1243.

[0037] Step 1243: Send a control command to the card reader via a remote communication connection established with the card reader, using the control command as an activation command. A remote communication link is established and maintained between the electronic device and the card reader, including but not limited to Bluetooth Low Energy, Wi-Fi Direct, or mobile data networks. When it is determined that an activation command needs to be sent, the processor of the electronic device sends a digital control command conforming to a predetermined protocol format to the card reader via the remote communication link. In one embodiment, the command is transmitted to a proxy service running on the card reader via a remote API call interface. After receiving this control command, the card reader adjusts the operating parameters of the NFC controller through the hardware access interface provided by its operating system, specifically including increasing the signal detection gain of the RF front-end or optimizing the signal processing algorithm.

[0038] This embodiment provides an activation command transmission mechanism based on a remote communication channel. When the NFC near-field communication link quality degrades due to device antenna characteristics or environmental interference, a pre-established remote communication connection is used to transmit digital control commands, enabling collaborative operation between different communication protocols. This method separates control signaling from data communication through remote API calls or direct device-to-device communication, ensuring reliable delivery of activation commands even when the NFC main channel is unstable. Using a remote communication interface to transmit control commands not only extends the distance limitations of command transmission but also enhances the system's adaptability in different application scenarios, providing redundant communication guarantees for complex mobile payment environments and improving the reliability and robustness of the entire interactive system.

[0039] In one embodiment of this application, after sending an activation command to a card reader, steps 160-190 are included.

[0040] Step 160: Control the NFC chip to return to card emulation mode. After sending the activation command via Method 1 (switching to reader mode), the processor controls the NFC chip to switch its operating mode again, returning from reader mode to card emulation mode, so as to be able to respond to subsequent card reading operations initiated by the activated card reader device.

[0041] Step 170: Interact with the activated card reader via the NFC chip.

[0042] Once the chip returns to card emulation mode and the card reader has been successfully activated, both parties enter the normal NFC data exchange phase. The electronic device sends the payment data or other information stored within it to the card reader via load modulation technology.

[0043] Step 180: When the card reader is detected to have moved away, a reset timer is started. The processor continuously monitors the RF near-field state, and when it determines that the field strength has been below the threshold for a certain period of time, it considers the card reader to have moved away. At this time, the system starts a reset timer T3, which is used to provide a delay buffer.

[0044] Step 190: After the reset timer times out, reset the NFC chip's card emulation function. When the reset timer T3 times out, the processor performs a reset operation on the card emulation function. This includes clearing the data buffer, resetting the chip state machine to its initial idle state, and notifying the upper-layer application that the interaction session has ended.

[0045] This embodiment defines the resource cleanup and state reset process after the card simulation interaction is completed. By introducing a reset timer, the RF field jitter problem during device removal is effectively handled, avoiding frequent state transitions and misjudgments. This is a typical de-jitter design. In physical world detection, signal edges often exhibit jitter. By delaying confirmation through a timer, these transient interferences can be filtered out, ensuring that state transitions occur under stable conditions, thereby improving the overall reliability of the system and the integrity of session management.

[0046] In one embodiment of this application, steps 101-102 are included before step 110.

[0047] Step 101: In response to the card emulation enable request initiated by the application, enable status interrupt detection for the NFC chip. When the upper-layer application software of the electronic device needs to provide card emulation services, it sends an enable request to the lower-layer NFC hardware abstraction layer or driver. The lower-layer software responds to this request by configuring the interrupt enable register of the NFC chip to enable interrupt response functions for events such as radio frequency field detection and card status changes.

[0048] Step 102: When a status interrupt is detected, the steps of acquiring the RF near-field status and the current card emulation status are executed. When an enabled event occurs inside the NFC chip, it notifies the processor via a hardware interrupt signal line. The processor's interrupt service routine or the task awakened by the interrupt is scheduled for execution. The first operation of this routine or task is to execute step 110, actively reading the current status information for subsequent logical judgment.

[0049] This embodiment establishes an event-driven background task processing mode. By replacing polling with an interrupt mechanism, the system can enter a low-power state or process other tasks when there are no external events, and only acquire status and perform logical processing when necessary (i.e., when an interrupt occurs). This is a classic optimization strategy in computing resource scheduling, changing continuous polling to passive response, freeing the CPU from meaningless waiting loops to process other meaningful work or sleep, thereby greatly optimizing the utilization efficiency of system resources, reducing standby power consumption, and conforming to the basic principles of low-power design in embedded systems.

[0050] In one embodiment of this application, the interrupt handling mechanism is subject to resource scheduling constraints in step 103.

[0051] Step 103: When a state interruption and a payment transaction process interruption occur simultaneously, the interruption service routine of the payment transaction process shall be executed first.

[0052] In the operating system's interrupt controller or task scheduler, the hardware interrupt priority or corresponding software task priority of the NFC chip status interrupt is set to be lower than the priority of the process handling core payment transactions. This ensures that when high-priority payment transactions are consuming processor resources, the card emulation-related status interrupt processing can be temporarily suspended or delayed, without preempting or blocking critical financial transaction operations.

[0053] This embodiment ensures that the real-time performance and determinism of critical business processes (payment transactions) within the system are not interfered with by non-critical background tasks (card emulation preparation) through reasonable priority configuration. This resource scheduling strategy guarantees the smoothness and security of the payment process. This is an application of priority scheduling in real-time operating system design. By assigning different priorities to different tasks, it can be ensured that the system is always processing the most important task at any given time, thereby meeting the timeliness requirements of critical tasks and improving the overall reliability of the system and user experience.

[0054] This application also provides an NFC transaction method for use in electronic devices, including steps 210 to 240.

[0055] Step 210: Receive transaction processing request. This request is generated by the upper-layer business logic of the electronic device. For example, after the POS machine completes the product scanning, it is initiated by the POS software, instructing the device to prepare to receive payment via NFC.

[0056] Step 220: In response to a transaction processing request, a method for executing enhanced card emulation functionality. When preparing to conduct a transaction, the device actively initiates and runs the enhanced card emulation functionality process, including steps 110 to 130, and possibly steps 121 to 125 and 160 to 190. The purpose of this step is to optimize and ensure the availability of the communication link before the formal exchange of transaction data.

[0057] Step 230: In card emulation mode, send payment data to the mobile terminal acting as a card reader. After the communication link is optimized or confirmed to be available through step 220, the electronic device remains in card emulation mode and sends its internally generated payment data (e.g., a message conforming to a specific payment specification) to the mobile terminal via the NFC link.

[0058] Step 240: Payment data is used to drive the mobile terminal to initiate a payment process for the electronic device. After receiving the payment data, the mobile terminal's internal payment application generates a payment instruction. Subsequently, the mobile terminal typically switches itself to card emulation mode and sends the payment instruction back. At this point, the electronic device needs to switch back to card reader mode to read the payment instruction and complete the final payment authorization process.

[0059] This method integrates enhanced card emulation capabilities into a cohesive component of a complete NFC transaction process. By making communication link optimization a prerequisite for transaction execution, it systematically improves the success rate and efficiency of the entire NFC payment transaction. This optimization is performed at the business process level. By adding a preprocessing stage designed to ensure communication quality, it directly overcomes the main technical obstacle affecting the final business goal (successful transaction) – unstable communication links. Therefore, the process design guarantees the achievement rate of the final goal, providing users with a smoother and more reliable payment experience.

[0060] Please refer to Figure 4 The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for enhancing card emulation or an NFC transaction method.

[0061] The beneficial effects of the electronic device of the present invention are the same as those of the method described above, and will not be repeated here.

[0062] The following combination Figure 2 (A flowchart of NFC module initialization) and Figure 3 (A flowchart of card simulation interaction) The specific implementation logic of the present invention is explained in detail step by step.

[0063] Step 1: NFC module initialization (corresponding) Figure 2 (NFC module initialization process) When the electronic device powers on, the system first executes the NFC module initialization process. This process begins with NFC chip initialization, where the processor configures the NFC chip's operating parameters via the bus, including basic parameters such as RF output power, modulation depth, and demodulation sensitivity. For systems supporting multiple NFC chips, this process initializes NFC chip 1, NFC chip 2, and NFC chip 3 sequentially according to a preset chip list, ensuring all available hardware resources are ready. This is equivalent to step 110 above.

[0064] Step 2: Build the card emulation software environment (corresponding) Figure 2 (Initialization and related procedures of NFC card emulation module) After hardware initialization, the system constructs the software environment for the NFC card emulation module, targeting application scenarios where POS machines need to seamlessly transmit transaction information to NFC tag reading terminals such as mobile phones via card emulation. This process includes creating a dedicated card emulation processing thread and multiple timer resources. The thread is responsible for handling card emulation transactions, and the timers are used to manage asynchronous events such as timeouts. Simultaneously, the system allocates read / write FIFO data buffers for data exchange, establishes data temporary storage and forwarding mechanisms, and configures an interrupt-based event-driven architecture to optimize system resource usage. This software environment construction provides a complete software foundation for resolving card emulation performance issues caused by the POS machine antenna design's bias towards a reader mode. Step 3: Register the hardware abstraction layer interface (corresponding to...) Figure 2 (NFC Hal Interface registration process) To achieve unified management of different NFC chips, the system registers NFC HAL Interfaces. For each NFC chip, driver developers implement a set of standard interface functions, including core functions such as obtaining the RFS field state, obtaining the current card state, interrupt control, and reading / writing FIFO data. These interfaces are registered into the system framework during the initialization phase, forming a unified hardware access layer. This allows upper-layer applications to transparently operate different NFC chip models, effectively solving the compatibility problem of POS machines needing to support multiple NFC chips. This abstraction layer design ensures that the access of new chips only requires implementing the standard interface, without modifying the core framework code, significantly improving development efficiency and system maintainability. Step 4: Application Enablement and Interrupt Configuration (corresponding to...) Figure 3 (Application Enable Card Simulation Function Flow) When an upper-layer application needs to provide card emulation services, the application enables the card emulation function. This request triggers the underlying framework to configure the NFC chip's interrupt register through the interrupt enable function in the registered general NFC HAL Interface, enabling interrupt response functions for events such as radio frequency field detection and state changes. This configuration process enables interrupt response functions for events such as radio frequency field detection and state changes, while setting the interrupt priority to be lower than the payment transaction process, ensuring that critical transaction tasks are not affected. By using an interrupt mechanism instead of a polling method, the system resource consumption problem when card emulation is a background task is effectively solved, improving processing efficiency.

[0065] Step 5: Event-driven state monitoring (corresponding to...) Figure 3 (China-Qatar simulation thread waiting for interrupt triggering process) After interrupt enable, the system enters a state where the card emulation thread waits for an interrupt to trigger. This thread is suspended when there are no events and does not occupy CPU resources. When the NFC chip detects a change in the external radio frequency field, a hardware interrupt is generated, waking up the suspended card emulation thread and implementing an efficient event-driven processing mechanism. This design ensures that the system responds promptly while minimizing power consumption, making it particularly suitable for embedded POS device applications requiring long standby times. Step 6: State Acquisition and Decision Making (corresponding to...) Figure 3 (The process involves obtaining the RF near-field state, the current card state, and determining whether phone activation is required.) Upon being awakened, the thread immediately acquires the RF near-field state and the current card state via the Hal Interface. Based on these two state parameters, a 500ms time window is used to detect the number of RF field transitions, and a comprehensive judgment is made in conjunction with the card state persistence. This judgment logic can accurately identify communication link establishment difficulties caused by POS antenna performance issues, providing a basis for subsequent proactive intervention decisions and effectively distinguishing between real device proximity events and environmental noise interference.

[0066] Step 7: Intelligent Activation and Data Interaction (corresponding to...) Figure 3 (The timer is started to activate the phone and begin the interaction process with the phone.) When activation is required, the system starts a 100ms timer for a delay assessment. This timer duration is based on the standard activation time of the NFC tag, allowing ample time for normal communication. If the card is still not activated after the timer expires, the system temporarily switches the NFC chip from card emulation mode to reader mode to generate a specific radio frequency signal, or sends an activation command via load modulation. Upon successful activation, the system establishes a normal data interaction channel with the mobile phone by reading and writing FIFO data, completing the seamless transmission of transaction information and other data. This is equivalent to step 120 above.

[0067] Step 8: Session End and State Reset (corresponding to) Figure 3 (The process of simulating phone removal and card reset was detected in the middle) When the interaction is complete and the phone is detected to have been removed, the system stops the running timer and performs a card emulation reset. This process includes clearing the FIFO data, resetting the chip state machine, and restoring the system to its initial idle state. When the application disables the card emulation function, the framework disables it via an interrupt in the general NFC HAL Interface, releases event listeners, and releases resources, completing the lifecycle management of the entire card emulation session and ensuring efficient utilization of system resources and long-term operational stability.

[0068] In summary, this embodiment constructs a stable and reliable NFC card emulation environment through layered initialization, achieves multi-chip compatibility using a hardware abstraction layer interface, and optimizes system resource utilization using an event-driven mechanism. By monitoring the coordinated changes in the radio frequency field and card status in real time and intelligently deciding the activation timing, it effectively solves the problem of communication link establishment difficulties caused by device antenna characteristics. The entire solution significantly improves the success rate and response speed of card emulation while ensuring system compatibility, providing a better user experience for mobile payment and other application scenarios.

[0069] The above are merely embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention's specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for enhancing card emulation functionality, characterized in that, Applied to electronic devices, the electronic devices having an NFC antenna and an NFC chip, the method includes the following steps: Acquire the radio frequency near-field state from the NFC antenna and the current card emulation state from the NFC chip; An activation command is sent to a card reader based on the radio frequency near-field state of the NFC antenna and the current card emulation state of the NFC chip. The activation command is configured to trigger the card reader to enhance the detection amplitude of the NFC signal.

2. The method for enhancing card emulation function according to claim 1, characterized in that, The step of sending an activation command to a card reader based on the radio frequency near-field state of the NFC antenna and the current card emulation state of the NFC chip includes: Determine whether at least two transitions in the radio frequency near-field state of the NFC antenna are detected within a preset first time window; At the same time, it is determined whether the current card simulation state remains inactive within the first time window; When at least two radio frequency near-field state transitions of the NFC antenna are detected within the first time window and the current card simulation state remains inactive, a timer is started. If the current card simulation state is still not activated after the timer expires, an activation command is sent to a card reader.

3. The method for enhancing card emulation function according to claim 2, characterized in that, Also includes: If the current card emulation state has been activated after the timer expires, the timer is stopped.

4. The method for enhancing card emulation function according to claim 1, characterized in that, Sending an activation command to a card reader is achieved in one of the following ways: The NFC chip is controlled to switch from card emulation mode to card reader mode, and a radio frequency field is generated, which is used as the activation command. Control the NFC chip to switch to card emulation mode.

5. The method for enhancing card emulation function according to claim 4, characterized in that, Also includes: A control command is sent to the card reader via a remote communication connection established with the card reader, and the control command serves as the activation command.

6. The method for enhancing card emulation function according to claim 5, characterized in that, After sending an activation command to a card reader, the method further includes: Control the NFC chip to return to card emulation mode; The NFC chip enables data interaction with the activated card reader. When the card reader is detected to have been moved away, a reset timer is started; After the reset timer expires, the card emulation function of the NFC chip is reset.

7. The method for enhancing card emulation function according to claim 1, characterized in that, Prior to the step of obtaining the radio frequency near-field state from the NFC antenna and the current card emulation state, the method further includes: In response to a card emulation enable request initiated by the application, status interruption detection of the NFC chip is enabled; When the state interruption is detected, the step of obtaining the radio frequency near-field state from the NFC antenna and the current card emulation state is performed.

8. The method for enhancing card emulation function according to claim 7, characterized in that, Also includes: When the state interruption and the payment transaction process interruption occur simultaneously, the interruption service routine of the payment transaction process shall be executed first.

9. An NFC transaction method, characterized in that, Applied to electronic devices, including: Receive transaction processing requests; In response to the transaction processing request, perform the method for enhancing card emulation functionality as described in any one of claims 1 to 8; In card emulation mode, payment data is sent to the mobile terminal, which acts as a card reader. The payment data is used to drive the mobile terminal to initiate a payment process for the electronic device.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method for enhancing card emulation function as described in any one of claims 1 to 8, or the steps of the NFC transaction method as described in claim 9.