Multi-region nfc identification method, nfc identification device and readable storage medium

By introducing a multiplexer switch into the NFC reader device and connecting it to the I2C interface of the main control chip, the I2C interface of the main control chip is expanded to multiple channels, solving the problem of limited number of NFC readers, meeting the device expansion needs in large-area or multi-region coverage scenarios, and improving the flexibility and reliability of the system.

CN122347150APending Publication Date: 2026-07-07GEER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610419209.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing NFC card reader devices are limited by the number of I2C interfaces on the MCU, which cannot meet the device expansion needs in scenarios with large-area or multi-region coverage.

Method used

By introducing a multiplexer between the main control chip and multiple NFC card readers, the main control chip's I2C interface is expanded into multiple channels, and communication with the NFC card readers on each channel is carried out in a time-division manner through a channel polling list.

Benefits of technology

It achieves a breakthrough in overcoming the limitation of the number of physical I2C interfaces of the main control chip at low cost, supports the access and identification of multiple NFC card readers, improves the flexibility and scalability of the system, simplifies deployment and maintenance, and ensures the reliability and response speed of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122347150A_ABST
    Figure CN122347150A_ABST
Patent Text Reader

Abstract

The application discloses a multi-region NFC identification method, an NFC identification device and a readable storage medium, relates to the field of near field communication technology, and is applied to the NFC identification device. The NFC identification device comprises a master control chip, at least one multiplexing switch and a plurality of NFC card readers. The input end of the multiplexing switch is connected with the I2C interface of the master control chip, and each NFC card reader is connected to a different channel of the multiplexing switch. The master control chip controls the multiplexing switch to sequentially select different channels based on a preset channel polling list, so that the master control chip communicates with the NFC card reader on the selected channel in time. The NFC card reader on the selected channel is controlled to read the label information of the identified NFC label and return the label information to the master control chip. The application can realize the connection of a plurality of NFC card readers at low cost, so as to meet the equipment expansion demand in the large-area or multi-region coverage scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of near-field communication technology, and in particular to a multi-area NFC identification method, an NFC identification device, and a readable storage medium. Background Technology

[0002] In applications such as smart payment devices, interactive display cabinets, and multi-channel access control systems, multiple NFC (Near Field Communication) card readers are typically required within the same device to meet the needs of multi-area and multi-location NFC tag identification. These card readers act as I2C (Inter-Integrated Circuit) slave devices, connecting to the main control chip via the I2C bus for data exchange.

[0003] Currently, most NFC card readers on the market are pre-installed with the same I2C device address, which cannot be modified by the user. Therefore, to connect multiple such NFC card readers, the main control chip needs to have multiple independent I2C hardware interfaces to distinguish each NFC card reader by connecting it to a different bus.

[0004] However, due to limitations in chip cost and package size, the number of I2C interfaces that a general-purpose MCU (Microcontroller Unit) can provide is very limited. This directly results in a limited number of NFC card readers that a device can connect to, making it impossible to meet the device expansion needs in scenarios with large-area or multi-region coverage. Summary of the Invention

[0005] The main objective of this application is to provide a multi-area NFC identification method, NFC identification device, and readable storage medium, which aims to achieve low-cost connection of multiple NFC card readers to meet the device expansion needs in scenarios with large-area or multi-area coverage.

[0006] This application provides a multi-area NFC identification method applied to an NFC identification device. The NFC identification device includes a main control chip, at least one multiplexer, and multiple NFC card readers. The input terminal of the multiplexer is connected to the I2C interface of the main control chip, and each of the NFC card readers is connected to a different channel of the multiplexer.

[0007] The method includes: The main control chip controls the multiplexer to sequentially select different channels based on a preset channel polling list, so that the main control chip can communicate with the NFC card reader on the selected channel in a time-division manner. The NFC reader on the selected channel is controlled to read the tag information of the identified NFC tag and return the tag information to the main control chip.

[0008] In one embodiment, before the step of the main control chip controlling the multiplexer to sequentially select different channels based on a preset channel polling list, the method further includes: Detect whether an NFC reader is connected to each channel of the multiplexer; Each channel connected to an NFC reader is designated as a target channel. Based on the channel number of each target channel, the target channels are arranged in order to generate the channel polling list.

[0009] In one embodiment, after the step of sequentially arranging the target channels based on their channel numbers to generate the channel polling list, the method further includes: The multiplexer periodically scans all channels to detect whether a new NFC reader is being connected to a channel, and whether an NFC reader is being removed from a channel. If a new NFC reader is detected in a channel, the channel with the new NFC reader will be added to the channel polling list. If a channel for removing NFC readers is detected, the channel for removing NFC readers will be removed from the channel polling list.

