NFC tag detection method and device, electronic equipment and readable storage medium

By dynamically acquiring the status value changes of the NFC reader's environmental sensors, determining the type of tag quantity change, and controlling the tags to enter a silent state or perform collision detection, the detection efficiency problem when users place NFC tags one by one is solved, thus improving detection efficiency.

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

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GEER TECH CO LTD
Filing Date
2026-03-31
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing collision detection algorithms require a complete collision detection process to be re-executed with all existing old tags each time a new tag is added when the user places NFC tags one by one, which increases the detection time and affects efficiency.

Method used

Within the working range of the NFC reader, the changes in the status values ​​of the environmental sensors are dynamically acquired. Based on the changes, the type of tag quantity change is determined, and existing tags are controlled to enter a silent state or to perform collision detection, thereby reducing the number of tags participating in communication.

Benefits of technology

This avoids the need for repeated testing of existing tags, reduces the probability of signal collisions, and improves the detection efficiency of NFC tags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122347155A_ABST
    Figure CN122347155A_ABST
Patent Text Reader

Abstract

The application discloses a kind of detection method, device, electronic equipment and readable storage medium of NFC label, it is related to near field communication technical field, including: at least one NFC label has existed in the working range of NFC card reader, and in the case where no new NFC label is detected within first preset time length, the state value variation of the environment sensor associated with NFC card reader is dynamically acquired;According to state value variation, determine the label number change type in the working range of NFC card reader;If it is determined that the label number increases, then control each original NFC label to enter the mute state, and control NFC card reader to scan and read the newly added NFC label;If it is determined that the label number decreases, then each original NFC label is detected by collision.This application can improve the detection efficiency of NFC label in the scenario where user discontinuously, one by one, places NFC label on NFC card reader.
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 method, apparatus, electronic device, and readable storage medium for detecting NFC tags. Background Technology

[0002] NFC (Near Field Communication) technology is widely used in multi-tag identification scenarios. Currently, when multiple NFC tags are present within the working range of an NFC reader, collision detection algorithms are typically used to detect each NFC tag.

[0003] However, existing collision detection algorithms are primarily designed for scenarios where multiple NFC tags are placed in a single batch. In practical applications, a special scenario exists where users place NFC tags onto the NFC reader one by one, non-continuously. In this scenario, if existing collision detection algorithms are used, the NFC reader needs to re-execute a complete collision detection process for each new tag added, along with all existing tags. As the number of existing tags increases, the detection time required for each incremental operation continuously increases, leading to a significant decrease in system response speed and impacting the detection efficiency of NFC tags. Summary of the Invention

[0004] The main objective of this application is to provide an NFC tag detection method, apparatus, electronic device, and readable storage medium, which aims to improve the detection efficiency of NFC tags in scenarios where users place NFC tags onto NFC readers one by one in a discontinuous manner.

[0005] This application provides a method for detecting NFC tags, the method comprising:

[0006] If at least one NFC tag already exists within the working range of the NFC reader, and no new NFC tag is detected within a first preset time period, the change in the state value of the environmental sensor associated with the NFC reader is dynamically acquired. Based on the change in the state value, determine the type of tag quantity change within the working range of the NFC reader; If the change in the number of tags is an increase in the number of tags, then all existing NFC tags are controlled to enter a silent state, and the NFC reader is controlled to scan and read the newly added NFC tags. If the change in the number of tags is a decrease in the number of tags, then collision detection is performed on each of the original NFC tags.

[0007] In one embodiment, the environmental sensor includes an infrared light sensor, and the change in state value includes a change in luminous flux; The step of determining the type of tag quantity change within the working range of the NFC reader based on the change in the state value includes: If the change in luminous flux is less than zero, then the change in the number of tags is determined to be an increase in the number of tags. If the change in luminous flux is greater than zero, then the change in the number of tags is determined to be a decrease in the number of tags.

[0008] In one embodiment, the environmental sensor includes an infrared light sensor and an ultrasonic sensor, and the change in state value includes a change in luminous flux and a change in reflection distance; The step of determining the type of tag quantity change within the working range of the NFC reader based on the change in the state value includes: If the change in luminous flux is less than zero and the change in reflection distance is less than zero, then the type of change in the number of tags is determined to be an increase in the number of tags. If the change in luminous flux is greater than zero and the change in reflection distance is greater than zero, then the type of change in the number of tags is determined to be a decrease in the number of tags.

[0009] In one embodiment, before the step of determining the type of tag quantity change within the working range of the NFC reader based on the change in the state value, the method further includes: Verify whether the absolute value of the change in the state value is greater than a preset change threshold; If so, then the step of determining the type of tag quantity change within the working range of the NFC reader based on the change in the state value is executed; If not, return to the step of dynamically acquiring the state value changes of the environmental sensors associated with the NFC reader.

