Touch point position prediction method and device, equipment, medium and program product
By predicting the future trajectory of the touch point position on the virtual touch screen, and optimizing the prediction with angular velocity and angular acceleration, the lag caused by delay in the virtual touch screen is solved, achieving a smoother and more natural interactive experience.
Patent Information
- Application Number
- CN202510355216.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-11
AI Technical Summary
In virtual touch screen technology, the processing of touch operation events is stuttered due to transmission delay and processing delay, which affects the smoothness and real-timeness of virtual touch interaction.
By obtaining multiple historical position coordinates of the touch point position of the virtual touch screen under the Cartesian coordinate system, dynamic motion information is determined, the future trajectory of the touch point position is predicted using angular velocity and angular acceleration, and optimizing the prediction results with the target correction function, responding to touch operations in advance.
It reduces the delay of virtual touch devices, improves the smoothness and real-timeness of virtual touch interaction, and improves the user's operating experience.
Smart Images

Figure CN120295540A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of virtual touchscreens, and particularly to a method, device, equipment, medium and program product for predicting the position of a touch point. Background Art
[0002] A touchscreen is an interactive input device. On a smart device equipped with a touchscreen, a user can control the operation of the operating system on the smart device by simply touching a certain position on the screen with a finger or a stylus. The virtual touchscreen technology is to virtualize a "touchscreen" on a terminal device (a smart device that does not have a physical touch device and cannot perform touch operations) so that the terminal device can also perform touch operations.
[0003] In the process of implementing touch operations through the virtual touchscreen technology on the terminal device, a physical touch device needs to be connected. In related technologies, usually, touch operation events on the physical touch device are sent to the terminal device through a specific transmission channel for the terminal device to implement touch operations.
[0004] However, in the process of transmitting touch operation events through a specific transmission channel, due to transmission delay and processing delay, the processing of touch operation events results in a lag in the touch effect. Therefore, it is urgent to improve the fluency and real-time performance of virtual touch interaction. Summary of the Invention
[0005] In view of this, the present invention provides a method, device, equipment, medium and program product for predicting the position of a touch point to solve the problem of obvious delay and touch effect lag that occur in the process of implementing virtual touch operations according to related technologies.
[0006] In a first aspect, the present invention provides a method for predicting the position of a touch point, including: obtaining a plurality of historical position coordinates of the touch point position on the virtual touchscreen in a rectangular coordinate system; determining the dynamic motion information of the touch point position at the current moment according to the plurality of historical position coordinates; the dynamic motion information is information used to describe the behavior trend of the touch point position during the movement process; predicting the polar coordinates of the touch point position at the next moment according to the dynamic motion information to obtain the target position polar coordinates at the next moment; determining the predicted coordinates of the touch point position at the next moment according to the target position polar coordinates at the next moment and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the next moment.
[0007] By obtaining multiple historical position coordinates of the touch point position on the virtual touch screen in the rectangular coordinate system, the present invention determines the dynamic motion information of the touch point position at the current moment, can accurately capture the behavioral trend of the movement of the touch point position, and makes the subsequent analysis of the touch point position more accurate. The present invention predicts the polar coordinates of the touch point position at the next moment based on the dynamic motion information, obtains the target position polar coordinates at the next moment, and determines the predicted coordinates of the touch point position at the next moment according to the target position polar coordinates at the next moment and the current position coordinates at the current moment, so as to perform a touch control operation according to the predicted coordinates at the next moment, thereby realizing the prediction of the touch point position at subsequent moments, helping to respond to relevant operations in advance, and thus reducing the latency of the virtual touch device. Compared with the related technology, the present invention predicts the touch point position at subsequent moments in advance, responds to relevant operations in advance, reduces the sense of lag that occurs when the user operates, and improves the fluency and real-time performance of virtual touch interaction.
[0008] In an alternative embodiment, the method for predicting the touch point position further includes: returning the step of determining the dynamic motion information of the touch point position at the current moment according to multiple historical position coordinates, so as to predict the polar coordinates of the touch point position at the next two moments, obtain the predicted coordinates of the touch point position at the next two moments, and perform a touch control operation according to the predicted coordinates at the next two moments.
[0009] The present invention continuously updates the historical position coordinate data, determines the dynamic motion information based on the updated data reflecting the behavioral trend of the touch point position, and then predicts the polar coordinates at the next two moments, making the prediction process continuously iterative, always based on the latest data, and improving the accuracy of predicting the touch point position. By predicting the touch point positions at the next moment and the next two moments, the present invention further reduces the sense of lag that occurs when the user operates, improves the fluency and real-time performance of virtual touch interaction, makes the interaction process of the virtual touch device more smooth and natural, and improves the user experience.
[0010] In an alternative embodiment, obtaining multiple historical position coordinates of the touch point position on the virtual touch screen in the rectangular coordinate system includes: storing the historical position coordinates corresponding to multiple touch events in a historical position queue; determining whether the number of multiple historical position coordinates in the historical position queue is greater than a preset number; if the number of multiple historical position coordinates in the historical position queue is greater than the preset number, obtaining the historical position coordinates of the touch point position in the rectangular coordinate system of a preset number from the end of the historical position queue.
[0011] The present invention stores the historical position coordinates corresponding to multiple touch events in a historical position queue, which can manage touch data in an orderly manner, determine the number of historical position coordinates in the historical position queue, and retrieve a specific number of coordinates at the queue tail when it is overloaded, avoiding excessive data accumulation and occupying too much memory, while ensuring that there are enough historical position coordinates for predicting the position of the touch point.
[0012] In an alternative embodiment, based on multiple historical position coordinates, the dynamic motion information of the touch point position at the current moment is determined, including: converting multiple historical position coordinates into multiple historical vector coordinates, performing polar coordinate transformation on the multiple historical vector coordinates to obtain multiple historical position polar coordinates; determining the angular velocity and angular acceleration corresponding to the position polar coordinate at the current moment according to the multiple historical position polar coordinates; and determining the dynamic motion information of the touch point position at the current moment according to the angular velocity and angular acceleration corresponding to the position polar coordinate at the current moment.
[0013] In an alternative embodiment, based on the dynamic motion information, the polar coordinate of the touch point position at the next moment is predicted to obtain the target position polar coordinate at the next moment, including: determining the modulus length of the target position polar coordinate at the next moment according to the modulus length of the position polar coordinate at the current moment; determining the angular acceleration of the polar coordinate at the next moment according to the angular acceleration corresponding to the position polar coordinate at the current moment; determining the angular velocity corresponding to the position polar coordinate at the current moment according to the difference between the polar angles corresponding to the position polar coordinates at the current moment and the previous moment; determining the angular velocity corresponding to the target position polar coordinate at the next moment according to the sum of the angular velocity corresponding to the position polar coordinate at the current moment and the angular acceleration of the polar coordinate at the next moment; obtaining the polar angle corresponding to the target position polar coordinate at the next moment according to the sum of the angular velocity corresponding to the target position polar coordinate at the next moment and the polar angle corresponding to the position polar coordinate at the current moment; and obtaining the target position polar coordinate at the next moment according to the modulus length of the target position polar coordinate at the next moment and the polar angle corresponding to the target position polar coordinate at the next moment.
[0014] The dynamic motion information of the present invention includes angular velocity and angular acceleration. Angular velocity and angular acceleration are physical quantities used to describe the rotational motion characteristics of an object. When predicting a non-linear moving position, using angular velocity and angular acceleration can more intuitively and accurately reflect the moving state and changes. Therefore, the present invention predicts the target position polar coordinate at the next moment through angular velocity and angular acceleration, improving the accuracy of touch point position prediction.
[0015] In an alternative embodiment, according to the polar coordinates of the target position at the next moment and the current position coordinates at the current moment, the predicted coordinates of the touch point position at the next moment are determined to perform a touch operation according to the predicted coordinates at the next moment, including: converting the polar coordinates of the target position at the next moment into the rectangular coordinate system to obtain the target position coordinates; obtaining a target correction function, and using the target correction function to correct the target position coordinates to obtain a correction result; the target correction function is a function that decays as the polar angle increases; according to the correction result and the current position coordinates at the current moment, the predicted coordinates of the touch point position at the next moment are determined to perform a touch operation according to the predicted coordinates at the next moment.
[0016] The present invention corrects the predicted polar coordinates of the target position at the next moment and combines the current position coordinates to determine the predicted coordinates at the next moment, further optimizing the prediction result and improving the accuracy of predicting the touch point position. The target correction function of the present invention decays as the polar angle increases. When the angular velocity change of the vector corresponding to the touch point position is small, that is, the trajectory of the touch point position is close to a straight line, it indicates that the moving direction and trend of the touch point position are relatively stable. Therefore, through the introduction of the target correction function, a relatively large prediction will be made based on the current trend; when the angular velocity change of the vector corresponding to the touch point position is small, that is, the trajectory of the touch point position is close to an arc, it indicates that the moving direction of the touch point position is constantly changing and the uncertainty increases. Therefore, through the introduction of the target correction function, a more cautious prediction will be made based on the current trend. The present invention improves the accuracy of predicting the touch point position at the next moment by introducing a target correction function.
[0017] In a second aspect, the present invention provides a prediction device for the touch point position, including: a behavior description module, configured to obtain a plurality of historical position coordinates of the touch point position on the virtual touch screen in the rectangular coordinate system, and determine the dynamic motion information of the touch point position at the current moment according to the plurality of historical position coordinates; the dynamic motion information is information used to describe the behavior trend of the touch point position during the movement; a trend prediction module, configured to predict the polar coordinates of the touch point position at the next moment according to the dynamic motion information to obtain the polar coordinates of the target position at the next moment; a coordinate prediction module, configured to determine the predicted coordinates of the touch point position at the next moment according to the polar coordinates of the target position at the next moment and the current position coordinates at the current moment to perform a touch operation according to the predicted coordinates at the next moment.
[0018] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the prediction method for the touch point position according to the first aspect or any corresponding embodiment thereof.
[0019] Fourthly, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to make a computer execute the prediction method of the touch point position according to the first aspect or any corresponding embodiment thereof.
[0020] Fifthly, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to make a computer execute the prediction method of the touch point position according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the related art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 It is a flowchart of the prediction method of the touch point position according to an embodiment of the present invention.
[0023] Figure 2 It is a schematic diagram of the prediction result without introducing the target correction function according to an embodiment of the present invention.
[0024] Figure 3 It is a schematic diagram of the prediction result with the introduction of the target correction function according to an embodiment of the present invention.
[0025] Figure 4 It is a flowchart of another prediction method of the touch point position according to an embodiment of the present invention.
[0026] Figure 5 It is a schematic diagram of the prediction process of the touch point position according to an embodiment of the present invention.
[0027] Figure 6 It is a schematic diagram of the overall framework corresponding to the prediction method of the touch point position according to an embodiment of the present invention.
[0028] Figure 7 It is a flowchart of yet another prediction method of the touch point position according to an embodiment of the present invention.
[0029] Figure 8 It is a structural block diagram of the prediction device of the touch point position according to an embodiment of the present invention.
[0030] Figure 9 It is a schematic diagram of the hardware structure of the computer device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0032] A touch screen is an interactive input device. The host refers to an intelligent device with a physical touch device or capable of realizing touch operations itself, and the client refers to an intelligent device without a physical touch device and unable to realize touch operations. On the host, the user only needs to touch a certain position on the screen with a finger or a stylus to control the operation of the operating system on the host. The virtual touch screen technology, however, creates a "touch screen" on the client so that the client can also realize touch operations.
[0033] During the use of the virtual touch screen technology, a physical touch device needs to be connected to the client for the user to perform touch operations. In the related art, the touch operation events on the physical touch device are usually sent to the client through a specific transmission channel for the client to realize touch operations.
[0034] However, no matter what kind of transmission channel is used, there is a certain transmission delay, and it takes a certain amount of time to process the touch operation events, resulting in a lag in the touch effect.
[0035] Touch prediction is to use an algorithm to predict the future trajectory of the touch position. Although the touch position and state at some future moments can be calculated based on the touch position and state at the current moment, the effect of the predicted touch position and state being ahead is not ideal, resulting in a delay in the processing of touch operation events.
[0036] The embodiments of the present invention provide a method for predicting the position of a touch point. By predicting the predicted coordinates of the next moment, the delay in processing touch events is reduced, so as to achieve the effect of improving the fluency and real-time performance of virtual touch interaction.
[0037] According to the embodiments of the present invention, an embodiment of a method for predicting the position of a touch point is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0038] In this embodiment, a method for predicting the position of a touch point is provided, which can be used in an electronic device, specifically in the operating system installed on the electronic device, such as Linux system, Windows system, etc. Figure 1 It is a flowchart of the method for predicting the position of a touch point according to an embodiment of the present invention, as Figure 1 shown. The process includes the following steps:
[0039] Step S101, obtain multiple historical position coordinates of the touch point position on the virtual touch screen in a rectangular coordinate system, and determine the dynamic motion information of the touch point position at the current moment according to the multiple historical position coordinates; the dynamic motion information is information used to describe the behavior trend of the touch point position during the movement.
[0040] Among them, the virtual touch screen is a touch interaction interface presented on a specific plane through projection, software simulation, etc. without physical entity buttons; the touch point position is the position corresponding to the touch behavior on the virtual touch interface when the user performs a touch operation on the virtual touch screen; the multiple historical position coordinates are the position coordinates corresponding to the touch point position recorded by the virtual touch screen at the current moment and multiple moments before the current moment when the user performs a touch operation on the physical touch device.
[0041] In an alternative embodiment, obtaining multiple historical position coordinates of the touch point position on the virtual touch screen in a rectangular coordinate system includes: storing the historical position coordinates corresponding to multiple touch events in a historical position queue; determining whether the number of multiple historical position coordinates in the historical position queue is greater than a preset number; if the number of multiple historical position coordinates in the historical position queue is greater than the preset number, obtain the historical position coordinates of the preset number of touch point positions in the rectangular coordinate system from the end of the historical position queue.
[0042] In some alternative embodiments, if the number of multiple historical position coordinates in the historical position queue is less than or equal to the preset number, continuously monitor the historical position queue until the number of historical position coordinates in the historical position queue is greater than the preset number, and obtain the historical position coordinates of the preset number of touch point positions in the rectangular coordinate system from the end of the historical position queue.
[0043] In some alternative embodiments, multiple touch events are stored in a preset touch event file in a preset memory. The preset memory can be a specific memory in the virtual touch device where the virtual touch screen is located for storing multiple touch events. The preset touch event file is a file used to store touch events when a touch event occurs on the physical touch device; the physical touch device is communicatively connected to the electronic device with the operating system installed.
[0044] In some alternative embodiments, the physical touch device can be a smart device with touch function such as a smart phone or a smart tablet, or can be a touchpad with touch function; the physical touch device and the electronic device equipped with an operating system can be connected through a cable or a wireless communication network. Exemplarily, when the physical touch device is a smart device, the smart device and the electronic device equipped with an operating system are connected through a wireless communication network, and when the physical touch device is a touchpad, the touchpad and the electronic device equipped with an operating system are connected through a cable.
[0045] In some alternative embodiments, the preset quantity can be set according to actual requirements. Exemplarily, the preset quantity can be 4.
[0046] In the embodiment of the present invention, the historical position coordinates corresponding to multiple touch events are stored in a historical position queue, which can manage touch data orderly, judge the number of historical position coordinates in the historical position queue and take a specific quantity of coordinates at the end of the queue when it is overloaded, avoiding excessive data accumulation from occupying too much memory, and at the same time ensuring that there are enough historical position coordinates for predicting the position of the touch point.
[0047] In some alternative embodiments, an array is pre-set in the virtual touch device to store the touch point information of each touch event. The touch point information includes the historical touch point positions corresponding to different fingers. In the embodiment of the present invention, by traversing each touch point information in the array, the historical position coordinates of the touch point are obtained and stored in the historical position queue.
[0048] In some alternative embodiments, the user can perform a touch operation on the physical touch device, and the touch operation is transmitted to the virtual touch screen of the virtual touch device through a specific transmission channel to form multiple touch events. The multiple touch events can be stored in a preset touch event file. The preset touch event file can be all files named "event (event)*" in the directory " / dev / input / (device / input / )", where * can be any number starting from 0. The kernels, directory names, and file names of different operating systems may vary, but the essence and functions are the same.
[0049] In an embodiment of the present invention, the "event*" file can be opened through the "open (open)" function to obtain a file descriptor. The "EVIOCGBIT (EVent IOCtl Get BIT, an input / output control command for obtaining the support bit mask of input device event types)" macro instruction is called on the file descriptor to query whether the device that forms multiple touch events is a virtual touch device. If the device that forms multiple touch events is a virtual touch device, the multiple touch events can be stored in a preset memory for subsequent processing of the touch events. If the device that forms multiple touch events is not a virtual touch device, no processing is performed. In an embodiment of the present invention, the touch events in the "event*" file can be read in real time by listening to the file descriptor.
[0050] In some alternative embodiments, one touch event includes multiple touch information. For example, one touch event includes, but is not limited to, the following five touch information: ABS (ABSolute, absolute)_MT (MultiTouch, multi-touch)_SLOT (position); ABS_MT_TRACKING (tracking)_ID (IDentifier, identifier); ABS_MT_POSITION (position)_X (X-axis); ABS_MT_POSITION_Y (Y-axis); SYN (SYNchronization, synchronization)_REPORT (report).
[0051] Among them, ABS_MT_SLOT represents which finger in multi-touch. In an embodiment of the present invention, the number of fingers that can be touched simultaneously supported by the physical touch device can be set or automatically generated. Generally, when recording, the number of fingers that can be touched simultaneously starts increasing from 0. Exemplarily, if ABS_MT_SLOT is denoted as ABS_MT_SLOT_MAX, it means that at most ABS_MT_SLOT_MAX + 1 fingers are supported.
[0052] ABS_MT_TRACKING_ID represents the ID assigned to the finger, which will not change after the finger is pressed and will not be repeated with other fingers, and is used to identify which finger ABS_MT_POSITION_X and ABS_MT_POSITION_Y belong to. When the value of ABS_MT_TRACKING_ID becomes -1, it means that the finger has been lifted and the touch information is cleared.
[0053] ABS_MT_POSITION_X represents the position of the touch point on the X-axis; ABS_MT_POSITION_Y represents the position of the touch point on the Y-axis; SYN_REPORT is used as a separator to indicate the completion of one report of the touch event.
[0054] Exemplarily, when two fingers are simultaneously pressed at a first position on a physical touch device and then lifted after moving to a second position, the touch event and the touch information corresponding to the touch event include: ABS_MT_SLOT... 0 (indicating the first finger); ABS_MT_TRACKING_ID... [id1] (indicating the identifier of the first finger); ABS_MT_POSITION_X... [x1.0] (indicating the value corresponding to the X-axis of the first finger at the first position); ABS_MT_POSITION_Y... [y1.0] (indicating the value corresponding to the Y-axis of the first finger at the first position); ABS_MT_SLOT... 1 (indicating the second finger); ABS_MT_TRACKING_ID... [id2] (indicating the identifier of the second finger); ABS_MT_POSITION_X... [x2.0] (indicating the value corresponding to the X-axis of the second finger at the first position); ABS_MT_POSITION_Y... [y2.0] (indicating the value corresponding to the Y-axis of the second finger at the first position); SYN_REPORT (indicating that the touch event reporting is completed). ABS_MT_SLOT... 0 (indicating the first finger); ABS_MT_POSITION_X... [x1.1] (indicating the value corresponding to the X-axis of the first finger at the second position); ABS_MT_POSITION_Y... [y1.1] (indicating the value corresponding to the Y-axis of the first finger at the second position); ABS_MT_SLOT... 1 (indicating the second finger); ABS_MT_POSITION_X... [x2.2] (indicating the value corresponding to the X-axis of the second finger at the second position); ABS_MT_POSITION_Y... [y2.2] (indicating the value corresponding to the Y-axis of the second finger at the second position); SYN_REPORT (indicating that the touch event reporting is completed). ABS_MT_SLOT... 0 (indicating the first finger); ABS_MT_TRACKING_ID... -1 (indicating that the first finger has been lifted); ABS_MT_SLOT... 1 (indicating the second finger); ABS_MT_TRACKING_ID... -1 (indicating that the second finger has been lifted); SYN_REPORT (indicating that the touch event reporting is completed).
[0055] In some alternative embodiments, according to multiple historical position coordinates, the dynamic motion information of the touch point position at the current moment is determined, including: performing polar coordinate transformation on the multiple historical position coordinates to obtain multiple historical position polar coordinates, and according to the multiple historical position polar coordinates, determining the angular velocity and angular acceleration corresponding to the position polar coordinate at the current moment, and the dynamic motion information is composed of the angular velocity and the angular acceleration.
[0056] Step S102: Predict the polar coordinates of the touch point position at the next moment according to the dynamic motion information to obtain the polar coordinates of the target position at the next moment.
[0057] In some alternative embodiments, predicting the polar coordinates of the touch point position at the next moment according to the dynamic motion information to obtain the polar coordinates of the target position at the next moment includes: determining the modulus length of the polar coordinates of the target position at the next moment according to the modulus length of the polar coordinates of the position at the current moment; determining the angular acceleration of the polar coordinates at the next moment according to the angular acceleration corresponding to the polar coordinates of the position at the current moment; determining the angular velocity corresponding to the polar coordinates of the position at the current moment according to the difference between the polar angles corresponding to the polar coordinates of the position at the current moment and the previous moment; determining the angular velocity corresponding to the polar coordinates of the target position at the next moment according to the sum of the angular velocity corresponding to the polar coordinates of the position at the current moment and the angular acceleration of the polar coordinates at the next moment; obtaining the polar angle corresponding to the polar coordinates of the target position at the next moment according to the sum of the angular velocity corresponding to the polar coordinates of the target position at the next moment and the polar angle corresponding to the polar coordinates of the position at the current moment; and obtaining the polar coordinates of the target position at the next moment according to the modulus length of the polar coordinates of the target position at the next moment and the polar angle corresponding to the polar coordinates of the target position at the next moment.
[0058] The dynamic motion information in the embodiments of the present invention includes angular velocity and angular acceleration. Angular velocity and angular acceleration are physical quantities used to describe the rotational motion characteristics of an object. When predicting the non-linear movement position, using angular velocity and angular acceleration can more intuitively and accurately reflect the movement state and changes. Therefore, in the embodiments of the present invention, the polar coordinates of the target position at the next moment are predicted through angular velocity and angular acceleration, improving the accuracy of touch point position prediction.
[0059] Step S103: Determine the predicted coordinates of the touch point position at the next moment according to the polar coordinates of the target position at the next moment and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the next moment.
[0060] In some alternative embodiments, determining the predicted coordinates of the touch point position at the next moment according to the polar coordinates of the target position at the next moment and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the next moment includes: converting the polar coordinates of the target position at the next moment to the rectangular coordinate system to obtain the target position coordinates; obtaining a target correction function and using the target correction function to correct the target position coordinates to obtain a correction result; the target correction function is a function that decays as the polar angle increases; and determining the predicted coordinates of the touch point position at the next moment according to the correction result and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the next moment.
[0061] In some alternative embodiments, the format of the target correction function is not unique, and the target correction function can be any function that decays as the polar angle increases. Exemplarily, the target correction function can be:
[0062]
[0063] where \(K(\theta)\) is the target correction function, \(\theta\) is the polar angle, and the setting of \(\pi / 12\) makes the target correction function value decay rapidly when the angular velocity is greater than \(\pi / 12\). Other radian values can also be set.
[0064] In some alternative embodiments, the target correction function can also be:
[0065]
[0066] where \(K(\theta)\) is the target correction function and \(\theta\) is the polar angle.
[0067] Among them, using the target correction function to correct the target position coordinates includes: introducing the target correction function into the coordinate value corresponding to the target position coordinate in the horizontal direction to obtain the correction value in the horizontal direction; introducing the target correction function into the coordinate value corresponding to the target position coordinate in the vertical direction to obtain the correction value in the vertical direction; and obtaining the correction result from the correction value in the horizontal direction and the correction value in the vertical direction.
[0068] As Figure 2 shows, it is a schematic diagram of the prediction result without introducing the target correction function. As Figure 3 shows, it is a schematic diagram of the prediction result with the target correction function introduced. Figure 2 and Figure 3 In, the abscissa is the coordinate in the horizontal direction of the touch point position, and the ordinate is the coordinate in the vertical direction of the touch point position. The value range of the abscissa and ordinate is from 0 to 32767, and the value range represents the left (upper) side to the right (lower) side of the virtual touch screen; from Figure 2 and Figure 3 By comparison, at the turning point of the touch trajectory, Figure 2 when the target correction function is not introduced, there is obvious distortion between the original data and the predicted data, while Figure 3 after the target correction function is introduced, the original data and the predicted data are more fitting. Therefore, the prediction effect is better after the target correction function is introduced.
[0069] In the embodiments of the present invention, the polar coordinates of the target position at the next moment obtained by prediction are corrected, and the predicted coordinates at the next moment are determined by combining the current position coordinates, further optimizing the prediction result and improving the accuracy of the touch point position prediction. The target correction function in the embodiments of the present invention decays as the polar angle increases. When the angular velocity change of the vector corresponding to the touch point position is small, that is, the trajectory of the touch point position is close to a straight line, it indicates that the moving direction and trend of the touch point position are relatively stable. Therefore, through the introduction of the target correction function, a relatively large-scale prediction will be made based on the current trend. When the angular velocity change of the vector corresponding to the touch point position is large, that is, the trajectory of the touch point position is close to an arc, it indicates that the moving direction of the touch point position is constantly changing and the uncertainty increases. Therefore, through the introduction of the target correction function, a more cautious prediction will be made based on the current trend. The embodiments of the present invention improve the accuracy of predicting the touch point position at the next moment by introducing the target correction function.
[0070] In the embodiments of the present invention, the dynamic motion information of the touch point position at the current moment is determined by obtaining multiple historical position coordinates of the touch point position on the virtual touch screen, and the behavior trend of the touch point position movement can be accurately captured, making the subsequent analysis of the touch point position more accurate. In the embodiments of the present invention, the polar coordinates of the touch point position at the next moment are predicted based on the dynamic motion information to obtain the polar coordinates of the target position at the next moment. According to the polar coordinates of the target position at the next moment and the current position coordinates at the current moment, the predicted coordinates of the touch point position at the next moment are determined, and the touch operation is executed according to the predicted coordinates at the next moment, so as to realize the prediction of the touch point position at the subsequent moment, which helps to respond to relevant operations in advance, thereby reducing the delay of the virtual touch device. Compared with the related technologies, the embodiments of the present invention predict the touch point position at the subsequent moment in advance, respond to relevant operations in advance, reduce the lag feeling when the user operates, and improve the fluency and real-time performance of the virtual touch interaction.
[0071] In this embodiment, a method for predicting the touch point position is provided, which can be used in an electronic device, specifically in the operating system installed on the electronic device, such as the Linux system. Figure 4 It is a flowchart of another method for predicting the touch point position according to the embodiments of the present invention, as Figure 4 shown, and the process includes the following steps:
[0072] Step S401: Obtain multiple historical position coordinates of the touch point position on the virtual touch screen in the rectangular coordinate system, and determine the dynamic motion information of the touch point position at the current moment according to the multiple historical position coordinates; the dynamic motion information is information used to describe the behavior trend of the touch point position during the movement.
[0073] Specifically, the above step S401 includes:
[0074] Step S4011: Obtain multiple historical position coordinates of the touch point position of the virtual touch screen in the rectangular coordinate system, convert the multiple historical position coordinates into multiple historical vector coordinates, and perform polar coordinate conversion on the multiple historical vector coordinates to obtain multiple historical position polar coordinates.
[0075] In some alternative embodiments, arrange the multiple historical positions in the order from the earliest moment to the current moment, and subtract the position coordinates of the previous moment from the position coordinates of the next moment respectively to obtain multiple historical vector coordinates. Exemplarily, the multiple historical position coordinates are arranged in chronological order. As Figure 5 shown, it is a schematic diagram of the prediction process of the touch point position. As Figure 5 shown by the multiple points recorded by the dark black dots in it, denote the multiple historical position coordinates as (x0, y0), (x1, y1), (x2, y2), (x3, y3), where (x3, y3) is the position coordinate at the current moment. Subtract the position coordinates of the previous moment from the position coordinates of the next moment respectively to obtain multiple historical vector coordinates. As Figure 5 shown, denote them as (dx1, dy1), (dx2, dy2), (dx3, dy3). Figure 5 In it, the horizontal arrow is used to represent the X-axis, and the vertical arrow is used to represent the Y-axis.
[0076] In some alternative embodiments, the polar coordinate conversion formula is:
[0077]
[0078] θ = cos -1 (dx / L);
[0079] where L is the modulus value in the polar coordinates, θ is the polar angle in the polar coordinates, x is the coordinate value of the historical vector coordinate on the X-axis in the plane rectangular coordinate system, y is the coordinate value of the historical vector coordinate on the Y-axis in the plane rectangular coordinate system, and cos -1 is the inverse cosine function.
[0080] Perform polar coordinate conversion on (dx1, dy1), (dx2, dy2), (dx3, dy3) using the polar coordinate conversion formula to obtain multiple historical position polar coordinates. As Figure 5 shown, denote them as (L1, θ1), (L2, θ2), (L3, θ3).
[0081] Step S4012: Determine the angular velocity and angular acceleration corresponding to the position polar coordinate at the current moment according to the multiple historical position polar coordinates.
[0082] In some alternative embodiments, determining the angular velocity and angular acceleration corresponding to the polar coordinates of the position at the current moment based on multiple historical position polar coordinates includes: among the multiple historical position polar coordinates, selecting the polar angle corresponding to the polar coordinates of the position at the current moment, the polar angle corresponding to the polar coordinates of the position at the previous moment, and the polar angle corresponding to the polar coordinates of the position at the moment two moments before; obtaining the angular velocity corresponding to the polar coordinates of the position at the current moment according to the difference between the polar angles corresponding to the polar coordinates of the position at the current moment and the previous moment respectively; obtaining the angular velocity corresponding to the polar coordinates of the position at the previous moment according to the difference between the polar angles corresponding to the polar coordinates of the position at the previous moment and the moment two moments before respectively; and obtaining the angular acceleration corresponding to the polar coordinates of the position at the current moment according to the difference between the angular velocities corresponding to the polar coordinates of the position at the current moment and the previous moment respectively.
[0083] Exemplarily, as Figure 5 shown, when the multiple historical position polar coordinates are (L1, θ1), (L2, θ2), (L3, θ3), the polar coordinates of the position at the current moment are (L3, θ3), the polar angle corresponding to the polar coordinates of the position at the current moment is θ3, the polar coordinates of the position at the previous moment are (L2, θ2), the polar angle corresponding to the polar coordinates of the position at the previous moment is θ2, the polar coordinates of the position at the moment two moments before are (L1, θ1), and the polar angle corresponding to the polar coordinates of the position at the moment two moments before is θ1, the calculation formula for the angular velocity corresponding to the polar coordinates of the position at the current moment is:
[0084] v3 = θ3 - θ2;
[0085] where v3 is the angular velocity corresponding to the polar coordinates of the position at the current moment, θ3 is the polar angle corresponding to the polar coordinates of the position at the current moment, and θ2 is the polar angle corresponding to the polar coordinates of the position at the previous moment.
[0086] The calculation formula for the angular velocity corresponding to the polar coordinates of the position at the previous moment is:
[0087] v2 = θ2 - θ1;
[0088] where v2 is the angular velocity corresponding to the polar coordinates of the position at the previous moment, θ2 is the polar angle corresponding to the polar coordinates of the position at the previous moment, and θ1 is the polar angle corresponding to the polar coordinates of the position at the moment two moments before.
[0089] The calculation formula for the angular acceleration corresponding to the polar coordinates of the position at the current moment is:
[0090] a3 = v3 - v2;
[0091] where a3 is the angular acceleration corresponding to the polar coordinates of the position at the current moment, v3 is the angular velocity corresponding to the polar coordinates of the position at the current moment, and v2 is the angular velocity corresponding to the polar coordinates of the position at the previous moment.
[0092] Step S4013: Determine the dynamic motion information of the touch point position at the current moment based on the angular velocity and angular acceleration corresponding to the position polar coordinates at the current moment.
[0093] Among them, the dynamic motion information is composed of the angular velocity and angular acceleration corresponding to the position polar coordinates at the current moment.
[0094] Step S402: Predict the polar coordinates of the touch point position at the next moment based on the dynamic motion information to obtain the target position polar coordinates at the next moment.
[0095] Specifically, the above Step S402 includes:
[0096] Step S4021: Determine the modulus length of the target position polar coordinates at the next moment based on the modulus length of the position polar coordinates at the current moment; determine the angular acceleration of the polar coordinates at the next moment based on the angular acceleration corresponding to the position polar coordinates at the current moment.
[0097] Among them, as Figure 5 shown, assume that the target position polar coordinates at the next moment can be denoted as (L4, θ4), the position polar coordinates at the current moment are (L3, θ3), the modulus length of the position polar coordinates at the current moment is L3, and use the modulus length L3 of the position polar coordinates at the current moment as the modulus length L4 of the target position polar coordinates at the next moment, and use the angular acceleration a3 corresponding to the position polar coordinates at the current moment as the angular acceleration a4 of the polar coordinates at the next moment.
[0098] Step S4022: Determine the angular velocity corresponding to the position polar coordinates at the current moment based on the difference between the polar angles corresponding to the position polar coordinates at the current moment and the previous moment, and determine the angular velocity corresponding to the target position polar coordinates at the next moment based on the sum of the angular velocity corresponding to the position polar coordinates at the current moment and the angular acceleration of the polar coordinates at the next moment.
[0099] Among them, the calculation formula for the angular velocity corresponding to the position polar coordinates at the current moment is:
[0100] v3 = θ3 - θ2
[0101] Among them, v3 is the angular velocity corresponding to the position polar coordinates at the current moment, θ3 is the polar angle corresponding to the position polar coordinates at the current moment, and θ2 is the polar angle corresponding to the position polar coordinates at the previous moment.
[0102] Among them, the calculation formula for the angular velocity corresponding to the target position polar coordinates at the next moment is:
[0103] v4 = v3 + a4;
[0104] Among them, v4 is the angular velocity corresponding to the polar coordinates of the target position at the next moment, v3 is the angular velocity corresponding to the polar coordinates of the position at the current moment, and a4 is the angular acceleration of the polar coordinates at the next moment.
[0105] Step S4023: Obtain the polar angle corresponding to the polar coordinates of the target position at the next moment according to the sum of the angular velocity corresponding to the polar coordinates of the target position at the next moment and the polar angle corresponding to the polar coordinates of the position at the current moment.
[0106] Among them, the calculation formula for the polar angle corresponding to the polar coordinates of the target position at the next moment is:
[0107] θ4 = θ3 + v4;
[0108] Among them, θ4 is the polar angle corresponding to the polar coordinates of the target position at the next moment, θ3 is the polar angle corresponding to the polar coordinates of the position at the current moment, and v4 is the angular velocity corresponding to the polar coordinates of the target position at the next moment.
[0109] Step S4024: Obtain the polar coordinates of the target position at the next moment according to the modulus length of the polar coordinates of the target position at the next moment and the polar angle corresponding to the polar coordinates of the target position at the next moment.
[0110] Among them, the polar coordinates of the target position at the next moment are composed of the modulus length L4 of the polar coordinates of the target position at the next moment and the polar angle θ4 corresponding to the polar coordinates of the target position at the next moment, that is, (L4, θ4).
[0111] Step S403: Determine the predicted coordinates of the touch point position at the next moment according to the polar coordinates of the target position at the next moment and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the next moment.
[0112] Specifically, the above step S403 includes:
[0113] Step S4031: Convert the polar coordinates of the target position at the next moment to the rectangular coordinate system to obtain the target position coordinates.
[0114] When the polar coordinates of the target position at the next moment are (L4, θ4), the formula for converting the polar coordinates of the target position at the next moment to the rectangular coordinate system is:
[0115] dx4 = L4 · cosθ4;
[0116] dy4 = L4 · sinθ4;
[0117] Among them, x4 is the coordinate value on the X-axis in the target position coordinates at the subsequent moment, y4 is the coordinate value on the Y-axis in the target position coordinates at the subsequent moment, L4 is the modulus of the polar coordinates of the target position at the subsequent moment, θ4 is the polar angle corresponding to the polar coordinates of the target position at the subsequent moment, sin is the sine function, and cos is the cosine function.
[0118] Step S4032: Obtain the target correction function, and use the target correction function to correct the target position coordinates to obtain a correction result; the target correction function is a function that decays as the polar angle increases.
[0119] Among them, obtain the target correction function K(θ). Introduce the target correction function into the coordinate value corresponding to the target position coordinates in the horizontal direction to obtain the corrected value corresponding to the horizontal direction, that is, K(θ4)·dx4; introduce the target correction function into the coordinate value corresponding to the target position coordinates in the vertical direction to obtain the corrected value corresponding to the vertical direction, that is, K(θ4)·dy4; obtain the correction result from the corrected value corresponding to the horizontal direction and the corrected value corresponding to the vertical direction.
[0120] Step S4033: Determine the predicted coordinates of the touch point position at the subsequent moment according to the correction result and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the subsequent moment.
[0121] In some optional embodiments, determining the predicted coordinates of the touch point position at the subsequent moment according to the correction result and the current position coordinates at the current moment includes: obtaining the corrected value corresponding to the horizontal direction and the corrected value corresponding to the vertical direction in the correction result; obtaining the coordinate value corresponding to the horizontal direction and the coordinate value corresponding to the vertical direction in the current position coordinates at the current moment; obtaining the predicted coordinates according to the sum of the corrected value corresponding to the horizontal direction and the coordinate value, and the sum of the corrected value corresponding to the vertical direction and the coordinate value.
[0122] Among them, the current position coordinates at the current moment are (x3, y3), the coordinate value corresponding to the horizontal direction (X-axis) in the current position coordinates at the current moment is x3, and the second coordinate value corresponding to the vertical direction (Y-axis) in the current position coordinates at the current moment is y3.
[0123] Among them, if the predicted coordinates are denoted as (x4, y4), which is the point marked with a hollow triangle in Figure 5 then:
[0124] x4 = x3 + K(θ4)·dx4;
[0125] y4 = y3 + K(θ4)·dy4;
[0126] Among them, x4 is the coordinate value of the predicted coordinate on the X-axis, y4 is the coordinate value of the predicted coordinate on the Y-axis, x3 is the coordinate value corresponding to the horizontal direction in the current position coordinate at the current moment, y3 is the coordinate value corresponding to the vertical direction in the current position coordinate at the current moment, and K(θ4) is the target correction function.
[0127] Step S404: Return to the step of determining the dynamic motion information of the touch point position at the current moment according to multiple historical position coordinates, so as to predict the polar coordinates of the touch point position at the next two moments and obtain the predicted coordinates of the touch point position at the next two moments.
[0128] Among them, the next two moments are the two moments after the current moment, that is, the moment after the next moment, as Figure 5 shown. Add the predicted coordinates (x4, y4) to the historical position coordinates, determine the dynamic motion information of the touch point position at the current moment according to multiple historical position coordinates, predict the polar coordinates of the touch point position at the next two moments according to the dynamic motion information, calculate the angular velocity v5 corresponding to the position polar coordinates at the next two moments, obtain the target position polar coordinates at the next two moments, that is, (L5, θ5), according to the angular velocity v5 corresponding to the position polar coordinates at the next two moments, perform a rectangular coordinate system conversion on (dx5, dy5), correct (dx5, dy5), so as to obtain the predicted coordinates (x5, y5) of the touch point position at the next two moments according to the predicted coordinates and the correction result. The point marked with a hollow triangle in Figure 5 is shown.
[0129] In some alternative embodiments, convert the touch events corresponding to the predicted coordinates at the next moment and the touch events corresponding to the predicted coordinates at the next two moments into a binary format, so as to perform a touch control operation according to the touch events corresponding to the predicted coordinates at the next moment and the touch events corresponding to the predicted coordinates at the next two moments after the format conversion.
[0130] Among them, the binary format is a format that can be recognized by each operating system, which is convenient for subsequent performing a touch control operation according to the touch events corresponding to the predicted coordinates at the next moment and the touch events corresponding to the predicted coordinates at the next two moments after the format conversion.
[0131] The touch point position prediction method provided in this embodiment continuously updates the historical position coordinate data, determines the dynamic motion information based on the updated data reflecting the touch point position behavior trend, and then predicts the polar coordinates of the next two moments, making the prediction process continuously iterative, always based on the latest data, and improving the accuracy of touch point position prediction. Through the prediction of the touch point positions at the next moment and the next two moments, the embodiment of the present invention further reduces the lag feeling during user operation, improves the fluency and real-time performance of virtual touch interaction, makes the interaction process of the virtual touch device more smooth and natural, and improves the user experience.
[0132] In this embodiment, a touch point position prediction method is provided, which can be used in an electronic device, specifically for the operating system installed on the electronic device, such as the Linux system. As Figure 6 shown, it is a schematic diagram of the overall framework corresponding to the touch point position prediction method, and it is a low-latency virtual touch device implemented on a Windows virtual machine running on the Linux system. In this embodiment, the host is the Linux system, and a physical touch device is externally connected to the Linux system. The guest is a Windows virtual machine running on the Linux system using Qemu. The Linux system includes a Linux touch driver and Qemu. Qemu includes a virtual touch device backend and a Windows virtual machine. The Windows virtual machine includes a Windows general touch driver and a virtual touch device specific driver. Figure 7 It is a flowchart of another touch point position prediction method according to an embodiment of the present invention. As Figure 7 shown, this process includes the following steps:
[0133] Read the touch event from the Linux touch driver and transmit it to the virtual touch device specific driver in the Windows virtual machine.
[0134] The virtual device specific driver obtains the current touch point information from the touch event and predicts the future touch point information according to the algorithm.
[0135] The virtual device specific driver provides the predicted touch point information to the Windows general touch driver.
[0136] In the embodiment of the present invention, for the specific process of predicting the future touch point information according to the algorithm, please refer to Figure 1 the steps S101 to S103 of the embodiment shown here, which will not be elaborated here.
[0137] Through the loop of reading touch events and predicting touch point information, the embodiment of the present invention continuously reduces the latency of the virtual touch device and improves the processing efficiency of touch operation events.
[0138] In this embodiment, a prediction device for the touch point position is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be elaborated again. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0139] This embodiment provides a prediction device for the touch point position, as Figure 8 shown, including:
[0140] A behavior description module 801, configured to obtain multiple historical position coordinates of the touch point position on the virtual touch screen in a rectangular coordinate system, and determine the dynamic motion information of the touch point position at the current moment according to the multiple historical position coordinates; the dynamic motion information is information used to describe the behavior trend of the touch point position during the movement.
[0141] A trend prediction module 802, configured to predict the polar coordinates of the touch point position at the next moment according to the dynamic motion information, and obtain the target position polar coordinates at the next moment.
[0142] A coordinate prediction module 803, configured to determine the predicted coordinates of the touch point position at the next moment according to the target position polar coordinates at the next moment and the current position coordinates at the current moment, so as to perform a touch control operation according to the predicted coordinates at the next moment.
[0143] In some alternative implementation manners, the prediction device for the touch point position further includes:
[0144] A second coordinate prediction module, configured to return to the step of determining the dynamic motion information of the touch point position at the current moment according to multiple historical position coordinates, so as to predict the polar coordinates of the touch point position at the next two moments, obtain the predicted coordinates of the touch point position at the next two moments, and perform a touch control operation according to the predicted coordinates at the next two moments.
[0145] In some alternative implementation manners, the behavior description module 801 includes:
[0146] A position information determination unit, configured to store the historical position coordinates corresponding to multiple touch events in a historical position queue.
[0147] A coordinate quantity judgment unit, configured to judge whether the quantity of the multiple historical position coordinates in the historical position queue is greater than a preset quantity.
[0148] A coordinate acquisition unit, configured to obtain the historical position coordinates of the touch point position in the rectangular coordinate system of a preset quantity starting from the end of the historical position queue according to the quantity of the multiple historical position coordinates in the historical position queue being greater than the preset quantity.
[0149] In some alternative embodiments, the behavior description module 801 further includes:
[0150] A coordinate conversion unit, configured to convert a plurality of historical position coordinates into a plurality of historical vector coordinates, perform polar coordinate conversion on the plurality of historical vector coordinates, and obtain a plurality of historical position polar coordinates.
[0151] A parameter determination unit, configured to determine the angular velocity and angular acceleration corresponding to the position polar coordinates at the current moment according to the plurality of historical position polar coordinates.
[0152] An information determination unit, configured to determine the dynamic motion information of the touch point position at the current moment according to the angular velocity and angular acceleration corresponding to the position polar coordinates at the current moment.
[0153] In some alternative embodiments, the trend prediction module 802 includes:
[0154] A modulus determination unit, configured to determine the modulus of the target position polar coordinates at the next moment according to the modulus of the position polar coordinates at the current moment.
[0155] An angular acceleration determination unit, configured to determine the angular acceleration of the polar coordinates at the next moment according to the angular acceleration corresponding to the position polar coordinates at the current moment.
[0156] An angular velocity determination unit, configured to determine the angular velocity corresponding to the position polar coordinates at the current moment according to the difference between the polar angles corresponding to the position polar coordinates at the current moment and the previous moment, and determine the angular velocity corresponding to the target position polar coordinates at the next moment according to the sum of the angular velocity corresponding to the position polar coordinates at the current moment and the angular acceleration of the polar coordinates at the next moment.
[0157] A polar angle determination unit, configured to obtain the polar angle corresponding to the target position polar coordinates at the next moment according to the sum of the angular velocity corresponding to the target position polar coordinates at the next moment and the polar angle corresponding to the position polar coordinates at the current moment.
[0158] A polar coordinate determination unit, configured to obtain the target position polar coordinates at the next moment according to the modulus of the target position polar coordinates at the next moment and the polar angle corresponding to the target position polar coordinates at the next moment.
[0159] In some alternative embodiments, the coordinate prediction module 803 includes:
[0160] A coordinate conversion unit, configured to convert the target position polar coordinates at the next moment into the rectangular coordinate system to obtain the target position coordinates.
[0161] A result correction unit, configured to obtain a target correction function, and use the target correction function to correct the target position coordinates to obtain a correction result; the target correction function is a function that decays as the polar angle increases.
[0162] A coordinate prediction unit, configured to determine a predicted coordinate of the touch point position at a subsequent moment according to the correction result and the current position coordinate at the current moment, so as to perform a touch operation according to the predicted coordinate at the subsequent moment.
[0163] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding embodiments above, and will not be repeated here.
[0164] The prediction device for the touch point position in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0165] An embodiment of the present invention further provides a computer device having the above Figure 8 prediction device for the touch point position shown.
[0166] Please refer to Figure 9 , Figure 9 which is a schematic structural diagram of a computer device provided by an optional embodiment of the present invention. As Figure 9 shown, the computer device includes: one or more processors 10, a memory 20, and an interface for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common main board or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (such as an array of servers, a set of blade servers, or a multi-processor system). Figure 9 In
[0167] FIG., a single processor 10 is taken as an example.
[0168] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.
[0169] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories may be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0170] The memory 20 may include a volatile memory, for example, a random access memory; the memory may also include a non-volatile memory, for example, a flash memory, a hard disk, or a solid-state drive; the memory 20 may further include a combination of the above types of memories.
[0171] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0172] The embodiments of the present invention further provide a computer-readable storage medium. The method according to the embodiments of the present invention may be implemented in hardware, firmware, or may be implemented as computer code recorded on a storage medium, or may be implemented as computer code originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored in such software processed on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium may further include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component capable of storing or receiving software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0173] A part of the present invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can call or provide the methods and / or technical solutions according to the present invention through the operations of the computer. Those skilled in the art should understand that the forms of existence of computer program instructions in a computer-readable medium include but are not limited to source files, executable files, installation package files, etc. Correspondingly, the ways for a computer to execute computer program instructions include but are not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.
[0174] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for predicting the position of a touch point, characterized in that The method includes: Obtaining a plurality of historical position coordinates of a touch point position on a virtual touch screen in a rectangular coordinate system, and determining dynamic motion information of the touch point position at the current moment according to the plurality of historical position coordinates; the dynamic motion information is information used to describe the behavioral trend of the touch point position during movement; Predicting the polar coordinates of the touch point position at the next moment according to the dynamic motion information to obtain the target position polar coordinates at the next moment; Determining the predicted coordinates of the touch point position at the next moment according to the target position polar coordinates at the next moment and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the next moment.
2. The method according to claim 1, wherein The method further includes: Returning to the step of determining the dynamic motion information of the touch point position at the current moment according to the plurality of historical position coordinates, so as to predict the polar coordinates of the touch point position at the next two moments, obtain the predicted coordinates of the touch point position at the next two moments, and perform the touch operation according to the predicted coordinates at the next two moments.
3. The method according to claim 1 or 2, characterized in that, The obtaining of a plurality of historical position coordinates of a touch point position on a virtual touch screen in a rectangular coordinate system includes: Storing the historical position coordinates corresponding to a plurality of touch events in a historical position queue; Judging whether the number of the plurality of historical position coordinates in the historical position queue is greater than a preset number; If the number of the plurality of historical position coordinates in the historical position queue is greater than the preset number, obtaining the historical position coordinates of the touch point position in the rectangular coordinate system of the preset number starting from the end of the historical position queue.
4. The method according to claim 1 or 2, characterized in that, The determining of the dynamic motion information of the touch point position at the current moment according to the plurality of historical position coordinates includes: Converting the plurality of historical position coordinates into a plurality of historical vector coordinates, and performing polar coordinate conversion on the plurality of historical vector coordinates to obtain a plurality of historical position polar coordinates; Determining the angular velocity and angular acceleration corresponding to the position polar coordinates at the current moment according to the plurality of historical position polar coordinates; Determining the dynamic motion information of the touch point position at the current moment according to the angular velocity and angular acceleration corresponding to the position polar coordinates at the current moment.
5. The method according to claim 4, characterized in that, The predicting of the polar coordinates of the touch point position at the next moment according to the dynamic motion information to obtain the target position polar coordinates at the next moment includes: Determining the modulus length of the target position polar coordinates at the next moment according to the modulus length of the position polar coordinates at the current moment; Determining the angular acceleration of the polar coordinates at the next moment according to the angular acceleration corresponding to the position polar coordinates at the current moment; Determining the angular velocity corresponding to the position polar coordinates at the current moment according to the difference between the polar angles respectively corresponding to the position polar coordinates at the current moment and the previous moment; Determining the angular velocity corresponding to the target position polar coordinates at the next moment according to the sum of the angular velocity corresponding to the position polar coordinates at the current moment and the angular acceleration of the polar coordinates at the next moment. Obtain the polar angle corresponding to the target position polar coordinates at the latter moment according to the sum of the angular velocity corresponding to the target position polar coordinates at the latter moment and the polar angle corresponding to the position polar coordinates at the current moment; Obtain the target position polar coordinates at the latter moment according to the modulus length of the target position polar coordinates at the latter moment and the polar angle corresponding to the target position polar coordinates at the latter moment; 6. The method according to claim 1 or 2, characterized in that, The determining the predicted coordinates of the touch point position at the latter moment according to the target position polar coordinates at the latter moment and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the latter moment includes: Convert the target position polar coordinates at the latter moment into a rectangular coordinate system to obtain target position coordinates; Obtain a target correction function, and use the target correction function to correct the target position coordinates to obtain a correction result; the target correction function is a function that decays as the polar angle increases; Determine the predicted coordinates of the touch point position at the latter moment according to the correction result and the current position coordinates at the current moment, so as to perform the touch operation according to the predicted coordinates at the latter moment.
7. A prediction device for the position of a touch point, characterized in that, The device includes: A behavior description module, configured to obtain multiple historical position coordinates of the touch point position on the virtual touch screen in a rectangular coordinate system, and determine the dynamic motion information of the touch point position at the current moment according to the multiple historical position coordinates; the dynamic motion information is information used to describe the behavior trend of the touch point position during the movement process; A trend prediction module, configured to predict the polar coordinates of the touch point position at the latter moment according to the dynamic motion information to obtain the target position polar coordinates at the latter moment; A coordinate prediction module, configured to determine the predicted coordinates of the touch point position at the latter moment according to the target position polar coordinates at the latter moment and the current position coordinates at the current moment, so as to perform a touch operation according to the predicted coordinates at the latter moment.
8. A computer device, characterized in that, including: A memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the prediction method for the touch point position according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause a computer to execute the prediction method for the touch point position according to any one of claims 1 to 6.
10. A computer program product, characterized in that, including computer instructions, the computer instructions are used to cause a computer to execute the prediction method for the touch point position according to any one of claims 1 to 6.