[0010] In one embodiment, the method further includes: Record the number of communication failures for each target channel in the channel polling list within a preset period; If the number of communication failures of any target channel in the channel polling list is greater than or equal to a preset threshold, then the target channel is removed from the channel polling list.

[0011] In one embodiment, after the step of removing the target channel from the channel polling list, the method further includes: Perform a bus reset operation on the target channel; After performing a bus reset operation on the target channel, it is detected whether the communication between the main control chip and the NFC reader on the target channel is successful. If so, the target channel is added back to the channel polling list; If not, report the fault information of the target channel to the user equipment.

[0012] In one embodiment, the method further includes: The historical recognition frequency of NFC tags by NFC readers on each target channel in the channel polling list is periodically obtained within a preset time period before the current moment. Based on the historical recognition frequency of each target channel, the polling weight of each target channel is dynamically adjusted. The polling weight is positively correlated with the historical recognition frequency; the channel with the larger the polling weight appears more frequently in the channel polling list.

[0013] In one embodiment, the method further includes: If the main control chip receives an interrupt signal from an NFC reader on a currently unselected channel, and the priority of the interrupt signal is higher than the priority of the currently processed I2C transaction, then it controls the multiplexing switch to switch to the channel that issued the interrupt signal. After completing the I2C transaction on the channel that issued the interrupt signal, control the multiplexer to switch back to the original channel.

[0014] In one embodiment, the method further includes: When the main control chip pre-controls the multiplexer to switch channels, it detects whether there are any incomplete I2C transactions in the currently selected channel. If so, wait for the I2C transaction on the currently selected channel to complete, and then control the multiplexing switch to switch channels.

[0015] Furthermore, to achieve the above objectives, this application also provides an NFC identification device, the NFC identification device comprising: The main control chip is used to execute the steps of implementing the multi-area NFC identification method as described above; At least one multiplexer switch, the input of which is connected to the I2C interface of the main control chip, and the output of which includes multiple channels for connecting to an NFC card reader; Multiple NFC card readers, each of which is connected to a different channel of the multiplexer.

[0016] In addition, to achieve the above objectives, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the multi-area NFC identification method as described above.

[0017] This application provides a multi-area NFC identification method applied to an NFC identification device. The NFC identification device includes a main control chip, at least one multiplexer, and multiple NFC readers. The input terminal of the multiplexer is connected to the I2C interface of the main control chip, and each NFC reader is connected to a different channel of the multiplexer. The method includes: the main control chip controlling the multiplexer to sequentially select different channels based on a preset channel polling list, so that the main control chip can communicate with the NFC readers on the selected channels in a time-division manner; controlling the NFC readers on the selected channels to read the tag information of the identified NFC tags, and returning the tag information to the main control chip.

[0018] Therefore, the technical solution provided in this application expands the I2C interface of the main control chip into multiple channels by adding a multiplexer to connect to the I2C interface of the main control chip. This allows a single I2C interface to connect to multiple NFC card readers, overcoming the limitation on the number of physical I2C interfaces of the main control chip. Simultaneously, each NFC card reader is connected to a different channel of the multiplexer, solving the problem of identical I2C device addresses not being able to coexist on the same bus through physical channel isolation. Based on this, the main control chip communicates with the NFC card readers on each channel in a time-division manner according to a channel polling list, thus enabling orderly information exchange with each NFC card reader.

[0019] In summary, the technical solution provided in this application does not require the use of a high-specification MCU with multiple I2C interfaces. It can achieve the access and identification of multiple NFC card readers simply by adding a low-cost multiplexing switch, thereby meeting the device expansion needs in large-area or multi-region coverage scenarios at a lower cost. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A flowchart illustrating the multi-area NFC identification method provided in the first embodiment of this application; Figure 2 A flowchart illustrating the multi-area NFC identification method provided in the second embodiment of this application; Figure 3A flowchart illustrating the multi-area NFC identification method provided in the third embodiment of this application; Figure 4 This is a flowchart illustrating the multi-area NFC identification method provided in the fourth embodiment of this application; Figure 5 This is a flowchart illustrating the multi-area NFC identification method provided in the fifth embodiment of this application; Figure 6 This is a schematic diagram of the structure of an NFC identification device provided in an embodiment of this application.

[0023] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0024] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0025] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0026] In applications such as smart payment devices, interactive display cabinets, and multi-channel access control systems, multiple NFC (Near Field Communication) card readers are typically required within the same device to meet the needs of multi-area and multi-location NFC tag identification. These card readers act as I2C (Inter-Integrated Circuit) slave devices, connecting to the main control chip via the I2C bus for data exchange.

[0027] Currently, most NFC card readers on the market are pre-installed with the same I2C device address, which cannot be modified by the user. Therefore, to connect multiple such NFC card readers, the main control chip needs to have multiple independent I2C hardware interfaces to distinguish each NFC card reader by connecting it to a different bus.

