Mouse signal processing method and device, computer equipment, readable storage medium and program product
By using a lower target sampling frequency and cubic spline interpolation algorithm to process mouse signals in cloud games, the problem of limited mouse operation experience in cloud games is solved, and a smoother mouse sliding animation and game screen is achieved.
Patent Information
- Application Number
- CN202411707340.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-11
AI Technical Summary
The mouse operation experience in cloud games is limited by network bandwidth and latency. Traditional methods can lead to network congestion and packet loss by increasing the mouse refresh rate, affecting the user experience.
The client's mouse signal is obtained using a lower target sampling frequency, loading it into the cache queue, and the interpolated signal sequence is obtained through the cubic spline interpolation algorithm, reducing network load and increasing mouse refresh rate.
It effectively reduces network load, prevents mouse signal packet loss, and increases mouse refresh rate through interpolation algorithm, generating smoother mouse sliding animations and game screens.
Smart Images

Figure CN119597161A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a mouse signal processing method, device, computer equipment, readable storage medium and program product. Background Art
[0002] With the development of computer technology, cloud gaming has gradually become a new gaming method in the fields of computer graphics, cloud computing, and human-computer interaction. Cloud gaming runs games on cloud servers and compresses game screens and audio data before transmitting them to users' devices, allowing users to enjoy high-quality gaming experiences anytime, anywhere without having to download and install large-scale game software. However, the user experience of cloud gaming is limited by factors such as network bandwidth and latency, especially the mouse operation experience in human-computer interaction.
[0003] In traditional technology, cloud gaming mouse solutions mainly improve the smoothness of the screen by increasing the mouse refresh rate. This method is similar to the mouse processing method of local games, that is, constantly detecting the position of the mouse and updating the display immediately. However, this method requires a lot of network bandwidth and computing resources, which can easily lead to network congestion and mouse network data packet loss, affecting the user experience. Summary of the invention
[0004] Based on this, it is necessary to provide a mouse signal processing method, device, computer equipment, computer-readable storage medium and computer program product that can improve the mouse refresh rate and avoid network congestion in response to the above technical problems.
[0005] In a first aspect, the present application provides a mouse signal processing method, which is applied to a cloud server and includes:
[0006] Acquire a mouse signal of the client based on a target sampling frequency, and load the mouse signal into a cache queue, wherein the mouse signal includes displacement data of the mouse;
[0007] Based on the cache queue and the preset number of interpolation points, a cubic spline interpolation algorithm is used to obtain an interpolation signal sequence for the mouse signal;
[0008] The client is responded to according to the interpolated signal sequence.
[0009] In one of the embodiments, before obtaining the mouse signal of the client based on the target sampling frequency, the method also includes: obtaining the maximum delay threshold of the client and the target refresh rate of the mouse; determining the target sampling frequency for the mouse signal based on the target refresh rate and the maximum delay threshold, the target sampling frequency being less than the target refresh rate.
[0010] In one of the embodiments, the method further includes: determining a corresponding number of interpolation points according to the target refresh rate and the target sampling frequency.
[0011] In one of the embodiments, the interpolation signal sequence includes interpolation signals corresponding to the number of interpolation points; and responding to the client according to the interpolation signal sequence includes: based on the target refresh rate, using the interpolation signal in the interpolation signal sequence to respond to the client.
[0012] In one of the embodiments, loading the mouse signal into the cache queue includes: obtaining the remaining capacity of the cache queue; when it is determined that the remaining capacity is greater than or equal to a set capacity threshold, loading the mouse signal into the cache queue and recording the loading timestamp.
[0013] In one of the embodiments, the method further includes: when it is determined that the remaining capacity is less than a set capacity threshold, determining the historical mouse signal with the earliest loading timestamp in the cache queue, deleting the historical mouse signal from the cache queue, and loading the mouse signal into the cache queue.
[0014] In a second aspect, the present application provides a mouse signal processing device, which is applied to a cloud server, and the device includes:
[0015] A signal acquisition module, used for acquiring a mouse signal of a client based on a target sampling frequency, and loading the mouse signal into a cache queue, wherein the mouse signal includes displacement data of the mouse;
[0016] An interpolation processing module, used for acquiring an interpolation signal sequence for the mouse signal by using a cubic spline interpolation algorithm based on the cache queue and a preset number of interpolation points;
[0017] A signal response module responds to the client according to the interpolation signal sequence.
[0018] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0019] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0020] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0021] The above-mentioned mouse signal processing method, device, computer equipment, computer-readable storage medium and computer program product obtain the mouse signal of the client based on a lower target sampling frequency, load the mouse signal into a cache queue, and use a cubic spline interpolation algorithm to obtain an interpolation signal sequence for the mouse signal based on the cache queue and the preset number of interpolation points, and respond to the client according to the interpolation signal sequence. It transmits a mouse signal with a lower refresh rate through the network to reduce the frequency of the client sending the mouse signal, thereby reducing the load on the network and preventing the packet loss of the mouse signal, and interpolates the low-frequency mouse signal through the cubic spline interpolation algorithm to obtain an interpolation signal sequence, thereby improving the mouse refresh rate, so that a smoother mouse sliding animation and a smoother game screen can be generated. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1A It is a schematic diagram of high mouse refresh rate in traditional technology;
[0024] Figure 1B A schematic diagram of a low mouse refresh rate in conventional technology;
[0025] Figure 2 A diagram showing an application environment of a mouse signal processing method in one embodiment;
[0026] Figure 3 is a flowchart of a method for processing mouse signals in one embodiment;
[0027] Figure 4 is an interactive schematic diagram of a mouse signal processing method in one embodiment;
[0028] Figure 5 is a structural block diagram of a mouse signal processing device in one embodiment;
[0029] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] As the wave of digitalization sweeps the world, cloud computing has become the core of the development of the IT (Internet technology) industry. As an emerging technology force, cloud gaming transfers game rendering from player devices to centralized servers, revolutionizing the gaming experience. However, current PC (Personal Computer) cloud gaming is always limited by network limitations, and it is difficult to achieve the experience of local gaming in terms of fluency, latency, and graphics. One of the key factors is the mouse refresh rate problem.
[0032] The mouse refresh rate (also called the mouse polling rate) is the frequency at which the mouse reports displacement to the operating system per second, usually in Hertz (Hz). Common mouse refresh rates include 125Hz, 500Hz, 1000Hz, 4000Hz, and 8000Hz. This data is extremely important for the gaming experience. The movement of the mouse by hand is a natural and smooth curve, and the displacement reported by the mouse to the system is not continuous from a microscopic scale, but a displacement line segment connected by scattered position points. Every time the mouse reports displacement, the system will teleport the mouse position to the corresponding position. Therefore, when the mouse reporting frequency is not high enough, the user sees the mouse sliding as a discontinuous picture with a card. Especially in FPS (First-person shooting game), the overall picture moves with the mouse, so the jam is more obvious. On the contrary, the higher the mouse refresh rate, the more it can fit a natural and smooth curve, and the higher the visual fluency. Therefore, general gaming mice tend to set the polling rate to a relatively high level, such as 1000Hz, 4000Hz or 8000Hz.
[0033] Usually, a high mouse polling rate will only consume more CPU (Central Processing Unit) resources to process polling signals in a local gaming environment. But for cloud gaming, it is a very tricky problem. Figure 1A , Figure 1B As shown in the figure, since the operation and rendering of cloud games are separated, the player's mouse operation (the user's operation on the client at the terminal) needs to be transmitted to the remote server through the network, and the server responds to the client, such as through the mouse API (Application Programming Interface). Therefore, when the mouse polling rate is too high, a large number of network data packets will be generated, and these large number of mouse operation network data packets are very likely to cause network congestion or trigger the network device QoS (Quality of Service) restriction mechanism to cause packet loss during network transmission.
[0034] Therefore, it is difficult for cloud games to improve the smoothness of the screen by increasing the mouse refresh rate like local games. However, too low a mouse refresh rate will cause the screen to freeze in MOBA (Multiplayer Online Battle Arena) games due to mouse movement, and in FPS games.
[0035] In summary, the traditional cloud gaming mouse experience has the following problems: If the mouse refresh rate is increased to improve the smoothness of the picture like local games, it will cause network congestion and mouse network data packet loss. If the mouse polling rate is set to a lower value to ensure stable network transmission, the game screen will be stuck due to discontinuous mouse displacement.
[0036] Based on this, the embodiment of the present application provides a mouse signal processing method, which obtains the mouse signal of the client based on a lower target sampling frequency, loads the mouse signal into a cache queue, and uses a cubic spline interpolation algorithm to obtain an interpolation signal sequence for the mouse signal based on the cache queue and a preset number of interpolation points, and responds to the client according to the interpolation signal sequence. It transmits a mouse signal with a lower refresh rate through the network to reduce the frequency of the client sending the mouse signal, thereby reducing the load on the network to prevent the packet loss of the mouse signal, and interpolates the low-frequency mouse signal through the cubic spline interpolation algorithm to obtain an interpolation signal sequence, thereby improving the mouse refresh rate, so that a smoother mouse sliding animation and a smoother game screen can be generated.
[0037] The mouse signal processing method provided in the embodiment of the present application can be applied to Figure 2 In the application environment shown. Among them, the terminal 202 communicates with the server 204 through the network. The data storage system can store the data that the server 204 needs to process. The data storage system can be integrated on the server 204, or it can be placed on the cloud or other network servers. Among them, the terminal 202 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 204 can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud computing services.
[0038] In an exemplary embodiment, Figure 3As shown, a mouse signal processing method is provided, which is applied to Figure 2 Specifically, this embodiment takes the server as a cloud server as an example, and the method may include the following steps:
[0039] Step 302: Obtain the mouse signal of the client based on the target sampling frequency, and load the mouse signal into a cache queue.
[0040] The mouse signal may include the displacement data of the mouse. Specifically, it may be the absolute displacement data of the mouse or the relative displacement data of the mouse. For example, if the displacement data of the mouse obtained by the last sampling is X:200, Y:300, and the displacement data of the mouse obtained by the current sampling is X:350, Y:300, then the displacement data of the mouse obtained by the current sampling is X:350, Y:300 as the absolute displacement data of the mouse, and the displacement of the mouse obtained by the current sampling relative to the displacement of the mouse by X:+150, Y:0 as the relative displacement data of the mouse.
[0041] The cache queue is a FIFO (First Input First Output) data structure used to store and manage mouse signals received from the client. By placing mouse signals received from the client into the cache queue, you can avoid blocking the application when processing tasks, thereby improving the system's concurrent processing capabilities and response speed.
[0042] The target sampling frequency can be a specific frequency that is preset to obtain mouse signals from the client. Since a higher sampling frequency means that the client reports mouse displacement data to the server more times per second, although a smoother and more responsive user experience can be provided at a high sampling frequency, it will also cause network congestion and mouse network data packet loss. Based on this, in this embodiment, a lower target sampling frequency can be set, and the cloud server obtains the client's mouse signal based on the preset lower target sampling frequency, and loads the mouse signal into the cache queue, thereby avoiding network congestion and mouse network data packet loss, and then improving the mouse refresh rate based on subsequent steps, so that a smoother mouse sliding animation and a smoother game screen can be generated.
[0043] Step 304: Based on the cache queue and the preset number of interpolation points, a cubic spline interpolation algorithm is used to obtain an interpolation signal sequence for the mouse signal.
[0044] Among them, the cubic spline interpolation algorithm is a mathematical method for interpolating data points. It can fit a smooth continuous function curve through a given set of scattered data (such as mouse signals in the cache queue). The basic idea is to use a cubic polynomial to approximate the data in a small interval, and use the connection conditions of these polynomials to ensure the smoothness of the entire curve. Specifically, the main steps of the cubic spline interpolation algorithm include: fitting a cubic polynomial in each small interval (which can be the interval corresponding to two adjacent mouse signals in the cache queue); setting boundary conditions to obtain a set of equations; solving the set of equations to find the coefficients of each small interval; given an interpolation point, using the coefficients to find the corresponding function value.
[0045] The preset number of interpolation points can be the number of pre-configured interpolation data points, that is, the length of the interpolation signal sequence. This number can be set based on actual needs, specifically, based on the target refresh rate required by the mouse and the above-mentioned target sampling frequency. For example, if the target refresh rate required by the mouse is M, and the target sampling frequency set by the server is N, then the number of interpolation points K = (MN) / N. For each sampled mouse signal, after processing with the cubic spline interpolation algorithm, an interpolation signal sequence of length K can be obtained, that is, K interpolation signals are obtained.
[0046] Step 306: respond to the client according to the interpolated signal sequence.
[0047] Since the interpolation signal sequence is a plurality of interpolation signals obtained by interpolating the sampled client mouse signals through the cubic spline interpolation algorithm, it is equivalent to increasing the refresh rate of the mouse. Since the length of the interpolation signal sequence is determined based on the target refresh rate required by the mouse, the server can respond to the client using the interpolation signal in the interpolation signal sequence based on the target refresh rate, thereby achieving the target refresh rate required by the mouse. Based on this, the server responds to the client according to the interpolation signal sequence, which can generate a smoother mouse sliding animation and a smoother game screen.
[0048] In the above mouse signal processing method, the mouse signal of the client is obtained based on a lower target sampling frequency, the mouse signal is loaded into a cache queue, and based on the cache queue and the preset number of interpolation points, a cubic spline interpolation algorithm is used to obtain an interpolation signal sequence for the mouse signal, and the client is responded to according to the interpolation signal sequence. It transmits a mouse signal with a lower refresh rate through the network to reduce the frequency of the client sending the mouse signal, thereby reducing the load on the network to prevent the packet loss of the mouse signal, and interpolates the low-frequency mouse signal through the cubic spline interpolation algorithm to obtain an interpolation signal sequence, thereby improving the mouse refresh rate, so that a smoother mouse sliding animation and a smoother game screen can be generated.
[0049] In an exemplary embodiment, in step 302, before obtaining the mouse signal of the client based on the target sampling frequency, the above method may also include: obtaining the maximum delay threshold of the client and the target refresh rate of the mouse; determining the target sampling frequency for the mouse signal based on the target refresh rate and the maximum delay threshold, wherein the target sampling frequency is less than the target refresh rate.
[0050] The target refresh rate of the mouse refers to the refresh rate required by the mouse, which can be determined based on the physical refresh rate of the mouse. For example, if the physical refresh rate of the client mouse is up to 1000Hz, since the mouse refresh rate is dynamic, when the user slides the mouse during the game, the dynamic refresh rate of the mouse can be stabilized at around 900Hz. Therefore, the target refresh rate of the mouse can be determined to be between 900Hz and 1000Hz.
[0051] The maximum delay threshold may refer to the duration threshold of the maximum delay duration that the client can accept. It can be set based on the needs of the actual scene. For example, for scenes with high real-time requirements, the maximum delay threshold can be set to a smaller value, and for scenes with low real-time requirements, the maximum delay threshold can be set to a slightly larger value. Since the present embodiment transmits a mouse signal with a lower refresh rate through the network, and then interpolates the low-frequency mouse signal through the cubic spline interpolation algorithm to obtain an interpolation signal sequence, thereby improving the mouse refresh rate, and responding to the client through the interpolation signal sequence will have a corresponding delay. Based on this, the server can obtain the maximum delay threshold of the client and the target refresh rate of the mouse, and then determine the target sampling frequency of the mouse signal according to the target refresh rate and the maximum delay threshold. Thereby, while reducing the network load and increasing the mouse refresh rate, the smoothness of the client screen can be ensured, thereby improving the user experience.
[0052] In one scenario, if the maximum delay threshold of the client obtained by the server is 5ms (milliseconds), and the target refresh rate of the mouse obtained is 1000Hz (i.e., refreshed 1000 times per second, i.e., refreshed once per millisecond), then based on the maximum delay threshold of the client of 5ms, it can be known that it can be refreshed at most 5 times within the maximum delay threshold, and the target sampling frequency of the mouse signal is at least 1000 / 5, i.e., 200Hz. This embodiment reduces the target sampling frequency of collecting mouse signals based on the maximum delay threshold of the client and the target refresh rate of the mouse. Compared with the traditional cloud gaming solution that uses the native mouse high refresh rate direct transmission method, the method of this embodiment can effectively prevent network congestion and network packet loss caused by too many data packets. In addition, since the target sampling frequency of the mouse signal in this embodiment is determined based on the maximum delay threshold of the client and the target refresh rate of the mouse, the delay caused by the subsequent simulation of the target refresh rate based on cubic spline interpolation is also acceptable to the client. Usually, when the maximum delay threshold is small, it is generally difficult for users to perceive, thereby providing a better user experience.
[0053] In an exemplary embodiment, in step 302, loading the mouse signal into the cache queue may specifically include: obtaining the remaining capacity of the cache queue; when it is determined that the remaining capacity is greater than or equal to a set capacity threshold, loading the mouse signal into the cache queue and recording the loading timestamp.
[0054] The remaining capacity of the cache queue refers to the remaining storage space of the cache queue. The capacity threshold may be a pre-set size of the storage space required to store a mouse signal. The loading timestamp refers to the specific time point when the mouse signal is loaded into the cache queue.
[0055] Since the cache queue is used to store and manage the mouse signal obtained from the client and use it as the basis for cubic spline interpolation, when the server obtains the mouse signal from the client, it first determines whether the remaining capacity of the cache queue is sufficient to store the current mouse signal. Specifically, when the server determines that the remaining capacity of the cache queue is greater than or equal to the set capacity threshold, it means that the remaining capacity of the cache queue is sufficient to store the current mouse signal. Therefore, the mouse signal is directly loaded into the cache queue and the loading timestamp is recorded. This allows the cache queue including the current mouse signal to be used for cubic spline interpolation in the future to obtain an interpolation signal sequence for the current mouse signal.
[0056] In one scenario, when the server determines that the remaining capacity of the cache queue is less than the set capacity threshold, it means that the remaining capacity of the cache queue may not be enough to store the current mouse signal. Therefore, the server can further determine the historical mouse signal with the earliest loading timestamp in the cache queue (i.e., determine the mouse signal that was first added to the cache queue), and delete the historical mouse signal from the cache queue, and then load the current mouse signal into the cache queue, while recording the loading timestamp. This allows the cache queue including the current mouse signal to be used for cubic spline interpolation in the future to obtain an interpolation signal sequence for the current mouse signal.
[0057] In an exemplary embodiment, Figure 4 The figure shows the implementation logic of the mouse signal processing method of the present application. Specifically, the client (such as a game client) in the terminal communicates with the server (specifically, it can be a cloud server) through the network. The client samples the mouse signal at a preset lower target sampling frequency and transmits it to the server through the network. Since the mouse signal transmitted is a lower sampling frequency, the load on the network can be reduced, avoiding network congestion and loss of transmitted data packets.
[0058] The server obtains the mouse signal sampled by the client based on the target sampling frequency, loads the mouse signal into the cache queue, and performs cubic spline interpolation processing based on all the mouse signals in the cache queue, thereby interpolating the latest low-frequency mouse signal into a high-frequency mouse signal, and then responds to the client one by one according to the interpolated frequency (such as responding through the mouse API). In this way, the mouse signal with a lower refresh rate is transmitted through the network, and on the server side, these unsmooth mouse signals with a lower refresh rate are converted into a smooth signal curve with a higher sampling rate through a suitable interpolation algorithm, so that a smoother mouse sliding animation and a smoother game screen can be generated.
[0059] Specifically, in the above embodiment, the target refresh rate of the mouse is 1000 Hz, and the target sampling frequency of the mouse signal is 200 Hz (that is, the mouse signal is sampled once every 5 ms). According to the above calculation method of the number of interpolation points, the number of interpolation points is (1000 Hz-200 Hz) / 200 Hz=4, which means that 4 interpolation signals need to be generated for one sampled mouse signal.
[0060] If the displacement data of the mouse obtained by the last sampling is X: 200, Y: 300, the displacement data of the mouse obtained by the current sampling is X: 350, Y: 300. If the mouse signal sampled this time is the absolute displacement data of the mouse, specifically X: 350, Y: 300, if the interpolation signal sequence of the mouse signal (absolute displacement data) sampled this time (that is, the absolute displacement data once every 5ms is divided into absolute displacement data once every 1ms) is obtained after processing by the above cubic spline interpolation algorithm: (X: 210, Y: 300), (X: 230, Y: 300), (X: 260, Y: 300), (X: 300, Y: 300), (X: 350, Y: 300), then the client can be responded to every 1ms based on the interpolation signal sequence, thereby improving the mouse refresh rate.
[0061] If the mouse signal sampled this time is the relative displacement data of the mouse, specifically X: 150, Y: 0, if it is processed by the above-mentioned cubic spline interpolation algorithm, the interpolation signal sequence of the mouse signal (relative displacement data) sampled this time (that is, the relative displacement data once every 5ms is divided into relative displacement data once every 1ms) is: (X: +10, Y: 0), (X: +20, Y: 0), (X: +30, Y: 0), (X: +40, Y: 0), (X: +50, Y: 0), then the client can be responded to every 1ms based on the interpolation signal sequence, thereby improving the mouse refresh rate.
[0062] Although the above interpolation processing causes a delay of about 4ms, the 4ms delay is imperceptible for cloud games, but it can generate smoother mouse sliding animations and smoother game pictures.
[0063] Compared with the traditional technology, the beneficial effects of this technical solution are as follows:
[0064] 1. Reduce network load: The method proposed in the present invention can effectively reduce the transmission volume of network data packets by reducing the mouse displacement frequency sent by the cloud game client, thereby reducing the load on the network. This can not only prevent network congestion and network packet loss caused by too many data packets, but also save network bandwidth and improve the utilization efficiency of network resources.
[0065] 2. Improve the smoothness of the picture: The present invention interpolates the low-frequency mouse signal into a high-frequency mouse signal through the cubic spline interpolation algorithm, and can generate a high-refresh rate mouse signal curve on the server side. This can make the game picture smoother and improve the user experience. Compared with traditional technologies, the present invention can find a better balance between network bandwidth and picture smoothness, thereby improving the overall experience of cloud games.
[0066] 3. Strong versatility: The technical solution of the present invention mainly involves technical fields such as computer graphics, cloud computing, and human-computer interaction, so it has strong versatility. In addition to cloud games, the method of the present invention can also be applied to other application scenarios that require high-precision mouse control, such as virtual reality, augmented reality, etc. In general, the method of the present invention has significant advantages in improving the cloud game mouse experience, can effectively solve the problems faced by traditional technologies, and improve the user experience of cloud games.
[0067] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0068] Based on the same inventive concept, the embodiment of the present application also provides a mouse signal processing device for implementing the mouse signal processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more mouse signal processing device embodiments provided below can refer to the limitations of the mouse signal processing method above, and will not be repeated here.
[0069] In an exemplary embodiment, Figure 5 As shown, a mouse signal processing device is provided, which is applied to a cloud server and includes: a signal acquisition module 502, an interpolation processing module 504 and a signal response module 506, wherein:
[0070] A signal acquisition module 502 is used to acquire a mouse signal of the client based on a target sampling frequency, and load the mouse signal into a cache queue, wherein the mouse signal includes displacement data of the mouse;
[0071] An interpolation processing module 504 is used to obtain an interpolation signal sequence for the mouse signal using a cubic spline interpolation algorithm based on the cache queue and a preset number of interpolation points;
[0072] The signal response module 506 responds to the client according to the interpolated signal sequence.
[0073] In an exemplary embodiment, the device also includes a refresh rate determination module, which is used to: obtain the maximum delay threshold of the client and the target refresh rate of the mouse; determine the target sampling frequency of the mouse signal based on the target refresh rate and the maximum delay threshold, and the target sampling frequency is less than the target refresh rate.
[0074] In an exemplary embodiment, the refresh rate determination module is further used to: determine the corresponding number of interpolation points according to the target refresh rate and the target sampling frequency.
[0075] In an exemplary embodiment, the interpolation signal sequence includes interpolation signals corresponding to the number of interpolation points; the signal response module is further used to: based on the target refresh rate, use the interpolation signal in the interpolation signal sequence to respond to the client.
[0076] In an exemplary embodiment, the signal acquisition module is also used to: obtain the remaining capacity of the cache queue; when it is determined that the remaining capacity is greater than or equal to a set capacity threshold, load the mouse signal into the cache queue and record the loading timestamp.
[0077] In an exemplary embodiment, the signal acquisition module is also used to: when it is determined that the remaining capacity is less than a set capacity threshold, determine the historical mouse signal with the earliest loading timestamp in the cache queue, delete the historical mouse signal from the cache queue, and load the mouse signal into the cache queue.
[0078] Each module in the above mouse signal processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0079] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store mouse signal data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a mouse signal processing method is implemented.
[0080] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0081] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0082] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0083] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0084] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0085] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0086] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0087] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A mouse signal processing method, characterized in that: The method is applied to a cloud server, and the method comprises: Acquire a mouse signal of the client based on a target sampling frequency, and load the mouse signal into a cache queue, wherein the mouse signal includes displacement data of the mouse; Based on the cache queue and the preset number of interpolation points, a cubic spline interpolation algorithm is used to obtain an interpolation signal sequence for the mouse signal; The client is responded to according to the interpolated signal sequence.
2. The method according to claim 1, characterized in that Before acquiring the mouse signal of the client based on the target sampling frequency, the method further includes: Obtain the maximum delay threshold of the client and the target refresh rate of the mouse; A target sampling frequency for the mouse signal is determined according to the target refresh rate and the maximum delay threshold, wherein the target sampling frequency is less than the target refresh rate.
3. The method according to claim 2, characterized in that The method further comprises: The corresponding number of interpolation points is determined according to the target refresh rate and the target sampling frequency.
4. The method according to claim 2, characterized in that: The interpolation signal sequence includes interpolation signals corresponding to the number of interpolation points; and responding to the client according to the interpolation signal sequence includes: Based on the target refresh rate, an interpolation signal in the interpolation signal sequence is used to respond to the client.
5. The method according to any one of claims 1 to 4, characterized in that: The step of loading the mouse signal into a cache queue comprises: Obtaining the remaining capacity of the cache queue; When it is determined that the remaining capacity is greater than or equal to the set capacity threshold, the mouse signal is loaded into the cache queue and a loading timestamp is recorded.
6. The method according to claim 5, characterized in that The method further comprises: When it is determined that the remaining capacity is less than a set capacity threshold, the historical mouse signal with the earliest loading timestamp in the cache queue is determined, the historical mouse signal is deleted from the cache queue, and the mouse signal is loaded into the cache queue.
7. A mouse signal processing device, characterized in that: The device is applied to a cloud server, and the device includes: A signal acquisition module, used for acquiring a mouse signal of a client based on a target sampling frequency, and loading the mouse signal into a cache queue, wherein the mouse signal includes displacement data of the mouse; An interpolation processing module, used for acquiring an interpolation signal sequence for the mouse signal by using a cubic spline interpolation algorithm based on the cache queue and a preset number of interpolation points; A signal response module responds to the client according to the interpolation signal sequence.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.