[0010] In one embodiment, the step of dynamically acquiring the state value change of the environmental sensor associated with the NFC reader includes: Dynamically detect whether the status values ​​of the environmental sensors have changed; If a change in the state value of the environmental sensor is detected, the image stabilization timer is started, and the state value of the environmental sensor is monitored for stability within a preset stabilization time after the image stabilization timer is started. If so, the difference between the state value of the environmental sensor at the end of the stabilization timing and the state value at the moment before the stabilization timing was started shall be taken as the change in state value. If not, return to the step of dynamically detecting whether the state value of the environmental sensor has changed.

[0011] In one embodiment, after the step of controlling each existing NFC tag to enter a silent state, the method further includes: If the state value of the environmental sensor does not change within the second preset time period, then each of the original NFC tags is woken up and the wake-up time is recorded. After the wake-up time reaches the preset wake-up time threshold, the original NFC tags are controlled to re-enter the silent state.

[0012] In one embodiment, the method further includes: The operating status information of the environmental sensors is periodically detected; Based on the operating status information, determine whether the environmental sensor has failed; If so, if a new NFC tag is detected within the working range of the NFC reader, collision detection is performed on all NFC tags within the working range of the NFC reader.

[0013] Furthermore, to achieve the above objectives, this application also provides an NFC tag detection device, the device comprising: The data acquisition module is used to dynamically acquire the change in the state value of the environmental sensor associated with the NFC reader when at least one NFC tag already exists within the working range of the NFC reader and no new NFC tag is detected within a first preset time period. The judgment module is used to determine the type of tag quantity change within the working range of the NFC card reader based on the change in the state value. The incremental detection module is used to control the existing NFC tags to enter a silent state and control the NFC reader to scan and read the newly added NFC tags if the change in the number of tags is an increase in the number of tags. The collision detection module is used to perform collision detection on each of the original NFC tags if the change in the number of tags is a decrease in the number of tags.

[0014] In addition, to achieve the above objectives, this application also provides an electronic device, the electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the NFC tag detection method as described above.

[0015] 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 NFC tag detection method described above.

[0016] This application provides a method for detecting NFC tags. When at least one NFC tag already exists within the working range of an NFC reader, and no new NFC tag is detected within a first preset time period, the method dynamically acquires the change in the state value of the environmental sensor associated with the NFC reader. Based on the change in the state value, the method determines the type of tag quantity change within the working range of the NFC reader. If the tag quantity change type is an increase in the number of tags, the method controls each existing NFC tag to enter a silent state, preventing these existing NFC tags from participating in subsequent communication processes, and controls the NFC reader to scan and read the newly added NFC tag. If the tag quantity change type is a decrease in the number of tags, the method performs collision detection on each existing NFC tag.

[0017] In the above-described manner, the technical solution provided in this application can avoid repeatedly performing the complete collision detection process on all existing old tags when adding a new tag in a scenario where users place tags discontinuously and one by one. This reduces the number of tags involved in communication, lowers the probability of signal collision, and thus ensures that the detection time of a single incremental operation does not increase with the increase in the number of existing tags, significantly improving the detection efficiency of NFC tags. Attached Figure Description

[0018] 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.

[0019] 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.

[0020] Figure 1 A flowchart illustrating the NFC tag detection method provided in the first embodiment of this application; Figure 2 A flowchart illustrating the NFC tag detection method provided in the second embodiment of this application; Figure 3 A flowchart illustrating the NFC tag detection method provided in the third embodiment of this application; Figure 4 A schematic diagram of the module structure of the NFC tag detection device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the hardware operating environment involved in the embodiments of this application.

[0021] 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

[0022] 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.

[0023] 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.

[0024] NFC (Near Field Communication) technology is widely used in multi-tag identification scenarios. Currently, when multiple NFC tags are present within the working range of an NFC reader, collision detection algorithms are typically used to detect each NFC tag.

[0025] However, existing collision detection algorithms are primarily designed for scenarios where multiple NFC tags are placed in a single batch. In practical applications, a special scenario exists where users place NFC tags onto the NFC reader one by one, non-continuously. In this scenario, if existing collision detection algorithms are used, the NFC reader needs to re-execute a complete collision detection process for each new tag added, along with all existing tags. As the number of existing tags increases, the detection time required for each incremental operation continuously increases, leading to a significant decrease in system response speed and impacting the detection efficiency of NFC tags.