[0028] However, due to limitations in chip cost and package size, the number of I2C interfaces that a general-purpose MCU (Microcontroller Unit) can provide is very limited. This directly results in a limited number of NFC card readers that a device can connect to, making it impossible to meet the device expansion needs in scenarios with large-area or multi-region coverage.

[0029] Based on this, this application provides a multi-area NFC identification method applied to an NFC identification device. The NFC identification device includes a main control chip, at least one multiplexer, and multiple NFC readers. The input terminal of the multiplexer is connected to the I2C interface of the main control chip, and each NFC reader is connected to a different channel of the multiplexer. The method includes: the main control chip controlling the multiplexer to sequentially select different channels based on a preset channel polling list, so that the main control chip can communicate with the NFC readers on the selected channels in a time-division manner; controlling the NFC readers on the selected channels to read the tag information of the identified NFC tags, and returning the tag information to the main control chip.

[0030] Therefore, the technical solution provided in this application expands the I2C interface of the main control chip into multiple channels by adding a multiplexer to connect to the I2C interface of the main control chip. This allows a single I2C interface to connect to multiple NFC card readers, overcoming the limitation on the number of physical I2C interfaces of the main control chip. Simultaneously, each NFC card reader is connected to a different channel of the multiplexer, solving the problem of identical I2C device addresses not being able to coexist on the same bus through physical channel isolation. Based on this, the main control chip communicates with the NFC card readers on each channel in a time-division manner according to a channel polling list, thus enabling orderly information exchange with each NFC card reader.

[0031] In summary, the technical solution provided in this application does not require the use of a high-specification MCU with multiple I2C interfaces. It can achieve the access and identification of multiple NFC card readers simply by adding a low-cost multiplexing switch, thereby meeting the device expansion needs in large-area or multi-region coverage scenarios at a lower cost.

[0032] The executing entity of the multi-area NFC identification method of this application can be a control device with data processing, network communication and program running functions. For example, it can be a control system or control circuit that can realize the above functions, or it can be an NFC identification device. This embodiment does not specifically limit it.

[0033] The following description uses an NFC identification device as the main implementation subject to illustrate the various embodiments.

[0034] This application proposes a multi-area NFC identification method according to a first embodiment, applied to an NFC identification device. The NFC identification device includes a main control chip, at least one multiplexer, and multiple NFC card readers. The input terminal of the multiplexer is connected to the I2C interface of the main control chip, and each NFC card reader is connected to a different channel of the multiplexer. Please refer to... Figure 1 The multi-area NFC identification method may include steps S10~S20: In step S10, the main control chip controls the multiplexing switch to sequentially select different channels based on a preset channel polling list, so that the main control chip can communicate with the NFC card reader on the selected channel in a time-division manner. It should be noted that the main control chip can be an MCU or other control chip with an I2C interface, etc., and this embodiment does not make specific limitations on it. The channel polling list is a list used to record the channel numbers that need to be polled. It can be generated by scanning whether an NFC card reader is connected to each channel during the initialization of the main control chip, or it can be flexibly set by the user according to actual needs, and this embodiment does not make specific limitations on it.

[0035] In one feasible implementation, where the channel polling list is generated during the initialization of the main control chip by scanning whether an NFC reader is connected to each channel, the generation process of the channel polling list may include steps S01 to S03: Step S01: Detect whether an NFC reader is connected to each channel of the multiplexer; When detecting whether an NFC reader is connected to each channel of a multiplexer, the main control chip can control the multiplexer to sequentially select each channel. After selection, it sends a command to the selected channel to read the device ID (such as reading the 0x00 register). If the main control chip receives a response signal and successfully returns the device ID within a preset response time, it determines that an NFC reader is connected to the currently selected channel. If the main control chip does not receive a response signal within the preset response time, it determines that no NFC reader is connected to the currently selected channel.

[0036] The preset response time can be a default time or it can be flexibly set by the user according to the actual situation. This embodiment does not make specific limitations on this.

[0037] Step S02: Each channel connected to an NFC card reader is designated as a target channel; Step S03: Arrange the target channels in order based on their channel numbers to generate a channel polling list.

[0038] In this embodiment, the main control chip detects whether an NFC reader is connected to each channel of the multiplexer, marking each channel with an NFC reader as a target channel. Then, it sorts the target channels according to their channel numbers to generate a structured channel polling list. This channel polling list mechanism allows the main control chip to poll only the channels in the list, eliminating the need to traverse all physical channels of the multiplexer, thus avoiding unnecessary communication overhead and improving bus utilization and system response efficiency.

