Rotary key identification method and device, electronic equipment and program product

By setting an infrared transceiver device on the button body of electronic devices and utilizing the amplitude characteristics of the reflected infrared signal in the color-coded area of ​​the encoder disk, the product model of the rotary button can be identified. This solves the problem of limited compatibility of rotary buttons in existing technologies and enables accurate identification and flexible interaction of various rotary buttons.

CN121996087APending Publication Date: 2026-05-08XIAOLULAISI TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAOLULAISI TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2026-01-09
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing electronic devices are only compatible with one type of rotary button, resulting in insufficient interaction flexibility and an inability to adapt to multiple rotary buttons.

Method used

By installing an infrared transceiver on the button body of an electronic device, and utilizing the amplitude characteristics of the reflected infrared signals from different color coding areas of the encoder disk, the product model of the rotary button can be identified. This includes analyzing the reflected signals and processing the encoded data to determine the model of the rotary button.

Benefits of technology

It achieves accurate recognition of various rotary buttons, reduces production costs, improves the flexibility and accuracy of interaction, and avoids coding errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121996087A_ABST
    Figure CN121996087A_ABST
Patent Text Reader

Abstract

The invention discloses a rotary key identification method and device, electronic equipment and a program product, and the method comprises the steps: controlling an infrared receiving and transmitting device to transmit an infrared signal, and obtaining a target reflection signal received by the infrared receiving and transmitting device; analyzing the target reflection signal, and determining each target signal amplitude included in the target reflection signal; identifying first target signal amplitudes corresponding to the first coding areas in the target signal amplitudes, and identifying codes of the target coding areas corresponding to second target signal amplitudes between two adjacent first target signal amplitudes by taking the first target signal amplitudes as interval marks so as to obtain coded data corresponding to the target reflection signals; the target coding region comprises a second coding region or a third coding region; and determining the product model of the rotary key according to the coded data. According to the application, the product model of the installed rotary key can be accurately identified, so that the rotary key can be adapted to various rotary keys, and the flexibility of interaction by using the rotary key is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to a method, device, electronic device, and program product for recognizing rotary buttons. Background Technology

[0002] Currently, some electronic devices (such as game consoles and controllers) are equipped with rotary buttons. Rotary buttons, with their continuously adjustable operation and intuitive features, are more advantageous in interactive scenarios requiring fine-tuning or continuous input, providing users with a more novel and accurate operating experience. However, electronic devices typically only support one type of rotary button, resulting in less flexible interaction. Summary of the Invention

[0003] This application discloses a method, device, electronic device, and program product for identifying rotary buttons. The electronic device can accurately identify the product model of the installed rotary buttons, thereby adapting to various rotary buttons and improving the flexibility of interaction using rotary buttons.

[0004] The first aspect of this application discloses a method for recognizing a rotary button, applied to an electronic device. The electronic device includes a device body, on which a button body is disposed. The button body is used to mount a rotary button, and the button body is provided with an infrared transceiver device for emitting infrared signals and receiving reflected signals of the infrared signals reflected by the rotary button. The rotary button includes an encoding disk disposed on the side of the rotary button near the button body. The encoding disk includes multiple first encoding areas, multiple second encoding areas, and multiple third encoding areas. The multiple first encoding areas are spaced apart, and a second encoding area or a third encoding area is provided between two adjacent first encoding areas. The first encoding areas, second encoding areas, and third encoding areas are different colors. The method includes: Control the infrared transceiver to transmit infrared signals and acquire the target reflection signals received by the infrared transceiver; The target reflection signal is analyzed to determine the amplitude of each target signal contained in the target reflection signal; The first target signal amplitude corresponding to the first coding region is identified among the various target signal amplitudes, and the first target signal amplitude is used as an interval marker. The coding of the target coding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes is identified to obtain the coded data corresponding to the target reflected signal; the target coding region includes the second coding region or the third coding region. The product model of the rotary button is determined based on the encoded data.

[0005] In some possible embodiments, analyzing the target reflected signal to determine the amplitudes of the various signals contained in the target reflected signal includes: The target reflection signal is analyzed to obtain the amplitude values ​​of each initial signal contained in the target reflection signal; The initial signal amplitudes are processed in reverse to obtain the target signal amplitudes corresponding to the initial signal amplitudes.

[0006] In some possible embodiments, the first coding region is black, the second coding region is gray, and the third coding region is white; The step of identifying the first target signal amplitude corresponding to the first coding region among the various target signal amplitudes, and using the first target signal amplitude as an interval marker, and identifying the coding of the target coding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes, includes: The target signal amplitude that is the peak among the various target signal amplitudes is determined as the first target signal amplitude corresponding to the first coding region; If the amplitude of the second target signal is a trough between two adjacent amplitudes of the first target signal, and the absolute value of the amplitude of the second target signal is greater than the first threshold, then the amplitude of the second target signal is converted into the first code corresponding to the second coding area. If the amplitude of the second target signal is a trough between two adjacent amplitudes of the first target signal, and the absolute value of the amplitude of the second target signal is less than the second threshold, then the amplitude of the second target signal is converted into the second code corresponding to the third coding region; the first threshold is greater than the second threshold.

[0007] In some possible embodiments, determining the product model of the rotary button based on the encoded data includes: Identify the starting encoded data contained in the encoded data; The first encoded data following the initial encoded data is compared with multiple pre-stored target encoded data, and different target encoded data correspond to different product models of the rotary button. If the first encoded data is detected to match any target encoded data, the product model corresponding to the matched target encoded data is taken as the product model of the rotary button.

[0008] In some possible embodiments, the infrared transceiver includes a first infrared transceiver module and a second infrared transceiver module. The first infrared transceiver module is located in the projection area on the key body corresponding to the center of the first encoding area when the encoding disk is stationary. The second infrared transceiver module is located in the projection area on the key body corresponding to the boundary between the first encoding area and the second encoding area when the encoding disk is stationary. The step of acquiring the target reflection signal received by the infrared transceiver includes: The first target reflection signal received by the first infrared transceiver module is acquired, and the second target reflection signal received by the second infrared transceiver module is acquired. The method further includes: The rotation direction of the rotary button is determined by analyzing the reflection signals of the first target and the second target. Determining the product model of the rotary button based on the encoded data includes: The product model of the rotary button is determined based on the encoded data and the rotation direction.

[0009] In some possible embodiments, the device body is further provided with a display screen; after determining the product model of the rotary button based on the encoded data, the method further includes: Based on the product model of the rotary button, obtain the control instruction set corresponding to the rotary button. The control instruction set includes control instructions corresponding to one or more rotation operation information of the rotary button. And / or, Based on the product model of the rotary button, the corresponding product function and / or product attributes are displayed on the screen.

[0010] In some possible embodiments, the button body is further provided with one or more LED beads, the light emission direction of the one or more LED beads is towards the rotary button, and the light emitted by the one or more LED beads can pass through the rotary button; After determining the product model of the rotary button based on the encoded data, the method further includes: Based on the target reflection signal received by the infrared transceiver, the rotation information of the rotary button is determined, and the rotation information includes rotation speed and / or rotation direction; Based on the rotation information, light emission parameters are determined, including one or more of light emission color, light emission brightness, and light emission frequency; Control the one or more LEDs to operate according to the light emission parameters.

[0011] A second aspect of this application discloses a rotary button recognition device applied to an electronic device. The electronic device includes a device body, on which a button body is disposed. The button body is used to mount a rotary button. The button body is provided with an infrared transceiver device, which is used to emit infrared signals and receive reflected signals of the infrared signals reflected by the rotary button. The rotary button includes an encoding disk, which is disposed on the side of the rotary button close to the button body. The encoding disk includes multiple first encoding areas, multiple second encoding areas, and multiple third encoding areas. The multiple first encoding areas are spaced apart, and a second encoding area or a third encoding area is provided between two adjacent first encoding areas. The first encoding areas, second encoding areas, and third encoding areas are different colors. The recognition device for the rotary button includes: The signal acquisition module is used to control the infrared transceiver to emit infrared signals and to acquire the target reflection signals received by the infrared transceiver. The signal analysis module is used to analyze the target reflection signal and determine the amplitude of each target signal contained in the target reflection signal; The encoding module is used to identify the first target signal amplitude corresponding to the first encoding region among the various target signal amplitudes, and to identify the encoding of the target encoding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes, using the first target signal amplitude as an interval marker, so as to obtain the encoded data corresponding to the target reflected signal; the target encoding region includes the second encoding region or the third encoding region; The model identification module is used to determine the product model of the rotary button based on the encoded data.

[0012] A third aspect of this application discloses an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to implement the method described in any of the above embodiments.

