Mouse track control method and device, server, medium and program product
By receiving client mouse trajectory information in the cloud and adding mouse trajectory points using prediction algorithms, the problem of unsmooth mouse trajectory in the cloud is solved and the user experience is improved.
Patent Information
- Application Number
- CN202411426564.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-10
AI Technical Summary
In the cloud desktop scenario, when the client's mouse trajectory data is transmitted to the cloud, due to the limitations of the mouse acquisition frequency, client acquisition frequency and network environment, the number of mouse trajectory points received by the cloud is lower than expected, resulting in the cloud's mouse trajectory not smooth. , the fold line is obvious, affecting the user experience.
By receiving the mouse trajectory information sent by the client, using the target mouse trajectory prediction algorithm, predicting and adding mouse trajectory points, improving the mouse trajectory data density, and smoothing the cloud mouse trajectory. Specific methods include determining the number of mouse trajectory points to be added and selecting appropriate prediction algorithms, such as trajectory prediction algorithms based on Bezier curves or velocity and angles, adding predicted mouse trajectory points.
By predicting and adding mouse track points, the smoothness and fluency of cloud mouse tracks are improved and the user experience is improved.
Smart Images

Figure CN119292724A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a mouse trajectory control method, device, server, medium and program product. Background Art
[0002] In the current cloud desktop scenario, the client's mouse track data will be transmitted to the cloud (i.e., the server, remote desktop). After receiving this data, the cloud will reproduce the same mouse movement operation. Limited by the collection frequency of the mouse itself, the collection frequency of the mouse track points by the client, and the packet loss of the network environment, the number of mouse track points received by the cloud is often lower than the theoretical expectation, which will cause the cloud mouse track to be uneven and have obvious broken lines, thus affecting the user experience. Summary of the invention
[0003] The object of the present invention is to provide a mouse trajectory control method, device, server, medium and program product, which are used to solve the problem that the mouse trajectory is not smooth and the broken line is obvious when the mouse trajectory transmitted by the client is reproduced in the cloud.
[0004] In order to achieve the above object, in a first aspect, the present invention provides a mouse trajectory control method, comprising:
[0005] Receive mouse track information sent by the client;
[0006] Based on at least part of the mouse trajectory points in the mouse trajectory information, using a target mouse trajectory prediction algorithm, N predicted mouse trajectory points are obtained; N is an integer greater than or equal to 1;
[0007] Based on the mouse trajectory information and the N predicted mouse trajectory points, the mouse trajectory of the client is reproduced.
[0008] In some embodiments, obtaining N predicted mouse trajectory points based on at least part of the mouse trajectory points in the mouse trajectory information using a target mouse trajectory prediction algorithm includes:
[0009] Based on the at least part of the mouse track points, determining the number N of mouse track points to be added;
[0010] In the case where N≥1, based on the at least part of the mouse trajectory points, using a target mouse trajectory prediction algorithm, N predicted mouse trajectory points are obtained;
[0011] Among them, the at least part of the mouse trajectory points include the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A which are ranked in the top three in descending order according to the receiving time in the mouse trajectory information.
[0012] In some embodiments, determining the number N of mouse track points to be added based on at least part of the mouse track points includes:
[0013] When the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A all fall within the coordinate range corresponding to the screen resolution size, and the cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A is greater than the cosine value of the first preset angle and less than the cosine value of the second preset angle, the number N of mouse trajectory points to be added is determined based on the position information of the first mouse trajectory point C and the position information of the second mouse trajectory point B; wherein the first preset angle is greater than the second preset angle.
[0014] In some embodiments, determining the number N of mouse track points to be added based on the position information of the first mouse track point C and the position information of the second mouse track point B includes:
[0015] Determine a first distance between the first mouse track point C and the second mouse track point B based on the position information of the first mouse track point C and the position information of the second mouse track point B;
[0016] When the first distance is greater than zero and less than or equal to a first threshold, determining the number of mouse track points to be added as N=0;
[0017] When the first distance is greater than the first threshold value and less than or equal to the second threshold value, determining the number of mouse track points to be added as N=1;
[0018] When the first distance is greater than the second threshold, the number of mouse track points to be added is determined to be N=2, wherein the second threshold is greater than the first threshold, and the first threshold and the second threshold are determined by the screen diagonal resolution.
[0019] In some embodiments, obtaining N predicted mouse trajectory points based on at least part of the mouse trajectory points using a target mouse trajectory prediction algorithm includes:
[0020] Determine a target mouse trajectory prediction algorithm according to N and a cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B, and the position information of the third mouse trajectory point A;
[0021] Based on the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A, the target mouse trajectory prediction algorithm is used to obtain N predicted mouse trajectory points.
[0022] In some embodiments, determining a target mouse trajectory prediction algorithm according to N and a cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B, and the position information of the third mouse trajectory point A comprises:
[0023] When N is 1, determine whether the cosine value of ∠ABC is less than the cosine value of the third preset angle;
[0024] If yes, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on a Bezier curve; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle;
[0025] When N is 2, determine whether the cosine value of ∠ABC is less than the cosine value of the fourth preset angle;
[0026] If so, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on Bezier curves; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; wherein the fourth preset angle is smaller than the third preset angle.
[0027] In some embodiments, the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle;
[0028] The step of obtaining N predicted mouse trajectory points based on at least part of the mouse trajectory points by using a target mouse trajectory prediction algorithm comprises:
[0029] When N is 1, determine the position information of a first reference point on an extension line extending from the third mouse track point A to the second mouse track point B; determine the position information of a second reference point on a line segment formed by the first reference point and the first mouse track point C according to the position information of the first reference point, the position information of the first mouse track point C, and a first position parameter; obtain a predicted position information of a mouse track point according to the position information of the second mouse track point B, the position information of the second reference point, and a second position parameter;
[0030] In the case where N is 2, the position information of the one predicted mouse trajectory point is determined as the position information of the first predicted mouse trajectory point; the position information of a third reference point on an extension line extending from the second mouse trajectory point B in the direction of the first predicted mouse trajectory point is determined; according to the position information of the third reference point, the position information of the first mouse trajectory point C and the first position parameter, the position information of a fourth reference point on a line segment formed by the third reference point and the first mouse trajectory point C is determined; according to the position information of the first predicted mouse trajectory point, the position information of the fourth reference point and the second position parameter, the position information of the second predicted mouse trajectory point is obtained;
[0031] Wherein, the distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C;
[0032] The distance between the third reference point and the position information of the first predicted mouse trajectory point is equal to the distance between the first predicted mouse trajectory point and the first mouse trajectory point C.
[0033] In some embodiments, the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on Bezier curves;
[0034] The step of obtaining N predicted mouse trajectory points based on at least part of the mouse trajectory points by using a target mouse trajectory prediction algorithm comprises:
[0035] When N is 1, determining the position information of a first reference point on an extension line extending from the third mouse track point A to the second mouse track point B; the distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C; and determining a Bezier curve based on the position information of the first reference point, the position information of the second mouse track point B and the position information of the first mouse track point C; and obtaining the position information of a predicted mouse track point on the Bezier curve according to a first preset parameter;
[0036] When N is 2, the position information of the first reference point on the extension line extending from the third mouse trajectory point A to the second mouse trajectory point B is determined; the distance between the first reference point and the second mouse trajectory point B is equal to the distance between the second mouse trajectory point B and the first mouse trajectory point C; and based on the position information of the first reference point, the position information of the second mouse trajectory point B and the position information of the first mouse trajectory point C, a Bezier curve is determined; according to the second preset parameters and the third preset parameters, the position information of the first predicted mouse trajectory point and the position information of the second predicted mouse trajectory point located on the Bezier curve are respectively obtained.
[0037] In a second aspect, the present invention further provides a mouse trajectory control device, comprising:
[0038] Receiving module, receiving the mouse track information sent by the client;
[0039] A first processing module, configured to obtain N predicted mouse trajectory points based on at least part of the mouse trajectory points in the mouse trajectory information by using a target mouse trajectory prediction algorithm, where N is an integer greater than or equal to 1;
[0040] The second processing module is used to reproduce the mouse trajectory of the client based on the mouse trajectory information and the N predicted mouse trajectory points.
[0041] In a third aspect, the present invention further provides a server, comprising a processor and a transceiver, wherein the transceiver receives and sends data under the control of the processor, and the processor is used to perform the following operations:
[0042] Receive mouse track information sent by the client;
[0043] Based on at least part of the mouse trajectory points in the mouse trajectory information, using a target mouse trajectory prediction algorithm, N predicted mouse trajectory points are obtained; N is an integer greater than or equal to 1;
[0044] Based on the mouse trajectory information and the N predicted mouse trajectory points, the mouse trajectory of the client is reproduced.
[0045] In a fourth aspect, the present invention further provides a readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the mouse trajectory control method described in the first aspect.
[0046] In a fifth aspect, the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps in the mouse trajectory control method described in the first aspect.
[0047] The above technical solution of the present invention has at least the following beneficial effects:
[0048] In an embodiment of the present invention, mouse trajectory information sent by a client is received; based on at least part of the mouse trajectory points in the mouse trajectory information, a target mouse trajectory prediction algorithm is used to obtain N predicted mouse trajectory points; N is an integer greater than or equal to 1; based on the mouse trajectory information and the N predicted mouse trajectory points, the mouse trajectory of the client is reproduced; in this way, the mouse trajectory information sent by the client is used to predict the mouse trajectory points, so as to add them to the mouse trajectory information, thereby increasing the mouse trajectory data density, thereby making the cloud mouse trajectory smooth and fluent, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram showing a flow chart of a mouse trajectory control method provided by an embodiment of the present invention;
[0050] Figure 2 A schematic diagram showing the use of a mouse trajectory prediction algorithm to obtain predicted mouse trajectory points in the present invention;
[0051] Figure 3 One of the schematic diagrams showing the use of a Bezier curve-based trajectory prediction algorithm to obtain predicted mouse trajectory points in the present invention;
[0052] Figure 4 One of the schematic diagrams showing the present invention using a trajectory prediction algorithm based on speed and angle to obtain predicted mouse trajectory points;
[0053] Figure 5 A schematic diagram showing a flow chart of the algorithm selection scheme of the present invention;
[0054] Figure 6 A second schematic diagram showing the use of a trajectory prediction algorithm based on speed and angle to obtain predicted mouse trajectory points in the present invention;
[0055] Figure 7 Schematic diagram showing three examples of second-order Bezier curves;
[0056] Figure 8 The second schematic diagram shows that the present invention uses a Bezier curve-based trajectory prediction algorithm to obtain predicted mouse trajectory points;
[0057] Fig. 9 A second flowchart diagram showing a method for controlling a mouse trajectory according to an embodiment of the present invention;
[0058] Fig.10 A schematic diagram showing a module of a mouse trajectory control device provided by an embodiment of the present invention;
[0059] Fig.11 A schematic diagram showing the hardware structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0061] like Figure 1 FIG. 1 is a flow chart of a mouse trajectory control method provided by an embodiment of the present invention. The method is executed by a server (cloud). The method specifically includes:
[0062] Step 101: Receive mouse track information sent by the client.
[0063] Among them, the client, also known as the user end, refers to the program that corresponds to the server and provides local services to customers. It needs to cooperate with the server to run.
[0064] In cloud desktop scenarios, such as drawing and painting, as the mouse moves continuously, the client will continuously capture the mouse trajectory information and package it to the cloud (ie, server, remote desktop).
[0065] Step 102: Based on at least part of the mouse trajectory points in the mouse trajectory information, a target mouse trajectory prediction algorithm is used to obtain N predicted mouse trajectory points; N is an integer greater than or equal to 1.
[0066] Here, firstly, based on at least part of the mouse trajectory points in the mouse trajectory information, the number N of mouse trajectory points to be added is determined, that is, the number N of predicted mouse trajectory points; then, the target mouse trajectory prediction algorithm is used to obtain N predicted mouse trajectory points, as shown in the following embodiments for details.
[0067] Step 103: Reproduce the mouse trajectory of the client based on the mouse trajectory information and the N predicted mouse trajectory points.
[0068] It should be understood that reproducing the mouse trajectory of the client based on the mouse trajectory information and the N predicted mouse trajectory points specifically refers to adding the N predicted mouse trajectory points to the mouse trajectory information to form a new mouse trajectory as the mouse trajectory of the client, and reproducing the same mouse movement operation based on the mouse trajectory of the client.
[0069] In this way, the mouse trajectory information sent by the client is used to predict the mouse trajectory points and add them to the mouse trajectory information to increase the mouse trajectory data density, thereby making the cloud mouse trajectory smooth and fluent, and improving the user experience.
[0070] In an optional embodiment, step 102 specifically includes:
[0071] Step 1021, based on the at least part of the mouse trajectory points, determine the number N of mouse trajectory points that need to be added; wherein the at least part of the mouse trajectory points include the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A, which are ranked in the top three in terms of receiving time from late to early in the mouse trajectory information.
[0072] Here, the receiving time of the position information of the first mouse track point C is the latest, which is later than the position information of the second mouse track point B. The position information of the second mouse track point B is later than the position information of the third mouse track point A.
[0073] Furthermore, the above step 1021 may specifically include:
[0074] When the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A all fall within the coordinate range corresponding to the screen resolution size, and the cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A is greater than the cosine value of the first preset angle and less than the cosine value of the second preset angle, the number N of mouse trajectory points to be added is determined based on the position information of the first mouse trajectory point C and the position information of the second mouse trajectory point B; wherein the first preset angle is greater than the second preset angle.
[0075] It should be noted that the conditions for adding mouse track points comprehensively consider the angle and smoothness of the current track. By recording the latest three mouse track points in real time, the state of the current track can be understood to a certain extent, and it can be used to decide whether to add mouse track points.
[0076] In the cloud desktop scenario, the coordinates of the mouse track points collected by the client may be outside the legal coordinates of the cloud (i.e., the coordinate range corresponding to the screen resolution size) (for example, the coordinates are negative). At this time, the additional mouse track points will also be outside the legal coordinates with a high probability. Therefore, the present invention will first verify the coordinates (i.e., position information) of the three latest mouse track points recorded in real time. That is, the position information of the first mouse track point C, the position information of the second mouse track point B, and the position information of the third mouse track point A all fall within the coordinate range corresponding to the screen resolution size, so that the subsequent operation of adding points (adding mouse track points) can be performed.
[0077] Figure 2The predicted mouse trajectory points (i.e., the mouse trajectory points that need to be added) obtained using the mouse trajectory prediction algorithm (see the subsequent section for details) are shown. Among them, point A (the third mouse trajectory point), B (the second mouse trajectory point), and C (the first mouse trajectory point) are three consecutive mouse trajectory points, and point E is a predicted mouse trajectory point. It can be intuitively felt that for trajectory points of a straight line or an approximate straight line, adding mouse trajectory points has little effect. Therefore, the present invention will make a judgment on the straight line trajectory. Combined with the survey results and the actual operation situation, preferably, the first preset angle varies within a range of about 175°, that is, the value range of the first preset angle is [171°, 179°]. The second preset angle varies within a range of about 5°, that is, the value range of the first preset angle is [1°, 9°]. Figure 2 In the example, the first preset angle is 179° and the second preset angle is 1°. That is, the cosine value of ∠ABC is compared with the cosine values of 1° and 179°. It should be noted that the method of the present invention does not use the slope as a basis for judgment, so there is no need to deal with the tricky situation of infinite slope.
[0078] Here, the cosine of ∠ABC is:
[0079]
[0080] If the cosine value of ∠ABC satisfies the following conditions, it is considered that points A, B, and C are not on the same straight line, so that the subsequent point adding (adding mouse trajectory points) operation can be performed.
[0081] cos(179°)<cos∠ABC<cos(1°) (2)
[0082] It should be noted that the larger the distance between two mouse track points, the more obvious the broken line is and the less smooth the track is. Therefore, the present invention determines the number N of mouse track points that need to be added based on the distance between two consecutive mouse track points.
[0083] Therefore, in an optional embodiment, the above step of determining the number N of mouse track points to be added based on the position information of the first mouse track point C and the position information of the second mouse track point B includes:
[0084] (1) Based on the position information of the first mouse track point C and the position information of the second mouse track point B, a first distance between the first mouse track point C and the second mouse track point B is determined.
[0085] (2) When the first distance is greater than zero and less than or equal to a first threshold, determine the number of mouse track points to be added as N=0.
[0086] (3) When the first distance is greater than the first threshold and less than or equal to the second threshold, determine the number of mouse track points to be added as N=1.
[0087] Optionally, the first threshold is 1 is 1 / 20 of the screen diagonal resolution, and the second threshold is Π 2 It is 1 / 15 of the screen diagonal resolution.
[0088] (4) When the first distance is greater than the second threshold, determine the number of mouse track points to be added N=2, wherein the second threshold is greater than the first threshold, and the first threshold and the second threshold are determined by the screen diagonal resolution.
[0089] If L represents the first distance, the number N (num) of mouse track points required to be added is shown in Table 1 below.
[0090] Table 1
[0091] L <![CDATA[(0,Π 1 ]]]> <![CDATA[(Π 1 ,P 2 ]]> <![CDATA[(Π 2 ,+∞]]]> num 0 1 2
[0092] Step 1022: when N≥1, based on at least part of the mouse trajectory points, a target mouse trajectory prediction algorithm is used to obtain N predicted mouse trajectory points.
[0093] Furthermore, the above step 1022 may specifically include:
[0094] ① Determine the target mouse trajectory prediction algorithm according to N and the cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A.
[0095] The present invention predicts the mouse track points by a mouse track prediction algorithm, that is, predicts the positions of the mouse track points to be added. The target mouse track prediction algorithm is a track prediction algorithm based on speed and angle or a track prediction algorithm based on a Bezier curve.
[0096] In an optional embodiment, the above step ① specifically includes:
[0097] When N is 1, determine whether the cosine value of ∠ABC is less than the cosine value of the third preset angle;
[0098] If yes, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on a Bezier curve; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle;
[0099] When N is 2, determine whether the cosine value of ∠ABC is less than the cosine value of the fourth preset angle;
[0100] If so, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on Bezier curves; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; wherein the fourth preset angle is smaller than the third preset angle.
[0101] Optionally, the third preset angle is 90° and the fourth preset angle is 60°.
[0102] Compared with trajectory prediction algorithms based on speed and angle, trajectory prediction algorithms based on Bezier curves have difficulty in handling situations where the trajectory angle is small and the number of added points is small. Figure 3 As shown in , when the trajectory angle is small and the number of added points is small, the trajectory prediction algorithm based on the Bezier curve may make the distance between the mouse trajectory points larger (that is, the distance between EC is greater than the distance between BC), which will cause the mouse trajectory to be distorted. Figure 4 , the trajectory prediction algorithm based on speed and angle can ensure that the trajectory is as smooth as possible (that is, the distance between FC is less than the distance between BC). The principles of the two trajectory prediction algorithms are described in the subsequent sections.
[0103] The above algorithm selection scheme converts the comparison between angles into the comparison between cosine values, and the cosine value of ∠ABC can be calculated according to formula (1). The main process of the above algorithm selection scheme can be found in Figure 5 .
[0104] Step 501, determining the number of mouse track points to be added;
[0105] If the number is 1, execute step 502; if the number is 2, execute step 503.
[0106] It should be noted that the number of mouse track points to be added is obtained based on the proportional relationship between the track length and the screen diagonal resolution, i.e., the above steps (3) and (4).
[0107] Step 502, determine whether cos∠ABC<cos(90°)?
[0108] If yes, execute step 504; if no, execute step 505.
[0109] Step 503, determine whether cos∠ABC<cos(60°)?
[0110] If yes, execute step 506; if no, execute step 507.
[0111] Step 504: obtain predicted mouse trajectory points based on a trajectory prediction algorithm of the Bezier curve.
[0112] Step 505: Get the predicted mouse trajectory point based on the trajectory prediction algorithm of speed and angle.
[0113] Step 506: Obtain predicted mouse trajectory points based on a trajectory prediction algorithm of the Bezier curve.
[0114] Step 507: Get the predicted mouse trajectory point based on the trajectory prediction algorithm of speed and angle.
[0115] In this way, a suitable mouse trajectory prediction algorithm can be adaptively selected in combination with the number of added points and the trajectory angle. It should be noted that as the trajectory angle and the number of added points increase, the present invention tends to use a trajectory prediction algorithm based on a Bezier curve.
[0116] ② Based on the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A, the target mouse trajectory prediction algorithm is used to obtain N predicted mouse trajectory points.
[0117] In an optional embodiment, the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; accordingly, the above step 1022 (or the above step ②) may include:
[0118] When N is 1, determine the position information of the first reference point on the extension line extending from the third mouse trajectory point A to the second mouse trajectory point B; determine the position information of the second reference point on the line segment formed by the first reference point and the first mouse trajectory point C based on the position information of the first reference point, the position information of the first mouse trajectory point C and the first position parameter; obtain a predicted position information of the mouse trajectory point based on the position information of the second mouse trajectory point B, the position information of the second reference point and the second position parameter.
[0119] The distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C.
[0120] Here, the first position parameter and the second position parameter are preset position parameters.
[0121] Figure 6A trajectory prediction algorithm based on speed and angle is demonstrated. Among them, points A, B, and C are the three latest mouse trajectory points, namely the first mouse trajectory point C, the second mouse trajectory point B, and the third mouse trajectory point A of the present invention. Point D (first reference point) is on the extension line of straight line AB, and BD=BC. n and m are position parameters, and DE:EC=n:1, BF:FE=m:1. Among them, E represents the second reference point, and the predicted mouse trajectory point is point F in the figure. Combined with the python-based algorithm visualization and actual operation, optionally, n (first position parameter) takes the value of 2, and m (second position parameter) takes the value of 1. At this time, point F is the predicted mouse trajectory point obtained. When the algorithm is used to predict multiple mouse trajectory points (that is, when L>Π 2 ), the last predicted point (here F) is needed to predict the next mouse track point. Figure 6 For example, use points B, F, and C to predict the next mouse trajectory point, that is, the following case where N is 2. After obtaining the position information of the first predicted mouse trajectory point F, use points B (the second mouse trajectory point), F (the first predicted mouse trajectory point), and C (the first mouse trajectory point) to obtain the position information of the second predicted mouse trajectory point.
[0122] When N is 2, the position information of the predicted mouse track point is determined as the position information of the first predicted mouse track point. Here, the first predicted mouse track point position information can be obtained by referring to the above case of N=1, which will not be repeated here.
[0123] Next, the following part repeats the above-mentioned principle of determining the position information of the predicted mouse track point when N=1. Specifically:
[0124] Determine the position information of a third reference point on the extension line extending from the second mouse trajectory point B in the direction of the first predicted mouse trajectory point; wherein the distance between the third reference point and the position information of the first predicted mouse trajectory point is equal to the distance between the first predicted mouse trajectory point and the first mouse trajectory point C.
[0125] According to the position information of the third reference point, the position information of the first mouse trajectory point C and the first position parameter, the position information of the fourth reference point on the line segment formed by the third reference point and the first mouse trajectory point C is determined; according to the position information of the first predicted mouse trajectory point, the position information of the fourth reference point and the second position parameter, the position information of the second predicted mouse trajectory point is obtained.
[0126] Here, the trajectory prediction algorithm based on speed and angle considers both the angle and speed of the mouse trajectory to predict the transition point between two mouse trajectory points. Specifically, "extend AB to point D" takes into account the angle of the current mouse trajectory, while "BD = BC" takes into account the speed of the current mouse trajectory at point B.
[0127] Before describing the following embodiment, that is, a trajectory prediction algorithm based on a Bezier curve to obtain the position information of the predicted mouse trajectory point, the Bezier curve is first introduced.
[0128] The Bezier curve defines the shape of the curve through control points. Although the curve does not necessarily pass through these control points, its path is affected by these points. The second-order Bezier curve is determined by three control points:
[0129] (1) Control point P0: the starting point of the curve.
[0130] (2) Control point P1: This point is not on the curve, but it determines the degree and direction of the curve.
[0131] (3) Control point P2: the end point of the curve.
[0132] Figure 7 Three examples of second-order Bezier curves are shown, which reflect the influence of control points on the curve.
[0133] In another optional embodiment, the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on a Bezier curve; accordingly, the above step 1022 (or the above step ②) may include:
[0134] When N is 1, the position information of a first reference point on an extension line extending from the third mouse trajectory point A to the second mouse trajectory point B is determined; the distance between the first reference point and the second mouse trajectory point B is equal to the distance between the second mouse trajectory point B and the first mouse trajectory point C; and based on the position information of the first reference point, the position information of the second mouse trajectory point B and the position information of the first mouse trajectory point C, a Bezier curve is determined; and according to a first preset parameter, the position information of a predicted mouse trajectory point located on the Bezier curve is obtained.
[0135] Optionally, the first preset parameter is 1 / 2; the second preset parameter is 1 / 3, and the third preset parameter is 2 / 3.
[0136] Figure 8Disclosed is a trajectory prediction algorithm based on Bessel curves. Among them, points A, B, and C are the latest three mouse trajectory points, namely the first mouse trajectory point C, the second mouse trajectory point B, and the third mouse trajectory point A of the present invention. Point D (the first reference point) is on the extension line of line AB, and BD = BC. Points B, C, and D are used as control points P0, P1, and P2 respectively to determine the Bessel curve, which is the prediction of the mouse trajectory.
[0137] It should be noted that Figure 8 The determination of the midpoint E (the obtained predicted mouse trajectory point) is related to the parameter (i.e., the preset parameter) 0 < t < 1 in the Bessel curve. It should be understood that as t gradually increases from 0 to 1, point E gradually moves from point B to point C. Figure 8 The first preset parameter corresponding to the displayed Bessel curve is 1 / 2.
[0138] Combined with the algorithm visualization based on python and the actual running situation, the relationship between the number N (num) of mouse trajectory points to be added and the preset parameter t (which can be the first preset parameter, the second preset parameter, the third preset parameter) is shown in Table 2 below.
[0139] Table 2
[0140] num 1 2 t 1 / 2 1 / 3 and 2 / 3
[0141] In the case where N is 2, determine the position information of the first reference point on the extension line extending in the direction from the third mouse trajectory point A to the second mouse trajectory point B; the distance between the first reference point and the second mouse trajectory point B is equal to the distance between the second mouse trajectory point B and the first mouse trajectory point C; and based on the position information of the first reference point, the position information of the second mouse trajectory point B, and the position information of the first mouse trajectory point C, determine the Bessel curve; according to the second preset parameter and the third preset parameter, respectively obtain the position information of the first predicted mouse trajectory point and the position information of the second predicted mouse trajectory point located on the Bessel curve.
[0142] Specifically, according to the second preset parameter, obtain the position information of the first predicted mouse trajectory point located on the Bessel curve; according to the third preset parameter, obtain the position information of the second predicted mouse trajectory point located on the Bessel curve.
[0143] It should be noted that when the number N of mouse trajectory points to be added is 0, based on the mouse trajectory information, reproduce the mouse trajectory of the client.
[0144] See Fig. 9 , the overall process of the mouse trajectory control method of the present invention will be described below from the client to the server. Specifically as follows:
[0145] Client:
[0146] Step 901, capturing the actual mouse track points.
[0147] Step 902, sending the actual mouse track points to the cloud.
[0148] Server side (cloud):
[0149] Step 903, receiving the actual mouse track point.
[0150] Step 904, recording the latest three real mouse trajectory points for predicting the mouse trajectory.
[0151] Step 905: Adaptively determine whether to add mouse track points and the number of points to be added.
[0152] For details, please refer to the description of steps 1021 to 1022.
[0153] If it is not necessary to add a mouse track point, execute step 909 ; if it is necessary to add a mouse track point, execute step 906 .
[0154] Step 906: adaptively select a suitable mouse trajectory prediction algorithm according to the number of added points and the mouse trajectory angle.
[0155] Step 907, obtaining new mouse trajectory points (ie, predicted mouse trajectory points) according to the mouse trajectory prediction algorithm.
[0156] Step 908: Reproduce the obtained predicted mouse trajectory points on the operating system.
[0157] Step 909, reproducing the actual mouse track points on the operating system.
[0158] The mouse track control method of the present invention directly improves the user experience by improving the smoothness of the mouse track in the cloud desktop, especially in scenes such as drawing and painting. Furthermore, during the use of the cloud desktop, the unsmooth mouse track will cause visual and operational lag, thereby affecting user satisfaction. The method of the present invention predicts the mouse track points through the mouse track information sent by the client, and adds them to the mouse track information to increase the mouse track data density, thereby making the cloud mouse track smooth and fluent, and improving the user experience.
[0159] It should be noted that the method of the present invention can be applied to multiple fields such as games, distance education, and remote office, and has a rich potential market.
[0160] like Fig.10As shown, an embodiment of the present invention further provides a mouse trajectory control device, wherein the device includes:
[0161] Receiving module 1001, receiving mouse track information sent by the client;
[0162] A first processing module 1002 is configured to obtain N predicted mouse trajectory points based on at least part of the mouse trajectory points in the mouse trajectory information by using a target mouse trajectory prediction algorithm, where N is an integer greater than or equal to 1;
[0163] The second processing module 1003 is used to reproduce the mouse trajectory of the client based on the mouse trajectory information and the N predicted mouse trajectory points.
[0164] Optionally, the first processing module 1002 includes:
[0165] A first processing unit, configured to determine a number N of mouse track points to be added based on at least part of the mouse track points;
[0166] A second processing unit is configured to obtain N predicted mouse trajectory points by using a target mouse trajectory prediction algorithm based on at least part of the mouse trajectory points when N≥1;
[0167] Among them, the at least part of the mouse trajectory points include the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A which are ranked in the top three in descending order according to the receiving time in the mouse trajectory information.
[0168] Optionally, the first processing unit is specifically configured to:
[0169] When the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A all fall within the coordinate range corresponding to the screen resolution size, and the cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A is greater than the cosine value of the first preset angle and less than the cosine value of the second preset angle, the number N of mouse trajectory points to be added is determined based on the position information of the first mouse trajectory point C and the position information of the second mouse trajectory point B; wherein the first preset angle is greater than the second preset angle.
[0170] Optionally, the first processing unit is specifically configured to:
[0171] Determine a first distance between the first mouse track point C and the second mouse track point B based on the position information of the first mouse track point C and the position information of the second mouse track point B;
[0172] When the first distance is greater than zero and less than or equal to a first threshold, determining the number of mouse track points to be added as N=0;
[0173] When the first distance is greater than the first threshold value and less than or equal to the second threshold value, determining the number of mouse track points to be added as N=1;
[0174] When the first distance is greater than the second threshold, the number of mouse track points to be added is determined to be N=2, wherein the second threshold is greater than the first threshold, and the first threshold and the second threshold are determined by the screen diagonal resolution.
[0175] Optionally, the first processing module 1002 includes:
[0176] a third processing unit, configured to determine a target mouse trajectory prediction algorithm according to N and a cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B, and the position information of the third mouse trajectory point A;
[0177] The fourth processing unit is used to obtain N predicted mouse trajectory points based on the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A using the target mouse trajectory prediction algorithm.
[0178] Optionally, the third processing unit is specifically configured to:
[0179] When N is 1, determine whether the cosine value of ∠ABC is less than the cosine value of the third preset angle;
[0180] If yes, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on a Bezier curve; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle;
[0181] When N is 2, determine whether the cosine value of ∠ABC is less than the cosine value of the fourth preset angle;
[0182] If so, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on Bezier curves; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; wherein the fourth preset angle is smaller than the third preset angle.
[0183] Optionally, the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; the second processing unit is specifically used for:
[0184] When N is 1, determine the position information of a first reference point on an extension line extending from the third mouse track point A to the second mouse track point B; determine the position information of a second reference point on a line segment formed by the first reference point and the first mouse track point C according to the position information of the first reference point, the position information of the first mouse track point C, and a first position parameter; obtain a predicted position information of a mouse track point according to the position information of the second mouse track point B, the position information of the second reference point, and a second position parameter;
[0185] In the case where N is 2, the position information of the one predicted mouse trajectory point is determined as the position information of the first predicted mouse trajectory point; the position information of a third reference point on an extension line extending from the second mouse trajectory point B in the direction of the first predicted mouse trajectory point is determined; according to the position information of the third reference point, the position information of the first mouse trajectory point C and the first position parameter, the position information of a fourth reference point on a line segment formed by the third reference point and the first mouse trajectory point C is determined; according to the position information of the first predicted mouse trajectory point, the position information of the fourth reference point and the second position parameter, the position information of the second predicted mouse trajectory point is obtained;
[0186] Wherein, the distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C;
[0187] The distance between the third reference point and the position information of the first predicted mouse trajectory point is equal to the distance between the first predicted mouse trajectory point and the first mouse trajectory point C.
[0188] Optionally, the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on a Bezier curve; and the second processing unit is specifically used for:
[0189] When N is 1, determining the position information of a first reference point on an extension line extending from the third mouse track point A to the second mouse track point B; the distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C; and determining a Bezier curve based on the position information of the first reference point, the position information of the second mouse track point B and the position information of the first mouse track point C; and obtaining the position information of a predicted mouse track point on the Bezier curve according to a first preset parameter;
[0190] When N is 2, the position information of the first reference point on the extension line extending from the third mouse trajectory point A to the second mouse trajectory point B is determined; the distance between the first reference point and the second mouse trajectory point B is equal to the distance between the second mouse trajectory point B and the first mouse trajectory point C; and based on the position information of the first reference point, the position information of the second mouse trajectory point B and the position information of the first mouse trajectory point C, a Bezier curve is determined; according to the second preset parameters and the third preset parameters, the position information of the first predicted mouse trajectory point and the position information of the second predicted mouse trajectory point located on the Bezier curve are respectively obtained.
[0191] The mouse trajectory control device of the embodiment of the present invention receives mouse trajectory information sent by a client; based on at least part of the mouse trajectory points in the mouse trajectory information, obtains N predicted mouse trajectory points using a target mouse trajectory prediction algorithm; N is an integer greater than or equal to 1; based on the mouse trajectory information and the N predicted mouse trajectory points, reproduces the mouse trajectory of the client; in this way, the mouse trajectory points are predicted through the mouse trajectory information sent by the client to be added to the mouse trajectory information, thereby increasing the mouse trajectory data density, thereby making the cloud mouse trajectory smooth and fluent, and improving the user experience.
[0192] In order to better achieve the above goals, Fig.11 As shown, an embodiment of the present invention further provides a server, including a processor 1100 and a transceiver 1110, wherein the transceiver 1110 receives and sends data under the control of the processor 1100, and the processor 1100 is used to perform the following process:
[0193] Receive mouse track information sent by the client;
[0194] Based on at least part of the mouse trajectory points in the mouse trajectory information, using a target mouse trajectory prediction algorithm, N predicted mouse trajectory points are obtained; N is an integer greater than or equal to 1;
[0195] Based on the mouse trajectory information and the N predicted mouse trajectory points, the mouse trajectory of the client is reproduced.
[0196] Optionally, the processor 1100 is further configured to:
[0197] Based on the at least part of the mouse track points, determining the number N of mouse track points to be added;
[0198] In the case where N≥1, based on the at least part of the mouse trajectory points, using a target mouse trajectory prediction algorithm, N predicted mouse trajectory points are obtained;
[0199] Among them, the at least part of the mouse trajectory points include the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A which are ranked in the top three in descending order according to the receiving time in the mouse trajectory information.
[0200] Optionally, the processor 1100 is further configured to:
[0201] When the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A all fall within the coordinate range corresponding to the screen resolution size, and the cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A is greater than the cosine value of the first preset angle and less than the cosine value of the second preset angle, the number N of mouse trajectory points to be added is determined based on the position information of the first mouse trajectory point C and the position information of the second mouse trajectory point B; wherein the first preset angle is greater than the second preset angle.
[0202] Optionally, the processor 1100 is further configured to:
[0203] Determine a first distance between the first mouse track point C and the second mouse track point B based on the position information of the first mouse track point C and the position information of the second mouse track point B;
[0204] When the first distance is greater than zero and less than or equal to a first threshold, determining the number of mouse track points to be added as N=0;
[0205] When the first distance is greater than the first threshold value and less than or equal to the second threshold value, determining the number of mouse track points to be added as N=1;
[0206] When the first distance is greater than the second threshold, the number of mouse track points to be added is determined to be N=2, wherein the second threshold is greater than the first threshold, and the first threshold and the second threshold are determined by the screen diagonal resolution.
[0207] Optionally, the processor 1100 is further configured to:
[0208] Determine a target mouse trajectory prediction algorithm according to N and a cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B, and the position information of the third mouse trajectory point A;
[0209] Based on the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A, the target mouse trajectory prediction algorithm is used to obtain N predicted mouse trajectory points.
[0210] Optionally, the processor 1100 is further configured to:
[0211] When N is 1, determine whether the cosine value of ∠ABC is less than the cosine value of the third preset angle;
[0212] If yes, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on a Bezier curve; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle;
[0213] When N is 2, determine whether the cosine value of ∠ABC is less than the cosine value of the fourth preset angle;
[0214] If so, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on Bezier curves; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; wherein the fourth preset angle is smaller than the third preset angle.
[0215] Optionally, the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; the processor 1100 is further configured to:
[0216] When N is 1, determine the position information of a first reference point on an extension line extending from the third mouse track point A to the second mouse track point B; determine the position information of a second reference point on a line segment formed by the first reference point and the first mouse track point C according to the position information of the first reference point, the position information of the first mouse track point C, and a first position parameter; obtain a predicted position information of a mouse track point according to the position information of the second mouse track point B, the position information of the second reference point, and a second position parameter;
[0217] In the case where N is 2, the position information of the one predicted mouse trajectory point is determined as the position information of the first predicted mouse trajectory point; the position information of a third reference point on an extension line extending from the second mouse trajectory point B in the direction of the first predicted mouse trajectory point is determined; according to the position information of the third reference point, the position information of the first mouse trajectory point C and the first position parameter, the position information of a fourth reference point on a line segment formed by the third reference point and the first mouse trajectory point C is determined; according to the position information of the first predicted mouse trajectory point, the position information of the fourth reference point and the second position parameter, the position information of the second predicted mouse trajectory point is obtained;
[0218] Wherein, the distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C;
[0219] The distance between the third reference point and the position information of the first predicted mouse trajectory point is equal to the distance between the first predicted mouse trajectory point and the first mouse trajectory point C.
[0220] Optionally, the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on a Bezier curve; the processor 1100 is further configured to:
[0221] When N is 1, determining the position information of a first reference point on an extension line extending from the third mouse track point A to the second mouse track point B; the distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C; and determining a Bezier curve based on the position information of the first reference point, the position information of the second mouse track point B and the position information of the first mouse track point C; and obtaining the position information of a predicted mouse track point on the Bezier curve according to a first preset parameter;
[0222] When N is 2, the position information of the first reference point on the extension line extending from the third mouse trajectory point A to the second mouse trajectory point B is determined; the distance between the first reference point and the second mouse trajectory point B is equal to the distance between the second mouse trajectory point B and the first mouse trajectory point C; and based on the position information of the first reference point, the position information of the second mouse trajectory point B and the position information of the first mouse trajectory point C, a Bezier curve is determined; according to the second preset parameters and the third preset parameters, the position information of the first predicted mouse trajectory point and the position information of the second predicted mouse trajectory point located on the Bezier curve are respectively obtained.
[0223] The server of the embodiment of the present invention receives mouse trajectory information sent by a client; based on at least part of the mouse trajectory points in the mouse trajectory information, obtains N predicted mouse trajectory points using a target mouse trajectory prediction algorithm; N is an integer greater than or equal to 1; based on the mouse trajectory information and the N predicted mouse trajectory points, reproduces the mouse trajectory of the client; in this way, the mouse trajectory points are predicted through the mouse trajectory information sent by the client to be added to the mouse trajectory information, thereby increasing the mouse trajectory data density, thereby making the cloud mouse trajectory smooth and fluent, and improving the user experience.
[0224] An embodiment of the present invention further provides a server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, each process in the above-described mouse trajectory control method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0225] The embodiment of the present invention further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, each process in the above-mentioned mouse trajectory control method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0226] An embodiment of the present invention further provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, the various processes of the aforementioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0227] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0228] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A device that specifies functions in one or more processes and / or one or more blocks.
[0229] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable storage medium produce a paper product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0230] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that the computer or other programmable device executes a series of operating steps to produce a computer-implemented process, thereby providing instructions executed on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0231] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A mouse trajectory control method, characterized in that: include: Receive mouse track information sent by the client; Based on at least part of the mouse trajectory points in the mouse trajectory information, using a target mouse trajectory prediction algorithm, N predicted mouse trajectory points are obtained; N is an integer greater than or equal to 1; Based on the mouse trajectory information and the N predicted mouse trajectory points, the mouse trajectory of the client is reproduced.
2. The method according to claim 1, characterized in that The step of obtaining N predicted mouse trajectory points based on at least part of the mouse trajectory points in the mouse trajectory information by using a target mouse trajectory prediction algorithm comprises: Based on the at least part of the mouse track points, determining the number N of mouse track points to be added; In the case where N≥1, based on the at least part of the mouse trajectory points, using a target mouse trajectory prediction algorithm, N predicted mouse trajectory points are obtained; Among them, the at least part of the mouse trajectory points include the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A which are ranked in the top three in descending order according to the receiving time in the mouse trajectory information.
3. The method according to claim 2, characterized in that The step of determining the number N of mouse track points to be added based on at least part of the mouse track points includes: When the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A all fall within the coordinate range corresponding to the screen resolution size, and the cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A is greater than the cosine value of the first preset angle and less than the cosine value of the second preset angle, the number N of mouse trajectory points to be added is determined based on the position information of the first mouse trajectory point C and the position information of the second mouse trajectory point B; wherein the first preset angle is greater than the second preset angle.
4. The method according to claim 3, characterized in that The determining the number N of mouse track points to be added based on the position information of the first mouse track point C and the position information of the second mouse track point B includes: Determine a first distance between the first mouse track point C and the second mouse track point B based on the position information of the first mouse track point C and the position information of the second mouse track point B; When the first distance is greater than zero and less than or equal to a first threshold, determining the number of mouse track points to be added as N=0; When the first distance is greater than the first threshold value and less than or equal to the second threshold value, determining the number of mouse track points to be added as N=1; When the first distance is greater than the second threshold, the number of mouse track points to be added is determined to be N=2, wherein the second threshold is greater than the first threshold, and the first threshold and the second threshold are determined by the screen diagonal resolution.
5. The method according to claim 2, characterized in that: The step of obtaining N predicted mouse trajectory points based on at least part of the mouse trajectory points by using a target mouse trajectory prediction algorithm comprises: Determine a target mouse trajectory prediction algorithm according to N and a cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B, and the position information of the third mouse trajectory point A; Based on the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A, the target mouse trajectory prediction algorithm is used to obtain N predicted mouse trajectory points.
6. The method according to claim 5, characterized in that The target mouse trajectory prediction algorithm is determined according to N and the cosine value of ∠ABC formed by the position information of the first mouse trajectory point C, the position information of the second mouse trajectory point B and the position information of the third mouse trajectory point A, including: When N is 1, determine whether the cosine value of ∠ABC is less than the cosine value of the third preset angle; If yes, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on a Bezier curve; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; When N is 2, determine whether the cosine value of ∠ABC is less than the cosine value of the fourth preset angle; If so, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on Bezier curves; otherwise, it is determined that the target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; wherein the fourth preset angle is smaller than the third preset angle.
7. The method according to claim 2, characterized in that The target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on speed and angle; The step of obtaining N predicted mouse trajectory points based on at least part of the mouse trajectory points by using a target mouse trajectory prediction algorithm comprises: When N is 1, determine the position information of a first reference point on an extension line extending from the third mouse track point A to the second mouse track point B; determine the position information of a second reference point on a line segment formed by the first reference point and the first mouse track point C according to the position information of the first reference point, the position information of the first mouse track point C, and a first position parameter; obtain a predicted position information of a mouse track point according to the position information of the second mouse track point B, the position information of the second reference point, and a second position parameter; In the case where N is 2, the position information of the one predicted mouse trajectory point is determined as the position information of the first predicted mouse trajectory point; the position information of a third reference point on an extension line extending from the second mouse trajectory point B in the direction of the first predicted mouse trajectory point is determined; according to the position information of the third reference point, the position information of the first mouse trajectory point C and the first position parameter, the position information of a fourth reference point on a line segment formed by the third reference point and the first mouse trajectory point C is determined; according to the position information of the first predicted mouse trajectory point, the position information of the fourth reference point and the second position parameter, the position information of the second predicted mouse trajectory point is obtained; Wherein, the distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C; The distance between the third reference point and the position information of the first predicted mouse trajectory point is equal to the distance between the first predicted mouse trajectory point and the first mouse trajectory point C.
8. The method according to claim 2, characterized in that: The target mouse trajectory prediction algorithm is a trajectory prediction algorithm based on Bezier curve; The step of obtaining N predicted mouse trajectory points based on at least part of the mouse trajectory points by using a target mouse trajectory prediction algorithm comprises: When N is 1, determining the position information of a first reference point on an extension line extending from the third mouse track point A to the second mouse track point B; the distance between the first reference point and the second mouse track point B is equal to the distance between the second mouse track point B and the first mouse track point C; and determining a Bezier curve based on the position information of the first reference point, the position information of the second mouse track point B and the position information of the first mouse track point C; and obtaining the position information of a predicted mouse track point on the Bezier curve according to a first preset parameter; When N is 2, the position information of the first reference point on the extension line extending from the third mouse trajectory point A to the second mouse trajectory point B is determined; the distance between the first reference point and the second mouse trajectory point B is equal to the distance between the second mouse trajectory point B and the first mouse trajectory point C; and based on the position information of the first reference point, the position information of the second mouse trajectory point B and the position information of the first mouse trajectory point C, a Bezier curve is determined; according to the second preset parameters and the third preset parameters, the position information of the first predicted mouse trajectory point and the position information of the second predicted mouse trajectory point located on the Bezier curve are respectively obtained.
9. A mouse trajectory control device, characterized in that: include: Receiving module, receiving the mouse track information sent by the client; A first processing module, configured to obtain N predicted mouse trajectory points based on at least part of the mouse trajectory points in the mouse trajectory information by using a target mouse trajectory prediction algorithm, where N is an integer greater than or equal to 1; The second processing module is used to reproduce the mouse trajectory of the client based on the mouse trajectory information and the N predicted mouse trajectory points.
10. A server, comprising a processor and a transceiver, wherein the transceiver receives and sends data under the control of the processor, characterized in that: The processor is configured to perform the following operations: Receive mouse track information sent by the client; Based on at least part of the mouse trajectory points in the mouse trajectory information, using a target mouse trajectory prediction algorithm, N predicted mouse trajectory points are obtained; N is an integer greater than or equal to 1; Based on the mouse trajectory information and the N predicted mouse trajectory points, the mouse trajectory of the client is reproduced.
11. A readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps in the mouse trajectory control method according to any one of claims 1 to 8 are implemented.
12. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps in the mouse trajectory control method according to any one of claims 1 to 8.
Citation Information
Cited By
Remote desktop mouse data processing method and device, storage medium and electronic equipment
CN121657882A