Gear adjusting method and device, electronic equipment and storage medium

By collecting knob displacement and historical cumulative values ​​through optical sensors, the gear value is adjusted to compensate for hardware errors, solving the gear accuracy problem of the knob in high-precision scenarios and achieving higher knob operation accuracy and reliability.

CN122051064APending Publication Date: 2026-05-15LUXSHARE ITECH(ZHEJIANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LUXSHARE ITECH(ZHEJIANG) CO LTD
Filing Date
2026-01-27
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing knobs, in high-precision scenarios, suffer from distortion of rotation data and significant errors due to limitations in sensor physical characteristics or compromises in signal acquisition engineering, which affects gear positioning accuracy.

Method used

The cumulative displacement and historical cumulative displacement of the knob are collected by an optical sensor. The knob's engagement state is determined based on the displacement range of different gears. When the knob's engagement state is in the middle of an adjacent gear, if the cumulative displacement and historical cumulative displacement meet the conditions, the gear value is adjusted to compensate for hardware errors.

Benefits of technology

Ensure the accuracy of the knob positions, reduce the impact of hardware errors, and improve the accuracy and reliability of knob operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122051064A_ABST
    Figure CN122051064A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a gear adjusting method and device, electronic equipment and a storage medium, and the method comprises the steps: collecting the displacement cumulant of a knob through an optical sensor, and obtaining the stored historical knob cumulant; determining a knob gear-entering state of the knob based on the displacement cumulant and the gear displacement ranges of different gears; and determining that the gear entering state of the knob is the middle of adjacent gears and the displacement cumulant and the historical knob cumulant meet gear adjustment conditions, and adjusting the gear value of the knob based on the displacement cumulant. According to the embodiment of the invention, the gear value can be adjusted according to the displacement accumulation amount and the historical knob accumulation amount, so that the gear of the knob is determined according to the displacement accumulation amount, the precision error caused by knob hardware is made up, and the knob gear precision can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer application technology, and in particular to a gear adjustment method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, knobs are evolving towards "intelligent digitalization, precision integration, tactile interaction, and reliable long lifespan." High-precision gear selection is the core guarantee for achieving accurate parameter control, safe and reliable operation, and data traceability. In scenarios such as vehicles, industrial control, medical devices, and instrumentation, it directly determines the performance of equipment and the user experience.

[0003] Currently, the precise determination of a knob's position mainly relies on high-precision sensors to collect physical rotation data. A high-precision encoder or sensor converts the knob's mechanical rotation (angle / number of turns) into an electrical signal, while signal conditioning circuitry eliminates noise to ensure the accuracy of the original signal. However, due to limitations in the physical characteristics of the sensors themselves or engineering compromises in signal acquisition, the original rotation data can be distorted, and some errors cannot be fully compensated for by algorithms, resulting in significant errors even in some high-precision scenarios. Summary of the Invention

[0004] The present invention provides several embodiments of a gear adjustment method, apparatus, electronic device and storage medium, wherein at least one embodiment can reduce knob hardware error and reduce the impact of knob displacement error on gear accuracy.

[0005] According to one aspect of the present invention, a gear adjustment method is provided, wherein the method includes: The cumulative displacement of the knob is collected by an optical sensor, and the stored historical cumulative knob displacement is obtained. The knob's engagement state is determined based on the cumulative displacement and the displacement range of different gears; If the knob is determined to be in the middle of an adjacent gear position, and the cumulative displacement and the historical knob cumulative displacement satisfy the gear adjustment conditions, the gear value of the knob is adjusted based on the gear position matched by the cumulative displacement.

[0006] According to another aspect of the present invention, a gear adjustment device is provided, wherein the device comprises: The rotation parameter module is used to collect the cumulative displacement of the knob through an optical sensor and obtain the stored historical cumulative knob displacement. The gear position status module is used to determine the gear engagement state of the knob based on the cumulative displacement and the gear displacement range of different gears; The gear adjustment module is used to determine that the knob is in the middle of an adjacent gear, and that the cumulative displacement and the historical knob cumulative displacement meet the gear adjustment conditions, and adjusts the gear value of the knob based on the gear value matched by the cumulative displacement.

[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the gear adjustment method according to any embodiment of the present invention.

[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the gear adjustment method according to any embodiment of the present invention.

[0009] The technical solution of this invention collects the cumulative displacement of the knob and the historical cumulative displacement of the knob using an optical sensor. Based on the displacement range of different gears, it determines the knob engagement state corresponding to the cumulative displacement. When the knob engagement state is in the middle of an adjacent gear, if the cumulative displacement and the historical cumulative displacement meet the gear adjustment conditions, the gear value of the knob is adjusted based on the cumulative displacement. This invention determines the knob engagement state as being in the middle of an adjacent gear based on the cumulative displacement, and adjusts the gear value based on the cumulative displacement and the historical cumulative displacement, thereby determining the knob gear based on the cumulative displacement. This compensates for accuracy errors caused by the knob hardware and ensures the accuracy of the knob gear.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

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

[0012] Figure 1 This is a flowchart of a gear adjustment method provided in Embodiment 1 of the present invention; Figure 2This is a flowchart of another gear adjustment method provided in Embodiment 2 of the present invention; Figure 3 This is a flowchart of another gear adjustment method provided in Embodiment 3 of the present invention; Figure 4 This is a flowchart of another gear adjustment method provided in Embodiment 4 of the present invention; Figure 5 This is an example diagram of a gear adjustment method provided in Embodiment 5 of the present invention; Figure 6 This is a schematic diagram of the structure of a gear adjustment device according to Embodiment Six of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device that implements the gear adjustment method of the present invention. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0015] Example 1 Figure 1 This is a flowchart of a gear adjustment method according to Embodiment 1 of the present invention. This embodiment is applicable to situations where the gear value is adjusted when the rotary gear position is between adjacent gear positions. This method can be executed by a gear adjustment device, which can be implemented in hardware and / or software, and can be configured in a main control unit or algorithm chip. Figure 1 As shown, the method includes: Step 110: Collect the cumulative displacement of the knob using an optical sensor and obtain the stored historical cumulative knob displacement.

[0016] Among them, optical sensors are sensors that can collect the rotation state of the knob through non-contact photoelectric sensing schemes. Optical sensors can include, but are not limited to, incremental photoelectric encoders, absolute photoelectric encoders, reflective photoelectric sensors, and grating displacement sensors. The cumulative displacement can be the accumulated amount of knob rotation displacement during the current knob operation. The cumulative displacement can include multiple rotation displacements over a period of time. The historical knob cumulative amount can be the accumulated amount of knob displacement generated after knob operation in the past process. The historical knob cumulative amount can be generated after each knob rotation. The historical knob cumulative amount can include multiple displacement amounts, each of which can indicate the displacement generated after the previous knob operation. For example, if the historical knob cumulative amount is 1 displacement amount, it can represent the cumulative displacement after the last knob operation.

[0017] In this embodiment of the invention, an optical sensor can be used to monitor the knob's operating status by collecting the cumulative displacement of the knob during the current operation and the historical cumulative displacement saved before the current operation. This non-contact method of collecting rotational displacement avoids wear and gap problems caused by mechanical contact, thus reducing hardware errors in the knob. It is understood that the cumulative displacement and historical cumulative displacement can be expressed in units such as rotation angle or rotational displacement.

[0018] Step 120: Determine the knob's engagement state based on the cumulative displacement and the displacement range of different gears.

[0019] The gear positions can be calibrated ranges set by rotational displacement or angle within the knob. The number of gear positions can be set based on actual business needs and the knob's application scenario; for example, the knob can have 12 or 14 gear positions. The gear displacement range is used to identify whether the knob's displacement falls within the larger range of a certain gear position. The gear displacement range enables gear locking and precision control. The gear displacement range consists of at least a low displacement threshold and a high displacement threshold. For example, if a knob's displacement is less than the high displacement threshold of a certain gear position and greater than its low displacement threshold, then the knob's gear position is set to that gear. The knob's engagement state indicates whether the knob has selected a specific gear position. If the knob is rotated to a certain gear position, its engagement state can be determined as being within that gear position. Otherwise, if the knob is between two adjacent gear positions, and its displacement is higher than the lower gear but lower than the higher gear, then its engagement state can be determined as being in the middle of the adjacent gear positions.

[0020] Specifically, the gear displacement range configured for different gear positions can be obtained. This gear displacement range can be the individual gear displacement range for each gear position. For example, the gear displacement range for gear 10 is 9.5 and 10.5, while the gear displacement range for gear 15 is 14.6 and 15.4, etc. Alternatively, an error range can be set for the gear displacement range for all gear positions, such as ±1 or ±10, etc. The gear displacement range for each gear position can be determined according to this error range and each gear position. The cumulative displacement amount can be compared with the gear displacement range of each gear position. If it is determined that the cumulative displacement amount belongs to the gear displacement range of a certain gear position, then the knob's engagement state is determined to be within the gear position. If it is determined that the cumulative displacement amount is between the gear displacement ranges of two gear positions, then the knob's engagement state is determined to be between adjacent gear positions.

[0021] Step 130: Determine that the knob is in the middle of the adjacent gear position, and that the cumulative displacement and the historical knob cumulative displacement meet the gear adjustment conditions. Adjust the gear value of the knob based on the cumulative displacement.

[0022] Among them, the gear adjustment condition can be the condition for determining the adjustable gear value of the knob this time. The gear adjustment condition can include the difference between the cumulative displacement and the historical cumulative displacement of the knob being greater than a threshold. This threshold can be determined by the lowest gear among all gears, or the historical cumulative displacement of the knob being lower than the low displacement threshold of a certain gear, and the cumulative displacement being higher than the high displacement threshold of a certain gear, etc.

[0023] In this embodiment of the invention, if the knob is determined to be in the middle of an adjacent gear position, that is, the value of the cumulative displacement is between the gear displacement ranges of two adjacent gear positions, then the cumulative displacement and the historical knob cumulative displacement are compared with the gear adjustment conditions. If the cumulative displacement and the historical knob cumulative displacement meet the gear adjustment conditions of the gear code, then the adjustment direction and adjustment value of the knob can be determined according to the cumulative displacement, and the gear value of the knob can be adjusted according to the adjustment direction and adjustment value.

[0024] In this embodiment of the invention, the cumulative displacement of the knob and the historical cumulative displacement of the knob are collected by an optical sensor. Based on the displacement range of different gears, the knob engagement state corresponding to the cumulative displacement is determined. When the knob engagement state is in the middle of an adjacent gear, if the cumulative displacement and the historical cumulative displacement meet the gear adjustment conditions, the gear value of the knob is adjusted based on the cumulative displacement. In this embodiment of the invention, when the knob engagement state is determined to be in the middle of an adjacent gear based on the cumulative displacement, the gear value is adjusted based on the cumulative displacement and the historical cumulative displacement, thereby determining the knob gear based on the cumulative displacement, compensating for the accuracy error caused by the knob hardware, and ensuring the accuracy of the knob gear.

[0025] Example 2 Figure 2This is a flowchart of another gear adjustment method provided by Embodiment 2 of the present invention. The embodiment of the present invention describes the method for determining the gear position of the knob. See [link to flowchart]. Figure 2 The method provided in this embodiment of the invention specifically includes the following steps: Step 210: Collect the cumulative displacement of the knob using an optical sensor and obtain the stored historical cumulative knob displacement.

[0026] Step 220: Obtain the gear displacement range configured for each gear, wherein the gear displacement range includes at least a low gear displacement threshold and a high gear displacement threshold.

[0027] The low threshold and high threshold of gear displacement can be the amount of knob displacement or rotation angle that defines each gear. If the cumulative displacement of a knob in a certain rotation operation is between the low threshold and high threshold of gear displacement for a certain gear, then the knob can be adjusted to that gear.

[0028] In this embodiment of the invention, the gear displacement range configured for each gear can be obtained. Each gear displacement range includes at least a low gear displacement threshold and a high gear displacement threshold for the corresponding gear. For example, the gear displacement ranges for all gears can be stored in an array. Each element in the array can store the low gear displacement threshold and the high gear displacement threshold for a gear, and the index of each element in the array can identify the high or low gear position.

[0029] Step 230: If the cumulative displacement is higher than the high threshold of the first gear displacement and lower than the low threshold of the second gear displacement, then the knob is determined to be in the middle of the adjacent gear.

[0030] In this embodiment of the invention, when the cumulative displacement is higher than the high threshold of the gear displacement of a certain gear, and the cumulative displacement is lower than the low threshold of the gear displacement of another gear, it can be understood that the two gears are not in an adjacent state. In this case, the knob's gear-on state can be determined as the middle of the adjacent gears.

[0031] Step 240: If the cumulative displacement is higher than the low threshold of the gear displacement and lower than the high threshold of the same gear displacement, then the knob is determined to be in gear.

[0032] Specifically, if the cumulative displacement of the knob is higher than the low threshold of the gear position displacement and lower than the high threshold of the same gear position displacement, then the cumulative displacement is between the low threshold and the high threshold of a certain gear position, and the knob is determined to be in a gear position. The knob in gear state can be set to be in gear position.

[0033] Step 250: Determine that the knob is in the middle of the adjacent gear position, and that the cumulative displacement and the historical knob cumulative displacement meet the gear adjustment conditions. Adjust the gear value of the knob based on the cumulative displacement.

[0034] Step 260: Determine that the knob is in the gear position, and adjust the gear value of the knob based on the cumulative displacement.

[0035] In this embodiment of the invention, when the knob is determined to be in the gear position, it is not necessary to determine whether the cumulative displacement of the knob and the historical knob accumulation meet the gear adjustment conditions. The gear value of the knob can be directly adjusted. The adjustment direction and adjustment value of the knob can be determined according to the current trend and value of the cumulative displacement. The gear value can be increased or decreased according to this adjustment method, thereby realizing the adjustment of the knob's gear value.

[0036] Based on the above embodiments of the invention, the gear adjustment conditions include at least the cumulative displacement being higher than the high threshold of the gear displacement of a gear, and the cumulative historical knob displacement being lower than the low threshold of the gear displacement of another gear.

[0037] In this embodiment of the invention, the gear adjustment conditions of the knob may include at least the cumulative displacement being higher than the high threshold of the gear displacement of a certain gear, and the historical cumulative displacement of the knob being lower than the low threshold of the gear displacement of another gear. That is, when the cumulative displacement is greater than the high threshold of the gear displacement of a certain gear, and when the historical cumulative displacement of the knob is lower than the low threshold of the gear displacement of another gear, it can be determined that the cumulative displacement of the knob is at least greater than the gear displacement range of a certain gear, the knob can meet the gear adjustment conditions, and the gear value of the knob can be adjusted.

[0038] In this embodiment of the invention, the cumulative displacement of the knob is collected by an optical sensor, and the pre-saved historical cumulative displacement of the knob is determined to obtain the gear displacement range of each gear. If the cumulative displacement is higher than the high threshold of the gear displacement of one gear but lower than the low threshold of the gear displacement of another gear, the knob is determined to be in the middle of the adjacent gear. If the cumulative displacement is higher than the low threshold of the gear displacement of one gear but lower than the high threshold of the gear displacement of the same gear, the knob is determined to be in the gear. When the knob is determined to be in the middle of the adjacent gear, and the cumulative displacement and the historical cumulative displacement of the knob meet the gear adjustment conditions, the gear value of the knob is adjusted based on the cumulative displacement. When the knob is determined to be in the gear, the gear value of the knob is adjusted based on the cumulative displacement. This embodiment of the invention can adjust the gear value of the knob based on the cumulative displacement, and configure different gear value adjustment strategies for different gear engagement situations, reducing knob hardware errors and improving the accuracy of knob gear adjustment.

[0039] Example 3 Figure 3This is a flowchart of another gear adjustment method provided in Embodiment 3 of the present invention. This embodiment of the present invention describes the process of adjusting the gear value of the knob. See [link to documentation]. Figure 3 The method provided in this embodiment of the invention specifically includes the following steps: Step 310: Collect the cumulative displacement of the knob using an optical sensor and obtain the stored historical cumulative knob displacement.

[0040] Step 320: Determine the knob's engagement state based on the cumulative displacement and the displacement range of different gears.

[0041] Step 330: Determine that the knob is in the middle of the adjacent gear position, and that the cumulative displacement and the historical knob cumulative displacement meet the gear adjustment conditions.

[0042] Step 340: Determine the adjustment direction of the knob based on the trend of the cumulative displacement value.

[0043] The trend of value change can be the change of the cumulative displacement over time. This trend can indicate the direction of rotation of the knob during a particular rotation operation. For example, if the knob rotates clockwise, the cumulative displacement value increases over time; conversely, if the knob rotates counterclockwise, the cumulative displacement value decreases over time. The adjustment direction can be the direction in which the gear value is adjusted, including increasing or decreasing the gear value.

[0044] In this embodiment of the invention, the trend of the cumulative displacement value can be statistically analyzed. When the trend is that the displacement value increases over time, the adjustment direction is determined to increase the gear value; when the trend is that the displacement decreases over time, the adjustment direction is determined to decrease the gear value. Specifically, the method for statistically analyzing the trend of the cumulative displacement value can be to statistically analyze the trend of the cumulative displacement value increasing or decreasing over a period of time.

[0045] Step 350: Determine the gear adjustment value of the knob according to the gear matching the cumulative displacement.

[0046] In this embodiment of the invention, the cumulative displacement can be compared with the gear displacement range of each gear. The gear corresponding to the gear displacement range that the cumulative displacement is closest to can be used as the gear adjustment value. For example, if the gear is closest to the gear displacement range of gear A, then the gear value of gear A can be used as the gear adjustment value.

[0047] Step 360: Increase or decrease the gear adjustment value of the knob according to the adjustment direction.

[0048] Specifically, regarding the knob's gear position, the determined gear adjustment value can be increased or decreased according to the determined adjustment direction, thereby achieving the adjustment of the knob's gear position.

[0049] In this embodiment of the invention, the cumulative displacement of a knob collected by an optical sensor is acquired, and the historical cumulative displacement of the knob is read. The cumulative displacement is compared with the displacement range of different gear positions to determine the knob's engagement state. When the knob's engagement state is in the middle of an adjacent gear position, and the cumulative displacement and historical cumulative displacement meet the gear adjustment conditions, the adjustment direction of the knob is determined according to the trend of the cumulative displacement value. The gear position matching the cumulative displacement is used as the knob's gear adjustment value, and the knob's gear value is increased or decreased according to the adjustment direction. This embodiment of the invention, by determining that the knob's engagement state is in the middle of an adjacent gear position based on the cumulative displacement, adjusts the gear value based on the cumulative displacement and historical cumulative displacement, thereby determining the knob's gear position based on the cumulative displacement. This compensates for accuracy errors caused by the knob's hardware and ensures the accuracy of the knob's gear position.

[0050] Based on the above embodiments of the invention, determining the gear adjustment value of the knob according to the gear matched by the cumulative displacement includes: if the knob is in the middle of an adjacent gear, then the high gear or low gear corresponding to the cumulative displacement is obtained, and the high gear is reduced by 1 or the low gear is used as the gear adjustment value; if the knob is in the gear, then the target gear corresponding to the cumulative displacement is obtained as the gear adjustment value.

[0051] The high and low gears can be two positions where the cumulative displacement of the knob is between two levels, with the high gear value being higher than the low gear value.

[0052] Specifically, when the knob is in the middle of an adjacent gear position, the knob is between two adjacent gear positions. It can obtain the higher or lower gear between the two adjacent gear positions. The higher gear can be subtracted by 1 and used as the gear adjustment value, or the lower gear can be used as the gear adjustment value.

[0053] Based on the above embodiments of the invention, the method further includes: determining that the gear value of the knob has been updated, and judging whether the cumulative displacement is greater than the first gear value, wherein the first gear value is the low threshold value of the gear displacement of the lowest gear among all gears; if yes, the gear value is updated; if no, the gear value is set as the temporary gear of the knob.

[0054] The first gear value can be a baseline measurement value for the knob's gear position. It can determine the validity of the rotational displacement and reduce the impact of false rotational displacement caused by mechanical vibration, electromagnetic interference, etc. The first gear value can be the lowest threshold value for determining whether the cumulative displacement is valid. The first gear value can also be the gear displacement threshold of the lowest gear among all gears. The temporary gear can be an intermediate value during the knob's gear value locking process. In the temporary gear, the knob may not update the gear value, but only provide a knob indication, waiting for the gear value to be updated upon subsequent rotation.

[0055] In this embodiment of the invention, it can be determined whether the knob's gear value has been updated during the current rotation operation. If so, the cumulative displacement can be compared with the first gear value. If the cumulative displacement is greater than the first gear value, the rotation operation corresponding to the current cumulative displacement is valid, and the updated gear value is used as the knob's final gear value. If not, the updated gear value is used only as a temporary gear, and no corresponding operation is performed to reduce the impact of errors on the device. For example, the temporary gear value is not used for reading or operation by the main control unit.

[0056] Example 4 Figure 4 This is a flowchart of another gear adjustment method provided in Embodiment 4 of the present invention. The embodiments of the present invention describe the data processing process for the knob in its stopped state. See [link to flowchart]. Figure 4 The method provided in this embodiment of the invention specifically includes the following steps: Step 410: Collect the cumulative displacement of the knob using an optical sensor and obtain the stored historical cumulative knob displacement.

[0057] Step 420: Determine the knob's engagement state based on the cumulative displacement and the displacement range of different gears.

[0058] Step 430: Determine that the knob is in the middle of the adjacent gear position, and that the cumulative displacement and the historical knob cumulative displacement meet the gear adjustment conditions. Adjust the gear value of the knob based on the cumulative displacement.

[0059] Step 440: If it is determined that the cumulative displacement of the knob is less than the zero-point threshold for at least a threshold number of consecutive times, then the knob is determined to be in a stopped rotation state.

[0060] The zero-point threshold is the minimum cumulative displacement required to determine whether the knob has rotated. When the cumulative displacement is greater than or equal to the zero-point threshold, the knob has rotated; conversely, when the cumulative displacement is less than the zero-point threshold, the knob has not rotated. The threshold count is the minimum number of times the knob has not rotated to be in a stopped state. When the cumulative displacement is less than the zero-point threshold multiple times consecutively, the knob can be determined to be in a stopped state.

[0061] In this embodiment of the invention, whenever the cumulative displacement is obtained, the cumulative displacement can be compared with the zero-point threshold. If the cumulative displacement is less than the zero-point threshold, one non-rotation count can be recorded. Otherwise, if the cumulative displacement is greater than or equal to the zero-point threshold, the non-rotation count is cleared to zero. When the non-rotation count of the knob increases to the threshold count, it is determined that the knob is in a stopped rotation state.

[0062] Step 450: If the knob is in a stopped state and the knob's gear value has been updated, then adjust the historical knob accumulation amount according to the knob's gear position and the accumulated displacement.

[0063] In this embodiment of the invention, when the knob is in a stopped rotation state, if the knob's gear value has been updated, the historical knob accumulation value can be adjusted according to the knob's engagement state and the accumulated displacement. Different knob engagement states allow for different adjustment strategies for the historical knob accumulation value. When the knob is engaged within a gear, there is no need to record the accumulated displacement value; the historical knob accumulation value can be cleared to avoid error accumulation. When the knob is engaged in the middle of an adjacent gear, the historical knob accumulation value needs to be recorded, and the accumulated displacement value can be saved as the historical knob accumulation value. Furthermore, to improve accuracy, the accumulated displacement value can be corrected by error elimination before being saved as the historical knob accumulation value.

[0064] In this embodiment of the invention, the cumulative displacement of the knob is obtained based on an optical sensor, and the saved historical cumulative displacement of the knob is also obtained. The knob's engagement state is determined according to the cumulative displacement and the gear displacement range of each gear position. When the knob's engagement state is in the middle of an adjacent gear position, and the cumulative displacement and the historical cumulative displacement satisfy the gear adjustment conditions, the knob's gear value is adjusted based on the cumulative displacement. When the knob's cumulative displacement is less than a zero threshold for at least a threshold number of consecutive times, the knob is determined to be in a stopped rotation state. When the knob is determined to be in a stopped rotation state, and the knob's gear value has been updated, the historical cumulative displacement is adjusted according to the knob's engagement state and the cumulative displacement. When the knob's engagement state is determined to be in the middle of an adjacent gear position based on the cumulative displacement, the gear value is adjusted based on the cumulative displacement and the historical cumulative displacement, thereby determining the knob's gear position based on the cumulative displacement. This compensates for accuracy errors caused by the knob's hardware and ensures the accuracy of the knob's gear position.

[0065] Furthermore, based on the above embodiments of the invention, adjusting the historical knob accumulation amount according to the knob's engagement state and displacement accumulation includes: If the knob is determined to be in gear, the historical knob accumulation is reset to zero; if the knob is determined to be in gear between adjacent gears, the displacement accumulation is extracted to match the midpoint value of the gear displacement range corresponding to the gear, and the displacement accumulation is subtracted from the midpoint value before being added to the historical knob accumulation.

[0066] In this embodiment of the invention, the displacement range of each gear position also includes a gear midpoint value. This gear midpoint value can indicate the center value of the gear position range and can be used to eliminate the cumulative error of the displacement accumulation. Specifically, when the knob is in gear, the historical knob accumulation is reset to zero. When the knob is in gear, the gear midpoint value within the displacement range corresponding to the current displacement accumulation of the knob can be obtained. The matched gear can be the gear corresponding to the current gear position value of the knob. The displacement accumulation can be subtracted from the current gear midpoint value, and then added to the historical knob accumulation to complete the adjustment of the historical knob accumulation.

[0067] Example 5 Figure 5 This is an example diagram of a gear adjustment method according to Embodiment 5 of the present invention. This embodiment provides a method for adjusting the gear position of a knob. The knob is circular, with a pressable button in the center and a rotatable dial on the periphery. The knob module may also include a waterproof and dustproof rubber ring, a sensor, and an algorithm chip. Each input of the knob can require a 30-degree rotation. The knob uses 12 physical separators for complete selection, and the button's travel is 0.3 mm. The sensor can be an optical sensor, which can collect the rotational displacement of the dial. See also... Figure 5 The algorithm chip can analyze the cumulative displacement collected by the sensor and determine the current state between the optical sensor and the turntable. Based on the cumulative displacement and the current state, it can determine the current gear position of the knob and update the gear information when necessary. The gear information update process can be implemented through a gear adjustment method, thereby ensuring that the knob can identify the gear position at various rotation speeds and in a stationary state. Specifically, the gear adjustment method may include the following steps: Step 1: Obtain the current cumulative displacement. First, obtain the current-sum data of the current knob's dial displacement. This current-sum data can be determined by the absolute value of the rotational displacement collected by the optical sensor.

[0068] Step 2: Find the threshold range for the current gear. The corresponding gear threshold range is found based on the current cumulative displacement. This gear threshold range can be stored in the array `data thd`, where each gear can have three thresholds: a lower threshold, an upper threshold, and a center value. The gear interval where the current cumulative displacement falls is found by traversing the `data thd` array.

[0069] Step 3: Determine whether the knob has reached the gear position based on the cumulative displacement and the gear threshold range.

[0070] Step 3.1: If the cumulative displacement is within the gear threshold range and the knob meets one of the following conditions, then the gear will be updated: Condition 1: Gear not updated Condition 2: The gear has been updated, but the current cumulative displacement is greater than the low threshold of the first gear of the knob.

[0071] Step 3.2: The cumulative displacement is between two gear positions. If the cumulative displacement of the knob is between two gear positions and the following conditions are met, then the gear position is updated, and after the update, between_gears_f1ag is set to true, indicating that the sensor is stopped between the two gear positions. The above conditions include: Condition 1: The previous displacement was less than the low threshold of a certain gear. Condition 2: The current displacement is greater than the high threshold of a certain gear. Condition 3: The gear is being updated.

[0072] In the above embodiments of the invention, the logic for updating the gear position is as follows: The direction of knob rotation is determined based on the direction of change in cumulative displacement, which can be either forward or reverse. The knob's gear is adjusted according to the gear level matched to the cumulative displacement, and the gear update flag `gear_updated` is set.

[0073] Step 3.4: Determine whether the knob has stopped rotating by observing the changes in the cumulative displacement. If the cumulative displacement changes are less than the zero-point threshold ZERO_DATA_THD for several consecutive times, the knob is considered to have stopped rotating. The number of consecutive times can be SPEED_.ZERO_COUNT times.

[0074] Step 3.5: After the knob stops rotating, if the knob's gear setting has been updated (e.g., gear_updated=1), then different actions are taken depending on whether the knob is stopped between two gear settings: (1) If the knob is stopped in the gear position, for example, between_gears_f1ag is false, the displacement accumulation and other related variables can be reset; (2) If the knob stops between two gears, for example, between_gears_f1ag is true, the cumulative displacement is subtracted from the center value of the current gear, thereby reducing the cumulative error.

[0075] Step 3.6: Update the current angle of the knob according to the previously updated gear position.

[0076] In this embodiment of the invention, the 12 positions of the knob are set to 360 degrees, and the rotational displacement of the knob's dial is set to 3600 degrees, so that the corresponding current angle can be determined based on the updated positions.

[0077] Example 6 Figure 6 This is a schematic diagram of a gear adjustment device according to Embodiment Six of the present invention. Figure 6 As shown, the device includes: The rotation parameter module 510 is used to acquire the cumulative displacement of the knob through an optical sensor and obtain the stored historical cumulative knob displacement.

[0078] The gear position module 520 is used to determine the gear engagement state of the knob based on the cumulative displacement and the gear displacement range of different gears.

[0079] The gear adjustment module 530 is used to determine that the knob is in the middle of the adjacent gears, and the cumulative displacement and the historical knob cumulative displacement meet the gear adjustment conditions, and to match the gear value of the gear adjustment knob based on the cumulative displacement.

[0080] In this embodiment of the invention, the rotation parameter module controls the optical sensor to collect the cumulative displacement of the knob and the historical cumulative displacement of the knob. The gear position module determines the knob engagement state corresponding to the cumulative displacement based on the gear displacement range of different gears. When the knob engagement state is in the middle of an adjacent gear, if the cumulative displacement and the historical cumulative displacement satisfy the gear adjustment conditions, the gear value of the knob is adjusted based on the cumulative displacement. In this embodiment of the invention, when the knob engagement state is determined to be in the middle of an adjacent gear based on the cumulative displacement, the gear value is adjusted based on the cumulative displacement and the historical cumulative displacement, thereby determining the knob gear based on the cumulative displacement, compensating for the accuracy error caused by the knob hardware, and ensuring the accuracy of the knob gear position.

[0081] In some embodiments of the invention, the gear position status module 520 includes: The range extraction unit is used to obtain the gear displacement range configured for each gear, wherein the gear displacement range includes at least a low gear displacement threshold and a high gear displacement threshold.

[0082] The first case unit is used to determine that the knob is in the middle of the adjacent gear if the cumulative displacement is higher than the high threshold of the gear displacement of a gear and lower than the low threshold of the gear displacement of another gear.

[0083] The second case unit is used to determine that the knob is in gear if the cumulative displacement is higher than the low threshold of the gear displacement and lower than the high threshold of the same gear displacement.

[0084] In some embodiments of the invention, it further includes: a gear-in-gear update module, used to determine that the knob is in gear and adjust the gear value of the knob based on the cumulative displacement.

[0085] Based on the above embodiments of the invention, the gear adjustment module 530 includes: The direction determination unit is used to determine the adjustment direction of the knob based on the trend of the cumulative displacement value.

[0086] The adjustment value unit is used to determine the gear adjustment value of the knob according to the gear matched by the cumulative displacement.

[0087] The gear adjustment unit is used to increase or decrease the gear value of the knob according to the adjustment direction.

[0088] Based on the above embodiments of the invention, the adjustment value unit determines the gear adjustment value of the knob according to the gear matched with the cumulative displacement, including: If the knob is in the middle of an adjacent gear position, the high gear or low gear corresponding to the cumulative displacement is obtained, and the high gear is reduced by 1 or the low gear is used as the gear adjustment value. If the knob is in gear, the target gear corresponding to the cumulative displacement is obtained as the gear adjustment value.

[0089] Based on the above embodiments of the invention, it further includes: a secondary update unit, used to determine that the gear value of the knob has been updated, and to determine whether the cumulative displacement is greater than the first gear value, wherein the first gear value is the low threshold value of the gear displacement of the lowest gear among all gears; if yes, the gear value update is completed, otherwise, the gear value is set as the temporary gear of the knob.

[0090] Based on the above embodiments of the invention, it further includes: a stop state module, used to determine that the knob is in a stop rotation state if the cumulative displacement of the knob is less than the zero point threshold for at least a threshold number of consecutive times.

[0091] Based on the above embodiments of the invention, it further includes: a parameter adjustment module, used to determine that the knob is in a stopped rotation state and the knob's gear value has been updated, and then adjust the historical knob accumulation amount according to the knob's gear position and the cumulative displacement amount.

[0092] Based on the above embodiments of the invention, the parameter adjustment module adjusts the historical knob accumulation amount according to the knob's engagement state and the accumulated displacement, including: If the knob is confirmed to be in the correct gear position, then the historical knob accumulation value will be reset to zero. If the knob is determined to be in the middle of an adjacent gear, the midpoint value of the gear displacement range corresponding to the gear is extracted from the cumulative displacement. The cumulative displacement is then subtracted from the midpoint value and added to the historical knob cumulative displacement.

[0093] Based on the above embodiments of the invention, the gear adjustment conditions include at least the cumulative displacement being higher than the high threshold of the gear displacement of a gear, and the cumulative historical knob displacement being lower than the low threshold of the gear displacement of another gear.

[0094] The gear adjustment device provided in the embodiments of the present invention can execute the gear adjustment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.

[0095] Example 7 Figure 7 This is a schematic diagram of the structure of an electronic device implementing the gear adjustment method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0096] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0097] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0098] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as gear shifting methods.

