High-precision control method and device for mouse direction and mouse

By analyzing the characteristic data and deviation values ​​of the mouse movement trajectory and combining with counter judgment, high-precision control of the mouse movement direction is achieved, and the problem of direction judgment relies on simple linear detection in the prior art is solved, and the operation accuracy and response speed are improved.

CN119536533AInactive Publication Date: 2025-02-28SHENZHEN NEW VIEWPOINT SCI & TECH LTD CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411665244.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-02-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the mouse direction control method relies on simple linear detection and is difficult to capture the tiny displacement changes of the mouse in a small range, resulting in a decrease in operation accuracy and response speed.

Method used

By obtaining the mouse's movement trajectory, calculating the horizontal and vertical movement distances between the trajectory points, analyzing the motion characteristic data, calculating the slope deviation value and the movement distance deviation value, and combining the counter of the mouse body to make judgments, high-precision control of the mouse movement direction is achieved.

Benefits of technology

It improves the recognition accuracy and response speed of mouse movement direction, can quickly identify mouse movement direction, judge the accuracy of direction, and improve user experience in complex operations or scenarios that require fine control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536533A_ABST
    Figure CN119536533A_ABST
Patent Text Reader

Abstract

The invention discloses a high-precision control method and device for the direction of a mouse and the mouse. The method comprises the steps that the movement track of the mouse is obtained; calculating according to the motion trail to obtain a horizontal movement distance and a vertical movement distance between adjacent trail points; performing calculation according to the horizontal movement distance and the vertical movement distance to obtain motion characteristic data between adjacent track points; calculating according to the motion characteristic data to obtain a slope deviation value and a moving distance deviation value; performing judgment operation on the motion trail to obtain a counting number; the slope deviation value is compared with a preset slope threshold value, and the total number of times when the slope deviation value is smaller than the preset slope threshold value is obtained; when it is judged that the counting number and the total number of times meet preset conditions, direction confirmation operation is conducted according to the angle deviation value and the moving distance deviation value, and the effective moving direction of the mouse is obtained. According to the method, the moving direction of the mouse can be quickly recognized, the direction judgment accuracy is high, and the mouse response speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a high-precision control method and device for the direction of a mouse, and a mouse. Background Art

[0002] At present, with the continuous development of computer software and hardware technology, the mouse, as an important input device, is widely used in various scenarios, such as medical equipment. The movement of the mouse not only requires precise control, but also requires rapid response to user instructions during operation to avoid operational errors. In the prior art, the mouse direction control method usually determines the mouse direction by detecting the starting point and the end point of the mouse movement trajectory. When the mouse moves, the initial position is recorded as the starting point, and the end point is recorded when the operation ends, and the direction of the mouse is determined by the line between the starting point and the end point. If the starting point and the end point are on the same straight line, the direction of the mouse movement is set to be opposite to the direction of the line. However, this method shows limitations in certain situations.

[0003] The core problem of the existing technology is that direction judgment relies too much on simple linear detection and lacks the ability to respond sensitively to small displacement changes. When the mouse moves in a small range without forming obvious direction changes, the system cannot effectively capture these changes, thereby reducing the accuracy and response speed of the operation. This affects the user experience in complex operations or scenarios that require fine control. Summary of the invention

[0004] The invention provides a high-precision control method and device for the direction of a mouse and a mouse, so as to realize rapid identification of the moving direction of the mouse, judge the accuracy of the direction and improve the response speed of the mouse.

[0005] In a first aspect, in order to solve the above technical problems, the present invention provides a high-precision control method for the direction of a mouse, comprising: Get the mouse motion trajectory, where the motion trajectory includes trajectory points, the The coordinates of the trajectory points are , ,……, , ; Calculating according to the motion trajectory to obtain the horizontal moving distance and the vertical moving distance between adjacent trajectory points; Calculating according to the horizontal moving distance and the vertical moving distance to obtain motion feature data between adjacent trajectory points, wherein the motion feature data includes slope, moving distance, average slope, average moving distance and angle deviation value; Calculate according to the motion characteristic data to obtain a slope deviation value and a moving distance deviation value; Based on the counter of the mouse body, a judgment operation is performed on the movement trajectory to obtain a count number; Comparing the slope deviation value with a preset slope threshold value to obtain a total number of times the slope deviation value is less than the preset slope threshold value; When it is determined that the count number and the total number of times meet the preset conditions, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse.

[0006] Preferably, the calculation formula for the horizontal moving distance is: In the formula, is the horizontal moving distance between adjacent trajectory points; The motion trajectory The X-axis coordinate value of each trajectory point; The motion trajectory The X-axis coordinate value of each trajectory point; ; The vertical moving distance calculation formula is: In the formula, is the vertical moving distance between adjacent trajectory points; For the motion trajectory The Y-axis coordinate value of each trajectory point; The motion trajectory The Y-axis coordinate value of each trajectory point; .