[0026] Based on this, this application provides an NFC tag detection method. When at least one NFC tag already exists within the working range of an NFC reader, and no new NFC tag is detected within a first preset time period, the method dynamically acquires the change in the state value of the environmental sensor associated with the NFC reader. Based on the change in the state value, it determines the type of tag quantity change within the working range of the NFC reader. If the tag quantity change type is an increase in the number of tags, it controls each existing NFC tag to enter a silent state, preventing these existing NFC tags from participating in subsequent communication processes, and controls the NFC reader to scan and read the newly added NFC tag. If the tag quantity change type is a decrease in the number of tags, it performs collision detection on each existing NFC tag.

[0027] In the above-described manner, the technical solution provided in this application can avoid repeatedly performing the complete collision detection process on all existing old tags when adding a new tag in a scenario where users place tags discontinuously and one by one. This reduces the number of tags involved in communication, lowers the probability of signal collision, and thus ensures that the detection time of a single incremental operation does not increase with the increase in the number of existing tags, significantly improving the detection efficiency of NFC tags.

[0028] The subject executing the NFC tag detection method of this application can be an electronic 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 card reader. This embodiment does not specifically limit it.

[0029] The following description uses an electronic device as the execution subject to illustrate the various embodiments.

[0030] This application presents a first embodiment of an NFC tag detection method, please refer to... Figure 1 The NFC tag detection method may include steps S10~S40: Step S10: If at least one NFC tag already exists within the working range of the NFC reader and no new NFC tag is detected within a first preset time period, dynamically acquire the change in the state value of the environmental sensor associated with the NFC reader. It should be noted that the working range of an NFC reader refers to the effective field range within which the NFC reader can establish communication with NFC tags, typically an area of ​​several centimeters to over ten centimeters around the NFC reader's antenna. The presence of at least one NFC tag within the working range of the NFC reader means that the NFC tag has been stably residing within the working range of the NFC reader and has been successfully recognized by the NFC reader. The first preset duration is the waiting time threshold used to determine whether the number of tags has reached a stable state. It can be a default value or can be flexibly set by the user according to actual conditions; this embodiment does not specifically limit this. The environmental sensor can be located on or near the recognition area of ​​the NFC reader. It is used to sense changes in the physical environment within the working range of the NFC reader. It can include, but is not limited to, infrared light sensors, ultrasonic sensors, and / or photoelectric sensors, etc., and this embodiment does not specifically limit this. The change in state value refers to the amplitude and direction of the change in the output value of the environmental sensor within a certain time interval, which is used to characterize the approach or departure of objects within the working range of the NFC reader.

[0031] In the case where the environmental sensor includes an infrared light sensor, it can be mounted on the NFC reader, and its sensing area at least partially overlaps with the working range of the NFC reader. In the case where the environmental sensor includes an ultrasonic sensor, it can be mounted on the NFC reader to emit ultrasonic waves and receive reflected echoes, thereby measuring the distance between itself and objects within the working range of the NFC reader.

[0032] Understandably, when at least one NFC tag exists within the working range of the NFC reader, and no new NFC tags are identified within a first preset time period, it can be determined that the current tag count has reached a stable state. At this point, the current state value of the environmental sensor can be recorded as a baseline value. Subsequently, the state value of the environmental sensor is continuously monitored, and when a change in the state value is detected, the difference between the current state value and the baseline value is calculated in real time to obtain the change in state value. If the output value decreases, the change in state value is negative; if the output value increases, the change in state value is positive.

[0033] In one feasible implementation, step S10 may include steps S11 to S14: Step S11: Dynamically detect whether the status values ​​of the environmental sensors have changed; It should be noted that when dynamically detecting whether the state value of the environmental sensor changes, it can be detected in real time or periodically at certain time intervals. This embodiment does not make specific limitations on this.

[0034] Step S12: If a change in the state value of the environmental sensor is detected, start the image stabilization timing and monitor whether the state value of the environmental sensor remains stable within the preset image stabilization time after the image stabilization timing is started. It should be noted that the image stabilization timing refers to a time counter that starts after a change in the state value is detected. It is used to determine whether the state change is a real and valid change rather than a momentary disturbance. The preset image stabilization duration, i.e., the image stabilization observation time window, can be a default value or can be flexibly set by the user according to the actual situation. This embodiment does not impose specific limitations on it. The environmental sensor's state value remaining stable means that during the image stabilization timing period, the environmental sensor's state value remains near the changed value, and its fluctuation amplitude does not exceed the preset stability tolerance.

[0035] Step S13, if yes, then the difference between the state value of the environmental sensor at the end of the image stabilization timing and the state value at the moment before the image stabilization timing was started is taken as the change in state value; It should be noted that if the status value of the environmental sensor remains stable within the preset stabilization time after the stabilization timer is started, the stabilization timer will end. This end time is the stabilization timer end time.