[0099] In some embodiments, the gear shifting method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the gear shifting method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the gear shifting method by any other suitable means (e.g., by means of firmware).

[0100] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0101] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0102] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0103] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0104] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0105] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0106] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0107] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A gear adjustment method, characterized in that, The method includes: The cumulative displacement of the knob is collected by an optical sensor, and the stored historical cumulative knob displacement is obtained. The knob's engagement state is determined based on the cumulative displacement and the displacement range of different gears; If the knob is determined to be in the middle of an adjacent gear position, and the cumulative displacement and the historical knob cumulative displacement satisfy the gear adjustment conditions, the gear value of the knob is adjusted based on the cumulative displacement.

2. The method according to claim 1, characterized in that, Determining the knob's engagement state based on the cumulative displacement and the displacement range of different gears includes: Obtain the gear displacement range configured for each gear, wherein the gear displacement range includes at least a low gear displacement threshold and a high gear displacement threshold; If the cumulative displacement is higher than the high threshold of the gear displacement of one gear and lower than the low threshold of the gear displacement of another gear, then the gear position of the knob is determined to be the middle of the adjacent gear. If the cumulative displacement is higher than the low threshold of the gear displacement of the gear position, and lower than the high threshold of the gear displacement of the same gear position, then the knob is determined to be in gear.