[0007] Preferably, the slope calculation formula is: In the formula, is the slope between adjacent trajectory points; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; ; The calculation formula of the moving distance is: In the formula, is the moving distance between adjacent trajectory points; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; ; The calculation formula of the average slope is: In the formula, is the average slope; is the slope between adjacent trajectory points; ; The calculation formula of the average moving distance is: In the formula, is the average moving distance; is the moving distance between adjacent trajectory points; ; The angle deviation value calculation formula is: In the formula, is the angle deviation value; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; .

[0008] Preferably, the calculation formula of the slope deviation value is: In the formula, is the slope deviation value; is the slope between adjacent trajectory points; is the average slope; The calculation formula of the moving distance deviation value is: In the formula, is the moving distance deviation value; is the moving distance between adjacent trajectory points; is the average moving distance.

[0009] Preferably, the counter based on the mouse body performs a judgment operation on the motion trajectory to obtain a count number, including: Initializing the counter and counting the motion trajectory to obtain the number of trajectory points; When the number of trajectory points is less than a preset number or satisfies a preset increment condition, the count number is incremented by 1 each time a trajectory point is counted or each time the preset increment condition is met; When the number of trajectory points is equal to a preset number, the counting increment operation is stopped and the count number is output.

[0010] Preferably, when it is determined that the count number and the total number of times meet a preset condition, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain a valid moving direction of the mouse, including: When the total number of times is less than the count number, the count number is incremented by 1; When the total number of times is equal to the counted number, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse.

[0011] Preferably, performing a direction confirmation operation according to the angle deviation value and the moving distance deviation value to obtain a valid moving direction of the mouse includes: When the angle deviation value is greater than a preset angle threshold, and the moving distance deviation value is less than a preset moving distance threshold, a trajectory point extraction operation is performed to obtain a valid moving trajectory point; The effective movement trajectory points are connected in chronological order to obtain the effective movement direction of the mouse.

[0012] In a second aspect, the present invention provides a high-precision control device for mouse direction, comprising: A distance calculation module, used to calculate according to the motion trajectory to obtain the horizontal movement distance and the vertical movement distance between adjacent trajectory points; A data calculation module, used for calculating according to the horizontal moving distance and the vertical moving distance to obtain motion feature data between adjacent trajectory points, wherein the motion feature data includes slope, moving distance, average slope, average moving distance and angle deviation value; A deviation calculation module, used to calculate according to the motion characteristic data to obtain a slope deviation value and a moving distance deviation value; A counting operation module, used for performing a judgment operation on the motion trajectory based on a counter of the mouse body to obtain a count number; A slope comparison module, used to compare the slope deviation value with a preset slope threshold value to obtain a total number of times that the slope deviation value is less than the preset slope threshold value; The direction confirmation module is used to perform a direction confirmation operation according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse when it is determined that the count number and the total number of times meet the preset conditions.

[0013] In a third aspect, the present invention further provides an electronic device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements any one of the above-mentioned high-precision control methods for the mouse direction when executing the computer program.

[0014] In a fourth aspect, the present invention further provides a mouse, comprising a high-precision control device for the direction of the mouse as described in any one of the above.

[0015] The present invention discloses a high-precision control method, device and mouse for the direction of a mouse, and the method can improve the recognition accuracy and response speed of the mouse movement direction. By acquiring the movement trajectory of the mouse in real time and calculating the horizontal and vertical movement distances between the trajectory points, the slight movement of the mouse can be captured. Furthermore, by analyzing the movement feature data of the mouse, calculating the slope deviation value and the movement distance deviation value, and combining the counter of the mouse body to judge the movement trajectory, the quantitative analysis of the mouse movement behavior is increased. By comparing the slope deviation value with the preset slope threshold, the slight changes in the mouse movement can be identified. When the count number and the total number of times meet the preset conditions, the direction is confirmed according to the angle deviation value and the movement distance deviation value. Compared with the prior art, the method can realize the rapid identification of the mouse movement direction, the accuracy of the direction judgment and the improvement of the mouse response speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic flow chart of a high-precision control method for the mouse direction provided by the first embodiment of the present invention; Figure 2 It is a schematic diagram of the structure of a high-precision control device for the mouse direction provided by the second embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] Reference Figure 1 The first embodiment of the present invention provides a high-precision control method for the direction of a mouse, comprising the following steps: S11, obtaining a motion trajectory of the mouse, wherein the motion trajectory includes trajectory points, the The coordinates of the trajectory points are , ,……, , ; S12, calculating according to the motion trajectory to obtain a horizontal moving distance and a vertical moving distance between adjacent trajectory points; S13, performing calculation according to the horizontal moving distance and the vertical moving distance to obtain motion feature data between adjacent trajectory points, wherein the motion feature data includes a slope, a moving distance, an average slope, an average moving distance, and an angle deviation value; S14, performing calculations based on the motion feature data to obtain a slope deviation value and a moving distance deviation value; S15, based on the counter of the mouse body, performing a judgment operation on the motion trajectory to obtain a count number; S16, comparing the slope deviation value with a preset slope threshold value to obtain a total number of times the slope deviation value is less than the preset slope threshold value; S17, when it is determined that the count number and the total number of times meet the preset conditions, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse.