[0036] Step S14: If not, return to the step of performing dynamic detection of whether the state value of the environmental sensor has changed.

[0037] In this embodiment, after detecting a change in the state value of the environmental sensor, the change in state value is not immediately determined. Instead, a stabilization timer is initiated, continuously monitoring whether the state value remains stable within a preset stabilization duration. Only when the state value remains stable within the stabilization window is the difference before and after the change determined as a valid change in state value; if fluctuations occur within the window, the detection process is reset. Therefore, this embodiment effectively filters out sensor signal interference caused by non-tag operation factors such as hand tremors, ambient light flicker, and brief object obstruction, avoiding false triggers due to instantaneous disturbances and significantly improving the accuracy of determining the type of tag quantity change.

[0038] Step S20: Determine the type of tag quantity change within the working range of the NFC reader based on the change in status value; It should be noted that the type of tag quantity change refers to the direction of change of the number of tags within the working range of the NFC reader relative to the number of currently existing NFC tags. This may include, but is not limited to, an increase or decrease in the number of tags. This embodiment does not specifically limit this.

[0039] In one feasible implementation, the environmental sensor includes an infrared light sensor, and the change in state value includes the change in luminous flux; step S20 may include steps S21-S22: Step S21: If the change in light flux is less than zero, then the type of change in the number of tags is determined to be an increase in the number of tags. Step S22: If the change in light flux is greater than zero, then the type of change in the number of tags is determined to be a decrease in the number of tags.

[0040] It should be noted that the change in luminous flux refers to the difference in the output value of the infrared light sensor at different times. Specifically, it can be the luminous flux detection value at the current time minus the luminous flux detection value at the reference time.

[0041] Understandably, if the change in luminous flux is less than zero, it indicates that the luminous flux detected by the infrared sensor is weaker than at the reference time, corresponding to an object occlusion scenario. In this case, the change in the number of tags can be determined as an increase in the number of tags. If the change in luminous flux is greater than zero, it indicates that the luminous flux detected by the infrared sensor is stronger than at the reference time, corresponding to an object removal scenario. In this case, the change in the number of tags can be determined as a decrease in the number of tags.

[0042] In this embodiment, by utilizing the physical law that a decrease in luminous flux corresponds to object occlusion (adding a new tag), a negative change is determined to be an increase in the number of tags; conversely, by utilizing the physical law that an increase in luminous flux corresponds to object removal (tags being taken away), a positive change is determined to be a decrease in the number of tags. Therefore, the technical solution provided by this embodiment achieves rapid mapping from environmental perception to business logic without the need for complex algorithms or additional sensor data fusion.

[0043] In another feasible implementation, the environmental sensor includes an infrared light sensor and an ultrasonic sensor, and the change in state value includes the change in luminous flux and the change in reflection distance; step S20 may include steps S23-S24: Step S23: If the change in luminous flux is less than zero and the change in reflection distance is less than zero, then the type of change in the number of tags is determined to be an increase in the number of tags. Step S24: If the change in luminous flux is greater than zero and the change in reflection distance is greater than zero, then the type of change in the number of tags is determined to be a decrease in the number of tags.

[0044] It should be noted that the change in reflection distance refers to the difference in reflection distance measured by the ultrasonic sensor at different times. Specifically, it can be calculated by subtracting the measurement value at the reference time from the measurement value at the current time.

[0045] Understandably, if both the change in luminous flux and the change in reflection distance are less than zero, it indicates that the infrared sensor detected a decrease in luminous flux and the ultrasonic sensor detected a shortening of the reflection distance, both pointing towards the object. Therefore, the change in the number of tags can be determined as an increase in the number of tags. Conversely, if both the change in luminous flux and the change in reflection distance are greater than zero, it indicates that the infrared sensor detected an increase in luminous flux and the ultrasonic sensor detected an increase in the reflection distance, both pointing towards the object moving away. Therefore, the change in the number of tags can be determined as a decrease in the number of tags.

[0046] This embodiment introduces an ultrasonic sensor for redundancy verification, building upon the judgment of a single infrared light sensor. Specifically, when both the change in luminous flux and the change in reflection distance are negative, it is determined that the number of tags has increased; when both the change in luminous flux and the change in reflection distance are positive, it is determined that the number of tags has decreased. Thus, the technical solution provided by this embodiment utilizes the complementary characteristics of infrared sensors sensing light obstruction and ultrasonic sensors sensing changes in physical distance, effectively distinguishing between genuine tag operations and interference events. For example, when a sudden change in ambient light causes a false triggering of the infrared sensor, because the direction of change is inconsistent with that of the ultrasonic sensor, the system will not incorrectly judge it as an increase or decrease in tags. Therefore, the technical solution provided by this embodiment significantly improves the accuracy of judging the type of tag quantity change through multi-sensor fusion, providing a more reliable control basis for subsequent incremental or full-quantity detection, and is particularly suitable for applications such as intelligent display and inventory management in complex environments.