[0039] Furthermore, after step S03, the multi-area NFC identification method may also include steps S04 to S06: Step S04: Periodically scan all channels of the multiplexer to detect whether there are any newly connected NFC readers or channels where NFC readers have been removed. It should be noted that the multiplexer can scan all channels of the multiplexer periodically, either according to the default cycle or according to the cycle that the user flexibly sets according to actual needs. This embodiment does not make specific limitations on this.

[0040] Step S05: If a new NFC reader is detected, add the new NFC reader to the channel polling list; Step S06: If a channel for removing NFC card readers is detected, remove the channel for removing NFC card readers from the channel polling list.

[0041] This implementation allows the main control chip to periodically scan all channels of the multiplexer at regular intervals. By comparing the results of two consecutive scans, it identifies newly connected NFC readers and those that have been removed. For channels with newly connected NFC readers, the system dynamically adds them to the channel polling list, ensuring they are covered by subsequent polling. For channels with removed NFC readers, the system dynamically removes them from the polling list, avoiding invalid polling. Therefore, the technical solution provided by this implementation enables the system to detect changes in NFC readers in real time, supports hot-swapping of NFC readers, and automatically adjusts the polling strategy without requiring device restarts or manual intervention. This not only simplifies field deployment and maintenance, improving system flexibility and scalability, but also avoids wasting bus resources by promptly removing polling from invalid channels.

[0042] Step S20: Control the NFC reader on the selected channel to read the tag information of the identified NFC tag and return the tag information to the main control chip.

[0043] It should be noted that NFC readers can identify NFC tags (such as cards, mobile phones, and smartwatches) that enter their radio frequency field range. After identifying an NFC tag, the NFC reader can identify the NFC tag's unique identifier (UID) through an anti-collision algorithm to read the tag information. The NFC tag information refers to the data stored in the NFC tag, which may include, but is not limited to, the NFC tag's unique identifier and user data. This embodiment does not specifically limit this.

[0044] After the main control chip controls the multiplexing switch to select a channel, the dwell time of the main control chip on that channel can be determined based on the number of NFC tags identified by the NFC reader on that channel detected by the main control chip.

[0045] As described above, the technical solution provided in this embodiment expands the I2C interface of the main control chip into multiple channels by adding a multiplexer to connect to the I2C interface of the main control chip. This allows a single I2C interface to connect to multiple NFC card readers, overcoming the limitation on the number of physical I2C interfaces of the main control chip. Simultaneously, each NFC card reader is connected to a different channel of the multiplexer, solving the problem of identical I2C device addresses not being able to coexist on the same bus through physical channel isolation. Based on this, the main control chip communicates with the NFC card readers on each channel in a time-sharing manner using a channel polling list, thus enabling orderly information exchange with each NFC card reader.

[0046] Therefore, the technical solution provided in this embodiment does not require the use of a high-specification MCU with multiple I2C interfaces. By simply adding a low-cost multiplexing switch, the access and identification of multiple NFC card readers can be achieved, thereby meeting the device expansion needs in large-area or multi-region coverage scenarios at a lower cost.

[0047] Based on the first embodiment described above, a second embodiment of the multi-region NFC identification method of this application is proposed. For the second embodiment, please refer to... Figure 2 The multi-area NFC identification method may also include steps S30-S40: Step S30: Record the number of communication failures of each target channel in the channel polling list within a preset period; It should be noted that the preset period can be a default period or can be flexibly set by the user according to actual needs; this embodiment does not impose specific limitations on this. Communication failure refers to the situation where the main control chip fails to complete data transmission normally when conducting I2C communication with an NFC reader on a certain channel. The manifestations of communication failure may include, but are not limited to: no response from the slave device (i.e., the NFC reader), communication timeout, data verification error, bus lock, etc. The number of communication failures refers to the cumulative number of communication failures that occur on a certain channel within the preset period, which can be used to measure the health status and communication reliability of the NFC reader on that channel.

[0048] Step S40: For any target channel in the channel polling list, if the number of communication failures of the target channel is greater than or equal to a preset threshold, then the target channel is removed from the channel polling list.

[0049] It should be noted that the preset number of times threshold is used as the basis for determining whether the NFC reader on the channel is faulty and needs to be isolated. It can be a default value or it can be flexibly set by the user according to the actual situation. This embodiment does not make specific limitations on this.

[0050] This embodiment configures the main control chip to continuously monitor the communication status of each target channel in the channel polling list during the polling process, recording the number of communication failures for each channel within a preset period. When the number of communication failures for a channel is greater than or equal to a preset threshold, it can be determined that the NFC reader on that channel has a persistent fault, and it is then removed from the channel polling list. This effectively prevents the faulty channel from blocking the overall polling process, avoiding wasted bus resources and response delays caused by single-point failures. Simultaneously, by isolating the faulty channel from the polling list, the system can concentrate limited communication resources on normally functioning NFC readers, ensuring that NFC tag recognition in other areas is not affected, thus guaranteeing the reliability of NFC recognition.