[0019] In step S11, it is necessary to obtain the motion trajectory of the mouse, wherein the motion trajectory includes trajectory points, the The coordinates of the trajectory points are , ,……, , ,include: In a specific embodiment, the motion trajectory of the mouse is composed of continuous trajectory points, each of which represents the specific position of the mouse at a certain moment, and the coordinates are ,in Represents the index of the trajectory point, there are a total of trajectory points, i.e. , ,……, , Constructs a complete path from the starting location to the ending location.

[0020] First, in order to obtain these trajectories, the system will collect the coordinate information of the current position of the mouse at a fixed time interval. In this way, the movement path of the mouse can be continuously recorded. Each recorded trajectory point data will be stored in the system memory or database in turn to form a complete trajectory curve.

[0021] Secondly, in order to ensure the accuracy of the acquired data, the system usually uses a de-jitter or error filtering algorithm to exclude the noise data generated when the mouse is stationary or has slight vibrations. This can avoid unnecessary error interference and ensure that the recorded trajectory truly reflects the movement path of the mouse.

[0022] Specifically, the acquired trajectory data is used for further calculation and analysis, such as determining the direction of mouse movement or calculating the angle of movement.

[0023] In step S12, it is necessary to calculate according to the motion trajectory to obtain the horizontal movement distance and the vertical movement distance between adjacent trajectory points, including: In a specific embodiment, the system obtains the motion trajectory according to the steps, that is, each pair of adjacent trajectory points and Calculate to obtain the horizontal moving distance and the vertical moving distance, wherein the calculation formula of the horizontal moving distance is: In the formula, is the horizontal moving distance between adjacent trajectory points; The motion trajectory The X-axis coordinate value of each trajectory point; The motion trajectory The X-axis coordinate value of each trajectory point; ; The vertical moving distance calculation formula is: In the formula, is the vertical moving distance between adjacent trajectory points; The motion trajectory The Y-axis coordinate value of each trajectory point; The motion trajectory The Y-axis coordinate value of the trajectory point .

[0024] For example, these two calculation results reflect the movement of the mouse from one position to the next. Through the continuous changes in the horizontal and vertical movement distances of multiple adjacent track points, it can be determined whether the mouse is moving in a specific direction or turning. In this way, the mouse track is not just a collection of position points, but a dynamic process that reflects its movement characteristics.

[0025] In step S12 of the present invention, the horizontal and vertical moving distances of adjacent trajectory points are calculated to provide necessary data support for subsequent operations such as direction determination and trajectory prediction.

[0026] In step S13, it is necessary to calculate according to the horizontal moving distance and the vertical moving distance to obtain motion feature data between adjacent trajectory points, wherein the motion feature data includes slope, moving distance, average slope, average moving distance and angle deviation value, including: First, calculate the slope between each pair of adjacent trajectory points , used to describe the relative movement direction of the mouse, where the slope calculation formula is: In the formula, is the slope between adjacent trajectory points; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; ; In a specific embodiment, the slope represents the relative movement direction of the mouse between two adjacent trajectory points, which is a preliminary description of the mouse movement angle. By calculating the slope, the change in the movement direction of the mouse between two points can be preliminarily determined. When the slope is a positive value, it means that the mouse is moving upward, when it is a negative value, it means that it is moving downward, and a zero value means horizontal movement. By continuously calculating the slopes of multiple adjacent points, the change in the mouse trajectory can be intuitively reflected, such as whether the movement trend remains consistent or turns.

[0027] Secondly, calculate the moving distance between adjacent trajectory points , used to describe the total path length of the mouse moving from one position to another, where the calculation formula for the moving distance is: In the formula, is the moving distance between adjacent trajectory points; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; ; In a specific embodiment, the moving distance is used to describe the actual path length of the mouse between adjacent track points. It represents the total displacement of the mouse from one position to the next, reflecting the amplitude and intensity of the mouse movement. By analyzing the moving distance, it can be determined whether the mouse maintains stable movement, accelerates or decelerates.

[0028] For example, in order to describe the overall movement trend of the mouse, it is necessary to calculate the average slope between all adjacent trajectory points. , wherein the calculation formula of the average slope is: In the formula, is the average slope; is the slope between adjacent trajectory points; ; In a specific embodiment, the average slope is the average value of the slopes between all adjacent track points, which is used to describe the overall movement trend of the mouse. If the average slope is close to zero, it means that the mouse tends to move horizontally as a whole; if it is a positive or negative value, it means that the mouse as a whole has an obvious upward or downward trend. The average slope helps to identify the direction change trend of the mouse over a long period of time and improve the accuracy of the movement direction prediction.

