A data processing method, device and medium based on mouse and keyboard
Obtaining and modifying the keyboard and mouse status data on the cloud host through the API interface solves the problem of data interference when shared by multiple users in cloud games and improves the user experience.
Patent Information
- Application Number
- CN202110024874.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-08
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-01-08
AI Technical Summary
In cloud games, when multiple users share cloud hosts, the integration of keyboard and mouse status data leads to data interference and reduces the user experience.
Obtain multiple keyboard and mouse status data through the API interface, and modify and store it according to the target identity data to ensure that each user obtains matching keyboard and mouse status data and avoid data interference.
It improves the user experience, ensures normal game response, and avoids the problem of mutual interference of keyboard and mouse status data.
Smart Images

Figure CN112791387B
Abstract
Description
Technical Field
[0001] The present application relates to the field of game service technology, and in particular to a data processing method, device and medium based on a mouse and keyboard. Background Art
[0002] With the development of network technology and cloud computing technology, a new type of gaming has emerged: cloud gaming. In cloud gaming, all game programs are run on the cloud host provided by the cloud gaming service provider. The cloud host is responsible for rendering the game screen using its high-performance central processing unit (CPU) and graphics processing unit (GPU). The video streaming program will compress the screen displayed by the cloud host and then transmit it to the user through the network. Therefore, users only need to have a device with basic video decompression capabilities to smoothly experience various games that require high-performance hardware. In order to enhance the competitiveness of their own cloud gaming services, game service providers usually purchase high-performance computers as cloud hosts. However, for players who do not need too high computer performance, when using cloud hosts to provide services to these users separately, the performance of the cloud hosts is redundant.
[0003] At present, in order to reduce the problem of performance redundancy, a method of running multiple users' games on a single cloud host is adopted, so that multiple users share hardware resources to give full play to the full performance of the cloud host. However, in the process of multiple users using the cloud host, the cloud host integrates the keyboard and mouse status data of all users into one input data, and forms a set of virtual keyboard and mouse devices based on the virtual human interface device framework (HID) for the input data. Therefore, when the game calls the keyboard and mouse status data of a certain user, the called data is the integrated input data. Therefore, the keyboard and mouse status data of multiple users interfere with each other, resulting in the game calling abnormal keyboard and mouse status data through the cloud host, resulting in the game not responding or abnormal game response, which reduces the user's experience.
[0004] It can be seen that how to improve the user experience is an urgent problem to be solved by those skilled in the art. Summary of the invention
[0005] The purpose of the present application is to provide a data processing method based on a mouse and a keyboard, so as to improve the user experience. The purpose of the present application is also to provide a data processing device and a medium based on a mouse and a keyboard.
[0006] In order to solve the above technical problems, the present application provides a data processing method based on a mouse and a keyboard, comprising:
[0007] Acquire first data representing the states of multiple keyboards and mice through an API interface;
[0008] Get input data representing the target keyboard and mouse status;
[0009] The first data is modified according to the input data to obtain second data.
[0010] Preferably, the first data representing the states of multiple keyboards and mice is obtained through the API interface specifically:
[0011] The first data is obtained through the API interface of the driver layer.
[0012] Preferably, the API interface specifically includes: NtUserGetKeyState, NtUserGetAsyncKeyState, NtUserGetKeyboardState, GetKeyState, GetModifierBits, LogicalCursorPosFromDpiAwarenessContext, NtUserClipCursor, NtUserSetCursorPos and NtUserShowCursor.
[0013] Preferably, it also includes:
[0014] Obtain target identity data corresponding to the input data; wherein the target identity data is identity data corresponding to the current process.
[0015] According to the correspondence between each identity data and each storage area, the input data is stored in a target storage area corresponding to the target identity data.
[0016] Preferably, the step of obtaining the input data representing the target keyboard and mouse status is as follows:
[0017] The input data is acquired in the target storage area.
[0018] Preferably, it also includes:
[0019] Acquire a global variable representing the update of the storage area;
[0020] When new input data is received, the flag bit in the global variable is updated.
[0021] Preferably, there are two target storage areas.
[0022] Preferably, before storing the input data in the target storage area corresponding to the target identity data according to the correspondence between each identity data and each storage area, the method further comprises:
[0023] The input data is divided into keyboard data and mouse data.
[0024] Preferably, storing the input data in a target storage area corresponding to the target identity data specifically comprises:
[0025] The keyboard data and the mouse data are stored in the two target storage areas respectively.
[0026] Preferably, it also includes:
[0027] When a query signal for querying the input data is received, the second data is sent by calling the API interface.
[0028] In order to solve the above technical problems, the present application also provides a data processing device based on a mouse and a keyboard, comprising:
[0029] A first acquisition module, used for acquiring first data representing the states of multiple keyboards and mice through an API interface;
[0030] A second acquisition module is used to acquire input data representing the target keyboard and mouse status;
[0031] A modification module is used to modify the first data according to the input data to obtain second data.
[0032] In order to solve the above technical problems, the present application also provides a data processing device based on a mouse and a keyboard, comprising:
[0033] Memory for storing computer programs;
[0034] The processor is used to implement the steps of the data processing method based on mouse and keyboard as described above when executing the computer program.
[0035] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method based on the mouse and keyboard as described above are implemented.
[0036] The data processing method based on mouse and keyboard provided in the present application obtains first data representing multiple keyboard and mouse states through an API interface, obtains input data representing the target keyboard and mouse state, and modifies the first data according to the input data to obtain second data. Since the first data is modified by the input data representing the target keyboard and mouse state, when the game calls the keyboard and mouse state data of a certain user, the cloud host provides the second data matching the keyboard and mouse state data of the user, avoiding the problem of mutual interference of keyboard and mouse state data of multiple users and improving the user experience.
[0037] In addition, the present application provides a data processing device and medium based on a mouse and a keyboard, which correspond to the above-mentioned data processing method based on a mouse and a keyboard, and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] Figure 1 A flowchart of a first data processing method based on a mouse and keyboard provided in an embodiment of the present application;
[0040] Figure 2 A flowchart of a second data processing method based on a mouse and keyboard provided in an embodiment of the present application;
[0041] Figure 3 A flowchart of a user updating keyboard data and mouse data provided in an embodiment of the present application;
[0042] Figure 4 A flowchart of a third data processing method based on a mouse and keyboard provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of a data processing device based on a mouse and a keyboard provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of the structure of another data processing device based on a mouse and a keyboard provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] The core of the present application is to provide a data processing method based on a mouse and a keyboard, so as to improve the user's experience. The core of the present application is also to provide a data processing device and a medium based on a mouse and a keyboard.
[0047] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0048] Figure 1 The flowchart of the first data processing method based on mouse and keyboard provided in the embodiment of the present application is as follows. Figure 1 As shown, the method includes:
[0049] S10: Acquire first data representing multiple keyboard and mouse states through an API interface.
[0050] In the embodiment of the present application, after the terminal captures the data representing the keyboard and mouse states of multiple users, the data representing the keyboard and mouse states are integrated into the first data and sent to the cloud host. When the application stored in the cloud host requires the user's input data, the cloud host obtains the first data through the application program interface (Application Program Interface, API). In a specific implementation, the first data may include data representing the multiple keyboard and mouse states, or may not include data representing the multiple keyboard and mouse states.
[0051] It should be noted that before obtaining the first data through the API interface, the API interface needs to be hooked so that the application installed on the cloud host can filter all messages and events and access messages that are inaccessible under normal circumstances.
[0052] S11: Obtain input data representing the target keyboard and mouse status.
[0053] It is understandable that in a specific implementation, the terminal may recapture the input data representing the target keyboard and mouse status, or the terminal may capture the data representing the keyboard and mouse status of multiple users and store them in different storage areas of the cloud host according to different users.
[0054] In addition, the input data may include data representing the input status of the user's keyboard and mouse, and the input data may also include data representing other types of input status, such as data representing the input status of a game controller, etc.
[0055] S12: Modify the first data according to the input data to obtain second data.
[0056] When an application installed on the cloud host queries the target keyboard and mouse status through the application layer API interface, the first data is obtained through the API interface processed by HOOK. At the same time, the HOOK function obtains the corresponding input data according to the identity document (ID) of the current process, modifies the first data according to the input data to obtain the second data, and sends the second data to the application, so that the application can obtain the second data that matches the keyboard and mouse status of the target user.
[0057] The data processing method based on mouse and keyboard provided in the embodiment of the present application obtains first data representing multiple keyboard and mouse states through an API interface, obtains input data representing the target keyboard and mouse state, and modifies the first data according to the input data to obtain second data. Since the first data is modified by the input data representing the target keyboard and mouse state, when the game calls the keyboard and mouse state data of a certain user, the cloud host provides the second data matching the keyboard and mouse state data of the user, avoiding the problem of mutual interference of keyboard and mouse state data of multiple users and improving the user experience.
[0058] On the basis of the above embodiment, S10 specifically includes: acquiring the first data through the API interface of the driver layer.
[0059] It is understandable that there are many different types of API interfaces in the cloud host. Taking the API interface of the application layer as an example, if the first data is obtained through the API interface of the application layer, the mouse and keyboard-based processing method provided in this application can only be effective for a certain process. However, in a specific implementation, it may be necessary to provide mouse and keyboard-based processing methods for multiple processes at the same time. If the first data is obtained using an API interface of the non-driver layer, the problem of avoiding mutual interference between the keyboard and mouse status data of multiple users can be avoided only for a certain process, but this problem cannot be avoided for other processes.
[0060] As a preferred embodiment, the API specifically includes: NtUserGetKeyState, NtUserGetAsyncKeyState, NtUserGetKeyboardState, GetKeyState, GetModifierBits, LogicalCursorPosFromDpiAwarenessContext, NtUserClipCursor, NtUserSetCursorPos and NtUserShowCursor.
[0061] It can be understood that compared with the existing method in which the application cannot obtain the user's input data in different uppercase and lowercase letters, the solution provided in the embodiment of the present application, through the three interfaces NtUserGetKeyState, NtUserGetAsyncKeyState and GetModifierBits, enables the application to accurately obtain the user's input data in different uppercase and lowercase letters, thereby ensuring that the cloud host service supports the user's uppercase and lowercase input.
[0062] In addition, compared with the existing method in which the application cannot obtain the input data of the mouse position, the solution provided in the embodiment of the present application, through the three interfaces of LogicalCursorPosFromDpiAwarenessContext, NtUserClipCursor, and NtUserSetCursorPos, enables the application to accurately obtain the input data of the user's mouse position, thereby avoiding the problem of the application not rendering the game and inaccurate game clicks due to continuous detection of mouse coordinates, thereby further improving the user experience.
[0063] The mouse and keyboard-based data processing method provided in the embodiment of the present application obtains the first data through the API interface of the driver layer, which can ensure that the mouse and keyboard-based processing method is provided for all processes, so that all processes can avoid the problem of mutual interference between the keyboard and mouse status data of multiple users, thereby further improving the user experience.
[0064] Figure 2 The flowchart of the second data processing method based on mouse and keyboard provided in the embodiment of the present application is as follows. Figure 2 As shown, the method also includes:
[0065] S20: Acquire target identity data corresponding to the input data.
[0066] The target identity data is the identity data corresponding to the current process.
[0067] It is understandable that the target account data may be an identity document (ID) that represents the user's identity information, such as the account and password for logging into a game. The target account data may also be the user's fingerprint information, facial recognition information, etc.
[0068] S21: According to the correspondence between each identity data and each storage area, the input data is stored in a target storage area corresponding to the target identity data.
[0069] The target storage area is specifically a piece of memory applied for in advance by the cloud host at the driver layer. It can be understood that one identity data corresponds to one piece of memory, that is, one user's input data is stored in one piece of memory.
[0070] Furthermore, in order to facilitate the management of input data and improve the speed of calling input data, as a preferred embodiment, there are two target storage areas. Before S21, it also includes: dividing the input data into keyboard data and mouse data. S21 specifically includes: storing the keyboard data and the mouse data in two target storage areas respectively.
[0071] It can be understood that the two target storage areas are specifically two memory blocks applied for in advance by the cloud host at the driver layer, and one identity data corresponds to two memory blocks, that is, the keyboard data and mouse data of a user are stored in the two memory blocks respectively.
[0072] It should be noted that when the input data is divided into three types of data, such as keyboard data, mouse data and game controller data, one identity data can correspond to three blocks of memory, that is, a user's keyboard data, mouse data and game controller data are respectively stored in three blocks of memory, so as to facilitate the management of input data and improve the speed of calling input data.
[0073] Furthermore, S11 specifically obtains input data in the target storage area.
[0074] It can be understood that when the application installed on the cloud host queries the target keyboard and mouse status through the application layer API interface, the first data is obtained through the API interface processed by HOOK. At the same time, the HOOK function obtains the identity document (ID) of the current process, and can obtain input data through the ID information of the current process in the storage area corresponding to the ID information.
[0075] The data processing method based on mouse and keyboard provided in the embodiment of the present application obtains the target identity data corresponding to the input data, and then stores the input data in the storage area corresponding to the target identity data according to the correspondence between each identity data and each storage area. Since the input data is stored in the storage area corresponding to the target account data, it can be quickly obtained from the storage area when the application obtains the keyboard and mouse status of the user, thereby improving the speed of data processing based on mouse and keyboard, and further improving the user's use experience.
[0076] Figure 3 The flowchart of the third data processing method based on mouse and keyboard provided in the embodiment of the present application is as follows. Figure 3 As shown, based on the above embodiment, it also includes:
[0077] S30: Acquire a global variable representing the update storage area.
[0078] In the embodiment of the present application, the global variable is specifically a global variable obtained according to the win32kbase.sys program.
[0079] S31: Determine whether new input data is received, if yes, proceed to S22, if no, end.
[0080] S32: Update the flag bit in the global variable.
[0081] It should be noted that updating the flag bit in the global variable may be to perform addition processing on the flag bit in the global variable each time it is updated, for example, adding 1. It is understandable that the above-mentioned updating of the flag bit in the global variable is only one form of expression, and does not represent the only form of expression. In specific implementation, it is only necessary to ensure that the global variable is different after each update of the input data.
[0082] It should also be noted that there is no specific order for updating the input data in the storage area and updating the flag in the global variable. The input data in the storage area can be updated first, and then the flag in the global variable can be updated. The input data in the storage area and the flag in the global variable can also be updated at the same time. The flag in the global variable can also be updated first, and then the input data in the storage area can be updated. It is understandable that in order to ensure that after the flag in the global variable is updated, the program running in the cloud host can obtain the updated input data, in the specific implementation, the steps of updating the input data in the storage area first and then updating the flag in the global variable are adopted.
[0083] Figure 4 A flowchart of a user updating keyboard data and mouse data provided in an embodiment of the present application. Figure 4 As shown, the method for users to update keyboard data and mouse data is as follows:
[0084] S40: The terminal captures new keyboard and mouse raw data through the RawInput model that captures keyboard and mouse input data.
[0085] S41: The terminal transmits the input data to the cloud host through the network.
[0086] S42: The cloud host parses the received input data, and divides the original keyboard and mouse data in the input data into keyboard data and mouse data.
[0087] S43: The cloud host updates the keyboard data and the mouse data to two memories corresponding to the user account data through the communication interface IOCTRL, and associates the two memories with the ID information.
[0088] S44: Update the flag in the global variable. The data processing method based on the mouse and keyboard provided in the embodiment of the present application updates the flag in the global variable each time the new input data of the user is obtained. Therefore, after the user input data is updated, the program running in the cloud host is prevented from not obtaining new data from the driver layer, but only using the unupdated user input data, thereby ensuring that the application running in the cloud host must obtain the updated input data, further improving the user experience.
[0089] Based on the above embodiment, it also includes:
[0090] When a query signal for querying input data is received, the second data is sent by calling an API interface.
[0091] It should be noted that the query signal is specifically sent by an application (e.g., a game) installed on the cloud host. Sending the second data by calling the API interface specifically means that when the application installed on the cloud host queries the target keyboard and mouse status through the application layer API interface, the first data is obtained through the HOOKed API interface, and the HOOK function obtains the corresponding input data according to the identity document (ID) of the current process, modifies the first data according to the input data to obtain the second data, and sends the second data to the application.
[0092] The mouse and keyboard-based data processing method provided in the embodiment of the present application sends the second data by calling the API interface, wherein the second data is specifically obtained by modifying the first data according to the input data. Therefore, the application will only obtain the second data that matches the keyboard and mouse status data of the target user, thereby avoiding the problem of mutual interference of input data of multiple users and improving the user experience.
[0093] In the above embodiments, the data processing method based on the mouse and keyboard is described in detail, and the present application also provides embodiments corresponding to the data processing device based on the mouse and keyboard. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the perspective of the functional module, and the other is based on the perspective of the hardware.
[0094] Figure 5 The following is a schematic diagram of a data processing device based on a mouse and a keyboard provided in an embodiment of the present application. Figure 5 As shown, based on the perspective of functional modules, the device includes:
[0095] The first acquisition module 10 is used to acquire first data representing the states of multiple keyboards and mice through an API interface.
[0096] The second acquisition module 11 is used to acquire input data representing the target keyboard and mouse status.
[0097] The modification module 12 is used to modify the first data according to the input data to obtain the second data.
[0098] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0099] As a preferred embodiment, it also includes:
[0100] The third acquisition module is used to acquire the first data through the API interface of the driver layer.
[0101] Also includes:
[0102] The fourth acquisition module is used to acquire target identity data corresponding to the input data; wherein the target identity data is identity data corresponding to the current process.
[0103] The first storage module is used to store the input data in a target storage area corresponding to the target identity data according to the corresponding relationship between each identity data and each storage area.
[0104] The fifth acquisition module is used to acquire input data in the target storage area.
[0105] Also includes:
[0106] The sixth acquisition module is used to acquire a global variable representing the update storage area.
[0107] The update module is used to update the flag bit in the global variable when new input data is received.
[0108] Also includes:
[0109] The division module is used to divide the input data into keyboard data and mouse data.
[0110] The second storage module is used to store the keyboard data and the mouse data in two target storage areas respectively.
[0111] Also includes:
[0112] The seventh acquisition module is used to send the second data by calling the API interface when receiving the query signal for querying the input data.
[0113] The mouse and keyboard-based data processing device provided in the embodiment of the present application obtains first data representing multiple keyboard and mouse states through an API interface, obtains input data representing the target keyboard and mouse state, and modifies the first data according to the input data to obtain second data. Since the first data is modified by the input data representing the target keyboard and mouse state, when the game calls the keyboard and mouse state data of a certain user, the cloud host provides the second data matching the keyboard and mouse state data of the user, thereby avoiding the problem of mutual interference between the keyboard and mouse state data of multiple users and improving the user experience.
[0114] Figure 6 This is a schematic diagram of the structure of another data processing device based on a mouse and a keyboard provided in an embodiment of the present application. Figure 6 As shown, from the perspective of hardware structure, the device includes:
[0115] A memory 20, used for storing computer programs;
[0116] The processor 21 is used to implement the steps of the data processing method based on the mouse and keyboard in the above embodiment when executing the computer program.
[0117] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0118] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, the relevant steps of the data processing method based on the mouse and keyboard disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, data involved in the data processing method based on the mouse and keyboard, etc.
[0119] In some embodiments, the data processing device based on the mouse and keyboard may also include a display screen 22 , an input and output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0120] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the data processing device based on a mouse and a keyboard, and may include more or less components than those shown in the figure.
[0121] The mouse and keyboard-based data processing device provided in the embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: obtain first data representing multiple keyboard and mouse states through an API interface, and obtain input data representing the target keyboard and mouse state, and modify the first data according to the input data to obtain second data. Since the first data is modified by the input data representing the target keyboard and mouse state, when the game calls the keyboard and mouse state data of a certain user, the cloud host provides the second data matching the keyboard and mouse state data of the user, avoiding the problem of mutual interference of keyboard and mouse state data of multiple users and improving the user experience.
[0122] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0123] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0124] The computer-readable storage medium provided in the embodiment of the present application stores a computer program on the medium. When the computer program is executed by the processor, the following method can be implemented: first data representing multiple keyboard and mouse states are obtained through an API interface, and input data representing the target keyboard and mouse state are obtained, and the first data is modified according to the input data to obtain second data. Since the first data is modified by the input data representing the target keyboard and mouse state, when the game calls the keyboard and mouse state data of a certain user, the cloud host provides the second data matching the keyboard and mouse state data of the user, avoiding the problem of mutual interference of keyboard and mouse state data of multiple users, and improving the user's use experience.
[0125] The above is a detailed introduction to a data processing method, device and medium based on a mouse and keyboard provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0126] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A data processing method based on mouse and keyboard, characterized in that: include: Acquire first data representing the states of multiple keyboards and mice through an API interface; Get input data representing the target keyboard and mouse status; Modify the first data according to the input data to obtain second data; Wherein, the data processing method based on mouse and keyboard further includes: Acquire target identity data corresponding to the input data; wherein the target identity data is identity data corresponding to the current process; According to the correspondence between each identity data and each storage area, the input data is stored in a target storage area corresponding to the target identity data; the target storage area is a memory corresponding to the driver layer of the cloud host; The method of obtaining input data representing the target keyboard and mouse status is as follows: Acquire the input data in the target storage area; Wherein, the API interface specifically includes: NtUserGetKeyState, NtUserGetAsyncKeyState, NtUserGetKeyboardState, GetKeyState, GetModifierBits, LogicalCursorPosFromDpiAwarenessContext, NtUserClipCursor, NtUserSetCursorPos and NtUserShowCursor; Wherein, the data processing method based on mouse and keyboard further includes: When a query signal for querying the input data is received, the second data is sent by calling the API interface.
2. The data processing method based on mouse and keyboard according to claim 1, characterized in that: The first data representing the states of multiple keyboards and mice obtained through the API interface is specifically: The first data is obtained through the API interface of the driver layer.
3. The data processing method based on mouse and keyboard according to claim 1, characterized in that: Also includes: Acquire a global variable representing the update of the storage area; When new input data is received, the flag bit in the global variable is updated.
4. The data processing method based on mouse and keyboard according to claim 1, characterized in that: There are specifically two target storage areas; Before storing the input data in the target storage area corresponding to the target identity data according to the correspondence between each identity data and each storage area, the method further includes: Dividing the input data into keyboard data and mouse data; Storing the input data in the target storage area corresponding to the target identity data is specifically: The keyboard data and the mouse data are stored in the two target storage areas respectively.
5. A data processing device based on a mouse and a keyboard, characterized in that: include: A first acquisition module, used for acquiring first data representing the states of multiple keyboards and mice through an API interface; A second acquisition module is used to acquire input data representing the target keyboard and mouse status; A modification module, used for modifying the first data according to the input data to obtain second data; Wherein, the data processing device based on mouse and keyboard further includes: A fourth acquisition module is used to acquire target identity data corresponding to the input data; wherein the target identity data is identity data corresponding to the current process; A first storage module is used to store the input data in a target storage area corresponding to the target identity data according to the correspondence between each identity data and each storage area; the target storage area is a memory corresponding to the driver layer of the cloud host; A fifth acquisition module, used for acquiring input data in a target storage area; Wherein, the API interface specifically includes: NtUserGetKeyState, NtUserGetAsyncKeyState, NtUserGetKeyboardState, GetKeyState, GetModifierBits, LogicalCursorPosFromDpiAwarenessContext, NtUserClipCursor, NtUserSetCursorPos and NtUserShowCursor; Wherein, the data processing device based on mouse and keyboard further includes: A sixth acquisition module, used to acquire a global variable representing an update storage area; The update module is used to update the flag bit in the global variable when new input data is received.
6. A data processing device based on a mouse and a keyboard, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data processing method based on mouse and keyboard as claimed in any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data processing method based on a mouse and a keyboard as claimed in any one of claims 1 to 4 are implemented.
