Disclosure of Invention
In order to overcome the problems in the related art, the invention provides a method and a device for controlling mouse shaking.
According to a first aspect of the embodiments of the present invention, there is provided a mouse shaking control method, applied to a server, the method including:
receiving a shaking mouse moving signal;
determining the acceleration and the speed of the shaking mouse moving signal according to the shaking mouse moving signal;
judging whether a next mouse moving signal is received within a preset time length of the received jittering mouse moving signal;
if the next mouse moving signal is not received, determining the current mouse coordinate corrected as the jittering mouse moving signal according to the acceleration and the speed of the jittering mouse moving signal;
and rendering the game picture according to the current mouse coordinate and sending the rendered picture to the client.
Wherein the method further comprises: and if the next mouse moving signal is received, determining the current mouse coordinate after being corrected as the jittering mouse moving signal according to the acceleration and the speed of the jittering mouse moving signal and the position information of the next mouse moving signal.
Wherein the determining the current mouse coordinate corrected as the jittered mouse movement signal according to the acceleration and the speed of the jittered mouse movement signal and the position information of the next mouse movement signal comprises:
and performing interpolation operation on the current mouse movement coordinate of the dither mouse movement signal according to the acceleration and the speed of the dither mouse movement signal and the position information of the next mouse movement signal, and taking the current mouse movement coordinate obtained by the interpolation operation as the current mouse coordinate after the dither mouse movement signal is corrected.
Wherein the method further comprises:
and when the mouse moving signal is not received at the preset sampling point, determining the mouse moving signal as the jitter mouse moving signal.
Wherein the method further comprises:
and storing the current mouse coordinate to a historical track queue.
According to a second aspect of the embodiments of the present invention, there is provided a mouse shaking control apparatus, applied to a server, the apparatus including:
the receiving module is used for receiving the shaking mouse moving signal;
the first determining module is used for determining the acceleration and the speed of the shaking mouse moving signal according to the shaking mouse moving signal;
the judging module is used for judging whether the next mouse moving signal is received within the preset time length of the jitter mouse moving signal;
the second determining module is used for determining the current mouse coordinate after being corrected as the shake mouse moving signal according to the acceleration and the speed of the shake mouse moving signal when the judging module judges that the next mouse moving signal is not received;
and the rendering module is used for rendering the game picture according to the current mouse coordinate and sending the rendered picture to the client.
The second determining module is further configured to determine, if the next mouse movement signal is received, a current mouse coordinate corrected as the jittered mouse movement signal according to the acceleration and the speed of the jittered mouse movement signal and the position information of the next mouse movement signal.
The second determining module is further configured to perform interpolation operation on the current mouse movement coordinate of the dither mouse movement signal according to the acceleration and the speed of the dither mouse movement signal and the position information of the next mouse movement signal, and use the current mouse movement coordinate obtained through the interpolation operation as the current mouse coordinate after the correction of the dither mouse movement signal.
The receiving module is further configured to determine that the mouse moving signal is the jittering mouse moving signal when the mouse moving signal is not received at the preset sampling point.
Wherein the apparatus further comprises:
and the storage module is used for storing the current mouse coordinates to the historical track queue.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
when the server end receives a mouse moving signal sent by the client end and judges that the mouse moving signal sent by the client end is a jittering mouse moving signal, whether a next mouse moving signal is received or not is further judged within a certain time length from the moment of receiving the jittering mouse moving signal, a corresponding correction mode is provided for the current mouse coordinate of the jittering mouse moving signal according to the receiving condition of the next mouse moving signal, so that the jittering compensation is carried out on the current mouse coordinate of the received mouse moving signal, the influence of network fluctuation or blocking on the mouse jittering is reduced, and the user experience is improved. In addition, the game picture is rendered according to the corrected current mouse coordinate and sent to the client, so that the difference between the mouse movement feedback of the user and the cloud game picture is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Detailed Description
In order to make the objects, 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 drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The cloud game is a game mode based on cloud computing, all games run at a server side in a running mode of the cloud game, and a rendered game picture is compressed and then transmitted to a user through a network.
Network delay: network delay refers to the transmission of various data in a network medium through a network protocol (such as TCP, UDP), and if the amount of information is too large and not limited, the excessive network traffic will cause the device to react slowly, resulting in network delay.
Network fluctuation: if the network is congested, queuing delays will affect end-to-end delays and cause packet delays transmitted over the same connection to vary, resulting in unstable data transmission.
The user uses the cloud game service, the client acquires a mouse control signal of the user and sends the mouse control signal to the server, the server maps corresponding control information to the mouse control of the system after receiving the control signal, and remote mouse control operation from the user to the remote server is completed, as shown in fig. 1, the client acquires a mouse movement signal 1 'according to a constant acquisition frequency 2'. However, due to network fluctuation or congestion, the mouse movement signal sent to the server by the user is not the mouse movement signal acquired by the client, as shown in fig. 2, the time sequence of the mouse movement signal 1 received by the server does not arrive according to the time sequence acquired by the client due to network fluctuation 2, and at this time, the user can obviously feel the jitter of mouse operation, and the user experience is reduced.
In order to solve the technical problem, the invention provides a mouse jitter control method, which is characterized in that the current mouse coordinate of a received mouse movement signal is subjected to jitter compensation at a server side to obtain a smooth mouse movement track, thereby reducing the influence of network fluctuation or blockage on mouse jitter and improving user experience.
According to an exemplary embodiment, as shown in fig. 3, the method in the embodiment of the present invention is applied to a server, and the server may be a cloud server. The method in this embodiment comprises the steps of:
step S301, receiving a shaking mouse moving signal.
In this step, the client sends a mouse movement signal to the server, and the client may be an electronic device such as a computer, a smart phone, a tablet computer, and a smart wearable device. The server receives a mouse movement signal sent by the client, and needs to judge whether the received mouse movement signal is a jittering mouse movement signal, that is, a mouse movement signal sent when the mouse movement signal is a mouse jitter.
Step S302, determining the acceleration and the speed of the shaking mouse moving signal according to the shaking mouse moving signal.
In the step, the server only needs to determine the acceleration and the speed of the mouse movement signal when the mouse shakes, so that the current mouse coordinate of the mouse movement signal can be corrected according to the movement trend of the mouse, and shake compensation can be timely performed when the mouse shakes.
Step S303, judging whether the next mouse moving signal is received within the preset time length of the received jittered mouse moving signal.
In this step, the server receives a mouse movement signal sent by the client when the mouse movement signal is a mouse movement signal sent by the client when the mouse is jittered, and determines whether a next mouse movement signal is received within a preset time period after the time when the jittered mouse movement signal is received, so as to correct the current mouse coordinate of the jittered mouse movement signal according to the receiving condition of the next mouse movement signal, wherein the preset time period can be flexibly set as required, and is not specifically limited herein.
And step S304, if the next mouse moving signal is not received, determining the current mouse coordinate corrected as the jittering mouse moving signal according to the acceleration and the speed of the jittering mouse moving signal.
In the step, the server does not receive the next mouse moving signal within the preset time length of receiving the jittering mouse moving signal, that is, the data transmission is unstable due to reasons of packet loss, network delay, network fluctuation, blocking and the like, the server does not receive the next mouse moving signal in time, the server determines the acceleration and the speed of the jittering mouse moving signal, that is, determines the mouse moving trend of the current mouse moving signal, and corrects the current mouse coordinate of the jittering mouse moving signal according to the mouse moving trend so as to realize the jittering compensation of the current mouse coordinate.
In one example, the current mouse movement coordinate is predicted according to the acceleration and the speed of the shake mouse movement signal, and the predicted current mouse movement coordinate is determined as the current mouse coordinate after the shake mouse movement signal is corrected.
And S305, rendering the game picture according to the current mouse coordinate and sending the rendered picture to the client.
In the step, the server corrects the current mouse coordinate of the mouse movement signal to finish the smooth processing of mouse shake, renders a game picture according to the current mouse coordinate, sends the rendered picture to the client, optimizes the picture feedback of the mouse movement signal by the server, effectively reduces the difference between the mouse movement feedback of the user and the cloud game picture, and improves the user experience.
In the embodiment of the invention, the server receives a mouse movement signal sent by the client and determines that the received mouse movement signal is a jittering mouse movement signal, the mouse movement signal sent by the client is transmitted to the server within a certain time due to the blockage of network connection, the server cannot receive the next mouse movement signal, the server predicts the current mouse coordinate of the jittering mouse movement signal according to the acceleration and the speed of the jittering mouse movement signal, the predicted current mouse coordinate is used as the current mouse coordinate after the jittering mouse movement signal is corrected, a game picture is rendered according to the corrected current mouse coordinate and the rendered picture is sent to the client, and the difference between the mouse movement feedback of the user and the cloud game picture is reduced. The embodiment of the invention only corrects the current mouse moving coordinate in time when the mouse shakes, effectively improves the mouse shaking sense of the client caused by network problems and improves the game experience.
According to an exemplary embodiment, as shown in fig. 4, the method in the embodiment of the present invention is applied to a server. The method in the embodiment of the invention comprises the following steps:
step S401, receiving a mouse moving signal.
In this step, the server receives a mouse movement signal sent by the client, where the current mouse movement signal may be a mouse movement signal sent when the client mouse shakes.
Step S402, judging whether a mouse moving signal is received at a preset sampling point or not; if not, executing step S403; if yes, go to step S408.
In the step, when the server is connected to a mouse moving signal sent by the client, whether the moment of receiving the mouse moving signal is the moment of a preset sampling point is judged to determine whether the mouse moving signal is the mouse moving signal sent when the mouse shakes, when the mouse moving signal is not the mouse moving signal sent when the mouse shakes, a game picture can be directly rendered according to the mouse moving signal, and when the mouse moving signal is judged to be the mouse moving signal sent when the mouse shakes, shake compensation needs to be carried out on the mouse moving signal, so that the shake sense of mouse control felt by a user is reduced, and the user experience is improved.
The preset sampling point can be set according to the constant acquisition frequency when the client acquires the mouse movement signal, for example, the preset sampling point is the same as the constant acquisition frequency of the client, the service judges whether the mouse movement signal is received at the preset sampling point, that is, the server judges whether the received mouse movement signal arrives according to the time sequence of acquiring the mouse movement signal by the client, if the mouse movement signal arrives according to the time sequence of acquiring the mouse movement signal by the client, the mouse of the user generates a shaking sense, and if the mouse movement signal does not arrive according to the time sequence of acquiring the mouse movement signal by the client, the mouse of the user is shaken.
Step S403, determining the mouse movement signal as a jittered mouse movement signal.
In the step, the server judges that the moment of receiving the mouse moving signal is inconsistent with the moment of the preset sampling point, and determines that the mouse moving signal is a jittered mouse moving signal, namely the mouse is jittered.
And S404, determining the acceleration and the speed of the shaking mouse moving signal according to the shaking mouse moving signal.
Step S405, judging whether a next mouse moving signal is received within a preset time length of the received jittered mouse moving signal; if not, go to step S406; if yes, go to step S407.
And step S406, determining the current mouse coordinate corrected as the shaking mouse moving signal according to the acceleration and the speed of the shaking mouse moving signal.
Step S405 is the same as step S303, and step S406 is the same as step S304, which are described in step S303 and step S304, and are not repeated herein.
And step S407, determining the current mouse coordinate corrected as the shaking mouse movement signal according to the acceleration and the speed of the shaking mouse movement signal and the position information of the next mouse movement signal.
In the step, the server may receive a next mouse moving signal in advance from within a preset time period during which the jittered mouse moving signal is received, the server determines the acceleration and the speed of the jittered mouse moving signal and the position information of the next mouse moving signal, that is, determines the mouse moving trend of the current mouse moving signal, and corrects the current mouse coordinate of the jittered mouse moving signal in time according to the mouse moving trend and the position information of the next mouse moving signal, so that the mouse moving coordinate is smoothly processed at the server, and the continuity of the mouse moving signal of the server is optimized.
In one example, the current mouse movement coordinate of the shake mouse movement signal is interpolated according to the acceleration and the speed of the shake mouse movement signal and the position information of the next mouse movement signal, and the current mouse movement coordinate obtained by the interpolation is used as the current mouse coordinate after the shake mouse movement signal is corrected. In this embodiment, the server receives a mouse movement signal sent by the client and determines that the received mouse movement signal is a jittered mouse movement signal, and when the mouse movement signal sent by the client is transmitted to the server within a certain time, the server receives a next mouse movement signal, and according to the acceleration and the speed of the jittered mouse movement signal and the position information of the next mouse movement signal, the server performs interpolation operation on the current mouse coordinate of the jittered mouse movement signal to obtain a corrected current mouse coordinate, renders a game picture according to the corrected current mouse coordinate, and sends the rendered picture to the client, so as to reduce the difference between the mouse movement feedback of the user and the cloud game picture, and improve the game experience of the user.
And step S408, rendering the game picture according to the current mouse coordinate and sending the rendered picture to the client.
Step S408 is the same as step S305, and is described in step S305, which is not described herein again.
And step S409, storing the current mouse coordinates to a historical track queue.
In the step, the server corrects the mouse moving signal sent when the mouse shakes, then caches and utilizes the corrected mouse moving signal, provides compensation reference information for the compensation and correction of the shaking mouse moving signal generated when the mouse shakes again, and provides more accurate data for mouse track prediction through the historical track of the mouse.
In the embodiment of the invention, when the server is connected to the mouse moving signal sent by the client and judges that the mouse moving signal sent by the client is a jittering mouse moving signal, whether the next mouse moving signal is received or not within a certain time length from the moment of receiving the jittering mouse moving signal is further judged, so that a corresponding correction mode is provided for the current mouse coordinate of the jittering mouse moving signal according to the receiving condition of the next mouse moving signal, the jittering compensation is carried out on the current mouse coordinate of the received mouse moving signal, the influence of network fluctuation or blockage on the mouse jittering is reduced, and the user experience is improved.
According to an exemplary embodiment, as shown in fig. 5, the apparatus in the embodiment of the present invention is applied to a server. The device in the embodiment of the invention comprises:
a receiving module 501, configured to receive a shake mouse movement signal;
a first determining module 502, configured to determine an acceleration and a speed of the jittered mouse movement signal according to the jittered mouse movement signal;
the judging module 503 is configured to judge whether a next mouse moving signal is received within a preset time length since the jittered mouse moving signal is received;
a second determining module 504, configured to determine, according to the acceleration and the speed of the jittered mouse movement signal, a current mouse coordinate corrected as the jittered mouse movement signal when the determining module determines that the next mouse movement signal is not received;
and a rendering module 505, configured to render the game screen according to the current mouse coordinate and send the rendered screen to the client.
The second determining module 504 is further configured to determine, if a next mouse movement signal is received, a current mouse coordinate corrected as the jittered mouse movement signal according to the acceleration and the speed of the jittered mouse movement signal and the position information of the next mouse movement signal.
The second determining module 504 is further configured to perform interpolation operation on the current mouse movement coordinate of the shake mouse movement signal according to the acceleration and the speed of the shake mouse movement signal and the position information of the next mouse movement signal, and use the current mouse movement coordinate obtained through the interpolation operation as the current mouse coordinate after the shake mouse movement signal is corrected.
The receiving module 501 is further configured to determine that the mouse moving signal is a jittering mouse moving signal when the mouse moving signal is not received at the preset sampling point.
Wherein, the device also comprises a device body,
and the storage module 506 is used for storing the current mouse coordinates to the historical track queue.
An embodiment of the present invention provides a computer device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the executable instructions in the memory to implement the mouse shaking control method described above.
FIG. 6 is a block diagram illustrating a computer device 600 according to an example embodiment. For example, the computer device 600 may be provided as a server. Referring to fig. 6, the computer device 600 includes a processor 601, and the number of processors may be set to one or more as necessary. The computer device 600 also has a memory 602 for storing instructions, such as application programs, that are executable by the processor 601. The number of the memories can be set to one or more according to needs. Which may store one or more application programs. The processor 601 is configured to execute instructions to perform the mouse shaking control method described above.
Embodiments of the present invention also provide a non-transitory computer-readable storage medium including instructions stored thereon, where the executable instructions, when executed by a processor, implement the method for eliminating lens impact noise. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied in the medium. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, including, but not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computer, and the like. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such article or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of additional like elements in the article or device comprising the element.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and variations of this invention provided they come within the scope of the appended claims and their equivalents.