[0029] For example, in order to describe the overall movement trend of the mouse, it is also necessary to calculate the average moving distance between all adjacent track points. , wherein the calculation formula of the average moving distance is: In the formula, is the average moving distance; is the moving distance between adjacent trajectory points; ; In a specific embodiment, the average moving distance is the average of the moving distances between all adjacent track points, indicating the average movement amplitude of the mouse over a period of time. It reflects the overall strength and stability of the mouse movement. A larger average moving distance indicates that the mouse moves faster, while a smaller value indicates that the mouse moves slower. By analyzing the average moving distance, the movement response speed and sensitivity of the mouse can be better adjusted.

[0030] Finally, in order to analyze the angle change of the mouse movement trajectory, it is necessary to calculate the angle deviation value , wherein the angle deviation value calculation formula is: In the formula, is the angle deviation value; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; .

[0031] In a specific embodiment, the angle deviation value describes the angle change of the mouse between adjacent track points, further refining the motion characteristics described by the slope. By calculating the angle deviation value, it is possible to identify subtle changes in the direction of mouse movement, which is an important basis for determining whether the mouse has turned.

[0032] In step S13 of the present invention, based on the calculation of the horizontal moving distance and the vertical moving distance, multiple motion feature data including slope, moving distance, average slope, average moving distance and angle deviation value are obtained. These data not only describe the instantaneous motion state of the mouse, but also reflect the overall motion trend and change, providing data support for subsequent direction judgment and response optimization.

[0033] In step S14, it is necessary to calculate based on the motion feature data to obtain a slope deviation value and a moving distance deviation value, including: Specifically, it is necessary to calculate the slope deviation value of each adjacent trajectory point , to describe its relationship with the overall average slope The degree of deviation, wherein the calculation formula of the slope deviation value is: In the formula, is the slope deviation value; is the slope between adjacent trajectory points; is the average slope; In a specific embodiment, the slope deviation value indicates the degree of deviation of the slope between each pair of adjacent track points relative to the overall average slope. It reflects the change in the local movement direction of the mouse and the difference compared with the overall trend. For example, a positive slope deviation value indicates that the movement direction of the track segment deviates from the overall average trend by a larger angle, while a negative slope deviation value indicates that the deviation angle is smaller.

[0034] Specifically, the moving distance deviation value needs to be calculated , to measure the moving distance of each pair of adjacent trajectory points relative to the overall average moving distance The deviation degree of the moving distance is calculated as follows: In the formula, is the moving distance deviation value; is the moving distance between adjacent trajectory points; is the average moving distance.

[0035] In a specific embodiment, the moving distance deviation value represents the ratio of the moving distance between each pair of adjacent trajectory points to the overall average moving distance. This value indicates the deviation of the movement amplitude of the mouse in a certain segment of the trajectory from the overall movement trend. When the deviation value is equal to 1, it means that the movement of this segment is consistent with the overall average movement distance; when it is greater than 1, it means that the movement amplitude is large, and when it is less than 1, it means that the movement amplitude is small. By calculating the moving distance deviation value, it can be determined whether the movement amplitude of the mouse in the trajectory is consistent with the overall movement trend. A large deviation value indicates that the mouse may have abnormal acceleration or deceleration in this segment of movement, which requires further analysis and adjustment.

[0036] In step S14 of the present invention, the calculation of the deviation value can provide support for determining the change pattern of the mouse movement. If the slope deviation value and the moving distance deviation value are both within a reasonable range, it indicates that the mouse movement tends to be stable and conforms to the expected trajectory; if the deviation value exceeds a certain range, it is necessary to further determine whether there is a direction change, trajectory deviation or other abnormal conditions.

[0037] In step S15, it is necessary to perform a judgment operation on the motion trajectory based on the counter of the mouse body to obtain a count number, including: First, before starting the judgment operation, the system needs to initialize the counter. The purpose of initialization is to ensure that the counter is in a zero count state and can record the number of points of the mouse motion trajectory from the beginning. After the initialization is completed, the system starts to count the acquired motion trajectory and record the number of trajectory points. Each recorded trajectory point represents the state of the mouse at that position, thus forming a continuous trajectory line.

[0038] Secondly, when the number of recorded trajectory points is less than the preset number, or satisfies the preset incrementing condition, the value of the counter will be incremented by 1 each time a trajectory point is added or the incrementing condition is met.

[0039] It should be noted that the preset condition is that the slope deviation value is less than the preset slope threshold, and the preset number is a sampling limit for the trajectory, which is used to control the size of the data volume. By incrementing the counter, the mouse trajectory changes can be dynamically monitored, thereby providing a reference for subsequent trajectory analysis.

[0040] Finally, when the number of track points recorded by the counter is equal to the preset number, the counting operation will stop and the system will output the final count number. The counter stops incrementing, which means that the collection or judgment operation of the mouse track has reached the preset conditions and can enter the next step of analysis or control. In this way, it can be ensured that the system collects and analyzes data when necessary without exceeding the established range or conditions.

[0041] In step S15 of the present invention, the movement trajectory is judged and counted by a counter based on the mouse body, so that the change of the mouse trajectory can be dynamically tracked and controlled.

