WO2022111722A1 - 键盘操作数据传输方法及装置、键盘操作执行方法及装置 - Google Patents

键盘操作数据传输方法及装置、键盘操作执行方法及装置 Download PDF

Info

Publication number
WO2022111722A1
WO2022111722A1 PCT/CN2021/134265 CN2021134265W WO2022111722A1 WO 2022111722 A1 WO2022111722 A1 WO 2022111722A1 CN 2021134265 W CN2021134265 W CN 2021134265W WO 2022111722 A1 WO2022111722 A1 WO 2022111722A1
Authority
WO
WIPO (PCT)
Prior art keywords
keyboard
data
key code
preset data
queue
Prior art date
Application number
PCT/CN2021/134265
Other languages
English (en)
French (fr)
Inventor
万安庆
Original Assignee
上海达龙信息科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海达龙信息科技有限公司 filed Critical 上海达龙信息科技有限公司
Publication of WO2022111722A1 publication Critical patent/WO2022111722A1/zh

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/22Setup operations, e.g. calibration, key configuration or button assignment
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • A63F13/63Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor by the player, e.g. authoring using a level editor

Definitions

  • the present invention relates to the technical field of cloud games, and in particular, to a keyboard operation data transmission method and device, and a keyboard operation execution method and device.
  • Cloud games are games based on cloud computing. In the operation mode of cloud games, all games are run on the server side, and the whole game meets the players through the network, which means that there is not much requirement for the player's game equipment, as long as there are enough smart phones and tablets Decoding rendering ability and a certain network speed can play the game masterpiece.
  • the continuous development of 5G is the most critical breakthrough point for the entire cloud game market, but only enough network speed is not enough to make cloud games run smoothly enough. Packet loss (referring to one or more data packets) caused by network instability. The data cannot reach the destination through the network), which will inevitably cause the operation of the client to be unable to be executed in real time and completely on the remote cloud desktop.
  • the purpose of the present invention is to provide a keyboard operation data transmission method and device, and a keyboard operation execution method and device to solve the above deficiencies in the prior art.
  • the present invention provides a method for transmitting keyboard operation data, which is applied to a client; the method includes: connecting to a remote server, and periodically polling to obtain keyboard operation data after a successful connection; The keyboard operation data obtained by the second polling, if a keyboard button press event occurs, the virtual key code data corresponding to the keyboard button is inserted into the preset data queue; if a keyboard button up event occurs, the preset The virtual key code data corresponding to the keyboard keys in the data queue is kicked out; the preset data queue is periodically sent to the remote server for the remote server to perform corresponding keyboard operations accordingly.
  • the method further includes: if the virtual key code data of the keyboard key corresponding to the keyboard operation data of the keyboard key press event includes the The virtual key code data of the original keyboard keys and the virtual key code data of the newly added keyboard keys in the preset data queue, then the virtual key code data of the original keyboard keys are retained in the preset data queue, and The virtual key code data of the newly added keyboard key is added thereafter.
  • the method further includes: adding the virtual key code data of the newly added keyboard keys to the end of the preset data queue; if the virtual key code data of the original keyboard keys is the same as the If there is a data gap between the virtual key code data of the newly added keyboard key, the virtual key code data of the newly added keyboard key is prepended to eliminate the data gap.
  • the length of the preset data queue is the maximum number of operations that can simultaneously operate keyboard keys; the head of the preset data queue is provided with the number of queued valid data.
  • the present invention provides a keyboard operation execution method, which is applied to a remote server; the method includes: receiving a preset data queue of a client; key code data; execute the pressing event of the corresponding keyboard key according to the virtual key code data; compare the currently obtained preset data queue with the previously obtained preset data queue, if the currently obtained preset data queue is missing One or more virtual key code data, then execute the one or more keyboard key up events; or, transmit the keyboard key state corresponding to the currently obtained preset data queue to the driver for execution.
  • the length of the preset data queue is the maximum number of operations that can simultaneously operate keyboard keys; the head of the preset data queue is provided with the number of queued valid data.
  • the present invention provides a transmission device for keyboard operation data, which is applied to a client; the device includes: a remote communication module for connecting to a remote server; regularly and regularly sending preset data queues to the client. the remote server, for the remote server to perform corresponding keyboard operations; a data polling module for periodically polling to obtain keyboard operation data after the remote communication module successfully connects to the remote server; data processing The module is used for the keyboard operation data obtained by each polling. If a keyboard button press event occurs, the virtual key code data corresponding to the keyboard button is inserted into the preset data queue; if a keyboard button up event occurs, Then, the virtual key code data corresponding to the keyboard keys in the preset data queue is kicked out.
  • the present invention provides an execution device for keyboard operation, which is applied to a remote server; the device includes: a remote communication module for receiving a preset data queue of a client; the preset data queue It contains virtual key code data of keyboard keys; an operation execution module is used to execute the pressing event of the corresponding keyboard key according to the virtual key code data; compare the currently obtained preset data queue with the previously obtained preset data queue Yes, if one or more virtual key code data is missing from the currently obtained preset data queue, execute the one or more keyboard key lift events; or, change the keyboard key state corresponding to the currently obtained preset data queue passed to the driver for execution.
  • the present invention provides a computer-readable storage medium, wherein a computer program is stored, and when the computer program is loaded and executed by a processor, the transmission method of the described keyboard operation data is realized, or the The execution method of the keyboard operation.
  • the present invention provides an electronic device, comprising: a processor and a memory; wherein, the memory is used to store a computer program; the processor is used to load and execute the computer program, so that all The electronic device executes the keyboard operation data transmission method, or the keyboard operation execution method.
  • the keyboard operation data transmission method and device, and the keyboard operation execution method and device of the present invention enable the remote server to improve the anti-packet loss capability of the keyboard operation data transmission under the situation of network instability, and avoid the keyboard operation caused by packet loss. If the operation is not performed properly, and the client can increase the sending frequency to improve the data arrival rate, effectively execute the client's input operation, avoid losing keys or card keys, and has strong practicability.
  • FIG. 1 is a flowchart of a method for transmitting keyboard operation data according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a preset data queue according to an embodiment of the present invention.
  • FIG. 3 is a block diagram of a keyboard operation data transmission device according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for executing a keyboard operation according to an embodiment of the present invention.
  • FIG. 5 is a block diagram of a keyboard operation executing apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
  • this embodiment provides a method for transmitting keyboard operation data, and the method is executed by a client installed on an electronic device such as a smart phone, a tablet computer, and a portable computer.
  • the client establishes a communication connection with the remote server, so as to obtain the remote desktop of the cloud game provided by the remote server.
  • the keyboard operation data transmission method of this embodiment includes the following steps:
  • S11 Connect to a remote server, and periodically poll to obtain keyboard operation data after a successful connection.
  • the client enables the timing polling acquisition mode of keyboard input data.
  • the keyboard input data includes physical keyboard operation data and virtual keyboard key operation data, but does not include mouse operation data and video. data such as input and voice input.
  • the keyboard key operation data further includes keyboard key press event operation data and keyboard key lift event operation data.
  • the polling time can be set according to requirements, such as 125Hz, 1000Hz, etc., generally set to 125Hz, that is, the keyboard operation data is obtained by checking every 8ms.
  • the event-driven mode will be used to simulate the polling mode to obtain keyboard operation data.
  • the virtual key code data of the keyboard key corresponding to the keyboard operation data of the keyboard key press event includes the virtual key code data of the original keyboard key in the preset data queue
  • the virtual key code data of the newly added keyboard keys are retained in the preset data queue, and the newly added keyboard keys are added thereafter.
  • virtual key code data more specifically, adding the virtual key code data of the newly added keyboard keys to the end of the preset data queue; if the virtual key code data of the original keyboard keys is the same as the If there is a data gap between the virtual key code data of the newly added keyboard key, the virtual key code data of the newly added keyboard key is prepended to eliminate the data gap. If the user presses multiple keys at the same time for a long time, the data sequence of the virtual key codes of the keys already inserted in the queue will not be changed.
  • the length n of the preset data queue created by the client is the maximum number of operations that can operate the keyboard keys at the same time.
  • the head of the preset data queue also has queue valid data. quantity.
  • the keyboard key operation data is not obtained, so the number of valid data in the queue is 0; when the client polls for the second time, the keyboard key operation data is obtained, which is generated by the pressing event of 6 keyboard keys.
  • the virtual key code data C1 to C6 corresponding to the 6 keyboard keys are correspondingly inserted into the data bits 1 to 6 of the preset data queue, so the number of valid data in the queue is 6; when polling three times, the keyboard key operation data is obtained again.
  • the data is generated by the pressing event of 5 keyboard keys and the lifting event of 2 keyboard keys. Among them, the pressing event is generated by 4 original keys and 1 new key. At this time, 4 original keys are reserved.
  • the virtual key code data of the key in the preset data queue namely C1 ⁇ C3 and C6, insert the virtual key code data of the newly added key at the end of the queue, namely C7, and at the same time, the virtual key code data of the two keyboard keys that have a lift event are inserted.
  • the key code data C4 ⁇ C5 are kicked out from the preset data queue, so the number of queue valid data of the preset data queue obtained after three polls is 5; data space.
  • S13 Send a preset data queue to the remote server regularly and periodically, so that the remote server can perform corresponding keyboard operations accordingly.
  • the client sends the preset data queue to the remote server
  • the preset data queue contains valid data
  • only a few bits of valid data in the preset data queue are sent to the remote server, if the preset data queue has no valid data.
  • the present invention also provides a computer program product comprising one or more computer instructions.
  • the computer instructions may be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a server, data center, etc., which includes one or more available media integrated.
  • the usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a Solid State Disk (SSD)), and the like.
  • SSD Solid State Disk
  • this embodiment provides an apparatus 30 for transmitting keyboard operation data. Since the technical principle of this embodiment is similar to that of the foregoing method embodiments, the same technical details will not be repeated.
  • the apparatus 30 of this embodiment includes the following modules:
  • the remote communication module 31 is used to connect to a remote server; regularly and regularly send a preset data queue to the remote server, so that the remote server can perform corresponding keyboard operations;
  • the data polling module 32 is used to periodically poll to obtain keyboard operation data after the remote communication module 31 successfully connects to the remote server;
  • the data processing module 33 is used to insert the virtual key code data corresponding to the keyboard key into the preset data queue if a keyboard key pressing event is generated for the keyboard operation data obtained by each polling; When the event occurs, the virtual key code data corresponding to the keyboard keys in the preset data queue is kicked out.
  • this embodiment provides a method for executing keyboard operations.
  • the method is executed by a remote server. After establishing a communication connection with the client, the remote server provides the client with a remote desktop of the cloud game.
  • the keyboard operation execution method of this embodiment includes the following steps:
  • S41 Receive a preset data queue of the client; the preset data queue contains virtual key code data of keyboard keys, as shown in C1 to C7 of FIG. 2 .
  • S42 Execute a press event corresponding to a keyboard key according to the virtual key code data.
  • the remote server first obtains the preset data queue shown in the first row, and there is no virtual key code data in the queue; the remote server then obtains the preset data queue shown in the second row, which contains virtual key code data.
  • the remote server obtains the preset data queue shown in the third row, and the queue contains virtual key code data C1 ⁇ C6 C3 and C6-C7, at this time, execute the pressing events of the five keyboard keys corresponding to C1-C3 and C6-C7.
  • S43 Compare the currently obtained preset data queue with the previously obtained preset data queue, and if one or more virtual key code data is missing from the currently obtained preset data queue, execute the one or more keyboard keys or, transmit the keyboard key state corresponding to the currently obtained preset data queue to the driver for execution.
  • the preset data queue shown in the second row is obtained first, and then the preset data queue shown in the third row is obtained. Compared with the preset data queue shown in the second row, the third row If there is no C4 to C5 in the preset data queue shown, the key up event of the keyboard corresponding to C4 to C5 is executed.
  • step S43 realizes another execution mode: the remote server transmits the keyboard key state corresponding to the currently obtained preset data queue to the driver for execution through the operating system io mode, for example: the remote server creates a virtual HID device, the preset data queue The keyboard key state can be reported to the virtual HID device through the operating system driver io interface, and the virtual HID device will periodically poll and execute the update data of the state corresponding to the keyboard key.
  • the present invention also provides a computer program product comprising one or more computer instructions.
  • the computer instructions may be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server, a data center, etc. that includes one or more available media integrated.
  • the usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a Solid State Disk (SSD)), and the like.
  • SSD Solid State Disk
  • this embodiment provides a keyboard operation execution device 50 . Since the technical principle of this embodiment is similar to that of the foregoing method embodiments, the same technical details will not be repeated.
  • the apparatus 50 of this embodiment includes the following modules:
  • the remote communication module 50 is used for receiving a preset data queue of the client; the preset data queue contains virtual key code data of keyboard keys;
  • the operation execution module 51 is used to execute the pressing event of the corresponding keyboard key according to the virtual key code data; compare the currently obtained preset data queue and the previously obtained preset data queue, if the currently obtained preset data If one or more virtual key code data is missing from the queue, the event of raising the one or more keyboard keys will be executed.
  • the key operation data sent from the client to the remote server is only the data of the keyboard key press event, and the data of the keyboard key up event will not be sent by the client to the remote server. Since the number of client polls in the same time period is much higher than the user's operating hand speed (APM) on the client, the keyboard operation data obtained by the polling mechanism will not be omitted, and when the same keyboard operation occurs, the polling mechanism corresponds to The keyboard operation data will be repeatedly obtained many times. When the network is unstable, the virtual key code data of the same keyboard operation data will be repeatedly sent to the remote server correspondingly, thus increasing the probability of the remote server obtaining valid operation data and improving the anti-loss package capability.
  • API user's operating hand speed
  • this embodiment provides an electronic device, and the electronic device may be a desktop computer, a portable computer, a smart phone, and other devices.
  • the electronic device includes at least a memory and a processor connected through a bus, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to execute the keyboard operation data transmission method shown in FIG. 1 , or The keyboard operation execution method shown in FIG. 4 .
  • the system bus mentioned above may be a Peripheral Pomponent Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (EISA for short) bus or the like.
  • PCI Peripheral Pomponent Interconnect
  • EISA Extended Industry Standard Architecture
  • the system bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface is used to realize the communication between the database access device and other devices (eg client, read-write library and read-only library).
  • the memory may include random access memory (Random Access Memory, RAM for short), and may also include non-volatile memory (non-volatile memory), such as at least one disk storage.
  • the above-mentioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; may also be a digital signal processor (Digital Signal Processing, referred to as DSP) , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the keyboard operation data transmission method and device, and the keyboard operation execution method and device of the present invention improve the anti-packet loss capability of keyboard operation data transmission under the condition of network instability, so that the remote server can effectively perform the keyboard operation of the client. It avoids the occurrence of lost keys or stuck keys, has strong practicability, effectively overcomes various shortcomings in the prior art, and has high industrial utilization value.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