[0047] The above are only two feasible implementation methods of step S20 provided in this embodiment. This embodiment does not specifically limit the implementation method of step S20.

[0048] Furthermore, in one feasible implementation, before step S20, the NFC tag detection method may further include steps S201 to S203: Step S201: Verify whether the absolute value of the change in the state value is greater than the preset change threshold; It should be noted that the preset change threshold is used to distinguish between effective operation and environmental noise. 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.

[0049] If yes, then execute the step of determining the type of tag quantity change within the working range of the NFC reader based on the change in state value; Step S203: If not, return to the step of dynamically acquiring the state value changes of the environmental sensors associated with the NFC reader.

[0050] This embodiment limits the determination of tag quantity change type within the NFC reader's operating range based on the change in status value. Before doing so, the absolute value of the status value change is compared to a preset threshold. Only when the absolute value of the status value change is greater than the threshold (i.e., when the change is sufficiently large) is the operation considered valid and proceed to the subsequent tag quantity change type determination process. If the absolute value of the status value change is less than or equal to the threshold, it is considered environmental noise or a minor disturbance, and the system discards the change and returns to re-monitoring. Therefore, the technical solution provided by this embodiment effectively filters out invalid signal changes caused by factors such as ambient light flicker, temperature drift, sensor noise, and dust particles. This avoids frequent triggering of silent state switching or collision detection due to minor fluctuations, significantly reducing the system's false trigger rate and improving the stability and reliability of the overall detection process.

[0051] Step S30: If the tag quantity change type is tag quantity increase, then control each existing NFC tag to enter a silent state, and control the NFC reader to scan and read the newly added NFC tag. It should be noted that "existing NFC tags" refers to NFC tags that were already present within the working range of the NFC reader and were determined to be in a stable state. "Silent state" refers to a working mode of the NFC tag in which it does not respond to the polling commands of the NFC reader and therefore does not participate in the collision detection process. "Newly added NFC tags" refers to NFC tags that newly enter the working range of the NFC reader during a tag count increase event.

[0052] Step S40: If the tag quantity change type is a decrease in the number of tags, then perform collision detection on each of the original NFC tags.

[0053] It should be noted that collision detection refers to the technical process by which an NFC reader sequentially identifies each NFC tag when multiple NFC tags are present within its working range, using anti-collision algorithms (such as dynamic binary search, time-slot method, etc.).

[0054] Based on the above, this embodiment provides an NFC tag detection method. When at least one NFC tag already exists within the working range of the NFC reader, and no new NFC tag is detected within a first preset time period, the method dynamically acquires the change in the state value of the environmental sensor associated with the NFC reader. Based on the change in the state value, the method determines the type of tag quantity change within the working range of the NFC reader. If the tag quantity change type is an increase in the number of tags, the existing NFC tags are controlled to enter a silent state, preventing them from participating in subsequent communication processes, and the NFC reader is controlled to scan and read the newly added NFC tag. If the tag quantity change type is a decrease in the number of tags, collision detection is performed on the existing NFC tags.

[0055] In the above-described manner, the technical solution provided in this embodiment can avoid repeatedly performing the complete collision detection process on all existing old tags when adding a new tag in a scenario where the user places tags discontinuously and one by one. This reduces the number of tags involved in communication, lowers the probability of signal collision, and thus ensures that the detection time of a single incremental operation does not increase with the increase in the number of existing tags, significantly improving the detection efficiency of NFC tags.

[0056] Based on the first embodiment described above, a second embodiment of the NFC tag detection method of this application is proposed. For the second embodiment, please refer to... Figure 2 After controlling the existing NFC tags to enter a silent state, the NFC tag detection method may further include steps S31-S32: Step S31: If it is detected that the state value of the environmental sensor has not changed within the second preset time period, then wake up each of the original NFC tags and record the wake-up time. It should be noted that the second preset duration is used to limit the maximum duration for which the NFC tag is allowed to remain in a silent state. It can be a default value or can be flexibly set by the user according to actual conditions; this embodiment does not impose specific limitations on it. Within the second preset duration, the state value of the environmental sensor remains unchanged; that is, within the second preset duration, the output value of the environmental sensor does not change beyond the preset noise tolerance, indicating that there is neither tag addition nor tag removal operation within the operating range of the NFC reader. The wake-up duration refers to the duration counted from the wake-up time; it is used to record the duration for which the NFC tag remains in an active state after being woken up.