[0042] In step S16, the slope deviation value needs to be compared with a preset slope threshold value to obtain the total number of times the slope deviation value is less than the preset slope threshold value, including: In step S16, the calculated slope deviation value needs to be compared with the preset slope threshold value to determine and count the total number of times the slope deviation value is less than the preset threshold value. The purpose of this step is to identify the stable state or specific change trend in the mouse motion trajectory through comparison, so as to further optimize the mouse motion direction and trajectory control.

[0043] First, you need to set a preset slope threshold. This threshold is a key parameter used to determine the stability of the mouse movement direction. For example, for scenarios that require high precision and sensitivity (such as medical equipment or industrial control systems), a smaller threshold should be set to capture subtle changes in mouse movement. For example, 0.005 means that even a small movement deviation will affect the final control result. In daily office or ordinary operations, a larger threshold can be used to reduce the system's frequent response to small deviations, thereby improving operational smoothness. For example, the slope threshold can be set to 0.1.

[0044] Next, each calculated slope deviation value is compared with the preset slope threshold. When the slope deviation value is less than the preset threshold, it means that the mouse has maintained a high directional stability in this section of the trajectory, and there is no significant directional change or deviation. Each time this condition is met, it will be counted once. For example, if the total number of times the slope deviation value is less than the preset threshold is large, it means that the overall movement of the mouse is relatively stable; on the contrary, if the number is small, there are more directional changes, and further adjustment and optimization of the system response are required.

[0045] Finally, by counting the total number of times the slope deviation value is less than the preset threshold, the system can determine the stability of the mouse trajectory within a specific time.

[0046] In step S16 of the present invention, the stability or change trend of the mouse track can be determined by comparing the slope deviation value with a preset slope threshold and counting the total number of times that the condition is met.

[0047] In step S17, when it is determined that the count number and the total number of times meet the preset conditions, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse, including: First, the system needs to monitor the relationship between the total number of times and the number of counts. When the total number of times is less than the number of counts, it means that the mouse's motion trajectory has not yet reached the system's preset conditions or requirements. In order to continue tracking and accumulating data, the system will increment the number of counts by 1. Through this increment operation, the system ensures that the collection and processing of the trajectory is continuous and cumulative.

[0048] Secondly, when the total number of times is equal to the count number, it means that the collection of the mouse motion trajectory has reached the preset conditions, and a more detailed direction confirmation operation is required. Specifically, the system will use the angle deviation value and the moving distance deviation value to determine the direction of the mouse movement. The angle deviation value reflects the angle change of the mouse between adjacent trajectory points, while the moving distance deviation value describes the change in the movement amplitude of the mouse between these points. These two offset parameters can determine whether the direction of the mouse movement has changed or is in a stable state. For example, if the angle deviation value is greater than the preset angle threshold, and the moving distance deviation value is less than the preset moving distance threshold, it indicates that the direction of the mouse movement has changed significantly, and its movement amplitude is still within a reasonable range. At this time, the system will extract valid trajectory points and confirm the direction.

[0049] In a specific embodiment, the extraction of valid trajectory points is a further screening and optimization of the mouse trajectory data. Valid trajectory points are trajectory points that have obvious changes in direction during the movement process and meet the preset movement amplitude requirements. The process of extracting valid trajectory points is based on the judgment of the angle deviation value and the moving distance deviation value. When the angle deviation value is greater than the preset angle threshold, and at the same time the moving distance deviation value is less than the preset moving distance threshold, the system considers that the trajectory point represents a valid direction change, that is, the movement direction of the mouse has changed significantly, but its amplitude change is within a reasonable range and meets the standards of a valid moving trajectory. Therefore, these trajectory points are regarded as "valid trajectory points" for further direction confirmation.

[0050] In a specific embodiment, the direction confirmation operation needs to determine the effective movement direction of the mouse based on the effective track points, and the system will connect the effective track points according to the time sequence to form a continuous track representing the effective movement direction of the mouse. This process can establish a complete direction path by connecting the effective track points in the order of time, thereby obtaining the effective movement direction of the mouse.

[0051] In step S17 of the present invention, the system can confirm and optimize the movement direction of the mouse when certain conditions are met. This processing method avoids premature or too frequent direction confirmation, which helps to improve the accuracy of direction judgment. At the same time, by combining with the deviation value of the angle and the moving distance, the movement direction of the mouse can reflect the real movement trajectory. By extracting the trajectory points that meet the conditions and connecting them according to the time sequence, the system can confirm the effective movement direction of the mouse.

[0052] The following describes the working process of the present invention using a common scenario as an example. Figure 2 , which is Figure 1 Schematic diagram of the working scenario of the method.