[0013] A fourth aspect of this application discloses a computer program product comprising a computer program that, when executed by a processor, causes the processor to perform the method described in any of the above embodiments.

[0014] In this embodiment, the electronic device has a button body on its main body. The button body is used to mount a rotary button and is equipped with an infrared transceiver. The infrared transceiver is used to emit infrared signals and receive reflected signals from the rotary button. The rotary button includes an encoding disk, which includes multiple first encoding areas, multiple second encoding areas, and multiple third encoding areas. The multiple first encoding areas are spaced apart, and a second encoding area or a third encoding area is provided between two adjacent first encoding areas. The first, second, and third encoding areas are different colors. The electronic device controls the infrared transceiver to emit infrared signals and acquires the target reflected signals received by the infrared transceiver. It analyzes the target reflected signals to determine the amplitude of each target signal contained in the target reflected signals. The electronic device identifies the first target signal amplitude corresponding to the first encoding area among each target signal amplitude and uses the first target signal amplitude as an interval marker. It identifies the encoding of the target encoding area corresponding to the second target signal amplitude between two adjacent first target signal amplitudes to obtain the encoding data corresponding to the target reflected signal. The electronic device determines the product model of the rotary button based on the encoding data.

[0015] By analyzing and encoding the amplitude of the target reflected signal received by the infrared transceiver, the product model can be identified, reducing the difficulty of identifying the product model of the rotary button. At the same time, it eliminates the need for identification chips and other markings, reducing the production cost of the rotary button. Furthermore, since multiple first coding zones are set at intervals, the amplitude of the first target signal corresponding to the first coding zone can be used as an interval marker to accurately identify the code of the target coding zone corresponding to the amplitude of the second target signal between two adjacent first target signal amplitudes. This provides a more accurate and clearer reference guide for locating the target coding zone by using the amplitude of the first target signal as a reference, effectively avoiding coding errors caused by confusion of target signal amplitudes corresponding to multiple coding zones, and improving the accuracy of identifying the product model of the rotary button. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1A A schematic diagram of an electronic device with a rotary button provided in an embodiment of this application; Figure 1B A cross-sectional view of the button body and rotary button provided in the embodiments of this application; Figure 1C This is a schematic diagram of the structure of the rotary button provided in an embodiment of this application; Figure 1D This is a schematic diagram of the structure of the encoding disk provided in an embodiment of this application; Figure 1E This is a schematic diagram of the structure of the button body and the rotary button provided in the embodiments of this application; Figure 2 A flowchart illustrating a method for recognizing a rotary button, as provided in an embodiment of this application; Figure 3 A schematic diagram of the waveform of the target reflection signal after reverse processing, provided in an embodiment of this application; Figure 4 This is a flowchart illustrating the process of obtaining coded data corresponding to the target reflection signal, provided in an embodiment of this application. Figure 5 A flowchart for determining the product model of the rotary button provided in this application embodiment; Figure 6A This is a schematic diagram of the waveforms of the first target reflection signal and the second target reflection signal under clockwise rotation, provided in an embodiment of this application. Figure 6B This is a schematic diagram of the waveforms of the first target reflection signal and the second target reflection signal under counterclockwise rotation provided in an embodiment of this application; Figure 7 A flowchart for controlling one or more LEDs to operate according to luminous parameters is provided for embodiments of this application; Figure 8 A structural block diagram of a rotary button recognition device provided in an embodiment of this application; Figure 9 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0020] Furthermore, "at least one" refers to one or more, while "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c can be single or multiple.

[0021] Figure 1A This is a schematic diagram of an electronic device with a rotary button, provided as an embodiment of this application. Figure 1A As shown, the electronic device 100 may include a device body 101, on which a button body 102 is provided. For example, the button body 102 may be provided on both sides of the device body 101. The button body 102 is used to install a rotary button 103, and an infrared transceiver is provided in the button body 102. The infrared transceiver is used to transmit infrared signals and receive reflected signals of infrared signals reflected by the rotary button 103.

[0022] In some embodiments, electronic device 100 may be a game console, wearable device, smart home device, audio playback device (such as a speaker), in-vehicle device, or other device equipped with rotary buttons 103 for parameter adjustment or interactive control. For example, electronic device 100 may be such as Figure 1A The game console shown.

[0023] In some embodiments, a display screen 104 may also be provided on the main body 101 of the device, which is used to display various images and information during the operation of the electronic device 100.

[0024] Figure 1B This is a cross-sectional view of the button body and rotary button provided in an embodiment of this application. Figure 1B As shown, the button body 102 may include a shaft hole portion 1021, a circuit board 1022 and a trigger structure 1023, and the rotary button 103 may include a rotating shaft portion 1031, a main body portion 1032 and a magnetic suction component 1033.

[0025] In some embodiments, the pivot portion 1031 of the rotary button 103 is configured to be inserted into the shaft hole portion 1021 for detachable installation on the button body 102, and the main body portion 1032 is rotatably disposed on the pivot portion 1031. The main body portion 1032 is configured to rotate relative to the pivot portion 1031 when the pivot portion 1031 is inserted into the shaft hole portion 1021 or when the pivot portion 1031 is disengaged from the shaft hole portion 1021.

[0026] In some embodiments, the rotating shaft portion 1031 of the rotary button 103 is hollow, and the magnetic member 1033 is disposed in the hollow portion of the rotating shaft portion 1031. The magnetic member 1033 is configured to be magnetically connected to the button body 102 when the rotating shaft portion 1031 is inserted into the shaft hole portion 1021.

[0027] In some embodiments, the trigger structure 1023 of the button body 102 is disposed on the circuit board 1022, and the trigger structure 1023 is connected to the circuit board 1022 through conductive contacts. When the rotating shaft portion 1031 of the rotary button 103 is inserted into the shaft hole portion 1021, the rotary button 103 can drive the rotating shaft portion 1031 to move to trigger the trigger structure 1023 when the user performs the first operation. The trigger structure 1023 conducts the circuit on the circuit board 1022 through conductive contacts. When the user stops performing the first operation on the rotary button 103, the trigger structure 1023 resets, causing the circuit on the circuit board 1022 to disconnect. Therefore, the electronic device 100 can identify whether the user has performed the first operation on the rotary button 103 based on the conduction state of the circuit on the circuit board 1022.

[0028] For example, the first operation may include actions such as pushing or pressing. Pushing may refer to the action of the user applying a pushing force in the radial direction of the pivot portion 1031, and pressing may refer to the action of the user applying pressure toward the button body 102 in the axial direction of the pivot portion 1031.

[0029] Figure 1C This is a schematic diagram of the structure of a rotary button provided in an embodiment of this application. Figure 1C As shown, the rotary button 103 includes an encoder disk 105, which is located on the side of the rotary button 103 near the button body 102. The encoder disk 105 is circular and is coaxially arranged with the rotating shaft 1031 of the rotary button 103.

[0030] Figure 1D This is a schematic diagram of the structure of the encoding disk provided in an embodiment of this application. Figure 1DAs shown, the encoding disk 105 includes multiple first encoding areas 1051, multiple second encoding areas 1052, and multiple third encoding areas 1053. The multiple first encoding areas 1051 are spaced apart, and a second encoding area 1052 or a third encoding area 1053 is provided between two adjacent first encoding areas 1051. The first encoding areas 1051, second encoding areas 1052, and third encoding areas 1053 are different colors.

[0031] It should be noted that, since different colored coding areas have different reflectivities of infrared signals, the signal amplitude of the reflected signal of the same infrared signal reflected by different colored coding areas is not the same. The darker the color of the coding area (that is, the larger the gray value of the color of the coding area, the closer it is to pure black), the smaller the signal amplitude corresponding to that coding area. Therefore, the signal amplitudes corresponding to different colored coding areas are not the same. The electronic device 100 can determine the color of the coding area corresponding to the signal amplitude based on the signal amplitude of the reflected signal, thereby obtaining the coding area corresponding to the signal amplitude.

[0032] Furthermore, since multiple first coding areas 1051 are spaced apart, and a second coding area 1052 or a third coding area 1053 is provided between two adjacent first coding areas 1051, and the signal amplitudes corresponding to different colored coding areas are not the same, during the rotation of the coding disk 105, it will pass through the detection range of the infrared transceiver in a cyclic sequence of "first coding area - second coding area or third coding area - first coding area". This allows the reflected signal received by the infrared transceiver to exhibit a periodic amplitude change of "high-low-high" or "low-high-low", forming a clearly distinguishable peak and trough feature. This helps the electronic equipment to more accurately identify the coding area corresponding to each signal amplitude based on the peak and trough features.

[0033] Signal amplitude refers to the intensity of a reflected signal. For example, signal amplitude is typically characterized by voltage value, and signal amplitude is positively correlated with voltage value.