[0057] Step S32: After the wake-up time reaches the preset wake-up time threshold, control each existing NFC tag to re-enter the silent state.

[0058] It should be noted that the preset wake-up duration threshold is used to limit the minimum duration for which an NFC tag should remain active after being woken up.

[0059] In this embodiment, after controlling the original NFC tag to enter a silent state, a periodic state detection and recovery process is introduced. Specifically, a second preset duration is set as a continuous observation window for the silent state. If the environmental sensor does not detect any state change within this window, the system is determined to have entered a long-term inactive state. At this time, the system actively wakes up the original NFC tag to restore its responsiveness, and after maintaining the preset wake-up time, switches the NFC tag back to the silent state. Therefore, the technical solution provided by this embodiment can effectively avoid problems such as communication timeouts, state drift, or loss of synchronization with the NFC reader that may occur when the NFC tag is in a silent state for a long time. It can perform necessary state verification or data synchronization operations during the wake-up period, thereby enhancing the long-term operational stability of the system.

[0060] Based on the first and / or second embodiments described above, a third embodiment of the NFC tag detection method of this application is proposed. In the third embodiment, please refer to... Figure 3 The NFC tag detection method may also include steps S01 to S03: Step S01: Periodically detect the working status information of the environmental sensors; It should be noted that the working status information refers to the status data that reflects whether the environmental sensor is working normally. It may include, but is not limited to, whether the sensor is responding, whether the output value is within a reasonable range, whether the communication is normal, and / or whether there is a hardware fault indicator. This embodiment does not make specific limitations on this.

[0061] Step S02: Determine whether the environmental sensor has failed based on the working status information; It should be noted that environmental sensor failure refers to the inability of the environmental sensor to provide accurate information on changes in state values. Environmental sensor failure can include hardware malfunctions, communication interruptions, abnormal output values, and / or response timeouts.

[0062] When determining whether an environmental sensor has failed based on its operating status information, one feasible implementation can use a single criterion for failure assessment. For example, if the environmental sensor does not respond to a self-test command, or the returned status information contains a hardware error flag, or the output value exceeds the normal range, the environmental sensor can be determined to be faulty. Another feasible implementation can also use a combination of multiple dimensions of information for failure assessment. Specifically, the following factors can be considered: whether the environmental sensor responds to a self-test command, whether the output value is within a reasonable range, whether the output value changes within a preset time, and whether anomalies frequently occur in historical detections. Simultaneously, the system can assign different weights to each factor. Based on this, when the overall score exceeds a preset threshold, the sensor is determined to be faulty. For example, if the environmental sensor fails to respond to a self-test command three times consecutively, and the output value remains unchanged for more than one minute, it is determined to be faulty. This embodiment does not specifically limit the implementation method of step S02.

[0063] Step S03: If so, if a new NFC tag is detected within the working range of the NFC reader, collision detection is performed on all NFC tags within the working range of the NFC reader.

[0064] In this embodiment, the operating status information of the environmental sensor is periodically checked to determine if the sensor has failed. If failure is detected, the system automatically exits the incremental detection mode, which relies on sensor signals for judgment, and switches to a more robust full-scale collision detection mode. Therefore, during environmental sensor failure, if a new NFC tag is detected within the NFC reader's operating range, a full-scale collision detection is performed on all tags within that range to ensure accurate and complete tag identification. Thus, the technical solution provided in this embodiment effectively solves the technical problem of the system being unable to determine the direction of tag additions or removals or respond to new tags due to environmental sensor failure, significantly enhancing the system's robustness and availability. Even if the environmental sensor completely fails, the system can continue to operate using the traditional full-scale detection method, avoiding the risk of the entire identification function being paralyzed due to a single hardware failure. Furthermore, when the environmental sensor returns to normal, the system can re-enable the incremental detection mode, restoring efficient detection capabilities to achieve a balance between high reliability and high efficiency.

[0065] This application also provides an NFC tag detection device, please refer to... Figure 4 The NFC tag detection device may include: The data acquisition module 10 is used to dynamically acquire the change in the state value of the environmental sensor associated with the NFC reader when at least one NFC tag already exists within the working range of the NFC reader and no new NFC tag is detected within a first preset time period. The judgment module 20 is used to determine the type of tag quantity change within the working range of the NFC reader based on the change in status value. The incremental detection module 30 is used to control the existing NFC tags to enter a silent state and control the NFC reader to scan and read the newly added NFC tags if the tag quantity change type is an increase in the tag quantity. The collision detection module 40 is used to perform collision detection on each of the original NFC tags if the change in the number of tags is a decrease in the number of tags.

