An interactive device based on NFC and rotary coding and a control method thereof

CN122904918APending Publication Date: 2026-10-13CHENGDU MAODIAN DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611077614.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0009]本发明提供一种基于NFC与旋转编码的交互装置及其控制方法,旨在解决现有信息展示设备中触摸屏操作依赖视觉、易交叉感染且无法盲操,物理按键切换效率低下,以及NFC展示设备仅能呈现单一静态页面、缺乏多场景连贯浏览机制的技术问题

Benefits of technology

(1)插卡即显,一触即达:用户仅需将预置内容的NFC卡片插入插卡槽,装置自动识别卡片标识并调取对应的场景内容展示于屏幕,无需繁琐的菜单导航或手机扫码操作,实现了内容获取的零门槛与即时性,极大地降低了用户的学习成本和使用负担。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122904918A_ABST
    Figure CN122904918A_ABST
Patent Text Reader

Abstract

The application discloses an interactive device based on NFC and rotary coding and a control method thereof, and relates to the technical field of intelligent interactive equipment.The device comprises a shell, a card slot, an NFC reading module, a rotary encoder, a display screen, a storage module and a main control module.After a user inserts an NFC card into the card slot, the device automatically reads the card identification and calls corresponding scene content for display;clockwise rotation of the knob switches to the next scene, and counterclockwise rotation returns to the previous scene.The application also provides a rotary direction determination method and an adaptive variable-speed navigation method based on angular velocity, which realizes the efficient combination of slow and fine browsing and fast multi-scene jumping, and has a breakpoint memory function when the card is pulled out.The application combines NFC quick identification and rotary coding accurate navigation, realizes the interactive experience of card insertion display, physical knob blind operation, variable-speed browsing and seamless continuation, and has the characteristics of intuitive operation, clear feedback and efficient switching, and is suitable for exhibition display, teaching and training and product navigation scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent interactive technology, and in particular to an interactive device and its control method based on NFC and rotation encoding. Background Technology

[0002] With the rapid development of information technology, human-computer interaction methods are becoming increasingly diversified, and various information display and query devices have been widely used in exhibition venues, teaching and training, commercial guidance, and public services. Currently, the mainstream information interaction devices in these fields mainly rely on touch screens or physical buttons for browsing and switching content.

[0003] However, existing technologies have the following shortcomings: First, touchscreen interaction has inherent and obvious drawbacks. In public places such as museums, hospitals, and shopping malls, touchscreens, as shared devices, are prone to becoming a medium for the spread of germs, posing hygiene and safety risks. Furthermore, touchscreen operation requires users to keep their eyes constantly focused on the screen, making "blind operation" impossible, and the user experience is poor in low light or when the screen is reflective. In addition, capacitive touchscreens are not user-friendly when wearing gloves, limiting their applicability in specific scenarios.

[0004] Secondly, button-based switching is cumbersome. Some existing devices use physical up / down buttons to switch content. When there are many content scenes, users need to press the buttons repeatedly, resulting in low operating efficiency. Moreover, button interaction can only provide simple on / off signals and cannot sense the user's operating force and speed, making it difficult to achieve refined interactive control such as variable speed navigation.

[0005] Third, the application of NFC technology in the field of information display is insufficient. Near Field Communication (NFC) technology, due to its convenience of contactless identification, has become widespread in areas such as mobile payment, access control, and attendance. In recent years, some display devices have introduced NFC card reading functionality, allowing users to quickly retrieve preset information by swiping an NFC card or mobile phone. However, most existing NFC display devices only use the card as an "identity key," displaying only a single static page after reading it, lacking a multi-scenario hierarchical organization and coherent browsing mechanism for the card's internal or related content. If a user needs to view subcategories or details after reading a card, they still need to perform a secondary operation through the touchscreen, failing to fully leverage the convenience of NFC's one-touch access.

[0006] Fourth, the application scenarios of rotary encoders are limited. As a sensor that converts angular displacement into digital pulse signals, rotary encoders have been successfully applied in industrial control, audio volume adjustment, and automotive central control menu selection due to their good tactile feedback, precise step feedback, and wear resistance. However, in current technology, rotary encoders are usually used only as independent parameter adjustment elements. There are no known interactive device designs that organically integrate them with NFC card recognition technology and optimize them specifically for the content organization structure of "card theme - sequence scenario".

[0007] Fifth, there is a lack of a scene memory mechanism for the card removal state. Existing NFC interactive devices clear all browsing states after the card is removed. If the user needs to continue viewing the same card content, they have to start browsing from the beginning again after inserting the card again. This seriously affects the user experience when there are many scenarios, and it lacks intelligent breakpoint resume capability.

[0008] In summary, existing interactive devices lack a technical solution that deeply integrates the quick recognition capability of NFC cards with the precise bidirectional navigation capability of rotary encoders. In particular, for the content organization mode of "one card for multiple scenarios", it is still impossible to achieve the intuitive, efficient, and physically responsive screenless scene browsing experience of "insert card to display, clockwise rotation forward, counterclockwise rotation backward". Summary of the Invention

[0009] This invention provides an interactive device and its control method based on NFC and rotation encoding, aiming to solve the technical problems of existing information display devices, such as touch screen operation relying on vision, being prone to cross-infection and unable to be operated blindly, low efficiency of physical button switching, and NFC display devices only being able to present a single static page and lacking a multi-scene continuous browsing mechanism.

[0010] This invention deeply integrates NFC card recognition with rotary encoder navigation, enabling an intuitive interactive method where users can "insert a card to display multiple scene content, rotate clockwise to move to the next scene, and rotate counterclockwise to return to the previous scene." Furthermore, it introduces adaptive speed navigation and breakpoint memory functions to improve scene switching efficiency and browsing continuity. Ultimately, it provides users with a contextualized information browsing experience that is intuitive, provides clear feedback, is highly efficient and convenient, and allows navigation without relying on screen visuals.