[0034] In some embodiments, different coding areas have the same area size. It should be noted that a uniform area size setting ensures that the signal acquisition time of each coding area remains consistent during the rotation of the coding disk 105 by the infrared transceiver, avoiding sampling deviations of reflected signals caused by differences in area size, thereby improving the accuracy and precision of the infrared transceiver in detecting reflected signals under the high-speed rotation of the coding disk 105, and effectively reducing the bit error rate.

[0035] Figure 1E This is a schematic diagram of the button body and rotary button provided in an embodiment of this application. Figure 1EAs shown, the button body 102, the rotary button 103 and the encoder disk 105 are coaxially arranged. The infrared transceiver device 106 is disposed on the housing of the button body 102 facing the rotary button 103, and the infrared transceiver device 106 is correspondingly arranged with the annular encoder disk 105.

[0036] During the rotation of the rotary button 103, the infrared transceiver 106 continuously emits a stable infrared signal, and the infrared signal is perpendicularly irradiated onto the coaxially rotating encoder disk 105. The same infrared signal is reflected by the different colored coding areas on the encoder disk 105, forming reflected signals with different signal amplitudes. The infrared transceiver 106 can receive the various reflected signals continuously reflected during the rotation of the encoder disk 105 in real time.

[0037] In some embodiments, the infrared transceiver 106 may include an infrared transmitting unit and an infrared receiving unit. The infrared transmitting unit is used to transmit infrared signals to the rotary button 103, and the infrared receiving unit is used to receive the reflected signals of the infrared signals reflected by the rotary button 103. The infrared transmitting unit and the infrared receiving unit are coaxially arranged with the encoder disk 105.

[0038] Infrared signals can include infrared light within a specific wavelength range. The wavelength range of infrared light can be set according to actual needs; for example, the wavelength range of infrared light can be the near-infrared band of 780 nanometers to 850 nanometers, or the wavelength range of infrared light can be the near-infrared band of 850 nanometers to 940 nanometers.

[0039] When the infrared signal is infrared light, the infrared emitting unit can be a light-emitting diode (LED) used to emit infrared light. For example, the infrared emitting unit can be a near-infrared LED operating in the wavelength range of 780 nanometers to 850 nanometers to emit infrared light in this band.

[0040] The infrared receiving unit can be an infrared receiving diode. Based on the photoelectric effect, the infrared receiving diode converts the reflected signal from the encoder disk 105 into an analog electrical signal. The electronic device 100 can perform analog-to-digital conversion on the analog electrical signal to obtain a digital electrical signal (usually a voltage value), thereby determining the amplitude of each signal contained in the reflected signal. Optionally, the infrared receiving unit can also be an infrared receiving transistor, but it is not limited to this.

[0041] Optionally, the infrared transmitting unit and the infrared receiving unit can be integrated into one infrared transceiver device 106, or the infrared transmitting unit and the infrared receiving unit can be set separately, without specific limitations.

[0042] In some embodiments, the infrared transceiver device 106 may include a first infrared transceiver module 1061 and a second infrared transceiver module 1062, and each infrared transceiver module may include an infrared emitting unit and an infrared receiving unit corresponding to the infrared emitting unit.

[0043] The first infrared transceiver module 1061 is positioned in the projection area on the button body 102 corresponding to the center of the first encoding area 1051 when the encoder disk 105 is stationary. The second infrared transceiver module 1062 is positioned in the projection area on the button body 102 corresponding to the boundary between the first encoding area 1051 and the second encoding area 1052 when the encoder disk 105 is stationary. The angle between the positions of the first and second infrared transceiver modules 1061 and the center of the circle is 90 degrees. When the encoder disk 105 rotates clockwise, the second encoding area 1052 enters the detection range of the second infrared transceiver module 1062 first; when the encoder disk 105 rotates counterclockwise, the first encoding area 1051 enters the detection range of the second infrared transceiver module 1062 first. Therefore, the phase difference between the reflected signal received by the first infrared transceiver module 1061 and the reflected signal received by the second infrared transceiver module 1062 is 90 degrees (i.e., one-quarter of a cycle).

[0044] Optionally, the second infrared transceiver module 1062 can also be set at the intersection of the first encoding area 1051 and the third encoding area 1053 on the corresponding projection area on the key body 102 when the encoder disk 105 is stationary, and the angle between the position of the first infrared transceiver module 1061 and the position of the second infrared transceiver module 1062 and the center of the circle remains unchanged at 90 degrees.

[0045] In some embodiments, such as Figure 1E As shown, the button body 102 is also provided with one or more LED beads 107. The one or more LED beads 107 can be disposed inside the button body 102. The light emission direction of the one or more LED beads 107 is towards the rotary button 103, and the light emitted by the one or more LED beads 107 can pass through the rotary button 103.

[0046] In some embodiments, the rotary button 103 may have a first light-transmitting portion, and the button body 102 may have a second light-transmitting portion. The second light-transmitting portion is configured to allow light from one or more LED beads 107 to pass through. When the rotating shaft portion 1031 is inserted into the shaft hole portion 1021, the second light-transmitting portion is at least partially corresponding to the first light-transmitting portion of the rotary button 103, so that light emitted by one or more LED beads 107 can be transmitted to the first light-transmitting portion.

[0047] As one implementation method, such as Figure 1C and Figure 1EAs shown, the rotary button 103 may also have a first cover portion 1034 and a second cover portion 1035, and the first cover portion 1034 and the second cover portion 1035 may be made of transparent material or translucent material. The first cover portion 1034 and the second cover portion 1035 may serve as a first light-transmitting portion. When one or more LED beads 107 are running, the light emitted by one or more LED beads 107 can pass through the first cover portion 1034 and the second cover portion 1035.

[0048] Figure 2 A flowchart illustrating a method for recognizing a rotary button according to an embodiment of this application. Figure 2 As shown, the method may include the following steps: Step 202: Control the infrared transceiver to transmit infrared signals and acquire the target reflection signals received by the infrared transceiver.

[0049] In some embodiments, when the infrared transceiver includes multiple infrared transceiver modules, the electronic device can control the multiple infrared transceiver modules to transmit infrared signals and acquire the target reflection signal received by each infrared transceiver module.

[0050] For example, when an infrared transceiver includes a first infrared transceiver module and a second infrared transceiver module, the electronic device can control the first and second infrared transceiver modules to simultaneously transmit infrared signals and acquire the target reflection signal received by each infrared transceiver. The first and second infrared transceiver modules can transmit the same infrared signal or different infrared signals (e.g., different wavelength ranges), without specific limitations.

[0051] In some embodiments, the electronic device may acquire the target reflection signal received by the infrared transceiver, and then filter and amplify the target reflection signal to obtain a processed target reflection signal. Unless otherwise specified, the target reflection signal mentioned below refers to the processed target reflection signal.

[0052] Step 204: Analyze the target reflection signal to determine the amplitude of each target signal contained in the target reflection signal.

[0053] In one implementation, the electronic device can analyze the waveform corresponding to the target transmitted signal to determine the amplitude of each target signal contained in the waveform corresponding to the target reflected signal, as well as the amplitude type corresponding to each target signal amplitude.

[0054] The amplitude type can include peak type or trough type. A peak can refer to the local maximum value point in the waveform corresponding to the target reflected signal, and a trough can refer to the local minimum value point in the waveform corresponding to the target reflected signal.

[0055] In some embodiments, step 204 may include the following steps: analyzing the target reflection signal to obtain the amplitude values ​​of each initial signal contained in the target reflection signal; and performing reverse processing on each initial signal amplitude value to obtain the target signal amplitude value corresponding to each initial signal amplitude value.

[0056] Reverse processing can refer to inverting the amplitude of the initial signal. For example, for... Inverting the initial signal amplitude yields the target signal amplitude corresponding to that initial signal amplitude. Fu.

[0057] Furthermore, when the color of the first coding area is darker than the colors of the second and third coding areas, that is, when the grayscale value of the color of the first coding area is greater than the grayscale value of the colors of the second and third coding areas, the electronic device can analyze the target reflection signal, obtain the amplitude values ​​of each initial signal contained in the target reflection signal, and the electronic device can perform reverse processing on each initial signal amplitude to obtain the target signal amplitude corresponding to each initial signal amplitude.

[0058] It should be noted that because the color of the first coding area is darker than that of the second and third coding areas, the initial signal amplitude corresponding to the first coding area is smaller than that corresponding to the second and third coding areas. When multiple first coding areas are spaced apart, and a second or third coding area is placed between two adjacent first coding areas, the initial signal amplitude corresponding to the first coding area typically exhibits a trough characteristic in the waveform of the target reflected signal, while the initial signal amplitude corresponding to the second and third coding areas typically exhibits a peak characteristic. Therefore, electronic devices can identify the coding areas corresponding to each peak or trough characteristic by recognizing these peak or trough characteristics in the target reflected signal.