[0053] Suppose in a high-precision medical surgical navigation system, the doctor needs to accurately control the surgical robot arm through the mouse to perform complex and delicate surgical operations, such as implanting tiny instruments or making precise cuts in specific parts of the patient's body. At this time, any slight error may lead to serious consequences, so the movement of the mouse needs to be extremely stable, accurate and sensitive. The following is the specific working process of the method of the present invention in this application scenario: During the operation, the system will capture the movement trajectory of the mouse in real time, record the position data at each time point, and form a complete path containing multiple trajectory points. For example, when the doctor guides the surgical robot arm with the mouse, each small movement will generate a trajectory point to record the coordinates of the current position of the mouse. These coordinate points constitute a continuous path from the start of the operation to the current position. To ensure the accuracy of the data, the system will also apply de-jitter and error filtering algorithms to eliminate noise interference caused by slight jitter or unintentional movement of the mouse, ensuring that the acquired trajectory can truly reflect the intention of the mouse.

[0054] The system calculates the horizontal and vertical movement distances based on each pair of adjacent trajectory points. These data are used to determine the mouse movement range in the X-axis and Y-axis directions. For example, when the doctor needs to move the robotic arm in a specific direction, the changes in the horizontal and vertical movement distances can reflect the precise movement trajectory of the mouse, ensuring that every subtle movement is recorded and analyzed, providing basic data support for the subsequent direction judgment.

[0055] In this step, the system further calculates the slope and moving distance between each pair of adjacent trajectory points. The slope describes the relative movement direction of the mouse between two trajectory points, while the moving distance represents the total displacement of the mouse in this path. For example, when the doctor adjusts the direction of the surgical robot arm, the change in slope can reflect the trend of the direction change, while the moving distance indicates the amplitude of the movement. The system also calculates the average slope and average moving distance of all adjacent trajectory points to measure the overall movement trend and amplitude stability of the mouse. This information is crucial during surgery and can help the system judge the doctor's intention changes in real time and make adjustments.

[0056] The system calculates the slope deviation and movement distance deviation of each pair of adjacent trajectory points to measure the degree of deviation of the mouse movement trajectory from the overall average. For example, if the slope deviation is large, it may indicate that the direction of the mouse movement has changed significantly, prompting the system to make timely adjustments and compensations to the movement of the surgical robot arm; while a large movement distance deviation may indicate that the mouse moves too fast or too slow in a certain period of time, and the system can adjust the speed accordingly.

[0057] To further monitor the mouse's trajectory, the system uses a counter to count and judge the trajectory points. For example, when the doctor continues to adjust the surgical robot arm, the system will record every trajectory point of the mouse. The counter will dynamically increase until the preset conditions are met. This process ensures that the system will only perform subsequent analysis when there is enough data, thereby avoiding premature direction judgments that lead to misoperations.

[0058] The system compares the slope deviation value with a preset slope threshold. For high-precision surgical environments, the preset slope threshold is usually set low to capture any subtle changes in the mouse. If the total number of times the slope deviation value is less than the threshold is large, it indicates that the mouse's movement direction is relatively stable; if the number is small, the system will determine that the mouse may have many directional changes, suggesting that further monitoring and adjustment of the robot arm's movement may be required.

[0059] When the system determines that the number of counts and the total number of times meet the preset conditions, it will perform a direction confirmation operation based on the angle deviation value and the moving distance deviation value. For example, when the doctor adjusts the direction with the mouse, the system will determine whether the angle deviation value exceeds the preset angle threshold, and whether the moving distance deviation value is within a reasonable range. If the conditions are met, the system will extract valid trajectory points, confirm the effective movement direction of the mouse, and connect these trajectory points in chronological order. This confirmation process can ensure that the surgical robot arm moves accurately according to the doctor's intention, avoid unnecessary misoperation or direction deviation, and improve the safety of the surgical process.

[0060] In this application scenario, the high-precision mouse direction control method of the present invention can sense the subtle changes of the mouse in real time through precise trajectory acquisition, motion feature analysis, deviation calculation and direction confirmation, and accurately transmit them to the surgical robot arm, thus meeting the high-precision requirements of the medical environment.

[0061] In summary, the present invention discloses a high-precision control method, device and mouse for the direction of a mouse, and the method can improve the recognition accuracy and response speed of the mouse movement direction. By acquiring the movement trajectory of the mouse in real time and calculating the horizontal and vertical movement distances between the trajectory points, the slight movement of the mouse can be captured. Furthermore, by analyzing the motion feature data of the mouse, calculating the slope deviation value and the movement distance deviation value, and combining the counter of the mouse body to judge the movement trajectory, the quantitative analysis of the mouse movement behavior is added. By comparing the slope deviation value with the preset slope threshold, the subtle changes in the mouse movement can be identified. When the count number and the total number of times meet the preset conditions, the direction is confirmed according to the angle deviation value and the movement distance deviation value. Compared with the prior art, this method can realize the rapid identification of the mouse movement direction, the accuracy of judging the direction and improve the mouse response speed.