[0011] To achieve the above-mentioned objectives, the present invention provides the following technical solution: In a first aspect, the present invention provides an interactive device based on NFC and rotational encoding, comprising: The device housing has a card slot. An NFC reading module is disposed in or near the card slot and is used to read the card identification information stored in the NFC card inserted into the card slot. A rotary encoder, mounted on the housing, includes an operation knob for user operation, and outputs an electrical signal containing rotation direction information and rotation step number information in response to the user's rotation operation; A display screen is disposed on the surface of the housing and is used to display content images; The storage module is used to store the mapping relationship data between card identifiers and content scenes, as well as the scene content data of each scene; The main control module is electrically connected to the NFC reading module, the rotary encoder, the display screen, and the storage module, respectively. It is used to retrieve the corresponding content scene from the storage module according to the card identification information, and control the display screen to switch scenes in response to the electrical signal of the rotary encoder. The power supply module is used to supply power to the above modules.

[0012] Furthermore, the rotary encoder is an incremental rotary encoder, which outputs A-phase pulse signals and B-phase pulse signals with a phase difference of 90 degrees at its output end; the rotary encoder also integrates a push switch, and when the push switch is triggered, the main control module controls the display screen to display the details page of the current scene or controls the voice module to play the narration audio of the current scene.

[0013] Furthermore, the card slot is equipped with a card placement detection sensor, which is electrically connected to the main control module. When the card placement detection sensor detects that a card has been inserted into place, it sends a trigger signal to the main control module, and the main control module responds to the trigger signal by starting the NFC reading module to perform a reading operation.

[0014] Furthermore, the device housing is also equipped with a status indicator light and a voice output module; the main control module controls the status indicator light to display different colors when the card is successfully recognized, the scene is loaded, and the scene switching boundary is reached, and controls the voice output module to broadcast the scene title or scene number of the current scene.

[0015] Secondly, the present invention provides a control method employing the interactive device described above, comprising the following steps: Step S1: Monitor the card insertion signal in the card slot. When the insertion of a card is detected, activate the NFC reading module to read the pre-stored unique card identifier in the NFC card. Step S2: Query the card-scene mapping table in the storage module according to the card's unique identifier to obtain the content theme corresponding to the current card and the total number of scenes N under the theme, initialize the scene index Idx to 0, and control the display screen to load and display the content of the Idx-th scene; Step S3: Real-time acquisition of the A-phase pulse signal and B-phase pulse signal output by the rotary encoder, and determination of the direction of the user's rotation operation based on the phase difference between the A-phase pulse signal and the B-phase pulse signal; Step S4: Generate a direction coefficient D based on the determined rotation direction, calculate the target scene index based on the number of rotation steps, and control the display screen to switch to the target scene for display; Step S5: Continuously monitor the card presence signal in the card slot. When a card is detected to be removed, clear the current scene index and control the display screen to return to the standby interface or display a prompt message.

[0016] Furthermore, step S2 specifically includes: The storage module pre-stores a card-scene mapping table, which includes a card UID field, a theme name field, a total number of scenes N field, and a scene content data pointer field. The main control module matches the card UID read from the mapping table using a hash lookup algorithm. If the match is successful, the scene content data corresponding to the card is loaded into the memory buffer; if the match fails, the display screen is controlled to display the message "Unrecognized card".

[0017] Furthermore, the determination of the rotation direction in step S3 specifically includes: Let A(t) be the A-phase signal sequence acquired within the sampling period, and B(t) be the B-phase signal sequence. Define the direction determination function. :

[0018] in, This represents the XOR operation. This represents the number of pulse sampling points within the sampling period. when When the rotation is clockwise, the direction coefficient is determined to be... ; when When the rotation is counterclockwise, the direction coefficient is determined to be... ; when When this occurs, it is determined that there is no effective rotation, and the direction coefficient is... ; Simultaneously, the main control module also performs anti-shake processing: setting an anti-shake threshold. When the duration of continuous effective pulses is greater than The direction determination result is valid only when the specified time is reached.

[0019] Furthermore, the calculation of the target scene index in step S4 specifically includes: Set the base step size And preset speed threshold and maximum step size ; Real-time calculation of the rotational angular velocity of the operating knob The angular velocity It is calculated based on the number of valid pulses detected per unit time. when At that time, actual step size ; when At that time, the actual step size is calculated according to the following acceleration formula:

[0020] in, The preset angular velocity step gradient constant, This is the floor function; The target scene index is calculated using the following core formula. :

[0021] in, Index of the currently displayed scene. This represents the total number of scenes under the current card theme. Direction coefficient; The main control module controls the display screen to load and display the index. The scene content, and update the current scene index to ; when and At that time, or when and When the main control module determines that the scene boundary has been reached, it controls the status indicator light to flash to alert the user.

[0022] Furthermore, the card removal process in step S5 also includes a breakpoint memory function: The storage module includes a non-volatile storage area. When the main control module detects that a card has been removed, it automatically records the card's unique identifier (UID) and the currently viewed scene index. And the current timestamp, and store it in the non-volatile storage area in the form of key-value pairs; When the same card is inserted again, the main control module first checks whether there is a historical record of the UID in the non-volatile storage area. If it exists and the timestamp of the record is within a preset validity period, the module will proceed accordingly. If the record expires or does not exist, it will automatically redirect to the scene index in the history to continue browsing; if the record has expired or does not exist, it will start from the initial scene. The presentation begins.