[0059] However, because the lighter-colored second and third coding areas are more susceptible to external light (especially when the LEDs on the button are running), the size and position of the peaks can change to some extent. In some cases, a second or third coding area may correspond to multiple peaks, which can affect the accuracy of identifying each coding area. Therefore, it is necessary to reverse the initial signal amplitude so that the target signal amplitude corresponding to the darker-colored and more interference-resistant first coding area presents a peak feature. This allows for more accurate identification of each coding area using the target signal amplitude corresponding to the first coding area.

[0060] Figure 3This is a schematic diagram of the waveform of the target reflection signal after inversion processing, provided in an embodiment of this application. With the first coding region being black, the second coding region being gray, and the third coding region being white, and the black first coding regions being spaced out, after inverting each initial signal amplitude, as shown... Figure 3 As shown, the target signal amplitude 301, which has a peak amplitude and the largest amplitude, corresponds to the black first coding area; the target signal amplitude 302, which has a trough amplitude and the smaller amplitude, corresponds to the gray third coding area; and the target signal amplitude 303, which has a trough amplitude and the smallest amplitude, corresponds to the white second coding area.

[0061] It should be noted that, since the infrared light emitted by the infrared emitting unit is not an ideal point source, but rather a circular spot with a certain diameter, as the encoding disk rotates, the coverage area of ​​the circular spot gradually transitions from one encoding area to an adjacent encoding area. The difference in reflectivity between different encoding areas causes the intensity of the overall reflected signal of the spot to change continuously. Therefore, the intensity of the target reflected signal is as follows: Figure 3 The wave shown exhibits a continuous linear gradual change trend, rather than an ideal square wave with a step-like abrupt change.

[0062] Through the above implementation method, the weak reflection signal of the dark coding area can be effectively converted into significant peak features, improving its recognizability in signal processing, thereby improving the accuracy of subsequent coding recognition.

[0063] In some embodiments, the electronic device may determine whether a rotary button is mounted on a button body based on the amplitude of each target signal contained in the target reflected signal.

[0064] If the amplitude of each target signal is greater than the preset amplitude threshold, the electronic device can determine that the rotary button is installed on the button body; if the amplitude of each target signal is not greater than the preset amplitude threshold, the electronic device can determine that the rotary button is not installed on the button body.

[0065] The amplitude threshold can be determined based on the signal amplitude of each encoding area at the distance between the rotary button and the button body.

[0066] Understandably, when the rotary button is mounted on the button body, the infrared signal emitted by the infrared emitter will be reflected by the encoder disk. Due to the small distance between the rotary button and the button body, the amplitude of each target signal is usually large. However, when the rotary button is not mounted on the button body, the reflected signal may be infrared noise formed by reflections from objects in the external environment, and the signal amplitude is usually much smaller than the preset amplitude threshold. Therefore, by comparing the amplitude of each target signal with the preset amplitude threshold, the electronic device can determine whether the rotary button is mounted on the button body.

[0067] Alternatively, the electronic device can also determine that the rotary button is not installed on the button body if it does not receive a target reflection signal.

[0068] Optionally, the electronic device also includes a Hall element, which is disposed within the button body and corresponds to the magnetic attraction component of the rotary button. The electronic device can determine whether the rotary button is mounted on the button body by comparing the magnetic induction intensity detected by the Hall element with a preset intensity threshold.

[0069] Since the rotary button is magnetically attached to the button body, the Hall element can detect a strong magnetic induction intensity when the rotary button is magnetically attached to the button body. The electronic device can determine that the current magnetic induction intensity is greater than a preset intensity threshold, thereby determining that the rotary button is installed on the button body.

[0070] In some embodiments, the electronic device may perform subsequent steps upon detecting the installation process of the rotary button. The installation process of the rotary button can be detected by whether a sudden change occurs in the target reflection signal.

[0071] Optionally, the electronic device may respond to the user's first operation during the rotation of the rotary button and continue to perform subsequent steps.

[0072] Furthermore, the electronic device can stop performing subsequent steps if it determines that the rotary button is not installed on the button body.

[0073] Step 206: Identify the first target signal amplitude corresponding to the first coding region, and use the first target signal amplitude as the interval marker to identify the coding of the target coding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes, so as to obtain the coding data corresponding to the target reflection signal.

[0074] The target coding region includes a second coding region or a third coding region.

[0075] In some embodiments, the electronic device may encode the amplitude of a second target signal between two adjacent amplitudes of a first target signal, and determine the encoded data corresponding to the target reflection signal based on the encoding corresponding to the second encoding area and / or the third encoding area.

[0076] It is understandable that the multiple first coding regions set at intervals are mainly used to provide reference marks in the waveform of the target reflected signal, so that the waveform characteristics of the second target signal amplitude corresponding to the target coding region are more obvious and accurate, which helps to more accurately divide the boundaries corresponding to each coding region, thereby reducing the bit error rate and improving the accuracy of the coded data. Moreover, compared with the method of encoding the first coding region, the second coding region and the third coding region, the method of encoding only the second coding region and the third coding region is simpler and helps to reduce the complexity of implementing the encoding in electronic devices.

[0077] In some embodiments, the electronic device may identify the first target signal amplitude corresponding to the first coding region from each target signal amplitude of the target reflected signal after reverse processing, and identify the coding of the target coding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes using the first target signal amplitude as an interval marker, so as to obtain the coded data corresponding to the target reflected signal.

[0078] In one implementation, the first coding area is black, the second coding area is gray, and the third coding area is white. Figure 4 This is a flowchart illustrating the process of obtaining coded data corresponding to the target reflection signal, as provided in an embodiment of this application. Figure 4 As shown, step 206 may include steps 402 to 406.

[0079] Step 402: Determine the target signal amplitude that is the peak among the various target signal amplitudes as the first target signal amplitude corresponding to the first coding area.

[0080] After reverse processing, the signal amplitude of the first coding region, which is black, is the largest and will show obvious peak characteristics. The signal amplitude of the third coding region, which is white, and the signal amplitude of the second coding region, which is gray, are smaller than the signal amplitudes of the two adjacent first coding regions, showing trough characteristics. Therefore, after acquiring the amplitude of each target signal, the electronic device can match the peak target signal amplitude with the first coding region and the trough target signal amplitude with the target coding region.

[0081] In some embodiments, the electronic device may identify the target signal amplitude that is a peak among the various target signal amplitudes according to the peak detection technology, and determine the target signal amplitude whose absolute value is greater than a third threshold among the multiple target signal amplitudes that are peaks as the first target signal amplitude corresponding to the first coding region.

[0082] The third threshold can be set based on the color of the first encoding area.

[0083] If the second and third coding regions are disturbed by external signals, multiple small peaks may form in the second and third coding regions. Therefore, it is necessary to compare the absolute value of the target signal amplitude with the third threshold to eliminate small peaks caused by signal disturbance, thereby improving the accuracy of the first coding region identification.

[0084] In some embodiments, the electronic device may determine the target signal amplitude that is a trough between two adjacent first target signal amplitudes as the second target signal amplitude corresponding to the target coding region.

[0085] If there are multiple target signal amplitudes that are troughs between two adjacent first target signal amplitudes, the electronic device can determine the smallest target signal amplitude among the multiple target signal amplitudes that are troughs as the second target signal amplitude corresponding to the target coding area.

[0086] Step 404: If the amplitude of the second target signal between two adjacent first target signal amplitudes is a trough, and the absolute value of the second target signal amplitude is greater than the first threshold, then the amplitude of the second target signal is converted into the first code corresponding to the second coding area.

[0087] Step 406: If the amplitude of the second target signal between two adjacent amplitudes of the first target signal is a trough, and the absolute value of the amplitude of the second target signal is less than the second threshold, then the amplitude of the second target signal is converted into the second code corresponding to the third coding area.

[0088] The first threshold is greater than the second threshold, and both the first and second thresholds can be set according to the colors of the second and third coding regions respectively. Before reverse processing, the initial signal amplitude of the white third coding region is greater than the initial signal amplitude of the gray second coding region. After reverse processing, the second target signal amplitude of the white third coding region is less than the second target signal amplitude of the gray second coding region. Therefore, by using the second threshold and the first threshold which is greater than the second threshold, the second target signal amplitude corresponding to the second coding region and the second target signal amplitude corresponding to the third coding region can be distinguished.