3. The method according to claim 1, characterized in that, Also includes: Once the knob is determined to be in the correct gear position, the gear value of the knob is adjusted based on the cumulative displacement.

4. The method according to claim 1 or 3, characterized in that, The adjustment of the knob's position value based on the cumulative displacement includes: The adjustment direction of the knob is determined based on the trend of the cumulative displacement value. The adjustment value of the knob is determined according to the gear position matched by the cumulative displacement. The gear position value of the knob is increased or decreased according to the adjustment direction.

5. The method according to claim 4, characterized in that, Determining the gear adjustment value of the knob according to the gear matched by the cumulative displacement includes: If the knob is in the middle of an adjacent gear position, then the high gear or low gear corresponding to the cumulative displacement is obtained, and the high gear is reduced by 1 or the low gear is used as the gear adjustment value. If the knob is in the gear position, then the target gear corresponding to the cumulative displacement is obtained as the gear adjustment value.

6. The method according to claim 4, characterized in that, Also includes: It is determined that the gear value of the knob has been updated, and it is determined whether the cumulative displacement is greater than the first gear value, wherein the first gear value is the low threshold value of the gear displacement of the lowest gear among all the gears; If yes, then the gear value is updated; otherwise, the gear value is set as a temporary gear of the knob.

7. The method according to claim 1, characterized in that, Also includes: If it is determined that the cumulative displacement of the knob is less than the zero-point threshold for at least a threshold number of consecutive times, then the knob is determined to be in a stopped rotation state.