[0023] Furthermore, it also includes the knob pressing interaction steps: The main control module monitors the push-button status of the rotary encoder in real time; When the push switch is detected to be pressed briefly once, the main control module controls the display screen to switch between the overview view and the details view of the current scene, or controls the voice output module to play the audio narration of the current scene; When it is detected that the push switch has been pressed for more than a preset time. At this time, the main control module will take a screenshot of the current scene content and save it, or send the current scene information to an external terminal device through the communication interface.

[0024] Compared with the prior art, the present invention has the following advantages and beneficial effects: (1) Insert card and display, one touch to access: Users only need to insert the NFC card with the pre-set content into the card slot, and the device will automatically recognize the card and retrieve the corresponding scene content to display on the screen. There is no need for cumbersome menu navigation or mobile phone scanning operation, which realizes the zero threshold and immediacy of content acquisition, greatly reducing the user's learning cost and usage burden.

[0025] (2) Physical knobs for precise blind operation: An incremental rotary encoder is used as the scene navigation control. Users can move to the next scene by rotating it clockwise and return to the previous scene by rotating it counterclockwise. The interaction logic is intuitive. The inherent tactile feedback of the rotary encoder provides clear physical feedback. Users can complete the operation without looking at the knob. It is especially suitable for scenarios that require attention, such as exhibitions and teaching. It effectively improves the inherent defects of pure touch screen operation that rely on visual feedback.

[0026] (3) Variable speed navigation, efficient browsing: This invention proposes an adaptive stepping algorithm based on rotational angular velocity. When the user rotates slowly, fine browsing of each scene is achieved. When rotating quickly, multiple scenes are automatically switched. This takes into account both fine browsing and fast positioning, avoiding the tedious operation of repeated rotation when there are many scenes, and significantly improving browsing efficiency.

[0027] (4) Breakpoint memory, seamless continuation of browsing: The device automatically records the current browsing scene position when the card is removed. When the same card is inserted again, browsing can continue from the point of interruption without having to start from the beginning. This provides users with a smooth and continuous information acquisition experience, which is especially suitable for time-segmented and fragmented usage scenarios.

[0028] (5) Simple structure and strong scalability: Each functional module of this invention adopts mature standardized components, with high integration and controllable cost, and has good industrialization prospects. The display theme can be quickly switched by changing NFC cards with different content, which is suitable for various scenarios such as exhibition explanation, product display, teaching and training, and information query, and has good versatility and scalability. Attached Figure Description

[0029] Figure 1 This is a schematic diagram of the overall structure of the interactive device of the present invention; Figure 2 This is a circuit module connection block diagram of the interactive device of the present invention; Figure 3 This is a schematic diagram of the A / B phase pulse signals and direction determination principle of the rotary encoder of the present invention; Figure 4 This is a flowchart of the overall control method of the present invention. Detailed Implementation

[0030] The present invention will be further described in detail below with reference to experimental examples and specific embodiments. However, this should not be construed as limiting the scope of the above-mentioned subject matter of the present invention to the following embodiments; all technologies implemented based on the content of the present invention fall within the scope of the present invention.

[0031] Example 1 like Figure 1 As shown, the present invention provides an interactive device based on NFC and rotational encoding, one specific structure of which includes a device housing 100. The housing 100 is generally in the shape of a flat rectangular parallelepiped, and its front side is provided with a card slot 101, a display screen 102 and an operation knob 103.

[0032] The card slot 101 is a flat, open slot located at the bottom of the housing 100. Its opening width is adapted to the width of a standard NFC card (such as an ISO / IEC 14443 Type A standard card), which is approximately 54 mm. The slot depth is approximately two-thirds of the card length (approximately 55 mm) to facilitate user insertion and removal.

[0033] The NFC reading module 104 is located directly below the card slot 101, mounted flush against the bottom of the slot, with its sensing antenna facing inwards. The NFC reading module 104 uses a 13.56MHz card reader chip (such as NXP PN532 or RC522 models) that supports the ISO / IEC 14443A / B protocol, with an effective sensing distance designed to be 3 to 8 centimeters, ensuring the card remains within a stable sensing area after full insertion.

[0034] The display screen 102 is a 5-inch TFT color LCD screen with a resolution of 800×480 pixels. It is located in the upper half of the front of the housing 100 and is used to display the content screen corresponding to the card to the user.

[0035] The operation knob 103 is located on the right side of the front of the housing 100, between the display screen 102 and the card slot 101, allowing the user to rotate it with one hand while viewing the screen. The surface of the operation knob 103 is provided with anti-slip texture for easy gripping and application of force.

[0036] like Figure 2 As shown, the device housing 100 also houses a main control circuit board, which integrates a main control module 105 (using an STM32F407 series ARM Cortex-M4 microcontroller), a storage module 106 (containing a 2MB SPI Flash memory for storing scene content data), and a power supply module 107 (using 5V / 2A DC power supply and a built-in 3.7V / 2000mAh lithium battery as backup power). All of these modules are electrically connected via printed circuits on the circuit board.

[0037] In this embodiment, when the user inserts the NFC card 108 into the card slot 101, the NFC reading module 104 reads the card information and transmits it to the main control module 105. The main control module 105 retrieves the corresponding content from the storage module 106 and displays it on the display screen 102. The user can switch between different scenes by rotating the operation knob 103.