[0089] Electronic devices can pre-store a coding mapping table that corresponds one-to-one between coding zones of various colors and multiple codes. After the electronic device determines the color corresponding to the target coding zone based on the amplitude of the second target signal, it can determine the code corresponding to the amplitude of the second target signal according to the coding mapping table.

[0090] For example, the gray second coding area is preset to "1", and the white third coding area is preset to "0". Figure 3As shown, the electronic device can determine the target signal amplitude 301 with the largest amplitude as the first target signal amplitude corresponding to the black first coding area by using peak detection technology, and compare the target signal amplitude 302, which is a trough between two adjacent target signal amplitudes 301, with the first threshold and the second threshold. If the target signal amplitude 302 is greater than the first threshold, the electronic device can determine that the target signal amplitude 302 corresponds to the gray second coding area and convert the target signal amplitude 302 into the first code "1" corresponding to the second coding area. Similarly, the electronic device can compare the target signal amplitude 303, which is a trough between two adjacent target signal amplitudes 301, with the first threshold and the second threshold. If the target signal amplitude 303 is less than the second threshold, the electronic device can determine that the target signal amplitude 303 corresponds to the white third coding area and convert the target signal amplitude 303 into the second code "0" corresponding to the third coding area.

[0091] In some embodiments, the electronic device may integrate the first code of the second coding region and the second code of the third coding region into the coded data corresponding to the target reflection signal according to the sampling time sequence corresponding to each target signal amplitude.

[0092] For example, in Figure 3 In the waveform diagram shown, the horizontal axis of the waveform diagram has the positive direction of sampling time from left to right. Therefore, the electronic device can integrate the first code "1" of the second coding area and the second code "0" of the third coding area into the coded data "1011010" according to the sampling time sequence corresponding to the target signal amplitudes 301 to 303. According to the above implementation method, in Figure 1D When the third encoding area 1053 before the inner ring notch of the encoding disk 105 is the starting point of the sampling time, the encoded data of the encoding disk 105 rotating one revolution can be "10000000011001100010".

[0093] In other embodiments, the electronic device may identify the first initial signal amplitude corresponding to the first coding region from the initial signal amplitudes of the target reflected signal before reverse processing, and identify the coding of the target coding region corresponding to the second initial signal amplitude between two adjacent first initial signal amplitudes using the first initial signal amplitude as an interval marker, so as to obtain the coded data corresponding to the target reflected signal.

[0094] The electronic device can identify the initial signal amplitude that is a trough among the various initial signal amplitudes based on the trough detection technology, and determine the initial signal amplitude whose absolute value is less than the fourth threshold among the multiple initial signal amplitudes that are troughs as the first initial signal amplitude corresponding to the first coding area.

[0095] If the amplitude of the second initial signal between two adjacent first initial signal amplitudes is a peak, and the absolute value of the second initial signal amplitude is less than the fifth threshold, the electronic device can convert the second initial signal amplitude into the first code corresponding to the second coding area; if the amplitude of the second initial signal between two adjacent first initial signal amplitudes is a peak, and the absolute value of the second initial signal amplitude is greater than the sixth threshold, the second initial signal amplitude can be converted into the second code corresponding to the third coding area.

[0096] Through the above implementation method, the characteristic that the target signal amplitude of the black first coding region after reverse processing is higher than that of the target signal amplitude of the surrounding coding regions can be used to accurately identify the first coding region corresponding to the peak of each target signal amplitude. Using the identified first coding region as the anchor point, based on the amplitude difference between the white third coding region and the gray second coding region after reverse processing, the absolute value of the second target signal amplitude between two adjacent first target signal amplitudes is compared with the first threshold and the second threshold. This can achieve accurate differentiation between the second coding region and the third coding region, improving the accuracy of code recognition.

[0097] Step 208: Determine the product model of the rotary button based on the coding data.

[0098] The electronic device can pre-store target encoding data corresponding to multiple product models of the rotary button. After determining the encoding data corresponding to the target reflection signal according to the above steps, the electronic device can compare the encoding data with the pre-stored multiple target encoding data to determine the product model of the rotary button.

[0099] Figure 5 A flowchart illustrating the process of determining the product model of a rotary button, as provided in an embodiment of this application. Figure 5 As shown, step 208 may include steps 501 to 503.

[0100] Step 501: Identify the starting encoded data contained in the encoded data.

[0101] The electronic device can identify in real time whether the encoded data corresponding to the target reflection signal contains the initial encoded data, and then execute the subsequent steps if the encoded data corresponding to the target reflection signal contains the initial encoded data.

[0102] The starting encoding data refers to the preset encoding sequence in the encoding disk used to mark the starting position of valid encoding. The starting encoding data and the target encoding data together form the encoding data corresponding to the encoding disk. The target encoding data refers to the encoding sequence in the encoding disk used to carry the product model information of the rotary buttons. Encoding disks for rotary buttons of different product models can have the same starting encoding data and different target encoding data.

[0103] For example, Figure 1D The starting encoding data of the encoding disk 105 shown can be "1000000001" and the target encoding data can be "1001100010". Therefore, the electronic device can identify whether the encoding data corresponding to the target reflected signal contains the starting encoding data "1000000001".

[0104] It should be noted that by setting the starting encoding data in the encoding data corresponding to the encoding disk, the starting encoding data can be quickly located in the encoding data corresponding to the target reflection signal. This helps to quickly and accurately extract the first encoding data after the starting encoding data from the encoding data corresponding to the target reflection signal, avoiding the redundant operation of traversing the encoding data corresponding to the target reflection signal to determine the first encoding data, and improving the efficiency and accuracy of determining the product model of the rotary button.

[0105] Step 503: Compare the first encoded data after the initial encoded data in the encoded data with multiple pre-stored target encoded data.

[0106] The electronic device can take the code of the target number after the initial code data as the first code data, and compare each code in the first code data with the code of the corresponding position in the multiple target code data one by one. The target number can be determined according to the total number of codes in the target code data.

[0107] In some embodiments, if the encoded data includes initial encoded data, but the number of codes following the initial encoded data is less than the target number, the electronic device may re-execute step 503 after waiting for a first time period.

[0108] The first time period can be set according to actual needs. For example, the first time period can be determined based on the current rotation speed of the encoder disk. It is understandable that if the number of codes after the initial encoded data is less than the target number, it means the encoder disk has not yet completed a full rotation. Since the target reflected signal is generated in real time as the encoder disk rotates, the corresponding encoded data is also dynamically updated synchronously. Therefore, the electronic device can wait for the first time period, allowing the encoder disk to continue rotating and complete the sampling of the remaining encoded area, thus ensuring that the number of codes after the initial encoded data reaches the target number, forming complete first encoded data. The electronic device then compares the first encoded data with multiple pre-stored target encoded data sets.

[0109] In other embodiments, when the electronic device recognizes that the encoded data contains multiple starting encoded data, the electronic device can compare the first encoded data between two adjacent starting encoded data with multiple pre-stored target encoded data.

[0110] Since the coding areas on the coding disk are arranged in a ring, the coding data corresponding to the target reflected signal should be a loop structure with the start coding data and the target coding data connected end to end. The first coding data between two adjacent start coding data usually corresponds to the target coding data of the coding disk. Therefore, the electronic device can compare the target coding data of the coding disk with multiple pre-stored target coding data to determine the product model of the rotary button corresponding to the target coding data of the coding disk.

[0111] Step 505: If the first encoded data is detected to match any target encoded data, then the product model corresponding to the matched target encoded data is used as the product model of the rotary button.

[0112] For example, the product models of the rotary buttons include Type A, Type B, and Type C. The target encoding data corresponding to the Type A rotary button can be "1001100010", the target encoding data corresponding to the Type B rotary button can be "1101001010", and the target encoding data corresponding to the Type C rotary button can be "1010101001". Therefore, when the electronic device determines that the encoding data corresponding to the target reflected signal is "10000000011001100010", when it recognizes that the starting encoding data contained in the encoding data is "1000000001", it compares the first encoding data "1001100010" after the starting encoding data with the target encoding data corresponding to the above three models pre-stored in the electronic device, and determines that the first encoding data matches the target encoding data of the Type A rotary button, thereby determining that the product model of the rotary button is Type A.

[0113] When the coded data corresponding to the target reflection signal is “100000000110011000101000000001100”, the electronic device can compare the first coded data “1001100010” between two adjacent starting coded data “1000000001” with the target coded data corresponding to the three models that are pre-stored.

[0114] In some embodiments, the electronic device further includes a communication module, through which the electronic device can establish wired or wireless communication connections with external devices such as smartphones, personal computers, and cloud servers. If the electronic device detects that the first coded data does not match any of the multiple target coded data sets, the electronic device can transmit the first coded data to the external device. The external device can then compare the first coded data with the multiple target coded data sets pre-stored in the external device to determine the product model of the rotary button. This is to prevent the electronic device's local target coded database from failing to update the target coded data corresponding to the rotary button's product model in a timely manner, thus preventing the inability to recognize new rotary button models.