[0066] In one embodiment, the environmental sensor includes an infrared light sensor, and the change in state value includes the change in luminous flux; the determination module 20 is further configured to: If the change in luminous flux is less than zero, then the change in the number of tags is determined to be an increase in the number of tags. If the change in luminous flux is greater than zero, then the change in the number of tags is determined to be a decrease in the number of tags.

[0067] In one embodiment, the environmental sensor includes an infrared light sensor and an ultrasonic sensor, and the change in state value includes changes in luminous flux and changes in reflection distance; the judgment module 20 is further configured to: If the change in luminous flux is less than zero and the change in reflection distance is less than zero, then the type of change in the number of tags is determined to be an increase in the number of tags. If the change in luminous flux is greater than zero and the change in reflection distance is greater than zero, then the type of change in the number of tags is determined to be a decrease in the number of tags.

[0068] In one embodiment, the determination module 20 is further configured to: Verify whether the absolute value of the change in the status value is greater than a preset change threshold; If so, then proceed with the step of determining the type of tag quantity change within the NFC reader's operating range based on the change in status value; If not, return to the step of dynamically acquiring the state value changes of the environmental sensors associated with the NFC reader.

[0069] In one embodiment, the data acquisition module 10 is further configured to: Dynamically detect whether the status values ​​of environmental sensors have changed; If a change in the status value of the environmental sensor is detected, the image stabilization timer is activated, and the status value of the environmental sensor is monitored for stability within a preset stabilization duration after the image stabilization timer is activated. If so, the difference between the state value of the environmental sensor at the end of the stabilization timing and the state value at the moment before the stabilization timing was started will be taken as the change in state value. If not, return to the step of dynamically detecting whether the state value of the environmental sensors has changed.

[0070] In one embodiment, the NFC tag detection device further includes: If the status value of the environmental sensor does not change within the second preset time period, the existing NFC tags are woken up and the wake-up time is recorded. After the wake-up time reaches the preset wake-up time threshold, the original NFC tags are controlled to re-enter the silent state.

[0071] In one embodiment, the NFC tag detection device further includes: Periodically detect the operating status information of environmental sensors; Based on the operating status information, determine whether the environmental sensor has failed; If so, then if a new NFC tag is detected within the working range of the NFC reader, collision detection will be performed on all NFC tags within the working range of the NFC reader.

[0072] The NFC tag detection device provided in this application embodiment can improve the detection efficiency of NFC tags in scenarios where users place NFC tags onto NFC readers one by one without continuity. Compared with the prior art, the beneficial effects of the NFC tag detection device provided in this application embodiment are the same as those of the NFC tag detection method provided in the above embodiments, and other technical features in the NFC tag detection device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0073] This application also provides an electronic device, which may include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the NFC tag detection method described in the above embodiments.

[0074] The following is for reference. Figure 5 It shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of this application. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0075] like Figure 5As shown, the electronic device may include a processing unit 101 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory 102 or a program loaded from storage device 103 into random access memory 104. Random access memory 104 also stores various programs and data required for the operation of the electronic device. The processing unit 101, read-only memory 102, and random access memory 104 are interconnected via bus 105. Input / output interface 106 is also connected to bus 105. Typically, the following systems can be connected to input / output interface 106: input devices 107 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 108 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 103 including, for example, magnetic tape, hard disks, etc.; and communication devices 109. Communication device 109 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although the diagrams show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.

[0076] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 103, or installed from read-only memory 102. When the computer program is executed by processing device 101, it performs the functions defined in the methods of the embodiments of this application.

[0077] The electronic device provided in this application, employing the NFC tag detection method described in the above embodiments, can improve the detection efficiency of NFC tags in scenarios where users place NFC tags onto the NFC reader discontinuously and one by one. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the NFC tag detection method provided in the above embodiments, and other technical features of the electronic device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0078] It should be understood that various parts of the embodiments of this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0079] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the above claims.

[0080] 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 NFC tag detection method in the above embodiments.

[0081] 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.

[0082] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.

[0083] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by an electronic device, the electronic device: dynamically acquires the change in the state value of the environmental sensor associated with the NFC reader, provided that at least one NFC tag already exists within the working range of the NFC reader and no new NFC tag is detected within a first preset time period; determines the type of tag quantity change within the working range of the NFC reader based on the change in state value; if the tag quantity change type is an increase in the number of tags, controls each existing NFC tag to enter a silent state and controls the NFC reader to scan and read the newly added NFC tag; if the tag quantity change type is a decrease in the number of tags, performs collision detection on each existing NFC tag.

[0084] 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).

[0085] 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.

[0086] 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.