[0038] Example 2: As described in Embodiment 1, the rotary encoder is installed inside the housing 100, with its rotating shaft extending from the surface of the housing 100. The operating knob 103 is fixedly installed at the end of the rotating shaft. The rotary encoder used in this embodiment is an incremental mechanical rotary encoder (such as the EC11 series), which has the following structural and signal characteristics: The rotary encoder has three signal lines output from its output terminals: phase A output terminal, phase B output terminal, and a common terminal (ground). When the user rotates the operating knob 103, the grating or brush contacts inside the rotary encoder rotate with the shaft, generating two pulse signals at the phase A output terminal and the phase B output terminal respectively. Figure 3 As shown, the phase difference between the two signals is always 90 degrees (i.e., one-quarter of a cycle), and: When the operating knob 103 is rotated clockwise, the rising edge of phase A signal leads the rising edge of phase B signal (i.e., phase A phase leads phase B phase by 90 degrees). Figure 3 The waveform on the left side of the middle section is shown; When the operating knob 103 is rotated counterclockwise, the rising edge of the B-phase signal leads the rising edge of the A-phase signal (i.e., the B-phase phase leads the A-phase phase by 90 degrees). Figure 3 The waveform on the right side is shown.

[0039] The main control module 105 is connected to the A-phase output terminal and the B-phase output terminal respectively through the general purpose input / output (GPIO) pins, and uses the encoder interface mode of the timer to count and determine the direction of the two pulse signals.

[0040] In addition, the rotary encoder also integrates a push-switch function. This push-switch is located at the bottom of the rotary encoder's shaft. When the user presses the operation knob downwards along the axial direction, the contacts of the push-switch close, sending a low-level trigger signal to the main control module. When the user releases the knob, the push-switch returns to the open state under the action of a reset spring.

[0041] In this embodiment, when the user presses the operation knob 103, the main control module 105 responds to the trigger signal and controls the display screen 102 to display the details page of the current scene or controls the voice module to play the narration audio of the current scene.

[0042] Example 3: As described in Embodiment 1, a card placement detection sensor is provided on the inner bottom wall of the card slot 101. The sensor uses a miniature micro switch (such as the Omron SS-5GL type), and its actuating part protrudes from the inner surface of the card slot by about 0.5mm.

[0043] The common terminal of the micro switch is connected to the positive terminal of the power supply, and its normally open contact is connected to a GPIO pin of the main control module, with a pull-down resistor. When no card is inserted into the card slot 101, the micro switch is in the open state, and the GPIO pin is at a low level. When the user pushes the NFC card 108 into the card slot 101 to the bottom, the front edge of the card touches and presses the actuating part of the micro switch, causing the micro switch to close, and the GPIO pin changes from low level to high level.

[0044] The main control module 105 continuously monitors the level of the GPIO pin. When a rising edge from low to high is detected (i.e., the card is inserted), the main control module 105 determines that the card is in place, and then generates a trigger signal to start the NFC reading module 104 to perform the card reading operation. The advantages of this scheme are: it avoids the NFC reading module 104 from being in a continuous card-searching state for a long time, reducing device power consumption (especially in battery-powered mode); at the same time, it can prevent reading failures caused by reading the card before it is fully inserted, thus improving the recognition success rate.

[0045] In other variant embodiments, the card placement detection sensor can also be a photoelectric reflective sensor (such as the ITR20001 / T type), which determines whether the card is inserted in place by detecting changes in the intensity of light reflected from the card surface. Its principle is similar to the aforementioned micro switch scheme, and both fall within the protection scope of this invention.

[0046] Example 4: As described in Embodiment 1, a status indicator light is provided on the upper right corner of the front of the device housing 100. This status indicator light uses RGB tri-color LED beads (common cathode), and the brightness of its red, green, and blue channels is controlled by the three PWM output pins of the main control module 105, which can realize 256 levels of grayscale adjustment and multiple color mixing.

[0047] The main control module 105 controls the status indicator light to display different colors according to different working states, and the specific correspondence is shown in the table below:

[0048] Meanwhile, a voice output module 500 is provided on the back or side of the device housing 100. This voice output module includes a voice synthesis chip (such as a SYN6288 Chinese voice synthesis chip), a power amplifier, and a miniature speaker (8Ω / 1W). The voice synthesis chip communicates with the main control module 105 through a UART serial interface. After receiving text data sent by the main control module 105, it synthesizes it into a voice signal and drives the speaker to broadcast it.

[0049] In the specific work process: When the card is successfully recognized and the scene content is loaded, the main control module 105 controls the voice output module to broadcast the title of the current scene, such as "Welcome to visit, the current exhibit is a blue and white porcelain vase"; When the user rotates the knob clockwise to switch to the next scene, the voice output module announces "Scene 2" or the title of the new scene; When the user rotates the knob counterclockwise to return to the previous scene, the voice output module announces "Return to previous scene"; When a user attempts to continue switching forward but has reached the last scene, the status indicator light flashes orange, and the voice output module announces "The last scene has been reached."

[0050] With the combination of the aforementioned status indicators and voice broadcasts, users can obtain sufficient visual and auditory feedback during operation, making it especially suitable for use in scenarios such as museums and exhibition halls where quiet is required but it is inconvenient for users to observe the screen.

[0051] Example 5: like Figure 4 As shown, the overall flow of the control method of the present invention includes the following steps: Step S1 (Card Detection and Recognition): The main control module 105 continuously monitors the output level of the card insertion detection sensor in the card slot 101 via a GPIO pin. When a rising edge from low to high is detected (i.e., the card is inserted), the main control module 105 sends a card reading command to the NFC reading module 104. The NFC reading module 104 transmits a 13.56MHz carrier signal through its antenna to activate the inserted NFC card 108 and reads the unique identifier (UID, 4 or 7 bytes long) from the card using the ISO / IEC 14443A protocol. After successful reading, the NFC reading module 104 transmits the UID data to the main control module 105 via the SPI interface.