[0115] Through the above implementation method, not only can the starting encoded data and the first encoded data after the starting encoded data be quickly located in the encoded data corresponding to the target reflected signal, but also, compared with the traditional method of identifying product models by embedding an identity chip, by comparing the first encoded data after the starting encoded data with the target encoded data corresponding to multiple product models to determine the product model corresponding to the first encoded data and the rotary button, not only can the product model of the rotary button be accurately and efficiently identified without complex signal processing of the target reflected signal, but also without the need to install identity chips or other markings, thus reducing the production cost of the rotary button.

[0116] In some embodiments, the electronic device can determine the product model of the rotary button based on the encoded data corresponding to the target reflected signal and the rotation direction of the rotary button.

[0117] The electronic device can acquire the first target reflection signal received by the first infrared transceiver module and the second target reflection signal received by the second infrared transceiver module; the electronic device can analyze the first target reflection signal and the second target reflection signal to determine the rotation direction of the rotary button; the electronic device can determine the product model of the rotary button based on the encoded data and the rotation direction.

[0118] In one implementation, the electronic device can analyze the reflection signals of the first target and the second target to determine the phase relationship between the reflection signals of the first target and the second target, and determine the rotation direction of the rotary button based on the phase relationship.

[0119] Phase relationships can include phase lead and phase lag. Phase lead means that the phase of the second target reflected signal arrives at the same phase point earlier than the phase of the first target reflected signal, while phase lag means that the phase of the second target reflected signal arrives at the same phase point later than the phase of the first target reflected signal.

[0120] When the phase relationship between the first target reflection signal and the second target reflection signal is phase leading, the electronic device can determine that the rotation direction of the rotary button is clockwise, that is, forward rotation. When the phase relationship between the first target reflection signal and the second target reflection signal is phase lagging, the electronic device can determine that the rotation direction of the rotary button is counterclockwise, that is, reverse rotation.

[0121] Figure 6A This is a schematic diagram of the waveforms of the first target reflection signal and the second target reflection signal under clockwise rotation, provided in an embodiment of this application. Figure 6AAs shown, when the target reflects a larger amplitude signal in the black first coding area, the target signal amplitude is 1. When the target reflects a smaller amplitude signal in the light-colored coding area, the target signal amplitude is 0. The counting is performed once every half-rotation of the coding disk across the coding area. Figure 6A The colored squares represent the black first coded area being within the detection range of each infrared transceiver module. Therefore, when the encoder disk rotates clockwise, the first coded area is within the detection range of the first infrared transceiver module, the first target reflection signal 601 counts as 1, while the second coded area is within the detection range of the second infrared transceiver module, the second target reflection signal 602 counts as 0, and the combined count is 10. As the encoder disk rotates clockwise by half a coded area, the first coded area leaves the detection range of the first infrared transceiver module, and the target coded area enters the detection range of the first infrared transceiver module. The first target reflection signal 601 count changes from 1 to 0, while the second coded area remains within the detection range of the second infrared transceiver module, the second target reflection signal 602 count remains 0, and the combined count is updated to "00". When the encoder disk rotates clockwise by another half a coded area, the target coded area does not leave the detection range of the first infrared transceiver module, while the first coded area begins to enter the detection range of the second infrared transceiver module, and the combined count is updated to "01".

[0122] In summary, the combined counts of the first target reflection signal 601 and the second target reflection signal 602 when the encoder disk rotates clockwise are "10, 00, 01, 11, 10, 00, 01, 11, ...". This indicates that the black first encoding area will enter the detection range of the second infrared transceiver module first. In other words, the phase of the second target reflection signal 602 reaches the same phase point earlier than the phase of the first target reflection signal 601. The phase relationship between the first target reflection signal 601 and the second target reflection signal 602 is phase leading.

[0123] Figure 6B This is a schematic diagram of the waveforms of the first target reflection signal and the second target reflection signal under counterclockwise rotation, provided in an embodiment of this application. Figure 6B As shown, when the encoder disk rotates counterclockwise, the combined counts of the first target reflection signal 601 and the second target reflection signal 602 are "11, 01, 00, 10, 11, 01, 00, 10, ...", indicating that the black first encoding area will enter the detection range of the first infrared transceiver module first. That is, the phase of the second target reflection signal 602 is delayed compared to the phase of the first target reflection signal 601 to reach the same phase point. The phase relationship between the first target reflection signal 601 and the second target reflection signal 602 is phase lag.

[0124] In one implementation, after determining the rotation direction, the electronic device can determine the product model of the rotary button based on the first coded data corresponding to that rotation direction.

[0125] Electronic devices may have a set of forward rotation encoding data and a set of reverse rotation encoding data pre-set. The set of forward rotation encoding data may include the target encoding data for forward rotation corresponding to multiple product models with rotary buttons, and the set of reverse rotation encoding data may include the target encoding data for reverse rotation corresponding to multiple product models with rotary buttons.

[0126] After determining the rotation direction, the electronic device can compare the first encoded data corresponding to that rotation direction with multiple target encoded data included in the forward or reverse encoded data set to determine the product model of the rotary button.

[0127] It is understandable that the encoder usually generates different first encoded data when rotating forward and backward. The first encoded data generated by a product model when rotating forward may be the same as the first encoded data of other product models when rotating backward. If the rotation direction is not distinguished and the data is directly compared with all the target encoded data, it is easy to cause the electronic device to misjudge. Therefore, it is necessary to compare the first encoded data corresponding to the rotation direction with the encoded data set corresponding to the rotation direction to determine the product model of the rotary button.

[0128] For example, the first coded data for forward rotation of the encoder is "1001100010", and the first coded data for reverse rotation is "0100011001". The electronic device can compare the first coded data for forward rotation with "1001100010", or the first coded data for reverse rotation with "0100011001", in the set of reverse coded data to determine the product model of the rotary button.

[0129] Through the above implementation method, the electronic device can determine the product model of the rotary button based on the coded data corresponding to the target reflected signal and the rotation direction of the rotary button. This can avoid the problem of misidentification of the product model caused by the overlap of the coded data when the rotary button rotates forward with the coded data when other product models rotate in reverse, or the overlap of the coded data when the rotary button rotates in reverse with the coded data when other product models rotate forward, thus ensuring the accuracy of the product model identification result of the rotary button.

[0130] In some embodiments, when the infrared transceiver includes a first infrared transceiver module and a second infrared transceiver module, the electronic device can determine the first product model of the rotary button based on the encoded data corresponding to the first target reflection signal of the first infrared transceiver module, and determine the second product model of the rotary button based on the encoded data corresponding to the second target reflection signal of the second infrared transceiver module; the electronic device can compare the first product model with the second product model, and if the first product model and the second product model are the same, then the product model of the rotary button is determined to be the correct product model.

[0131] If the first and second product model numbers differ, the electronic device can repeat the above steps to re-determine the first and second product model numbers. If the new first product model number still differs from the new second product model number, the electronic device can issue an alarm message and / or display a model error message on the screen to remind the user to troubleshoot promptly. Determining the product model number of the rotary button using two infrared transceiver modules helps improve the accuracy of identifying the product model number of the rotary button.

[0132] In this embodiment, the product model is identified by performing amplitude analysis and encoding on the target reflected signal received by the infrared transceiver, reducing the difficulty of identifying the product model of the rotary button. Furthermore, it eliminates the need for identification chips and other markings, lowering the production cost of the rotary button. Since multiple first encoding zones are spaced apart, the amplitude of the first target signal corresponding to each first encoding zone can be used as an interval marker to accurately identify the encoding of the target encoding zone corresponding to the amplitude of the second target signal between two adjacent first target signal amplitudes. This provides a more accurate and clearer reference guide for locating the target encoding zone using the amplitude of the first target signal, effectively avoiding encoding errors caused by confusion of target signal amplitudes corresponding to multiple encoding zones, and improving the accuracy of identifying the product model of the rotary button.

[0133] In some embodiments, after determining the product model of the rotary button based on the encoded data, the electronic device may also obtain a set of control instructions corresponding to the rotary button based on the product model of the rotary button. The set of control instructions includes control instructions corresponding to one or more rotation operation information of the rotary button.

[0134] Rotation operation information can refer to the specific operation information detected and recognized by the electronic device when the user operates the rotation button. One or more rotation operation information may include rotation direction, rotation speed, number of rotations, or rotation-related interactive behaviors.

