CN-121996087-A - Identification method and device for rotary key, electronic equipment and program product
Abstract
The application discloses a method, a device, electronic equipment and a program product for identifying a rotary key, wherein the method comprises the steps of controlling an infrared receiving and transmitting device to emit infrared signals and acquiring target reflection signals received by the infrared receiving and transmitting device; the method comprises the steps of analyzing target reflected signals, determining the amplitude of each target signal contained in the target reflected signals, identifying the first target signal amplitude corresponding to a first coding region in the amplitude of each target signal, identifying the codes of the target coding regions corresponding to the second target signal amplitude between two adjacent first target signal amplitudes by taking the first target signal amplitude as an interval mark so as to obtain code data corresponding to the target reflected signals, wherein each target coding region comprises a second coding region or a third coding region, and determining the product model of a rotary key according to the code data. The application can accurately identify the product model of the installed rotary keys, thereby being capable of adapting to various rotary keys and improving the flexibility of interaction by using the rotary keys.
Inventors
- HUANG LIANG
- GUO JIANBING
Assignees
- 小鹿莱斯科技(深圳)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260109
Claims (10)
- 1. The identification method of the rotary key is characterized by being applied to electronic equipment, the electronic equipment comprises an equipment main body, a key body is arranged on the equipment main body and used for installing the rotary key, the key body is provided with an infrared receiving and transmitting device which is used for transmitting infrared signals and receiving reflection signals reflected by the rotary key, the rotary key comprises a coding disc, the coding disc is arranged on one side, close to the key body, of the rotary key, the coding disc comprises a plurality of first coding regions, a plurality of second coding regions and a plurality of third coding regions, the first coding regions are arranged at intervals, one second coding region or one third coding region is arranged between two adjacent first coding regions, and the first coding regions, the second coding regions and the third coding regions are different in color. Controlling the infrared receiving and transmitting device to emit infrared signals and acquiring target reflection signals received by the infrared receiving and transmitting device; analyzing the target reflected signals to determine the amplitude of each target signal contained in the target reflected signals; Identifying first target signal amplitude values corresponding to the first coding regions in the target signal amplitude values, and identifying codes of target coding regions corresponding to second target signal amplitude values between two adjacent first target signal amplitude values by taking the first target signal amplitude values as interval marks so as to obtain code data corresponding to the target reflected signals; and determining the product model of the rotary key according to the coded data.
- 2. The method of claim 1, wherein analyzing the target reflected signal to determine the respective signal magnitudes contained in the target reflected signal comprises: analyzing the target reflected signal to obtain each initial signal amplitude value contained in the target reflected signal; And carrying out reverse processing on the initial signal amplitudes to obtain target signal amplitudes corresponding to the initial signal amplitudes.
- 3. The method of claim 2, wherein the first coding region is black in color, the second coding region is gray in color, and the third coding region is white in color; The identifying the first target signal amplitude corresponding to the first coding region in the target signal amplitudes, and identifying the coding of the target coding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes by taking the first target signal amplitude as an interval mark comprises the following steps: Determining the target signal amplitude which is the peak in the target signal amplitudes as a first target signal amplitude corresponding to the first coding 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 larger than a first threshold, converting the second target signal amplitude into a first code corresponding to the second coding 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 smaller than a second threshold, converting the second target signal amplitude into a second code corresponding to the third code region, wherein the first threshold is larger than the second threshold.
- 4. The method of claim 1, wherein said determining a product model of the rotary key based on the encoded data comprises: identifying start encoded data contained in the encoded data; Comparing first coded data after the initial coded data with a plurality of prestored target coded data in the coded data, wherein different target coded data respectively correspond to different product models of the rotary keys; And if the first coded data is detected to be matched with any target coded data, taking the product model corresponding to the matched target coded data as the product model of the rotary key.
- 5. The method of claim 1, wherein the infrared transceiver comprises a first infrared transceiver module and a second infrared transceiver module, the first infrared transceiver module is disposed in a projection area corresponding to a region center of the first coding region on the key body when the coding disc is stationary, and the second infrared transceiver module is disposed in a projection area corresponding to a region of the key body at a boundary between the first coding region and the second coding region when the coding disc is stationary; the obtaining the target reflected signal received by the infrared transceiver device includes: acquiring a first target reflected signal received by the first infrared receiving and transmitting module and acquiring a second target reflected signal received by the second infrared receiving and transmitting module; The method further comprises the steps of: Analyzing the first target reflected signal and the second target reflected signal to determine the rotation direction of the rotary key; the determining the product model of the rotary key according to the encoded data comprises the following steps: and determining the product model of the rotary key according to the coded data and the rotary direction.
- 6. The method according to any one of claims 1 to 5, wherein the device body is further provided with a display screen, and after the product model of the rotary key is determined according to the encoded data, the method further comprises: According to the product model of the rotary key, a control instruction set corresponding to the rotary key is obtained, wherein the control instruction set comprises control instructions respectively corresponding to one or more pieces of rotary operation information of the rotary key; and/or the number of the groups of groups, And displaying the product functions and/or product attributes corresponding to the rotary keys on the display screen according to the product model of the rotary keys.
- 7. The method according to any one of claims 1 to 5, wherein the key body is further provided with one or more light beads, the light emitting direction of the one or more light beads faces the rotary key, and the light emitted by the one or more light beads can pass through the rotary key; After the product model of the rotary key is determined according to the encoded data, the method further comprises: determining rotation information of the rotation key according to the target reflection signal received by the infrared receiving and transmitting device, wherein the rotation information comprises rotation speed and/or rotation direction; Determining a lighting parameter according to the rotation information, wherein the lighting parameter comprises one or more of lighting color, lighting brightness and lighting frequency; And controlling the one or more lamp beads to operate according to the lighting parameters.
- 8. The identification device for the rotary key is characterized by comprising an equipment main body, wherein a key body is arranged on the equipment main body and used for installing the rotary key, the key body is provided with an infrared receiving and transmitting device which is used for transmitting infrared signals and receiving reflection signals reflected by the rotary key, the rotary key comprises a coding disc, the coding disc is arranged on one side, close to the key body, of the rotary key, the coding disc comprises a plurality of first coding regions, a plurality of second coding regions and a plurality of third coding regions, the first coding regions are arranged at intervals, one second coding region or one third coding region is arranged between two adjacent first coding regions, and the first coding regions, the second coding regions and the third coding regions are different in color; The identification device of the rotary key comprises: The signal acquisition module is used for controlling the infrared receiving and transmitting device to emit infrared signals and acquiring target reflected signals received by the infrared receiving and transmitting device; The signal analysis module is used for analyzing the target reflected signals and determining the amplitude values of all the target signals contained in the target reflected signals; The coding module is used for identifying first target signal amplitude values corresponding to the first coding regions in the target signal amplitude values, identifying codes of target coding regions corresponding to second target signal amplitude values between two adjacent first target signal amplitude values by taking the first target signal amplitude values as interval marks so as to obtain coded data corresponding to the target reflected signals, wherein the target coding regions comprise the second coding regions or the third coding regions; And the model identification module is used for determining the product model of the rotary key according to the coded data.
- 9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, causes the processor to implement the method of any of claims 1-7.
- 10. A computer program product comprising a computer program which, when executed by a processor, causes the processor to carry out the method according to any one of claims 1 to 7.
Description
Identification method and device for rotary key, electronic equipment and program product Technical Field The present application relates to the field of data processing technologies, and in particular, to a method and apparatus for identifying a rotary key, an electronic device, and a program product. Background At present, a rotary key is installed on part of electronic equipment (such as a game machine, a handle and the like), and the rotary key has more advantages in an interaction scene requiring fine adjustment or continuous input by virtue of the characteristics of continuous adjustable operation characteristics, visual operation and the like, so that more novel and more accurate operation experience can be provided for users. However, electronic devices are typically only adapted to one type of rotary key, resulting in an inflexible interaction. Disclosure of Invention The embodiment of the application discloses a method, a device, electronic equipment and a program product for identifying a rotary key, wherein the electronic equipment can accurately identify the product model of the installed rotary key, so that the electronic equipment can adapt to various rotary keys, and the flexibility of interaction by using the rotary keys is improved. The first aspect of the embodiment of the application discloses a rotary key identification method, which is applied to electronic equipment, wherein the electronic equipment comprises an equipment main body, a key body is arranged on the equipment main body and used for installing a rotary key, the key body is provided with an infrared receiving and transmitting device which is used for transmitting infrared signals and receiving reflection signals reflected by the rotary key, the rotary key comprises a coding disc, the coding disc is arranged on one side, close to the key body, of the rotary key, the coding disc comprises a plurality of first coding regions, a plurality of second coding regions and a plurality of third coding regions, the first coding regions are arranged at intervals, one second coding region or one third coding region is arranged between two adjacent first coding regions, and the first coding regions, the second coding regions and the third coding regions are different in color, and the method comprises the following steps: controlling the infrared receiving and transmitting device to emit infrared signals and acquiring target reflection signals received by the infrared receiving and transmitting device; analyzing the target reflected signals to determine the amplitude of each target signal contained in the target reflected signals; Identifying first target signal amplitude values corresponding to the first coding regions in the target signal amplitude values, and identifying codes of target coding regions corresponding to second target signal amplitude values between two adjacent first target signal amplitude values by taking the first target signal amplitude values as interval marks so as to obtain code data corresponding to the target reflected signals; and determining the product model of the rotary key according to the coded data. In some possible embodiments, the analyzing the target reflected signal to determine the respective signal amplitudes contained in the target reflected signal includes: analyzing the target reflected signal to obtain each initial signal amplitude value contained in the target reflected signal; And carrying out reverse processing on the initial signal amplitudes to obtain target signal amplitudes corresponding to the initial signal amplitudes. In some possible embodiments, the first coding region is black in color, the second coding region is gray in color, and the third coding region is white in color; The identifying the first target signal amplitude corresponding to the first coding region in the target signal amplitudes, and identifying the coding of the target coding region corresponding to the second target signal amplitude between two adjacent first target signal amplitudes by taking the first target signal amplitude as an interval mark comprises the following steps: Determining the target signal amplitude which is the peak in the target signal amplitudes as a first target signal amplitude corresponding to the first coding 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 larger than a first threshold, converting the second target signal amplitude into a first code corresponding to the second coding 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 smaller than a second threshold, converting the second target signal amplitude into a second code corresponding to the third code region, wherein the first threshold is larger than the second threshold. In some poss