[0062] Reference Figure 2 The second embodiment of the present invention provides a high-precision control device for the direction of a mouse, comprising: A trajectory acquisition module is used to acquire the motion trajectory of the mouse, wherein the motion trajectory includes trajectory points, the The coordinates of the trajectory points are , ,……, , ; A distance calculation module, used to calculate according to the motion trajectory to obtain the horizontal movement distance and the vertical movement distance between adjacent trajectory points; A data calculation module, used for calculating according to the horizontal moving distance and the vertical moving distance to obtain motion feature data between adjacent trajectory points, wherein the motion feature data includes slope, moving distance, average slope, average moving distance and angle deviation value; A deviation calculation module, used to calculate according to the motion characteristic data to obtain a slope deviation value and a moving distance deviation value; A counting operation module, used for performing a judgment operation on the motion trajectory based on a counter of the mouse body to obtain a count number; A slope comparison module, used to compare the slope deviation value with a preset slope threshold value to obtain a total number of times that the slope deviation value is less than the preset slope threshold value; The direction confirmation module is used to perform a direction confirmation operation according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse when it is determined that the count number and the total number of times meet the preset conditions.

[0063] Preferably, the trajectory acquisition module is specifically used to acquire the motion trajectory of the mouse, wherein the motion trajectory includes trajectory points, the The coordinates of the trajectory points are , ,……, , .

[0064] Preferably, the distance calculation module is specifically used to calculate according to the motion trajectory to obtain the horizontal movement distance and the vertical movement distance between adjacent trajectory points, including: The calculation formula of the horizontal moving distance is: In the formula, is the horizontal moving distance between adjacent trajectory points; The motion trajectory The X-axis coordinate value of each trajectory point; The motion trajectory The X-axis coordinate value of each trajectory point; ; The vertical moving distance calculation formula is: In the formula, is the vertical moving distance between adjacent trajectory points; The motion trajectory The Y-axis coordinate value of each trajectory point; The motion trajectory The Y-axis coordinate value of the trajectory point .

[0065] Preferably, the data calculation module is specifically used to calculate according to the horizontal moving distance and the vertical moving distance to obtain motion feature data between adjacent trajectory points, wherein the motion feature data includes slope, moving distance, average slope and average moving distance and angle deviation value, including: The slope calculation formula is: In the formula, is the slope between adjacent trajectory points; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; ; The calculation formula of the moving distance is: In the formula, is the moving distance between adjacent trajectory points; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; ; The calculation formula of the average slope is: In the formula, is the average slope; is the slope between adjacent trajectory points; ; The calculation formula of the average moving distance is: In the formula, is the average moving distance; is the moving distance between adjacent trajectory points; ; The angle deviation value calculation formula is: In the formula, is the angle deviation value; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; .

[0066] Preferably, the deviation calculation module is specifically used to calculate according to the motion feature data to obtain a slope deviation value and a moving distance deviation value, including: The calculation formula of the slope deviation value is: In the formula, is the slope deviation value; is the slope between adjacent trajectory points; is the average slope; The calculation formula of the average moving distance is: In the formula, is the moving distance deviation value; is the moving distance between adjacent trajectory points; is the average moving distance.

[0067] Preferably, the counting operation module is specifically used to perform a judgment operation on the motion trajectory based on a counter of the mouse body to obtain a count number, including: Initializing the counter and counting the motion trajectory to obtain the number of trajectory points; When the number of trajectory points is less than a preset number or satisfies a preset increment condition, the count number is incremented by 1 each time a trajectory point is counted or each time the preset increment condition is met; When the number of trajectory points is equal to a preset number, the counting increment operation is stopped and the count number is output.

[0068] Preferably, the slope comparison module is specifically used to compare the slope deviation value with a preset slope threshold value to obtain the total number of times the slope deviation value is less than the preset slope threshold value.

[0069] Preferably, the direction confirmation module is specifically used to perform a direction confirmation operation according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse when it is determined that the count number and the total number of times meet a preset condition, including: When the total number of times is less than the count number, the count number is incremented by 1; When the total number of times is equal to the counted number, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse.

[0070] Preferably, the direction confirmation module is further configured to perform a direction confirmation operation according to the angle deviation value and the moving distance deviation value to obtain a valid moving direction of the mouse, including: When the angle deviation value is greater than a preset angle threshold, and the moving distance deviation value is less than a preset moving distance threshold, a trajectory point extraction operation is performed to obtain a valid moving trajectory point; The effective movement trajectory points are connected in chronological order to obtain the effective movement direction of the mouse.

[0071] It should be noted that a high-precision control device for mouse direction provided in an embodiment of the present invention is used to execute all process steps of a high-precision control method for mouse direction in the above embodiment, and the working principles and beneficial effects of the two correspond one to one, so they will not be repeated here.

[0072] An embodiment of the present invention further provides a mouse, which includes the high-precision control device for the mouse direction as described above.

[0073] The embodiment of the present invention further provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as an angle deviation value calculation program. When the processor executes the computer program, the steps in the above-mentioned high-precision control method for the direction of the mouse are implemented, such as Figure 1 Alternatively, when the processor executes the computer program, the functions of each module / unit in the above-mentioned device embodiments are realized, such as the distance calculation module.

[0074] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the electronic device.

[0075] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, and a smart tablet. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. The electronic device may include more or fewer components than the above components, or may combine certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0076] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device.