8. The method according to claim 1 or 7, characterized in that, Also includes: If the knob is determined to be in a stopped rotation state and the knob's gear value has been updated, then the historical knob accumulation value is adjusted according to the knob's gear position and the accumulated displacement.

9. The method according to claim 8, characterized in that, The step of adjusting the historical knob accumulation amount based on the knob's engagement state and the accumulated displacement includes: If the knob is determined to be in the gear position, then the historical knob accumulation value is reset to zero. If the knob is determined to be in the middle of an adjacent gear, then the midpoint value of the gear displacement range corresponding to the gear is extracted from the cumulative displacement amount. The cumulative displacement amount is then subtracted from the midpoint value and added to the historical knob cumulative amount.

10. The method according to claim 1, characterized in that, The gear adjustment conditions include at least the cumulative displacement being higher than a high threshold for gear displacement of a gear, and the cumulative historical knob displacement being lower than a low threshold for gear displacement of another gear.

11. A gear adjustment device, characterized in that, The device includes: The rotation parameter module is used to collect the cumulative displacement of the knob through an optical sensor and obtain the stored historical cumulative knob displacement. The gear position status module is used to determine the gear engagement state of the knob based on the cumulative displacement and the gear displacement range of different gears; The gear adjustment module is used to determine that the knob is in the middle of an adjacent gear, and that the cumulative displacement and the historical knob cumulative displacement meet the gear adjustment conditions, and adjusts the gear value of the knob based on the gear value matched by the cumulative displacement.

12. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the gear adjustment method according to any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the gear adjustment method according to any one of claims 1-10.