[0052] Step S2 (Content Loading and Display): After receiving the UID, the main control module 105 uses the UID as the key to search the card-scene mapping table in the storage module 106 using a hash lookup algorithm (see Example 6). If the search is successful, it obtains the content theme name, the total number of scenes N, and the storage address pointer of the scene content data corresponding to the current card. The main control module 105 then makes a judgment: if N=0 or the pointed-to scene data area is empty, it controls the display screen 102 to display the prompt message "Current card has no content" and maintains a standby state. Otherwise, it initializes the scene index Idx to 0, reads the content data (including images, text, etc.) of the 0th scene from the storage address pointer, decompresses and renders it, and displays it on the display screen 102.

[0053] Step S3 (Determining the direction of rotation operation): The main control module 105 uses the encoder interface mode of the timer to acquire the A-phase and B-phase pulse signals output by the rotary encoder in real time. By detecting the phase difference between the A-phase and B-phase (see Example 7 for the specific determination algorithm), it determines whether the user's current rotation direction is clockwise, counterclockwise, or no valid operation.

[0054] Step S4 (Scene Switching Control): Based on the direction coefficient D determined in step S3 (clockwise D=+1, counterclockwise D=-1), and the actual step amount k calculated based on the current rotation speed of the knob (see Example 8 for the specific calculation method), the formula is used. Calculate the target scene index and control the display screen 102 to switch to the target scene for display.

[0055] Step S5 (Card Removal Process): The main control module 105 continuously monitors the voltage level of the card arrival detection sensor. When a falling edge (high to low) is detected (i.e., the card is removed), it first reads the current card's UID and the current scene index. And save it to a temporary register; then, if breakpoint memory is configured, save the UID and Write to the non-volatile storage area (see Example 9 for details); finally, clear the current scene index and scene data in the memory buffer, control the display screen 102 to clear the screen and switch to the standby interface (displaying a preset background image or the prompt text "Please insert card").

[0056] like Figure 4 As shown, the N=0 judgment branch in step S2 is marked with a dashed box to highlight the handling logic for abnormal situations. A loop feedback structure is used between steps S3 and S4, indicating that during card insertion, the main control module 105 continuously monitors the rotation operation and responds to every knob action of the user.

[0057] Example 6: In this embodiment, the storage module 106 pre-stores a card-scene mapping table. This mapping table is stored using an array structure, with each record corresponding to an authorized NFC card and containing the following fields:

[0058] The mapping table has a maximum of 256 records, and each record has a fixed length of 48 bytes (including field alignment padding), occupying a total of approximately 12KB of storage space.

[0059] After the main control module 105 obtains the card UID from the NFC reading module 104 (assumed to be 0x040xA30x7B0x120x450x890xEF), it executes the following hash lookup process: (1) Concatenate the 7-byte UID into a 56-bit integer Key; (2) Calculate the hash value: Hash=Key%TableSize, where TableSize is the record capacity of the mapping table (i.e., 256). (3) Using the hash value as the starting index, perform a linear probing search in the mapping table: if the UID recorded at the index matches the target UID, the search is successful; if the record at the index is empty (UID is all 0), the search fails; if the UID does not match, increment the index by 1 and continue searching until a matching record is found or an empty record is encountered.

[0060] After a successful search, the main control module 105 reads the scene_count field from the record to obtain the total number of scenes N, and reads the data_pointer field to obtain the starting address for storing the scene data. Then, it loads the scene content in the continuous data area pointed to by that address into the memory buffer. If no matching UID record is found after traversing the entire mapping table, it is determined to be an unauthorized card. The main control module 105 controls the display screen 102 to display the prompt message "Unidentified card, please replace with a valid card", and at the same time controls the status indicator light to flash red (see Example 4).

[0061] In other variant embodiments, binary tree search or direct index table or other equivalent table lookup methods can be used instead of hash search, all of which fall within the protection scope of this invention.

[0062] Example 7: This embodiment describes in detail the process of determining the direction of rotation.

[0063] In an incremental rotary encoder, two contacts (corresponding to phase A and phase B) sequentially contact and disconnect with the common pole during rotation, generating two rectangular wave pulse signals. For example... Figure 3 As shown in the waveform on the left, when rotating clockwise, the relationship between phase A (upper waveform) and phase B (lower waveform) is as follows: within each pulse cycle, the rising edge of phase A occurs while phase B is still at a high level, meaning the rising edge of phase A leads the falling edge of phase B by a quarter of a cycle, which manifests as phase A leading phase B by 90 degrees. Figure 3 As shown in the waveform on the right, when rotating counterclockwise, the rising edge of phase B leads the falling edge of phase A by a quarter of a cycle, meaning that phase B leads phase A by 90 degrees.

[0064] However, due to the elastic collision effect of the mechanical contacts, the actual output waveform will produce multiple "bouncing" near the level transition edge (i.e., the level repeatedly jumps high-low-high in a short period of time). If the bouncing is not processed, the main control module 105 will misjudge a single mechanical step as multiple pulses, resulting in repeated scene switching.

[0065] To address this issue, the main control module 105 in this embodiment performs the following anti-jitter processing: The main control module 105 sets the anti-jitter delay Tdebounce = 5ms in the GPIO interrupt service routine (this value is determined by actual measurement of the contact bounce time of the selected encoder EC11, usually 3-10ms). When a level transition is detected at either end of phase A or phase B, the interrupt of that pin is immediately disabled, and a 5ms timer is started. After 5ms, the current level value of the pin is reread and compared with the level value before the transition. If the two level values ​​are the same (e.g., both are high), the transition is counted as a valid transition; if the two level values ​​are different (indicating that the transition within 5ms is jitter), it is determined to be an interference pulse and filtered out, and the interrupt flag is not cleared. The anti-jitter processing is performed in the interrupt service routine of each phase level transition. During the anti-jitter period, the interrupt of that pin is temporarily disabled; subsequently, within the timed sampling period, the main control module synchronously acquires the confirmed valid level. The two are pipelined, with the anti-jitter processing taking precedence over the sampling process.