[0051] Furthermore, in one feasible implementation, after step S40, the multi-area NFC identification method may further include steps S50-S80: Step S50: Perform a bus reset operation on the target channel; It should be noted that the bus reset operation refers to a series of operations performed by the master control chip to restore the normal communication state of the bus for a faulty channel. It is used to clear possible bus lock-up states or abnormal device states.

[0052] When performing a bus reset operation on the target channel, in one feasible implementation, the master control chip can first control the multiplexing switch to select the target channel, and then send a certain number of clock pulses to the I2C bus to try to release the locked bus; then send a STOP condition (i.e., stop condition) to ensure that the I2C bus returns to the idle state; after waiting for a certain period of time, send a START condition (i.e., start condition) to try to re-establish communication.

[0053] Specifically, when SCL (Serial Clock Line) is high, SDA (Serial Data Line) transitions from high to low, which is the start condition. When SCL is high, SDA transitions from low to high, which is the stop condition.

[0054] In another feasible implementation, the main control chip can control the power switch connected to the power line of the faulty channel through the GPIO pin. Thus, the power supply of the faulty channel can be disconnected first and maintained in a power-off state for a certain period of time. Then, the power supply can be reconnected to power on the NFC card reader. After the NFC card reader completes the power-on initialization (i.e., after the NFC card reader has been in a power-on state for a certain period of time), the communication can be re-established.

[0055] The above are only two feasible implementations of step S50 provided in this embodiment. This embodiment does not specifically limit the implementation of step S50.

[0056] Step S60: After performing a bus reset operation on the target channel, check whether the communication between the main control chip and the NFC reader on the target channel is successful. When checking whether the communication between the main control chip and the NFC reader on the target channel is successful, the main control chip can send a command to the NFC reader on the target channel to read the device ID; if a response signal is received within the preset response time and the device ID is successfully returned, the communication is determined to be successfully restored; if the main control chip does not receive a response signal within the preset response time, the communication is determined to be unsuccessful.

[0057] Step S70: If yes, add the target channel back to the channel polling list; Step S80: If not, report the fault information of the target channel to the user equipment.

[0058] It should be noted that user equipment refers to a device capable of receiving fault information and presenting it to the user. User equipment can be a host computer, cloud server, or maintenance terminal that communicates with the main control chip, or it can be a local display screen, indicator light, or other hardware device; this embodiment does not specifically limit this. Fault information refers to information describing the fault channel and fault type, which may include, but is not limited to, the channel number of the fault channel, the time of fault occurrence, and the fault type (such as communication failure, bus lockout, device unresponsiveness, etc.); this embodiment does not specifically limit this.

[0059] In this embodiment, after removing a faulty channel from the channel polling list, the main control chip actively performs a bus reset operation on that channel to attempt to clear any possible bus lock-up or device malfunction. After the reset operation, the main control chip checks whether communication between the channel and the NFC reader on the target channel has been restored. If communication is successfully restored, the faulty channel is added back to the channel polling list to restore its normal tag recognition function. If communication fails to restore, it is determined that the NFC reader on that channel has an unrecoverable hardware fault, and the chip reports the fault information to the user device, prompting maintenance personnel to handle the issue on-site. Therefore, this embodiment effectively avoids prolonged device downtime due to temporary faults (such as power fluctuations or electromagnetic interference) by automatically recovering and self-healing faulty channels, reducing the need for manual intervention. Simultaneously, for unrecoverable hardware faults, timely reporting of fault information allows maintenance personnel to quickly locate and replace faulty devices, thereby improving the maintainability and reliability of the NFC recognition device.

[0060] Based on the first and / or second embodiments described above, a third embodiment of the multi-area NFC identification method of this application is proposed. In the third embodiment, please refer to... Figure 3 The multi-area NFC identification method may also include steps S100~S200: Step S100: Periodically obtain the historical recognition frequency of NFC tags for each target channel in the channel polling list within a preset time period before the current moment; It should be noted that the system can periodically retrieve the historical recognition frequency of NFC tags from each target channel in the channel polling list within a preset time period prior to the current moment, either using a default period or a period flexibly set by the user according to actual needs. This embodiment does not impose a specific limitation on this. The preset time period refers to the length of the time window used to statistically analyze the historical recognition frequency. It can be a default time period or can be flexibly set by the user according to actual needs; this embodiment does not impose a specific limitation on this. The historical recognition frequency refers to the number of times an NFC reader on a certain channel has successfully recognized an NFC tag within the past preset time period.

[0061] Step S200: Dynamically adjust the polling weights of each target channel according to the historical recognition frequency of each target channel. Among them, the polling weight is positively correlated with the historical recognition frequency; the greater the polling weight, the more times the channel appears in the channel polling list.