[0135] It is understandable that the functions and application scenarios of rotary buttons may differ across product models, resulting in different operating modes. Users performing the same rotation operation on rotary buttons of different models may trigger different control commands. Therefore, after determining the product model of the rotary button, the electronic device needs to update the corresponding control command set to ensure that each rotation operation accurately corresponds to the various control commands of the electronic device. This avoids operational failures or mis-triggered functions due to mismatched control commands, thereby improving the user experience.

[0136] In some embodiments, after determining the product model of the rotary button based on the encoded data, the electronic device may also display the product function and / or product attributes corresponding to the rotary button on the display screen based on the product model of the rotary button.

[0137] Product functionality refers to the operations and functions that a rotary button can perform in an electronic device. Product attributes may include the rotary button's size, material, performance parameters, and compatibility information such as the brand and / or model of the electronic devices it is compatible with.

[0138] It is understandable that rotary buttons can have various appearance styles, but the appearance of rotary buttons usually cannot help users quickly understand the product function and / or product attributes of the rotary buttons currently installed on the button body. Therefore, after the product model of the rotary button is determined, the electronic device can control the display screen to display the corresponding product function and / or product attributes of the rotary button, so that users can quickly and intuitively understand the rotary button currently installed on the button body, thereby improving the user experience.

[0139] In some embodiments, the electronic device may pre-store multiple display styles, each corresponding to a different display effect on the screen, and each display style may correspond to a rotary button of a different product model. After determining the product model of the rotary button based on the encoded data, the electronic device may also perform adaptive display on the screen according to the display style corresponding to the product model of the rotary button.

[0140] Display styles may include one or more of the following: primary color scheme, icon style, font type, background texture, and layout of display content.

[0141] For example, when product models are distinguished by color, and the rotary button is a blue model, the rotary button usually has a blue appearance. Therefore, electronic devices can display the product functions and / or product attributes corresponding to the rotary button on the display screen with a blue icon and background and white text, so that the display style of the electronic device is consistent with the appearance of the rotary button, improving the user experience.

[0142] In some embodiments, during the rotation of the rotary button, the electronic device can control the light emission parameters corresponding to each LED to match the rotation information of the encoder disk, thereby improving the user experience. Figure 7 A flowchart illustrating the control of one or more LEDs according to emission parameters provided in this application embodiment. Figure 7 As shown, after determining the product model of the rotary button based on the encoded data, the method may further include the following steps: Step 701: Determine the rotation information of the rotary button based on the target reflection signal received by the infrared transceiver.

[0143] Rotation information includes rotation speed and / or rotation direction. The rotation direction of the rotary button can be determined according to the above-described implementation method, and will not be repeated here.

[0144] In one implementation, the electronic device can obtain the rotation time of the rotary button and determine the rotation angle based on the total number of the first target signal amplitude and the second target signal amplitude corresponding to the target reflected signal, thereby determining the rotation speed of the rotary button based on the rotation time and rotation angle.

[0145] It should be noted that the total number of the first target signal amplitude and the second target signal amplitude corresponding to the target reflected signal corresponds to the number of coded areas already acquired by the infrared transceiver, and... Figure 1D With 40 coding areas in the encoder disk 105 shown, each coding area corresponds to a circumferential angle of 9 degrees. Therefore, the electronic device can directly calculate the angle that the encoder disk has rotated based on the total number of the first target signal amplitude and the second target signal amplitude, and thus determine the rotation speed of the rotary button based on the rotation time and rotation angle.

[0146] In another implementation, when the infrared transceiver includes a first infrared transceiver module and a second infrared transceiver module, the electronic device can obtain the rotation time of the rotary button and determine the rotation angle based on the number of combined counts, thereby determining the rotation speed of the rotary button based on the rotation time and rotation angle.

[0147] Since the combination count is updated every time the encoding disk rotates half of the encoding area, therefore... Figure 1D When the encoder disk 105 shown has 40 encoding areas, it can generate 80 combination counts when it rotates one revolution. The circumferential angle corresponding to each combination count (i.e., each half encoding area) is 4.5 degrees. Therefore, the electronic device can directly calculate the angle that the encoder disk has rotated based on the number of combination counts, and thus determine the rotation speed of the rotary button based on the rotation time and rotation angle.

[0148] It is understandable that the more coding areas a coding disk has, or the denser the coding area division, the smaller the circumferential angle corresponding to each coding area, the higher the accuracy of the electronic device's angle recognition of rotation, and the more accurate the determined rotation angle and rotation speed.

[0149] Step 703: Determine the light emission parameters based on the rotation information.

[0150] The luminescence parameters include one or more of the following: luminescence color, luminescence brightness, and luminescence frequency.

[0151] In one implementation, the electronic device can pre-store the light emission parameters corresponding to multiple target rotation information. After determining the rotation information, the electronic device can compare the rotation information with the multiple target rotation information to obtain the light emission parameters corresponding to the rotation information.

[0152] For example, the electronic device can compare the rotation speed with multiple speed ranges to determine the target speed range in which the rotation speed is located, and obtain the light emission frequency and / or light emission brightness corresponding to the target speed range. And / or, the electronic device can compare the rotation direction with the preset mapping relationship between the direction and the light emission color to determine the light emission color corresponding to the rotation direction.

[0153] For example, when multiple LEDs are arranged in a ring on the encoder disk, the electronic device can determine the lighting order of the LEDs according to the rotation direction. The lighting order of the LEDs can be the same as the rotation direction, and the lighting time interval between two adjacent LEDs can be determined according to the rotation speed. The faster the rotation speed, the shorter the lighting time interval between two adjacent LEDs.

[0154] Optionally, the electronic device can determine the light emission color of one or more LEDs according to the product model of the rotary button. Different product models of the rotary button correspond to different light emission colors. For example, the blue model of the rotary button can correspond to the blue light emission color.

[0155] Optionally, the electronic device may determine the light emission color of one or more LEDs when it detects that the rotary button is installed on the button body. For example, the electronic device may determine that the light emission color of one or more LEDs is white when it detects that the rotary button is installed on the button body, to remind the user that the installation of the rotary button has been completed.

[0156] Optionally, the electronic device can determine the light emission color of one or more LEDs when it detects that a user is operating the rotary button. For example, the electronic device can determine that one or more LEDs are red when it detects that a user is pushing the rotary button, to remind the user that the rotary button is currently being operated.

[0157] Step 705: Control one or more LEDs to operate according to the light emission parameters.

[0158] In this embodiment, the electronic device determines the rotation information of the rotary button based on the target reflection signal received by the infrared transceiver, determines the light emission parameters based on the rotation information, and controls one or more LED beads to operate according to the light emission parameters. Thus, the current rotation status of the rotary button can be intuitively and dynamically fed back to the user through the lighting effects of each LED bead, thereby improving the user's interactive experience.

[0159] Based on the rotary button recognition method provided in the above embodiments, Figure 8 This is a structural block diagram of a rotary button recognition device provided in an embodiment of this application. Figure 8 As shown, in one embodiment, a rotary button recognition device 800 is provided, which includes a signal acquisition module 801, a signal analysis module 802, an encoding module 803, and a model recognition module 804.

[0160] The signal acquisition module 801 is used to control the infrared transceiver to transmit infrared signals and to acquire the target reflection signals received by the infrared transceiver.

[0161] The signal analysis module 802 is used to analyze the target reflection signal and determine the amplitude of each target signal contained in the target reflection signal.

[0162] The encoding module 803 is used to identify the first target signal amplitude corresponding to the first encoding area among the various target signal amplitudes, and to identify the encoding of the target encoding area corresponding to the second target signal amplitude between two adjacent first target signal amplitudes, so as to obtain the encoding data corresponding to the target reflected signal; the target encoding area includes the second encoding area or the third encoding area.

[0163] The model identification module 804 is used to determine the product model of the rotary button based on the encoded data.

[0164] In some embodiments, the signal analysis module 802 is further configured to analyze the target reflection signal, obtain each initial signal amplitude contained in the target reflection signal, and perform reverse processing on each initial signal amplitude to obtain the target signal amplitude corresponding to each initial signal amplitude.

[0165] In some embodiments, the encoding module 803 is further configured to determine the target signal amplitude that is a peak among the various target signal amplitudes as the first target signal amplitude corresponding to the first encoding region; if the second target signal amplitude between two adjacent first target signal amplitudes is a trough and the absolute value of the second target signal amplitude is greater than a first threshold, then the second target signal amplitude is converted into the first code corresponding to the second encoding region; if the second target signal amplitude between two adjacent first target signal amplitudes is a trough and the absolute value of the second target signal amplitude is less than a second threshold, then the second target signal amplitude is converted into the second code corresponding to the third encoding region; the first threshold is greater than the second threshold.