[0066] After obtaining stable A-phase and B-phase signals, the direction determination logic is as follows: Defined within the sampling period (the sampling period is fixed at 10ms, meaning that the two signals are synchronously acquired once every 10ms), the logic value of the acquired phase A signal is... The logic value of phase B signal is The logic value "1" corresponds to a high level, and the logic value "0" corresponds to a low level.

[0067] Construct a direction determination function:

[0068] The physical meaning of this formula is: only at moments when the voltage levels of phase A and phase B differ (XOR is 1), the difference between the two is accumulated. Combined with... Figure 3 As shown in the waveform relationship, when rotating clockwise (left waveform), in each " Within the range of " and ,therefore The sum is positive. When rotating counterclockwise (right waveform), in each " Within the range of " and ,therefore The sum of all digits is negative. When the knob is stationary or has not been effectively rotated, there is no pulse input, and the sum is zero. .

[0069] Main control module 105 according to The sign of the direction coefficient is determined by: Clockwise ; It is counterclockwise. ; It has no rotation.

[0070] In the actual test of this embodiment, after adopting the above-mentioned anti-shake processing and direction determination algorithm, the number of direction misjudgments was 0 in 1000 consecutive mechanical stepping operations, and the scene switching accuracy reached 100%, which is far better than the control group without anti-shake processing (misjudgment rate of about 8.7%).

[0071] Example 8: This embodiment describes an acceleration navigation mechanism based on rotation speed.

[0072] In practical use cases, if a user needs to quickly jump from scene 1 to scene 20, switching only one scene at a time would require rotating 20 units, resulting in low operational efficiency. Therefore, this embodiment introduces a speed-adaptive step mechanism, dynamically adjusting the number of scene jumps corresponding to each rotation based on the angular velocity of the user's rotation knob.

[0073] The rotary encoder outputs a complete set of A / B quadrature pulse signals for each rotation of a positioning segment (i.e., a mechanical scale step; in this embodiment, an EC11 encoder is used, with 20 segments per revolution, each segment corresponding to an 18-degree mechanical rotation angle). The main control module 105 counts each received complete set of pulses as one valid operation, corresponding to the basic step size. This means jumping to one scene.