[0062] It should be noted that dynamic adjustment refers to the main control chip adjusting the polling weight of each target channel in real time or periodically based on changes in the historical recognition frequency of each target channel, thus tilting polling resources towards high-frequency channels. Polling weight refers to the weight of the number of times a channel appears in the channel polling list. Polling weight is positively correlated with historical recognition frequency; that is, the higher the historical recognition frequency, the greater the polling weight; the lower the historical recognition frequency, the smaller the polling weight.

[0063] In this embodiment, the main control chip assigns a weight to each target channel. The main control chip can generate a channel polling list based on the weight of each target channel. For example, if the weight of channel A is 4, the weight of channel B is 3, and the weight of channel C is 1, then the generated polling list can be [A, B, A, B, A, B, A, C].

[0064] Based on the above, in this embodiment, the main control chip periodically calculates the NFC tag recognition frequency of each target channel in the channel polling list over a preset period of time to determine the actual usage activity of each area. Subsequently, it dynamically adjusts the frequency of each target channel's appearance in the channel polling list (i.e., its weight) based on its historical recognition frequency. Channels with higher historical recognition frequencies appear more frequently in the channel polling list, thus being selected more often per unit time; conversely, channels with lower historical recognition frequencies appear less frequently and are selected less often. Therefore, the technical solution provided in this embodiment intelligently tilts polling resources towards high-frequency channels, ensuring rapid response in high-frequency usage areas while reducing the invalid access overhead of low-frequency channels, achieving a dynamic balance between system response speed and bus resource utilization.

[0065] Based on the first, second, and / or third embodiments described above, a fourth embodiment of the multi-area NFC identification method of this application is proposed. In the fourth embodiment, please refer to... Figure 4 The multi-area NFC identification method may also include steps S300~S400: Step S300: If the main control chip receives an interrupt signal from the NFC reader on the currently unselected channel, and the priority of the interrupt signal is higher than the priority of the currently processed I2C transaction, then the multiplexing switch is controlled to switch to the channel that issued the interrupt signal. It should be noted that the interrupt signal refers to the level change signal sent by the NFC reader to the main control chip through its event trigger output when it recognizes an NFC tag. This signal is used to notify the main control chip that an NFC tag needs processing. The priority of the interrupt signal refers to the priority level dynamically determined by the main control chip based on the functional attributes of the NFC tag recognized on the channel that issued the interrupt signal; tags with different functional attributes (such as control function tags, payment function tags, and information query tags) correspond to different priorities. The currently processed I2C transaction refers to the I2C communication process that the main control chip is currently performing, which can include a complete communication sequence from start to stop conditions. This I2C transaction can be reading tag information, configuring reader parameters, or other data interaction operations, etc., which are not specifically limited in this embodiment. The priority of the I2C transaction refers to the priority level assigned by the main control chip to the currently processed I2C transaction, which is determined by the transaction type of the I2C transaction.

[0066] When the main control chip receives an interrupt signal from an NFC reader on a currently unselected channel, it reads the tag information identified on that channel, parses the functional attributes of the tag information (such as control function, payment function, information query function), and indexes it in a preset priority mapping table to determine the priority of the interrupt signal.

[0067] Step S400: After completing the I2C transaction on the channel that issued the interrupt signal, control the multiplexer to switch back to the original channel.

[0068] For example, to help understand the implementation process of this embodiment, please refer to the following implementation scenario: For example, suppose an interactive display case is equipped with multiple NFC readers located in different areas of the case. The main control chip is currently communicating with an NFC reader located in a corner via channel 3. This NFC reader is reading the UID of a regular information query tag, and this operation has a low priority. At this moment, an NFC reader on channel 0 detects a control function tag (such as a special tag used to turn on the display case lights or start a demonstration mode). This NFC reader immediately wakes up the main control chip via an interrupt signal. After responding to the interrupt, the main control chip first reads the tag information on channel 0, parses its function attribute as a control function, and determines that the interrupt signal has a high priority according to a preset priority mapping table. Since the priority of this interrupt signal is higher than the priority of the currently processed information query transaction, the main control chip immediately suspends the transaction on channel 3 and controls the multiplexing switch to switch to channel 0 to prioritize the identification and response of the control function tag. After the control function is completed, the main control chip switches back to channel 3 to continue completing the interrupted information query transaction. The above mechanism ensures that control commands can be responded to in a timely manner, avoiding response delays caused by being blocked by low-priority transactions.