[0166] In some embodiments, the model identification module 804 is further configured to identify the starting code data contained in the code data; compare the first code data following the starting code data in the code data with a plurality of pre-stored target code data, wherein different target code data correspond to different product models of the rotary button; if the first code data is detected to match any target code data, the product model corresponding to the matched target code data is taken as the product model of the rotary button.

[0167] In some embodiments, the signal acquisition module 801 is further configured to acquire the first target reflection signal received by the first infrared transceiver module and the second target reflection signal received by the second infrared transceiver module.

[0168] The signal analysis module 802 is also used to analyze the reflection signals of the first target and the second target to determine the rotation direction of the rotary button; The model identification module 804 is also used to determine the product model of the rotary button based on the encoded data and the rotation direction.

[0169] In some embodiments, the rotary button recognition device 800 further includes an instruction acquisition module and a display module.

[0170] The instruction acquisition module is used to acquire the control instruction set corresponding to the rotary button based on the product model of the rotary button. The control instruction set includes the control instructions corresponding to one or more rotation operation information of the rotary button.

[0171] The display module is used to display the product function and / or product attributes corresponding to the rotary buttons on the display screen according to the product model of the rotary buttons.

[0172] In some embodiments, the rotary button recognition device 800 further includes an LED control module.

[0173] The LED control module is used to determine the rotation information of the rotary button based on the target reflection signal received by the infrared transceiver. The rotation information includes rotation speed and / or rotation direction. Based on the rotation information, the module determines the light emission parameters, which include one or more of the following: light emission color, light emission brightness, and light emission frequency. The module then controls one or more LEDs to operate according to the light emission parameters.

[0174] Figure 9 This is a structural block diagram of an electronic device provided in an embodiment of this application. Figure 9 As shown, the electronic device 900 may include a memory 902 and a processor 901. The memory 902 stores a computer program. When the computer program is executed by the processor 901, the electronic device 900 implements the rotary button recognition method as described in the above embodiments.

[0175] Processor 901 may include one or more processing cores. Processor 901 connects to various parts of the computer device using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory, and by calling data stored in memory. Optionally, processor 901 may be implemented using at least one hardware form of digital signal processing, field-programmable gate array, or programmable logic array. Processor 901 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 901 and may be implemented separately through a communication chip.

[0176] The memory 902 may include random access memory (RAM) or read-only memory (ROM). The memory can be used to store instructions, programs, code, code sets, or instruction sets. The memory may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described above, etc. The data storage area may also store data created during the use of the computer device.

[0177] This application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor implements the rotary button recognition method as described in the above embodiments.

[0178] This application discloses a computer program product, which includes a computer program, and when the computer program is executed by a processor, the processor implements the rotary button recognition method as described in the above embodiments.

[0179] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, ROM, etc.

[0180] The above description is merely a specific example of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for recognizing a rotary button, characterized in that, An electronic device is applied to an electronic device comprising a main body, on which a button body is disposed, the button body being used to mount a rotary button, the button body being provided with an infrared transceiver device for emitting infrared signals and receiving reflected signals of the infrared signals reflected by the rotary button; the rotary button includes an encoding disk disposed on the side of the rotary button near the button body, the encoding disk including multiple first encoding areas, multiple second encoding areas, and multiple third encoding areas, the multiple first encoding areas being spaced apart, and a second encoding area or a third encoding area being provided between two adjacent first encoding areas, the first encoding areas, second encoding areas, and third encoding areas being different colors; the method includes: Control the infrared transceiver to transmit infrared signals and acquire the target reflection signals received by the infrared transceiver; The target reflection signal is analyzed to determine the amplitude of each target signal contained in the target reflection signal; The first target signal amplitude corresponding to the first coding region is identified among the various target signal amplitudes, and the first target signal amplitude is used as an interval marker. The coding of the target coding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes is identified to obtain the coded data corresponding to the target reflected signal; the target coding region includes the second coding region or the third coding region. The product model of the rotary button is determined based on the encoded data.

2. The method according to claim 1, characterized in that, The step of analyzing the target reflection signal to determine the amplitude of each signal contained in the target reflection signal includes: The target reflection signal is analyzed to obtain the amplitude values ​​of each initial signal contained in the target reflection signal; The initial signal amplitudes are processed in reverse to obtain the target signal amplitudes corresponding to the initial signal amplitudes.

3. The method according to claim 2, characterized in that, The first coding area is black, the second coding area is gray, and the third coding area is white; The step of identifying the first target signal amplitude corresponding to the first coding region among the various target signal amplitudes, and using the first target signal amplitude as an interval marker, and identifying the coding of the target coding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes, includes: The target signal amplitude that is the peak among the various target signal amplitudes is determined as the first target signal amplitude corresponding to the first coding region; If the amplitude of the second target signal is a trough between two adjacent amplitudes of the first target signal, and the absolute value of the amplitude of the second target signal is greater than the first threshold, then the amplitude of the second target signal is converted into the first code corresponding to the second coding area. If the amplitude of the second target signal is a trough between two adjacent amplitudes of the first target signal, and the absolute value of the amplitude of the second target signal is less than the second threshold, then the amplitude of the second target signal is converted into the second code corresponding to the third coding region; the first threshold is greater than the second threshold.

4. The method according to claim 1, characterized in that, Determining the product model of the rotary button based on the encoded data includes: Identify the starting encoded data contained in the encoded data; The first encoded data following the initial encoded data is compared with multiple pre-stored target encoded data, and different target encoded data correspond to different product models of the rotary button. If the first encoded data is detected to match any target encoded data, the product model corresponding to the matched target encoded data is taken as the product model of the rotary button.

5. The method according to claim 1, characterized in that, The infrared transceiver device includes a first infrared transceiver module and a second infrared transceiver module. The first infrared transceiver module is located in the projection area on the key body corresponding to the center of the first encoding area when the encoding disk is stationary. The second infrared transceiver module is located in the projection area on the key body corresponding to the junction of the first encoding area and the second encoding area when the encoding disk is stationary. The step of acquiring the target reflection signal received by the infrared transceiver includes: The first target reflection signal received by the first infrared transceiver module is acquired, and the second target reflection signal received by the second infrared transceiver module is acquired. The method further includes: The rotation direction of the rotary button is determined by analyzing the reflection signals of the first target and the second target. Determining the product model of the rotary button based on the encoded data includes: The product model of the rotary button is determined based on the encoded data and the rotation direction.

6. The method according to any one of claims 1 to 5, characterized in that, The main body of the device is also provided with a display screen; after determining the product model of the rotary button based on the encoded data, the method further includes: Based on the product model of the rotary button, obtain the control instruction set corresponding to the rotary button. The control instruction set includes control instructions corresponding to one or more rotation operation information of the rotary button. And / or, Based on the product model of the rotary button, the corresponding product function and / or product attributes are displayed on the screen.

7. The method according to any one of claims 1 to 5, characterized in that, The button body is also provided with one or more LED beads, the light emission direction of the one or more LED beads is towards the rotary button, and the light emitted by the one or more LED beads can pass through the rotary button; After determining the product model of the rotary button based on the encoded data, the method further includes: Based on the target reflection signal received by the infrared transceiver, the rotation information of the rotary button is determined, and the rotation information includes rotation speed and / or rotation direction; Based on the rotation information, light emission parameters are determined, including one or more of light emission color, light emission brightness, and light emission frequency; Control the one or more LEDs to operate according to the light emission parameters.

8. A rotary button recognition device, characterized in that, This invention relates to an electronic device, which includes a main body and a button body on the main body. The button body is used to mount a rotary button and is equipped with an infrared transceiver for emitting infrared signals and receiving reflected signals from the rotary button. The rotary button includes an encoding disk located on the side of the rotary button near the button body. The encoding disk includes multiple first encoding areas, multiple second encoding areas, and multiple third encoding areas. The multiple first encoding areas are spaced apart, and a second encoding area or a third encoding area is provided between two adjacent first encoding areas. The first, second, and third encoding areas are different colors. The recognition device for the rotary button includes: The signal acquisition module is used to control the infrared transceiver to emit infrared signals and to acquire the target reflection signals received by the infrared transceiver. The signal analysis module is used to analyze the target reflection signal and determine the amplitude of each target signal contained in the target reflection signal; The encoding module is used to identify the first target signal amplitude corresponding to the first encoding region among the various target signal amplitudes, and to identify the encoding of the target encoding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes, using the first target signal amplitude as an interval marker, so as to obtain the encoded data corresponding to the target reflected signal; the target encoding region includes the second encoding region or the third encoding region; The model identification module is used to determine the product model of the rotary button based on the encoded data.

9. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the method as described in any one of claims 1 to 7.

10. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to implement the method as described in any one of claims 1 to 7.