本发明提供键盘操作数据传输方法及装置、键盘操作执行方法及装置。客户端执行的键盘操作数据的传输方法包括:连接远程服务器,并在成功连接之后定时轮询获取键盘操作数据;对于每次轮询获得的键盘操作数据,若有键盘按键按下事件产生,则将对应键盘按键的虚拟键码数据插入预设数据队列中;若有键盘按键抬起事件产生,则将所述预设数据队列中对应键盘按键的虚拟键码数据踢除;定时定期将所述预设数据队列发送至所述远程服务器,以供所述远程服务器据以执行相应的键盘操作。本发明提高了网络不稳定情况下键盘操作数据传输的抗丢包能力,使得远程服务器能有效地执行客户端的键盘操作,避免丢键或者卡键等状况的发生。

Description

键盘操作数据传输方法及装置、键盘操作执行方法及装置 技术领域
本发明涉及云游戏技术领域,特别是涉及键盘操作数据传输方法及装置、键盘操作执行方法及装置。
背景技术
云游戏就是以云计算为基础的游戏方式。在云游戏的运行模式下,所有游戏都在服务器端运行,游戏整体都是通过网络与玩家见面,也就意味着对玩家的游戏设备没有太大的要求,智能手机、平板电脑只要有足够的解码渲染能力以及一定的网速就可以畅玩游戏大作。5G的不断发展对整个云游戏市场来说是最为关键的突破点,但只有足够的网速也不足以让云游戏的运行足够顺畅,网络不稳定造成的丢包(指一个或多个数据包的数据无法透过网络到达目的地)势必会造成客户端的操作无法在远程云桌面得到实时、完整的执行。
为了保证云游戏的低延迟,在采用udp协议传输数据时,若有丢包则会造成客户端操作数据向远程服务器传输的丢失,从而导致远程服务器因接收不到完整的操作数据无法将用户的操作执行到位。
发明内容
鉴于以上所述现有技术的缺点,本发明的目的在于提供键盘操作数据传输方法及装置、键盘操作执行方法及装置,用于解决现有技术中的以上不足。
为实现上述目的及其他相关目的,本发明提供一种键盘操作数据的传输方法,应用于客户端;所述方法包括:连接远程服务器,并在成功连接之后定时轮询获取键盘操作数据;对于每次轮询获得的键盘操作数据,若有键盘按键按下事件产生,则将对应键盘按键的虚拟键码数据插入预设数据队列中;若有键盘按键抬起事件产生,则将所述预设数据队列中对应键盘按键的虚拟键码数据踢除;定时定期将所述预设数据队列发送至所述远程服务器,以供所述远程服务器据以执行相应的键盘操作。
于本发明一实施例中,对于每次轮询获得的键盘操作数据,所述方法还包括:若所述键盘按键按下事件的键盘操作数据所对应的键盘按键的虚拟键码数据包括所述预设数据队列中原有的键盘按键的虚拟键码数据和新增的键盘按键的虚拟键码数据,则在所述预设数据队列中保留所述原有的键盘按键的虚拟键码数据,并在其后添加所述新增的键盘按键的虚拟键码数据。
于本发明一实施例中,还包括:将所述新增的键盘按键的虚拟键码数据添加至所述预设数据队列的队尾;若所述原有的键盘按键的虚拟键码数据与所述新增的键盘按键的虚拟键码数据之间有数据空位,则将所述新增的键盘按键的虚拟键码数据前置,以消除所述数据空位。
于本发明一实施例中,所述预设数据队列的长度为可同时操作键盘按键的最多操作数量;所述预设数据队列的头部设有队列有效数据数量。
为实现上述目的及其他相关目的,本发明提供一种键盘操作的执行方法,应用于远程服务器;所述方法包括:接收客户端的预设数据队列;所述预设数据队列中含有键盘按键的虚拟键码数据;根据所述虚拟键码数据执行对应键盘按键的按下事件;将当前获得的预设数据队列及前一次获得预设数据队列进行比对,若当前获得的预设数据队列中缺失一个或多个虚拟键码数据,则执行该一个或多个键盘按键的抬起事件;或者,将当前获得的预设数据队列对应的键盘按键状态传递至驱动执行。
于本发明一实施例中,所述预设数据队列的长度为可同时操作键盘按键的最多操作数量;所述预设数据队列的头部设有队列有效数据数量。
为实现上述目的及其他相关目的,本发明提供一种键盘操作数据的传输装置,应用于客户端;所述装置包括:远程通信模块,用于连接远程服务器;定时定期将预设数据队列发送至所述远程服务器,以供所述远程服务器据以执行相应的键盘操作;数据轮询模块,用于在所述远程通信模块成功连接所述远程服务器之后,定时轮询获取键盘操作数据;数据处理模块,用于对每次轮询获得的键盘操作数据,若有键盘按键按下事件产生,则将对应键盘按键的虚拟键码数据插入预设数据队列中;若有键盘按键抬起事件产生,则将所述预设数据队列中对应键盘按键的虚拟键码数据踢除。
为实现上述目的及其他相关目的,本发明提供一种键盘操作的执行装置,应用于远程服务器;所述装置包括:远程通信模块,用于接收客户端的预设数据队列;所述预设数据队列中含有键盘按键的虚拟键码数据;操作执行模块,用于根据所述虚拟键码数据执行对应键盘按键的按下事件;将当前获得的预设数据队列及前一次获得预设数据队列进行比对,若当前获得的预设数据队列中缺失一个或多个虚拟键码数据,则执行该一个或多个键盘按键的抬起事件;或者,将当前获得的预设数据队列对应的键盘按键状态传递至驱动执行。
为实现上述目的及其他相关目的,本发明提供一种计算机可读存储介质,其中存储有计算机程序,所述计算机程序被处理器加载执行时,实现所述的键盘操作数据的传输方法,或实现所述的键盘操作的执行方法。
为实现上述目的及其他相关目的,本发明提供一种电子设备,包括:处理器及存储器;其中,所述存储器用于存储计算机程序;所述处理器用于加载执行所述计算机程序,以使所述电子设备执行所述的键盘操作数据的传输方法,或所述的键盘操作的执行方法。
如上所述,本发明的键盘操作数据传输方法及装置、键盘操作执行方法及装置,使得远程服务器能够在网络不稳定的情形下提高键盘操作数据传输的抗丢包能力,避免因丢包产生键盘操作执行不到位的情况,并且能够在因客户端提高发送频率来提高数据到达率,有效地执行客户端的输入操作,避免丢键或卡键,实用性较强。
附图说明
图1显示为本发明一实施例中的键盘操作数据传输方法的流程图。
图2显示为本发明一实施例中的预设数据队列的原理图。
图3显示为本发明一实施例中的键盘操作数据传输装置的模块图。
图4显示为本发明一实施例中的键盘操作执行方法的流程图。
图5显示为本发明一实施例中的键盘操作执行装置的模块图。
图6显示为本发明一实施例中的电子设备的结构示意图。
具体实施方式
以下通过特定的具体实例说明本发明的实施方式,本领域技术人员可由本说明书所揭露的内容轻易地了解本发明的其他优点与功效。本发明还可以通过另外不同的具体实施方式加以实施或应用,本说明书中的各项细节也可以基于不同观点与应用,在没有背离本发明的精神下进行各种修饰或改变。需说明的是,在不冲突的情况下,以下实施例及实施例中的特征可以相互组合。
需要说明的是,以下实施例中所提供的图示仅以示意方式说明本发明的基本构想,遂图示中仅显示与本发明中有关的组件而非按照实际实施时的组件数目、形状及尺寸绘制,其实际实施时各组件的型态、数量及比例可为一种随意的改变,且其组件布局型态也可能更为复杂。
如图1所示,本实施例提供一种键盘操作数据的传输方法,该方法由安装于智能手机、平板电脑、便携式电脑等电子设备的客户端负责执行。该客户端与远程服务器建立通信连接,以此来获得由远程服务器提供的云游戏的远程桌面。本实施例的键盘操作数据传输方法包括如下步骤:
S11:连接远程服务器,并在成功连接之后定时轮询获取键盘操作数据。
具体的,在客户端连接远程服务器,成功进入远程桌面后,客户端开启键盘输入数据定时轮询获取模式,键盘输入数据包括物理键盘操作数据、虚拟键盘按键操作数据,不包含鼠标操作数据、视频输入及语音输入等数据。键盘按键操作数据又包括键盘按键按下事件操作数据、键盘按键抬起事件操作数据。轮询时间可以根据需求设定,如可以设定为125Hz、1000Hz等,一般情况下设定为125Hz,即每8ms通过检查获取一次键盘操作数据。当客户端不支持轮询时,将采用事件驱动模式模拟轮询模式,获取键盘操作数据。
S12:对于每次轮询获得的键盘操作数据,若有键盘按键按下事件产生,则将对应键盘按键的虚拟键码数据(即虚拟键码值)插入预设数据队列中;若有键盘按键抬起事件产生,则将所述预设数据队列中对应键盘按键的虚拟键码数据踢除。
具体的,对于每次轮询获得的键盘操作数据,若所述键盘按键按下事件的键盘操作数据所对应的键盘按键的虚拟键码数据包括所述预设数据队列中原有的键盘按键的虚拟键码数据和新增的键盘按键的虚拟键码数据,则在所述预设数据队列中保留所述原有的键盘按键的虚拟键码数据,并在其后添加所述新增的键盘按键的虚拟键码数据;更具体地,将所述新增的键盘按键的虚拟键码数据添加至所述预设数据队列的队尾;若所述原有的键盘按键的虚拟键码数据与所述新增的键盘按键的虚拟键码数据之间有数据空位,则将所述新增的键盘按键的虚拟键码数据前置,以消除所述数据空位。若用户长时间同时按下多个按键时,不改变队列中已插入的此些按键虚拟键码数据顺序。
举例而言,如图2所示,客户端创建的预设数据队列的长度n为可同时操作键盘按键的最多操作数量,较佳的,在预设数据队列的头部还设有队列有效数据数量。客户端首次轮询时,未获得键盘按键操作数据,故队列有效数据数量为0;二次轮询时,获得了键盘按键操作数据,该数据由6个键盘按键的按下事件所产生,这6个键盘按键对应的虚拟键码数据C1~C6被相应插入至预设数据队列的1~6号数据位,故队列有效数据数量为6;三次轮询时,又获得了键盘按键操作数据,该数据由5个键盘按键的按下事件和2个键盘按键的抬起事件所产生,其中,按下事件由4个原有按键和1个新增按键产生,此时,保留4个原有按键在预设数据队列中的虚拟键码数据,即C1~C3和C6,在队尾插入新增按键的虚拟键码数据,即C7,同时,将2个发生抬起事件的键盘按键的虚拟键码数据C4~C5从预设数据队列中踢除,故三次轮询后得到的预设数据队列的队列有效数据数量为5;另外,将C6~C7前置,从而消除因剔除数据所产生的数据空位。
S13:定时定期将预设数据队列发送至所述远程服务器,以供所述远程服务器据以执行相应的键盘操作。
较佳的,客户端在向远程服务器发送预设数据队列时,若预设数据队列包含有效数据时只将预设数据队列的几位有效数据发送至远程服务器,若预设数据队列无有效数据时将空队列发送至远程服务器。
实现上述各方法实施例的全部或部分步骤可以通过计算机程序相关的硬件来完成。基于这样的理解,本发明还提供一种计算机程序产品,包括一个或多个计算机指令。所述计算机指令可以存储在计算机可读存储介质中。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(如:软盘、硬盘、磁带)、光介质(如:DVD)、或者半导体介质(如:固态硬盘Solid State Disk(SSD))等。
如图3所示,本实施例提供一种键盘操作数据的传输装置30,由于本实施例的技术原理与前述方法实施例的技术原理相似,因而不再对同样的技术细节做重复性赘述。本实施例的装置30包括如下模块:
远程通信模块31,用于连接远程服务器;定时定期将预设数据队列发送至所述远程服务器,以供所述远程服务器据以执行相应的键盘操作;
数据轮询模块32,用于在远程通信模块31成功连接所述远程服务器之后,定时轮询获取键盘操作数据;
数据处理模块33,用于对每次轮询获得的键盘操作数据,若有键盘按键按下事件产生,则将对应键盘按键的虚拟键码数据插入预设数据队列中;若有键盘按键抬起事件产生,则将所述预设数据队列中对应键盘按键的虚拟键码数据踢除。
如图4所示,本实施例提供一种键盘操作的执行方法,该方法由远程服务器负责执行,该远程服务器与客户端建立通信连接后,向客户端提供云游戏的远程桌面。本实施例的键盘操作执行方法包括如下步骤:
S41:接收客户端的预设数据队列;所述预设数据队列中含有键盘按键的虚拟键码数据,如图2的C1~C7所示。
S42:根据所述虚拟键码数据执行对应键盘按键的按下事件。
以图2为例,远程服务器先获得第一行所示的预设数据队列,该队列中无虚拟键码数据;远程服务器再获得第二行所示的预设数据队列,该队列中含有虚拟键码数据C1~C6,此时,执行C1~C6对应的6个键盘按键的按下事件;远程服务器又获得第三行所示的预设数据队列,该队列中含有虚拟键码数据C1~C3及C6~C7,此时,执行C1~C3及C6~C7对应的5个键盘按键的按下事件。
S43:将当前获得的预设数据队列及前一次获得预设数据队列进行比对,若当前获得的预设数据队列中缺失一个或多个虚拟键码数据,则执行该一个或多个键盘按键的抬起事件;或者,将当前获得的预设数据队列对应的键盘按键状态传递至驱动执行。
以图2为例,先获得第二行所示的预设数据队列,再获得第三行所示的预设数据队列,相比于第二行所示的预设数据队列,第三行所示的预设数据队列中缺少C4~C5,则执行C4~C5所对应的键盘按键的抬起事件。或者,步骤S43实现另一执行方式:远程服务器将当前获得的预设数据队列所对应的键盘按键状态通过操作系统io方式传递至驱动执行,例如:远程服务器创建虚拟HID设备,该预设数据队列可通过操作系统驱动io接口向该虚拟HID设备报告键盘按键状态,该虚拟HID设备会定时轮询并执行键盘按键对应状态的更新数据。
实现上述各方法实施例的全部或部分步骤可以通过计算机程序相关的硬件来完成。基于这样的理解,本发明还提供一种计算机程序产品,包括一个或多个计算机指令。所述计算机指令可以存储在计算机可读存储介质中。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(如:软盘、硬盘、磁带)、光介质(如:DVD)、或者半导体介质(如:固态硬盘Solid State Disk(SSD))等。
如图5所示,本实施例提供一种键盘操作的执行装置50,由于本实施例的技术原理与前述方法实施例的技术原理相似,因而不再对同样的技术细节做重复性赘述。本实施例的装置50包括如下模块:
远程通信模块50,用于接收客户端的预设数据队列;所述预设数据队列中含有键盘按键的虚拟键码数据;
操作执行模块51,用于根据所述虚拟键码数据执行对应键盘按键的按下事件;将当前获得的预设数据队列及前一次获得预设数据队列进行比对,若当前获得的预设数据队列中缺失一个或多个虚拟键码数据,则将执行该一个或多个键盘按键的抬起事件。
值得说明的是,从客户端发送至远程服务器的按键操作数据只有键盘按键按下事件的数据,键盘按键抬起事件的数据则不会被客户端发送至远程服务器。由于相同时间内客户端的轮询次数远远高于用户于客户端的操作手速(APM),轮询机制获取的键盘操作数据不会产生遗漏,且同一次键盘操作产生时,通过轮询机制对应的键盘操作数据会多次重复获取,在网络不稳定时,同样的键盘操作数据的虚拟键码数据会对应地重复发送至远程服务器,故而提高了远程服务器获取有效操作数据的几率,提高抗丢包能力。
参阅图6,本实施例提供一种电子设备,电子设备可以是台式机、便携式电脑、智能手 机等设备。详细的,电子设备至少包括通过总线连接的:存储器、处理器,其中,存储器用于存储计算机程序,处理器用于执行存储器存储的计算机程序,以执行图1所示的键盘操作数据传输方法、或图4所示的键盘操作执行方法。
上述提到的系统总线可以是外设部件互连标准(Peripheral Pomponent Interconnect,简称PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,简称EISA)总线等。该系统总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。通信接口用于实现数据库访问装置与其他设备(例如客户端、读写库和只读库)之间的通信。存储器可能包含随机存取存储器(Random Access Memory,简称RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
综上,本发明的键盘操作数据传输方法及装置、键盘操作执行方法及装置,提高了网络不稳定情况下键盘操作数据传输的抗丢包能力,使得远程服务器能有效地执行客户端的键盘操作,避免丢键或者卡键等状况的发生,实用性强,有效克服了现有技术中的种种缺点而具高度产业利用价值。
上述实施例仅例示性说明本发明的原理及其功效,而非用于限制本发明。任何熟悉此技术的人士皆可在不违背本发明的精神及范畴下,对上述实施例进行修饰或改变。因此,举凡所属技术领域中具有通常知识者在未脱离本发明所揭示的精神与技术思想下所完成的一切等效修饰或改变,仍应由本发明的权利要求所涵盖。

Claims (10)

  1. 一种键盘操作数据的传输方法,其特征在于,应用于客户端;所述方法包括:
    连接远程服务器,并在成功连接之后定时轮询获取键盘操作数据;
    对于每次轮询获得的键盘操作数据,若有键盘按键按下事件产生,则将对应键盘按键的虚拟键码数据插入预设数据队列中;若有键盘按键抬起事件产生,则将所述预设数据队列中对应键盘按键的虚拟键码数据踢除;
    定时定期将所述预设数据队列发送至所述远程服务器,以供所述远程服务器据以执行相应的键盘操作。
  2. 根据权利要求1所述的方法,其特征在于,对于每次轮询获得的键盘操作数据,所述方法还包括:
    若所述键盘按键按下事件的键盘操作数据所对应的键盘按键的虚拟键码数据包括所述预设数据队列中原有的键盘按键的虚拟键码数据和新增的键盘按键的虚拟键码数据,则在所述预设数据队列中保留所述原有的键盘按键的虚拟键码数据,并在其后添加所述新增的键盘按键的虚拟键码数据。
  3. 根据权利要求2所述的方法,其特征在于,还包括:
    将所述新增的键盘按键的虚拟键码数据添加至所述预设数据队列的队尾;
    若所述原有的键盘按键的虚拟键码数据与所述新增的键盘按键的虚拟键码数据之间有数据空位,则将所述新增的键盘按键的虚拟键码数据前置,以消除所述数据空位。
  4. 根据权利要求1所述的方法,其特征在于,所述预设数据队列的长度为可同时操作键盘按键的最多操作数量;所述预设数据队列的头部设有队列有效数据数量。
  5. 一种键盘操作的执行方法,其特征在于,应用于远程服务器;所述方法包括:
    接收客户端的预设数据队列;所述预设数据队列中含有键盘按键的虚拟键码数据;
    根据所述虚拟键码数据执行对应键盘按键的按下事件;
    将当前获得的预设数据队列及前一次获得预设数据队列进行比对,若当前获得的预设数据队列中缺失一个或多个虚拟键码数据,则执行该一个或多个键盘按键的抬起事件;或者,将当前获得的预设数据队列对应的键盘按键状态传递至驱动执行。
  6. 根据权利要求5所述的方法,其特征在于,所述预设数据队列的长度为可同时操作键盘按键的最多操作数量;所述预设数据队列的头部设有队列有效数据数量。
  7. 一种键盘操作数据的传输装置,其特征在于,应用于客户端;所述装置包括:
    远程通信模块,用于连接远程服务器;定时定期将预设数据队列发送至所述远程服务器,以供所述远程服务器据以执行相应的键盘操作;
    数据轮询模块,用于在所述远程通信模块成功连接所述远程服务器之后,定时轮询获取键盘操作数据;
    数据处理模块,用于对每次轮询获得的键盘操作数据,若有键盘按键按下事件产生,则将对应键盘按键的虚拟键码数据插入预设数据队列中;若有键盘按键抬起事件产生,则将所述预设数据队列中对应键盘按键的虚拟键码数据踢除。
  8. 一种键盘操作的执行装置,其特征在于,应用于远程服务器;所述装置包括:
    远程通信模块,用于接收客户端的预设数据队列;所述预设数据队列中含有键盘按键的虚拟键码数据;
    操作执行模块,用于根据所述虚拟键码数据执行对应键盘按键的按下事件;将当前获得的预设数据队列及前一次获得预设数据队列进行比对,若当前获得的预设数据队列中缺失一个或多个虚拟键码数据,则执行该一个或多个键盘按键的抬起事件;或者,将当前获得的预设数据队列对应的键盘按键状态传递至驱动执行。
  9. 一种计算机可读存储介质,其中存储有计算机程序,其特征在于,所述计算机程序被处理器加载执行时,实现如权利要求1至4中任一所述的键盘操作数据的传输方法,或实现如权利要求5或6所述的键盘操作的执行方法。
  10. 一种电子设备,其特征在于,包括:处理器及存储器;其中,
    所述存储器用于存储计算机程序;
    所述处理器用于加载执行所述计算机程序,以使所述电子设备执行如权利要求1至4中任一所述的键盘操作数据的传输方法,或执行如权利要求5或6所述的键盘操作的执行方法。
PCT/CN2021/134265 2020-11-30 2021-11-30 键盘操作数据传输方法及装置、键盘操作执行方法及装置 WO2022111722A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011377740.9 2020-11-30
CN202011377740.9A CN113750517B (zh) 2020-11-30 2020-11-30 键盘操作数据传输方法及装置、键盘操作执行方法及装置

Publications (1)

Publication Number Publication Date
WO2022111722A1 true WO2022111722A1 (zh) 2022-06-02

Family

ID=78786146

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/134265 WO2022111722A1 (zh) 2020-11-30 2021-11-30 键盘操作数据传输方法及装置、键盘操作执行方法及装置

Country Status (2)

Country Link
CN (1) CN113750517B (zh)
WO (1) WO2022111722A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102148874A (zh) * 2011-03-30 2011-08-10 北京彩讯科技股份有限公司 对网络计算机的远程多键盘鼠标控制方法
US20130227562A1 (en) * 2012-02-29 2013-08-29 Michael Tsirkin System and method for multiple queue management and adaptive cpu matching in a virtual computing system
CN103902056A (zh) * 2012-12-28 2014-07-02 华为技术有限公司 虚拟键盘输入方法、设备及系统
US20140343977A1 (en) * 2011-10-28 2014-11-20 Qurami S.R.L. Queue remote management system and method
CN109194642A (zh) * 2018-08-28 2019-01-11 深圳市创维群欣安防科技股份有限公司 白板远程同步处理方法、系统及存储介质
CN109395372A (zh) * 2018-12-07 2019-03-01 上海达龙信息科技有限公司 实现游戏手柄远程操控电脑游戏的方法、系统与电子设备
US10581751B1 (en) * 2015-12-16 2020-03-03 EMC IP Holding Company LLC Multi-queue based system for throttling backup agent save processes

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103970279A (zh) * 2013-01-30 2014-08-06 云联(北京)信息技术有限公司 一种云游戏控制方法及系统
CN109564560A (zh) * 2016-06-01 2019-04-02 北京易掌云峰科技有限公司 基于队列的消息同步
CN108052377B (zh) * 2017-12-29 2022-02-08 腾讯科技(深圳)有限公司 基于云的输入处理方法、装置、服务器和存储介质
CN110764936A (zh) * 2019-10-28 2020-02-07 深圳前海微众银行股份有限公司 一种数据采集方法及装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102148874A (zh) * 2011-03-30 2011-08-10 北京彩讯科技股份有限公司 对网络计算机的远程多键盘鼠标控制方法
US20140343977A1 (en) * 2011-10-28 2014-11-20 Qurami S.R.L. Queue remote management system and method
US20130227562A1 (en) * 2012-02-29 2013-08-29 Michael Tsirkin System and method for multiple queue management and adaptive cpu matching in a virtual computing system
CN103902056A (zh) * 2012-12-28 2014-07-02 华为技术有限公司 虚拟键盘输入方法、设备及系统
US10581751B1 (en) * 2015-12-16 2020-03-03 EMC IP Holding Company LLC Multi-queue based system for throttling backup agent save processes
CN109194642A (zh) * 2018-08-28 2019-01-11 深圳市创维群欣安防科技股份有限公司 白板远程同步处理方法、系统及存储介质
CN109395372A (zh) * 2018-12-07 2019-03-01 上海达龙信息科技有限公司 实现游戏手柄远程操控电脑游戏的方法、系统与电子设备

Also Published As

Publication number Publication date
CN113750517B (zh) 2024-04-30
CN113750517A (zh) 2021-12-07

Similar Documents

Publication Publication Date Title
US10891177B2 (en) Message management method and device, and storage medium
US11213743B2 (en) Method, system and electronic device for achieving remote control of computer game by game controller
KR102245247B1 (ko) 트리거된 동작을 이용하는 gpu 원격 통신
WO2022166927A1 (zh) 基于远程桌面的光标显示方法、装置、介质及电子设备
US20110283002A1 (en) Selectively Communicating Data Of A Peripheral Device To Plural Sending Computers
US11321150B2 (en) Ordered event notification
CN110247942B (zh) 一种数据发送方法、装置和可读介质
CN108418743B (zh) 一种聊天室消息分发方法、装置及电子设备
CN115348222B (zh) 一种消息分发方法、装置、服务端及存储介质
WO2022227693A1 (zh) 用于命令分发的装置、方法、芯片、计算机设备及介质
US9391918B2 (en) Communicating data in flows between first and second computers over a network
WO2023160276A1 (zh) 一种数据处理方法、装置、计算机设备以及可读存储介质
CN110928706B (zh) 小程序交互方法、装置、电子设备及存储介质
US9467526B2 (en) Network communication using intermediation processor
CN111131499A (zh) 并发和异步任务处理方法及其设备
CN114697391A (zh) 数据处理方法、装置、设备以及存储介质
WO2022111722A1 (zh) 键盘操作数据传输方法及装置、键盘操作执行方法及装置
US9332071B2 (en) Data stage-in for network nodes
US20230342086A1 (en) Data processing apparatus and method, and related device
WO2023165320A1 (zh) 播放参数配置方法及装置
US20230063599A1 (en) Edge computing network, data transmission method and apparatus, device and storage medium
CN112511595A (zh) 一种消息推送方法及消息服务系统
WO2023102682A1 (zh) 通信装置及报文传输方法
CN114826626B (zh) 共识节点的选举方法、装置、存储介质及节点设备
CN115348231B (zh) 一种消息处理方法、装置、服务端及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21897222

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21897222

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23-10-2023)