[0069] For example, suppose an unmanned convenience store deploys NFC readers at the entrance / exit and on the shelves. The main control chip is currently communicating with the NFC reader on the shelves via channel 5, reading data from product information query tags. This operation has a low priority. At this moment, the NFC reader on channel 0 (entrance / exit) detects a customer's payment tag and sends an interrupt signal. Upon responding to the interrupt, the main control chip reads the tag information, parses its function as payment, and determines the interrupt signal to have a high priority. Since the payment transaction has a higher priority than the currently processed information query transaction, the main control chip immediately switches to channel 0 to process the payment transaction, ensuring the customer can quickly complete the checkout. After the payment transaction is completed, it switches back to channel 5 to continue processing product information queries. This mechanism effectively ensures the real-time nature of payment transactions and avoids queuing congestion caused by background query tasks.

[0070] For example, suppose a multi-channel access control system has multiple users swiping their cards simultaneously. The main control chip is currently idle when it receives interrupt signals from NFC readers on channels 0, 2, and 5. The main control chip reads the tag information from each channel, identifying the tag on channel 0 as an administrator card (control function, highest priority), the tag on channel 2 as an employee card (payment / attendance function, medium priority), and the tag on channel 5 as a visitor card (information query function, low priority). The main control chip processes the transactions for each channel sequentially according to priority: first switching to channel 0 to process administrator card transactions, then switching to channel 2 to process employee card transactions, and finally switching to channel 5 to process visitor card transactions. This mechanism ensures that critical functions (such as administrator operations) receive priority response, achieving differentiated service quality assurance at the business level.

[0071] Based on the above, in this embodiment, when the main control chip is processing an I2C transaction on a certain channel, if it receives an interrupt signal from an NFC reader on another channel, the main control chip will compare the priority of the interrupt signal with the priority of the currently processed I2C transaction. If the interrupt signal has a higher priority, the main control chip will immediately pause the current transaction, switch channels to prioritize the processing of the high-priority tag identification transaction, and then switch back to the original channel to resume the original transaction after processing is complete. This allows critical tags with control or payment functions to interrupt low-priority information query transactions, ensuring that critical services receive the fastest possible response time.

[0072] Based on the first, second, third, and / or fourth embodiments described above, a fifth embodiment of the multi-area NFC identification method of this application is proposed. In this fifth embodiment, please refer to... Figure 5 The multi-area NFC identification method may also include steps S500~S600: Step S500: Under the condition of pre-controlling the multiplexer to switch channels, the main control chip detects whether there are any incomplete I2C transactions in the currently selected channel; In step S600, if yes, wait for the I2C transaction on the currently selected channel to complete, and then control the multiplexing switch to switch channels.

[0073] It should be noted that pre-controlled multiplexer channel switching refers to the moment before the main control chip is about to execute the channel switching operation. At this time, the main control chip has determined the next channel to be selected, but has not yet sent a channel selection command to the multiplexer. An incomplete I2C transaction refers to an I2C communication process where the start condition has been issued but the stop condition has not yet been received. This incomplete I2C transaction may be in the address transmission phase, data transmission phase, or the NFC reader is performing internal processing (such as clock stretching).

[0074] In this embodiment, when the main control chip needs to control the multiplexer to switch channels, it first checks whether there are any incomplete I2C transactions on the currently selected channel. If an incomplete I2C transaction is detected (i.e., the start condition has been issued but the stop condition has not yet been issued), the main control chip actively waits for the I2C transaction to complete completely until it receives the stop condition and the bus returns to an idle state before performing the channel switching operation. If no incomplete I2C transactions are detected, the channel switching is performed directly. This effectively avoids the risk of communication interruption and data corruption caused by forced channel switching in the multiplexer architecture, ensuring that each I2C transaction can be executed completely in an atomic manner without being interrupted by external operations.

[0075] This application also provides an NFC identification device, please refer to... Figure 6 NFC identification devices may include: The main control chip is used to execute the steps of implementing the multi-area NFC identification method of the above embodiments; At least one multiplexer switch, the input of which is connected to the I2C interface of the main control chip, and the output of which includes multiple channels for connecting to an NFC card reader; Multiple NFC card readers, each connected to a different channel of a multiplexer.

[0076] It should be noted that each I2C interface of the main control chip can be connected to at least one multiplexer; when multiple multiplexers are connected to the I2C interface, only one of these multiplexers is used as the master switch, and the others are used as backup switches, which only work when the master switch fails.

[0077] The NFC identification device provided in this application embodiment can achieve low-cost connection to multiple NFC card readers to meet the device expansion needs in scenarios with large-area or multi-region coverage. Compared with the prior art, the beneficial effects of the NFC identification device provided in this application embodiment are the same as those of the multi-region NFC identification method provided in the above embodiments, and will not be repeated here.

[0078] This application also provides a computer-readable storage medium storing a computer program that can run on a processor. The computer program is used to execute the multi-area NFC identification method described in the above embodiments.

[0079] The computer-readable storage medium provided in this application embodiment may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0080] The aforementioned computer-readable storage medium may be included in the NFC identification device; or it may exist independently and not be assembled into the NFC identification device.