[0077] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the electronic device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0078] Wherein, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0079] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0080] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A high-precision control method for mouse direction, characterized in that include: Get the mouse motion trajectory, where the motion trajectory includes trajectory points, the The coordinates of the trajectory points are , ,……, , ; Calculating according to the motion trajectory to obtain the horizontal moving distance and the vertical moving distance between adjacent trajectory points; Calculating according to the horizontal moving distance and the vertical moving distance to obtain motion feature data between adjacent trajectory points, wherein the motion feature data includes slope, moving distance, average slope, average moving distance and angle deviation value; Calculate according to the motion characteristic data to obtain a slope deviation value and a moving distance deviation value; Based on the counter of the mouse body, a judgment operation is performed on the movement trajectory to obtain a count number; Comparing the slope deviation value with a preset slope threshold value to obtain a total number of times the slope deviation value is less than the preset slope threshold value; When it is determined that the count number and the total number of times meet the preset conditions, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse.

2. The high-precision control method for mouse direction according to claim 1, characterized in that: The calculation formula of the horizontal moving distance is: In the formula, is the horizontal moving distance between adjacent trajectory points; The motion trajectory The X-axis coordinate value of each trajectory point; For the motion trajectory The X-axis coordinate value of each trajectory point; The vertical moving distance calculation formula is: In the formula, is the vertical moving distance between adjacent trajectory points; For the motion trajectory The Y-axis coordinate value of each trajectory point; For the motion trajectory The Y-axis coordinate value of each trajectory point; .

3. The high-precision control method for mouse direction according to claim 1, characterized in that: The slope calculation formula is: In the formula, is the slope between adjacent trajectory points; is the horizontal moving distance between adjacent trajectory points; is the vertical moving distance between adjacent trajectory points; ; The calculation formula of the moving distance is: In the formula, is the moving distance between adjacent trajectory points; The calculation formula of the average slope is: In the formula, is the average slope; The calculation formula of the average moving distance is: In the formula, is the average moving distance; The angle deviation value calculation formula is: In the formula, is the angle deviation value.

4. The high-precision control method for mouse direction according to claim 1, characterized in that: The calculation formula of the slope deviation value is: In the formula, is the slope deviation value; is the slope between adjacent trajectory points; is the average slope; The calculation formula of the moving distance deviation value is: In the formula, is the moving distance deviation value; is the moving distance between adjacent trajectory points; is the average moving distance.

5. The high-precision control method for mouse direction according to claim 1, characterized in that: The counter based on the mouse body performs a judgment operation on the motion trajectory to obtain a count number, including: Initializing the counter and counting the motion trajectory to obtain the number of trajectory points; When the number of trajectory points is less than a preset number or satisfies a preset increment condition, the count number is incremented by 1 each time a trajectory point is counted or each time the preset increment condition is met; When the number of trajectory points is equal to a preset number, the counting increment operation is stopped and the count number is output.

6. The high-precision control method for mouse direction according to claim 1, characterized in that: When it is determined that the count number and the total number of times meet the preset conditions, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse, including: When the total number of times is less than the count number, the count number is incremented by 1; When the total number of times is equal to the counted number, a direction confirmation operation is performed according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse.

7. The high-precision control method for the mouse direction according to claim 6, characterized in that: The step of performing a direction confirmation operation according to the angle deviation value and the moving distance deviation value to obtain a valid moving direction of the mouse includes: When the angle deviation value is greater than a preset angle threshold, and the moving distance deviation value is less than a preset moving distance threshold, a trajectory point extraction operation is performed to obtain a valid moving trajectory point; The effective movement trajectory points are connected in chronological order to obtain the effective movement direction of the mouse.

8. The high-precision control device for mouse direction according to claim 1, characterized in that: include: A trajectory acquisition module is used to acquire the motion trajectory of the mouse, wherein the motion trajectory includes trajectory points, the The coordinates of the trajectory points are , ,……, , ; A distance calculation module, used to calculate according to the motion trajectory to obtain the horizontal movement distance and the vertical movement distance between adjacent trajectory points; A data calculation module, used for calculating according to the horizontal moving distance and the vertical moving distance to obtain motion feature data between adjacent trajectory points, wherein the motion feature data includes slope, moving distance, average slope, average moving distance and angle deviation value; A deviation calculation module, used to calculate according to the motion characteristic data to obtain a slope deviation value and a moving distance deviation value; A counting operation module, used for performing a judgment operation on the motion trajectory based on a counter of the mouse body to obtain a count number; A slope comparison module, used to compare the slope deviation value with a preset slope threshold value to obtain a total number of times that the slope deviation value is less than the preset slope threshold value; The direction confirmation module is used to perform a direction confirmation operation according to the angle deviation value and the moving distance deviation value to obtain the effective moving direction of the mouse when it is determined that the count number and the total number of times meet the preset conditions.

9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for high-precision control of the mouse direction as claimed in any one of claims 1 to 7 is implemented.

10. A mouse, characterized in that: The mouse comprises the high-precision control device for the mouse direction as claimed in claim 8.