[0074] The specific implementation is as follows: The main control module 105 uses a timer capture function to measure the time interval between two consecutive valid pulses output by the rotary encoder in real time. According to the formula Calculate instantaneous angular velocity (in "pulses / second"), this formula is similar to... The expression is equivalent to (let) (That's all). To smooth out noise, a moving average filter is used: the arithmetic mean of the last 5 measurements is taken as the current angular velocity. .

[0075] The following parameters are preset: Speed ​​threshold (pulses / second), meaning that when the user rotates less than 5 steps per second, it is considered a slow operation; Angular velocity step gradient constant (pulses / second), meaning that for every 3 pulses / second increase in speed, the step size increases by 1; Maximum step size This means that you can jump to a maximum of 5 scenes at a time to prevent skipping a large amount of content due to accidental rapid scrolling.

[0076] when When the browser is in slow browsing mode, the actual step size is determined to be... This enables detailed browsing of each scene.

[0077] when When the system is in fast navigation mode, the acceleration is calculated according to the following formula:

[0078] For example: When the user When rotating at a speed of (pulses / second), the acceleration is That is, each rotation of a paragraph jumps to 2 scenes; when At (pulses / second), the acceleration is ; when The maximum step size is reached at (pulses / second). .

[0079] After obtaining the current orientation coefficient D (obtained from Example 7) and the actual step size Then, the target scene index is calculated using the following core formula:

[0080] in, The index of the currently displayed scene (initial value is 0). This represents the total number of scenes under the current card theme.

[0081] Taking N=30 as an example, if the user is currently in the scene Rotating clockwise at a moderate speed, we calculate k=2 and D=+1. The screen jumps from scene 5 to scene 7, skipping scene 6, with the content of scene 6 quickly passing by but not being displayed.

[0082] If the user is in the scenario If the clockwise rotation continues rapidly (D=+1, k=3), then... The index is limited to the maximum value N-1=29, meaning it stops at the last scene. At this point, the main control module 105 determines that the right boundary of the scene has been reached, the control status indicator 400 flashes orange twice, and a voice announcement is made saying "The last scene has been reached" (see Example 4), prompting the user that they cannot continue forward.

[0083] If the user is in the scenario If the clock rotates counterclockwise (D=-1), then... The index is limited to 0, stopping at scene 0. At the same time, the status indicator 400 flashes orange twice, and the voice announces "The starting scene has been reached".

[0084] The state transition relationship for accelerated navigation is as follows: the horizontal axis represents the user's rotation speed ω, and the vertical axis represents the actual step size k and the speed threshold. A step change in the step size occurs at the point, reaching Step saturation is .

[0085] Example 9: This embodiment describes the scene memory when the card is removed and the breakpoint resume function when it is reinserted.

[0086] The storage module 106 includes a non-volatile storage area (using a portion of a W25Q64 SPI Flash chip, with a capacity of 64KB, of which 2KB is allocated as a dedicated breakpoint memory area). This storage area stores data in key-value pair format, and the data structure of each record is as follows:

[0087] This storage area can store breakpoint records for up to 50 cards at the same time. When this limit is exceeded, the earliest record is discarded using a first-in-first-out (FIFO) strategy.

[0088] When the main control module 105 detects that a card has been removed via the card placement detection sensor (triggered by a falling edge), the following breakpoint recording process is executed: (1) Read the UID of the current card and the index of the current scene. ; (2) Obtain the current system timestamp (via the RTC real-time clock module); (3) Using UID as the key, search in the non-volatile storage area to see if a record with that UID already exists: If it exists, update the last_index and timestamp fields of the record; if it does not exist, create a new record, fill in the above three fields, and set valid_flag to 0x5A. (4) Write the updated data into the corresponding page of the Flash chip via SPI instruction.

[0089] To avoid the flash memory cells from being worn out due to frequent erasures and rewrites, this embodiment employs a circular storage strategy. Fifty recording slots are allocated in the dedicated breakpoint memory area, and each write operation rotates to the next slot, achieving wear leveling. Furthermore, write operations are only performed when the scene index has actually changed compared to the last record, avoiding unnecessary writes when the same card is repeatedly inserted and removed.

[0090] When the same card is inserted again, the main control module 105 executes the following breakpoint continuation process: (1) Read the card UID and check if a record of the UID exists in the non-volatile storage area; (2) If no record exists, or if the valid_flag in the queried record is not equal to 0x5A, then the display will start from the initial scene Idx=0; (3) If a valid record exists, read its timestamp field and compare it with the current system time: If the current time - timestamp ≤ Tvalid (the default validity period is 7 days, i.e. 604800 seconds), the record is considered valid. The main control module 105 automatically sets the scene index to the last_index value in the record and starts displaying content from that scene. If more than 7 days have passed, the record is considered to have expired. The record is ignored, and the display starts from the initial scene Idx=0. The record is updated with the new access time (i.e., the validity period is refreshed).

[0091] The breakpoint memory function in this embodiment performed well in actual testing. Taking a museum visit scenario as an example, if a visitor inserts an exhibit card at 10:00 AM and browses to scenario 12, then leaves for some reason and removes the card; if the visitor inserts the same card again at 2:00 PM, the device automatically continues the display from scenario 12, without requiring the visitor to flip through the previous 12 scenarios, significantly improving the continuity of the exhibition experience.

[0092] The complete timing logic of the breakpoint memory function is as follows: Card insertion → browsing → card removal → record breakpoint → reinsertion → read record → jump to breakpoint.

[0093] Example 10: This embodiment describes in detail the press interaction function of the operation knob 103.

[0094] As described above (see Embodiment 2), the bottom of the rotary encoder 200 integrates a push switch 201, whose switch signal output terminal is connected to a GPIO pin of the main control module 105 (configured as an external interrupt rising edge / falling edge trigger mode).

[0095] The main control module 105 records the duration Tpress of the button switch 201 being pressed via a timer, and sets the following time threshold: Short press detection thresholds: Tshort_min=50ms, Tshort_max=800ms; Long press to determine the threshold: .

[0096] The specific interaction logic is as follows: (1) Short press operation ( ): When the main control module 105 detects that the push switch has been released (triggered by rising edge), if If the area is within the short press range, execute the short press response: First, determine if the current scene contains details page data (by checking the `has_detail` flag in the scene data structure, which is preset during content creation). If `has_detail` equals true, control the display screen 102 to switch from the current view to the details view (e.g., switching from a panoramic view of the exhibit to a magnified view of a local detail, or from a brief description to a full text description). If the user presses the knob again briefly, the view returns to the overview view, thus switching between the overview and details views.

[0097] If has_detail=false (i.e., no details page is set for the current scene), the voice output module 500 is controlled to play the narration audio for the current scene. The narration audio file is pre-stored in the storage module 106 and stored in association with the scene content data (file format is MP3, sampling rate is 16kHz). The main control module 105 decodes the audio through an audio decoding chip (such as VS1053) and plays it through the speaker.

[0098] It's important to note that the short-press function has the following priority: "Details switching takes precedence over voice playback." This means that as long as a details page exists, a short press will always trigger a view switch without playing the voice message; only when a details page does not exist will a short press trigger voice playback. This avoids interference and resource conflicts caused by having two feedback methods running simultaneously.

[0099] (2) Long press operation ( ): When the main control module 105 continuously monitors that the push switch 201 has been pressed for 2000ms (without waiting for release), it immediately triggers a long press response: The first mode (default): The main control module 105 takes a screenshot of the content currently displayed on the screen 102 and saves it. The screenshot data (resolution 800×480, RGB565 format, 16 bits per pixel, approximately 750KB) is compressed into JPEG and stored in the file system (FATFS file system) of the storage module 106 with the file name "UID_timestamp.jpg" for later export and viewing by the user.

[0100] The second mode (requires prior configuration): The main control module 105 packages the scene index, scene title, scene description text, and screenshots of the current scene into a JSON format data packet and sends it to an external terminal device (such as a guide service desk computer, a visitor's smartphone APP, etc.) via a wired communication interface (USB-C interface, supporting virtual serial port protocol) or a wireless communication module (optional ESP8266Wi-Fi module or BLE Bluetooth module) for remote viewing or printing.

[0101] In practice, users can long-press the knob to save the exhibits they are interested in, eliminating the need for additional photography equipment and greatly facilitating data collection.

[0102] The complete state transition relationship of the press interaction is as follows: Idle state → Short press (Overview state ↔ Details state) → Release and return to idle state; Idle state → Long press (Screenshot state / Send state) → Return to idle state after completion.

[0103] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An interactive device based on NFC and rotational encoding, characterized in that, include: The device housing has a card slot. An NFC reading module is disposed in or near the card slot and is used to read the card identification information stored in the NFC card inserted into the card slot. A rotary encoder, mounted on the housing, includes an operation knob for user operation, and outputs an electrical signal containing rotation direction information and rotation step number information in response to the user's rotation operation; A display screen is disposed on the surface of the housing and is used to display content images; The storage module is used to store the mapping relationship data between card identifiers and content scenes, as well as the scene content data of each scene; The main control module is electrically connected to the NFC reading module, the rotary encoder, the display screen, and the storage module, respectively. It is used to retrieve the corresponding content scene from the storage module according to the card identification information, and control the display screen to switch scenes in response to the electrical signal of the rotary encoder. The power supply module is used to supply power to the above modules.

2. The interactive device based on NFC and rotational encoding according to claim 1, characterized in that, The rotary encoder is an incremental rotary encoder, which outputs A-phase pulse signals and B-phase pulse signals with a phase difference of 90° at its output end; the rotary encoder also integrates a push switch, and when the push switch is triggered, the main control module controls the display screen to display the details page of the current scene or controls the voice module to play the narration audio of the current scene.

3. The interactive device based on NFC and rotational encoding according to claim 1, characterized in that, The card slot is equipped with a card placement detection sensor, which is electrically connected to the main control module. When the card placement detection sensor detects that a card has been inserted, it sends a trigger signal to the main control module. The main control module responds to the trigger signal by activating the NFC reading module to perform a reading operation.

4. The interactive device based on NFC and rotational encoding according to claim 1, characterized in that, The device housing is also equipped with a status indicator light and a voice output module; the main control module controls the status indicator light to display different colors when the card is successfully recognized, the scene is loaded, and the scene switching boundary is reached, and controls the voice output module to broadcast the scene title or scene number of the current scene.

5. A control method employing the interactive device as described in any one of claims 1-4, characterized in that, Includes the following steps: Step S1: Monitor the card insertion signal in the card slot. When the insertion of a card is detected, activate the NFC reading module to read the pre-stored unique card identifier in the NFC card. Step S2: Query the card-scene mapping table in the storage module according to the unique identifier of the card to obtain the content theme corresponding to the current card and the total number of scenes N under the theme, initialize the scene index Idx to 0, and control the display screen to load and display the content of the Idx-th scene; Step S3: Real-time acquisition of the A-phase pulse signal and B-phase pulse signal output by the rotary encoder, and determination of the direction of the user's rotation operation based on the phase difference between the A-phase pulse signal and the B-phase pulse signal; Step S4: Generate a direction coefficient D based on the determined rotation direction, calculate the target scene index based on the number of rotation steps, and control the display screen to switch to the target scene for display; Step S5: Continuously monitor the card presence signal in the card slot. When a card is detected to be removed, clear the current scene index and control the display screen to return to the standby interface or display a prompt message.

6. The control method according to claim 5, characterized in that, Step S2 specifically includes: The storage module pre-stores a card-scene mapping table, which includes a card UID field, a theme name field, a total number of scenes N field, and a scene content data pointer field. The main control module matches the card UID read from the mapping table using a hash lookup algorithm. If the match is successful, the scene content data corresponding to the card is loaded into the memory buffer; if the match fails, the display screen is controlled to display the message "Unrecognized card".

7. The control method according to claim 5, characterized in that, The determination of the rotation direction in step S3 specifically includes: Let A(t) be the A-phase signal sequence acquired within the sampling period, and B(t) be the B-phase signal sequence. Define the direction determination function. : ; in, This represents the XOR operation. This represents the number of pulse sampling points within the sampling period. when When the rotation is clockwise, the direction coefficient is determined to be... ; when When the rotation is counterclockwise, the direction coefficient is determined to be... ; when When this occurs, it is determined that there is no effective rotation, and the direction coefficient is... ; Simultaneously, the main control module also performs anti-shake processing: setting an anti-shake threshold. When the duration of continuous effective pulses is greater than The direction determination result is valid only when the specified time is reached.

8. The control method according to claim 7, characterized in that, The calculation of the target scene index in step S4 specifically includes: Set the base step size And preset speed threshold and maximum step size ; Real-time calculation of the rotational angular velocity of the operating knob The angular velocity It is calculated based on the number of valid pulses detected per unit time. when At that time, actual step size ; when At that time, the actual step size is calculated according to the following acceleration formula: ; in, The preset angular velocity step gradient constant, This is the floor function; The target scene index is calculated using the following core formula. : ; in, Index of the currently displayed scene. This represents the total number of scenes under the current card theme. Direction coefficient; The main control module controls the display screen to load and display the index. The scene content, and update the current scene index to ; when and At that time, or when and When the main control module determines that the scene boundary has been reached, it controls the status indicator light to flash to alert the user.

9. The control method according to claim 5, characterized in that, The card removal process in step S5 also includes a breakpoint memory function: The storage module includes a non-volatile storage area. When the main control module detects that a card has been removed, it automatically records the card's unique identifier (UID) and the currently viewed scene index. And the current timestamp, and store it in the non-volatile storage area in the form of key-value pairs; When the same card is inserted again, the main control module first checks whether there is a historical record of the UID in the non-volatile storage area. If it exists and the timestamp of the record is within a preset validity period, the module will proceed accordingly. If the record expires or does not exist, it will automatically redirect to the scene index in the history to continue browsing; if the record has expired or does not exist, it will start from the initial scene. The presentation begins.

10. The control method according to claim 5, characterized in that, It also includes the knob press interaction steps: The main control module monitors the push-button status of the rotary encoder in real time; When the push switch is detected to be pressed briefly once, the main control module controls the display screen to switch between the overview view and the details view of the current scene, or controls the voice output module to play the audio narration of the current scene; When it is detected that the push switch has been pressed for more than a preset time. At this time, the main control module will take a screenshot of the current scene content and save it, or send the current scene information to an external terminal device through the communication interface.