[0081] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by the NFC identification device, the NFC identification device: controls the main control chip to sequentially select different channels based on a preset channel polling list, so that the main control chip can communicate with the NFC reader on the selected channel in a time-division manner; controls the NFC reader on the selected channel to read the tag information of the identified NFC tag, and returns the tag information to the main control chip.

[0082] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0084] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0085] The computer-readable storage medium provided in this application embodiment stores computer-readable program instructions for executing the above-described multi-area NFC identification method, enabling low-cost connection of multiple NFC card readers to meet device expansion needs in scenarios with large-area or multi-area coverage. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application embodiment are the same as those of the multi-area NFC identification method provided in the above embodiments, and will not be repeated here.

[0086] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the multi-area NFC identification method described above.

[0087] The computer program product provided in this application embodiment can achieve low-cost connection to multiple NFC card readers to meet the device expansion needs in scenarios with large-area or multi-region coverage. Compared with the prior art, the beneficial effects of the computer program product provided in this application embodiment are the same as those of the multi-region NFC identification method provided in the above embodiments, and will not be repeated here.

[0088] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.

Claims

1. A multi-region NFC identification method, characterized in that, The NFC identification device includes a main control chip, at least one multiplexer, and multiple NFC card readers; the input terminal of the multiplexer is connected to the I2C interface of the main control chip, and each of the NFC card readers is connected to a different channel of the multiplexer. The method includes: The main control chip controls the multiplexer to sequentially select different channels based on a preset channel polling list, so that the main control chip can communicate with the NFC card reader on the selected channel in a time-division manner. The NFC reader on the selected channel is controlled to read the tag information of the identified NFC tag and return the tag information to the main control chip.

2. The method as described in claim 1, characterized in that, Before the step of the main control chip controlling the multiplexer to sequentially select different channels based on a preset channel polling list, the method further includes: Detect whether an NFC reader is connected to each channel of the multiplexer; Each channel connected to an NFC reader is designated as a target channel. Based on the channel number of each target channel, the target channels are arranged in order to generate the channel polling list.

3. The method as described in claim 2, characterized in that, After the step of arranging the target channels sequentially based on their channel numbers to generate the channel polling list, the method further includes: The multiplexer periodically scans all channels to detect whether a new NFC reader is being connected to a channel, and whether an NFC reader is being removed from a channel. If a new NFC reader is detected in a channel, the channel with the new NFC reader will be added to the channel polling list. If a channel for removing NFC readers is detected, the channel for removing NFC readers will be removed from the channel polling list.

4. The method as described in claim 1, characterized in that, The method further includes: Record the number of communication failures for each target channel in the channel polling list within a preset period; If the number of communication failures of any target channel in the channel polling list is greater than or equal to a preset threshold, then the target channel is removed from the channel polling list.

5. The method as described in claim 4, characterized in that, After the step of removing the target channel from the channel polling list, the method further includes: Perform a bus reset operation on the target channel; After performing a bus reset operation on the target channel, it is detected whether the communication between the main control chip and the NFC reader on the target channel is successful. If so, the target channel is added back to the channel polling list; If not, the fault information of the target channel is reported to the user equipment.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The historical recognition frequency of NFC tags by NFC readers on each target channel in the channel polling list is periodically obtained within a preset time period before the current moment. Based on the historical recognition frequency of each target channel, the polling weight of each target channel is dynamically adjusted. The polling weight is positively correlated with the historical recognition frequency; the channel with the larger the polling weight appears more frequently in the channel polling list.

7. The method according to any one of claims 1 to 5, characterized in that, The method further includes: If the main control chip receives an interrupt signal from an NFC reader on a currently unselected channel, and the priority of the interrupt signal is higher than the priority of the currently processed I2C transaction, then it controls the multiplexing switch to switch to the channel that issued the interrupt signal. After completing the I2C transaction on the channel that issued the interrupt signal, control the multiplexer to switch back to the original channel.

8. The method according to any one of claims 1 to 5, characterized in that, The method further includes: When the main control chip pre-controls the multiplexer to switch channels, it detects whether there are any incomplete I2C transactions in the currently selected channel. If so, wait for the I2C transaction on the currently selected channel to complete, and then control the multiplexing switch to switch channels.

9. An NFC identification device, characterized in that, The NFC identification device includes: The main control chip is used to perform the steps of implementing the multi-area NFC identification method as described in any one of claims 1 to 8; At least one multiplexer switch, the input of which is connected to the I2C interface of the main control chip, and the output of which includes multiple channels for connecting to an NFC card reader; Multiple NFC card readers, each of which is connected to a different channel of the multiplexer.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the multi-area NFC identification method as described in any one of claims 1 to 8.