[0087] The computer-readable storage medium provided in this application embodiment stores computer-readable program instructions for performing the above-described NFC tag detection method, which can improve the detection efficiency of NFC tags in scenarios where users place NFC tags onto NFC readers one by one without continuity. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application embodiment are the same as the beneficial effects of the NFC tag detection method provided in the above embodiments, and will not be repeated here.

[0088] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the NFC tag detection method described above.

[0089] The computer program product provided in this application can improve the detection efficiency of NFC tags in scenarios where users place NFC tags onto NFC readers one by one without continuity. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the NFC tag detection method provided in the above embodiments, and will not be repeated here.

[0090] 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 method for detecting NFC tags, characterized in that, The method includes: If at least one NFC tag already exists within the working range of the NFC reader, and no new NFC tag is detected within a first preset time period, the change in the state value of the environmental sensor associated with the NFC reader is dynamically acquired. Based on the change in the state value, determine the type of tag quantity change within the working range of the NFC reader; If the change in the number of tags is an increase in the number of tags, then all existing NFC tags are controlled to enter a silent state, and the NFC reader is controlled to scan and read the newly added NFC tags. If the change in the number of tags is a decrease in the number of tags, then collision detection is performed on each of the original NFC tags.

2. The method as described in claim 1, characterized in that, The environmental sensor includes an infrared light sensor, and the change in state value includes the change in light flux. The step of determining the type of tag quantity change within the working range of the NFC reader based on the change in the state value includes: If the change in light flux is less than zero, then the change in the number of tags is determined to be an increase in the number of tags. If the change in luminous flux is greater than zero, then the change in the number of tags is determined to be a decrease in the number of tags.

3. The method as described in claim 1, characterized in that, The environmental sensor includes an infrared light sensor and an ultrasonic sensor, and the change in state value includes the change in luminous flux and the change in reflection distance; The step of determining the type of tag quantity change within the working range of the NFC reader based on the change in the state value includes: If the change in luminous flux is less than zero and the change in reflection distance is less than zero, then the type of change in the number of tags is determined to be an increase in the number of tags. If the change in luminous flux is greater than zero and the change in reflection distance is greater than zero, then the type of change in the number of tags is determined to be a decrease in the number of tags.

4. The method as described in claim 1, characterized in that, Before the step of determining the type of tag quantity change within the working range of the NFC reader based on the change in the state value, the method further includes: Verify whether the absolute value of the change in the state value is greater than a preset change threshold; If so, then the step of determining the type of tag quantity change within the working range of the NFC reader based on the change in the state value is executed; If not, return to the step of dynamically acquiring the state value changes of the environmental sensors associated with the NFC reader.

5. The method as described in claim 1, characterized in that, The step of dynamically acquiring the state value changes of the environmental sensors associated with the NFC reader includes: Dynamically detect whether the status values ​​of the environmental sensors have changed; If a change in the state value of the environmental sensor is detected, the image stabilization timer is started, and the state value of the environmental sensor is monitored for stability within a preset stabilization time after the image stabilization timer is started. If so, the difference between the state value of the environmental sensor at the end of the stabilization timing and the state value at the moment before the stabilization timing was started shall be taken as the change in state value; If not, return to the step of dynamically detecting whether the state value of the environmental sensor has changed.

6. The method according to any one of claims 1 to 5, characterized in that, After the step of controlling each existing NFC tag to enter a silent state, the method further includes: If the state value of the environmental sensor does not change within the second preset time period, then each of the original NFC tags is woken up and the wake-up time is recorded. After the wake-up time reaches the preset wake-up time threshold, the original NFC tags are controlled to re-enter the silent state.

7. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The operating status information of the environmental sensors is periodically detected; Based on the operating status information, determine whether the environmental sensor has failed; If so, if a new NFC tag is detected within the working range of the NFC reader, collision detection is performed on all NFC tags within the working range of the NFC reader.

8. A detection device for an NFC tag, characterized in that, The device includes: The data acquisition module is used to dynamically acquire the change in the state value of the environmental sensor associated with the NFC reader when at least one NFC tag already exists within the working range of the NFC reader and no new NFC tag is detected within a first preset time period. The judgment module is used to determine the type of tag quantity change within the working range of the NFC card reader based on the change in the state value. The incremental detection module is used to control the existing NFC tags to enter a silent state and control the NFC reader to scan and read the newly added NFC tags if the change in the number of tags is an increase in the number of tags. The collision detection module is used to perform collision detection on each of the original NFC tags if the change in the number of tags is a decrease in the number of tags.

9. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the NFC tag detection method as described in any one of claims 1 to 7.

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 NFC tag detection method as described in any one of claims 1 to 7.