CN116599942A - Image processing method, device, server and storage medium for a virtual desktop - Google Patents
Image processing method, device, server and storage medium for a virtual desktop Download PDFInfo
- Publication number
- CN116599942A CN116599942A CN202310481623.4A CN202310481623A CN116599942A CN 116599942 A CN116599942 A CN 116599942A CN 202310481623 A CN202310481623 A CN 202310481623A CN 116599942 A CN116599942 A CN 116599942A
- Authority
- CN
- China
- Prior art keywords
- image data
- virtual
- desktop
- virtual desktop
- display size
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/08—Protocols specially adapted for terminal emulation, e.g. Telnet
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Digital Computer Display Output (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本申请实施例公开了一种虚拟桌面的图像处理方法,该方法包括:在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,确定虚拟桌面当前的显示尺寸;基于服务端的硬件编码器的对齐步长和当前的显示尺寸,对虚拟桌面的原始图像数据进行扩充处理,获得处理后的图像数据;对齐步长表征硬件编码器每次读取数据的字节数;通过硬件编码器读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码,获得桌面编码数据;将桌面编码数据发送到客户端。本申请实施例还公开了一种虚拟桌面的图像处理装置、服务端和存储介质。
The embodiment of the present application discloses an image processing method of a virtual desktop. The method includes: after receiving an operation instruction representing a change in the display size of the virtual desktop on the client, determining the current display size of the virtual desktop; The alignment step of the encoder and the current display size are used to expand the original image data of the virtual desktop to obtain the processed image data; the alignment step represents the number of bytes of data read by the hardware encoder each time; through the hardware encoder The processed image data is read, and the original image data in the processed image data is encoded to obtain desktop encoded data; and the desktop encoded data is sent to the client. The embodiment of the present application also discloses an image processing device, a server and a storage medium of a virtual desktop.
Description
技术领域technical field
本申请涉及通信技术领域,尤其涉及一种虚拟桌面的图像处理方法、装置、服务端和存储介质。The present application relates to the field of communication technology, and in particular to a virtual desktop image processing method, device, server and storage medium.
背景技术Background technique
桌面云系统中,服务端与客户端的云桌面在进行数据传输时,需要通过独立计算环境初级协议(Simple Protocol for Independent Computing Environments,SPICE)中的编码器对即将显示在云桌面上的画面进行编码,以提高桌面云系统的传输速率。但是,因为客户端的云桌面的大小可以任意伸缩,这会使得编码的画面的大小随之发生改变,而编码器是按照固定字节数读取画面中的信息的;在云桌面的大小发生改变后,编码器无法按照固定字节数读取画面中的信息,只能逐字读取,导致编码器读取信息的效率降低且增加了编码的整体耗时。In the desktop cloud system, when the cloud desktops of the server and the client are transmitting data, they need to encode the picture to be displayed on the cloud desktop through the encoder in the Simple Protocol for Independent Computing Environments (SPICE) , to increase the transmission rate of the desktop cloud system. However, because the size of the client's cloud desktop can be scaled arbitrarily, this will cause the size of the encoded picture to change accordingly, and the encoder reads the information in the picture according to a fixed number of bytes; when the size of the cloud desktop changes Finally, the encoder cannot read the information in the screen according to the fixed number of bytes, but can only read word by word, which reduces the efficiency of the encoder to read information and increases the overall time consumption of encoding.
发明内容Contents of the invention
为解决上述技术问题,本申请实施例期望提供一种虚拟桌面的图像处理方法、装置、服务端和存储介质,解决了相关技术中的在云桌面的大小发生改变后,编码器无法按照固定字节数读取画面中的信息,只能逐字读取,导致编码器读取信息的效率降低且增加了编码的整体耗时的问题。In order to solve the above technical problems, the embodiment of the present application expects to provide a virtual desktop image processing method, device, server and storage medium, which solves the problem in the related art that after the size of the cloud desktop changes, the encoder cannot The information in the screen read by the number of sections can only be read word by word, which reduces the efficiency of the encoder to read information and increases the overall time-consuming problem of encoding.
本申请的技术方案是这样实现的:The technical scheme of the present application is realized like this:
一种虚拟桌面的图像处理方法,所述方法包括:An image processing method for a virtual desktop, the method comprising:
在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,确定所述虚拟桌面当前的显示尺寸;After receiving an operation instruction representing a change in the display size of the virtual desktop on the client, determine the current display size of the virtual desktop;
基于所述服务端的硬件编码器的对齐步长和所述当前的显示尺寸,对所述虚拟桌面的原始图像数据进行扩充处理,获得处理后的图像数据;所述对齐步长表征所述硬件编码器每次读取数据的字节数;Based on the alignment step of the hardware encoder of the server and the current display size, the original image data of the virtual desktop is expanded to obtain processed image data; the alignment step represents the hardware encoding The number of bytes of data read by the device each time;
通过所述硬件编码器读取所述处理后的图像数据,并对所述处理后的图像数据中的原始图像数据进行编码,获得桌面编码数据;Reading the processed image data through the hardware encoder, and encoding the original image data in the processed image data to obtain desktop encoded data;
将所述桌面编码数据发送到客户端。Send the desktop encoded data to the client.
上述方案中,所述显示尺寸发生变化,包括:In the above solution, the display size changes, including:
虚拟桌面从全屏状态变成窗口状态;或者,The virtual desktop changes from a full-screen state to a windowed state; or,
虚拟桌面从第一窗口状态变成第二窗口状态;或者,The virtual desktop changes from the first window state to the second window state; or,
虚拟桌面从第一显示屏切换到第二显示屏。The virtual desktop switches from the first display to the second display.
上述方案中,所述确定所述虚拟桌面当前的显示尺寸,包括:In the above solution, the determining the current display size of the virtual desktop includes:
根据所述客户端发送的所述虚拟桌面在所述客户端的显示屏上显示的坐标和所述虚拟桌面未发生变化前的显示尺寸,确定所述当前的显示尺寸;determining the current display size according to the coordinates of the virtual desktop sent by the client and displayed on the display screen of the client and the display size of the virtual desktop before any change;
相应的,所述基于所述服务端的硬件编码器的对齐步长和所述当前的显示尺寸,对所述虚拟桌面的原始图像数据进行扩充处理,获得处理后的图像数据,包括:Correspondingly, based on the alignment step of the hardware encoder of the server and the current display size, the original image data of the virtual desktop is expanded to obtain processed image data, including:
基于所述当前的显示尺寸和所述对齐步长,得到所述处理后的图像数据具有的虚宽和虚高;Obtaining a virtual width and a virtual height of the processed image data based on the current display size and the alignment step;
根据所述虚宽和所述虚高对所述原始图像数据进行扩充处理,得到所述处理后的图像数据。The original image data is expanded according to the virtual width and the virtual height to obtain the processed image data.
上述方案中,所述基于所述当前的显示尺寸和所述对齐步长,得到所述处理后的图像数据具有的虚宽和虚高,包括:In the above solution, the virtual width and virtual height of the processed image data are obtained based on the current display size and the alignment step size, including:
确定所述硬件编码器的对齐步长;determining an alignment step size of the hardware encoder;
基于对齐步长对所述虚拟桌面的实际宽和实际高进行处理,得到所述虚高和所述虚高;所述当前的显示尺寸包括所述实际宽和所述实际高。The actual width and the actual height of the virtual desktop are processed based on the alignment step to obtain the virtual height and the virtual height; the current display size includes the actual width and the actual height.
上述方案中,所述基于对齐步长对所述虚拟桌面的实际宽和实际高进行处理,得到所述虚高和所述虚高,包括:In the above solution, the actual width and actual height of the virtual desktop are processed based on the alignment step to obtain the virtual height and the virtual height, including:
确定所述对齐步长与所述实际宽和所述实际高之间的差异;determining a difference between the alignment step and the actual width and the actual height;
根据所述差异对所述实际宽和所述实际高进行扩充处理,得到所述虚宽和所述虚高;所述虚宽和所述虚高是所述对齐步长的整数倍。Expanding the actual width and the actual height according to the difference to obtain the imaginary width and the imaginary height; the imaginary width and the imaginary height are integer multiples of the alignment step.
上述方案中,所述根据所述虚高和所述虚高对所述原始图像数据进行扩充处理,得到处理后的图像数据,包括:In the above solution, the said original image data is expanded according to said virtual height and said virtual height to obtain processed image data, including:
根据所述虚高和所述虚宽对所述原始图像数据进行扩充,得到扩充后的图像数据;expanding the original image data according to the virtual height and the virtual width to obtain expanded image data;
根据目标字符对所述扩充后的图像数据进行填补,得到所述处理后的图像数据。The expanded image data is filled according to the target character to obtain the processed image data.
上述方案中,所述通过所述硬件编码器读取所述处理后的图像数据,并对所述处理后的图像数据中的原始图像数据进行编码,获得桌面编码数据,包括:In the above solution, reading the processed image data through the hardware encoder, and encoding the original image data in the processed image data to obtain desktop encoded data includes:
通过所述硬件编码器按照所述对齐步长,读取所述处理后的图像数据Read the processed image data according to the alignment step by the hardware encoder
通过所述硬件编码器对所述原始图像数据进行编码,得到所述桌面编码数据。The original image data is encoded by the hardware encoder to obtain the desktop encoded data.
一种虚拟桌面的图像处理装置,所述装置包括:An image processing device for a virtual desktop, the device comprising:
处理单元,用于在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,确定所述虚拟桌面当前的显示尺寸;The processing unit is configured to determine the current display size of the virtual desktop after receiving an operation instruction representing a change in the display size of the virtual desktop on the client;
所述处理单元,还用于基于所述服务端的硬件编码器的对齐步长和所述当前的显示尺寸,对所述虚拟桌面的原始图像数据进行扩充处理,获得处理后的图像数据;所述对齐步长表征所述硬件编码器每次读取数据的字节数;The processing unit is further configured to expand the original image data of the virtual desktop based on the alignment step of the hardware encoder of the server and the current display size, to obtain processed image data; The alignment step represents the number of bytes of data read by the hardware encoder each time;
所述处理单元,还用于通过所述硬件编码器读取所述处理后的图像数据,并对所述处理后的图像数据中的原始图像数据进行编码,获得桌面编码数据;The processing unit is further configured to read the processed image data through the hardware encoder, and encode the original image data in the processed image data to obtain desktop coded data;
发送单元,用于将所述桌面编码数据发送到所述客户端。A sending unit, configured to send the desktop encoded data to the client.
一种服务端,所述服务端包括:处理器、存储器和通信总线;A server, the server includes: a processor, a memory and a communication bus;
所述通信总线用于实现所述处理器和所述存储器之间的通信连接;The communication bus is used to realize the communication connection between the processor and the memory;
所述处理器用于执行所述存储器中的虚拟桌面的图像处理程序,以实现上述的虚拟桌面的图像处理方法的步骤。The processor is configured to execute the image processing program of the virtual desktop in the memory, so as to realize the steps of the above-mentioned method for processing the image of the virtual desktop.
一种存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现上述的虚拟桌面的图像处理方法的步骤。A storage medium, the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors, so as to realize the above-mentioned steps of the image processing method for a virtual desktop.
本申请的实施例所提供的虚拟桌面的图像处理方法、装置、服务端和存储介质,可以在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,确定虚拟桌面当前的显示尺寸,接着基于服务端的硬件编码器的对齐步长和当前的显示尺寸,对虚拟桌面的原始图像数据进行扩充处理获得处理后的图像数据,然后通过硬件编码器读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码获得桌面编码数据,将桌面编码数据发送到客户端;如此,由于处理后的图像数据是基于硬件编码器的对齐步长对虚拟桌面的原始图像数据进行扩充处理后得到的,因此处理的图像数据的数据大小与硬件编码器的对齐步长是匹配的,因此通过硬件编码器能够按照对齐步长读取完处理后的图像数据,不存在需要单独读取的字节,读取数据的速率较高,且编码时只对处理后的图像数据中的原始图像数据进行编码,不会增加多余操作,因此降低了处理所消耗的时间,提高了数据编码效率,进而提高了虚拟桌面的整体性能,解决了相关技术中的在云桌面的大小发生改变后,编码器无法按照固定字节数读取画面中的信息,只能逐字读取,导致编码器读取信息的效率降低且增加了编码的整体耗时的问题。The image processing method, device, server, and storage medium of the virtual desktop provided in the embodiments of the present application can determine the current display size of the virtual desktop after receiving an operation instruction representing a change in the display size of the virtual desktop on the client, Then, based on the alignment step size of the hardware encoder on the server side and the current display size, the original image data of the virtual desktop is expanded to obtain the processed image data, and then the processed image data is read by the hardware encoder, and processed The original image data in the processed image data is encoded to obtain the desktop encoded data, and the desktop encoded data is sent to the client; thus, since the processed image data is based on the alignment step of the hardware encoder, the original image data of the virtual desktop is It is obtained after expansion processing, so the data size of the processed image data matches the alignment step of the hardware encoder, so the processed image data can be read according to the alignment step through the hardware encoder, and there is no need to read it separately Bytes, the rate of reading data is high, and only the original image data in the processed image data is encoded during encoding, which will not increase redundant operations, thus reducing the time consumed by processing and improving data encoding. efficiency, thereby improving the overall performance of the virtual desktop, and solving the problem in related technologies that after the size of the cloud desktop changes, the encoder cannot read the information in the screen according to the fixed number of bytes, and can only read word by word, resulting in encoding The efficiency of reading information by the reader is reduced and the overall time-consuming problem of encoding is increased.
附图说明Description of drawings
图1为本申请实施例提供的一种虚拟桌面的图像处理方法的流程示意图;FIG. 1 is a schematic flowchart of an image processing method for a virtual desktop provided in an embodiment of the present application;
图2(a)和图2(b)为本申请实施例提供的一种虚拟桌面的图像处理方法中虚拟桌面的显示尺寸发生变化的示意图;FIG. 2(a) and FIG. 2(b) are schematic diagrams showing changes in the display size of the virtual desktop in an image processing method for a virtual desktop provided by an embodiment of the present application;
图3为本申请实施例提供的另一种虚拟桌面的图像处理方法的流程示意图;FIG. 3 is a schematic flowchart of another image processing method for a virtual desktop provided by an embodiment of the present application;
图4为本申请实施例提供的又一种虚拟桌面的图像处理方法的流程示意图;FIG. 4 is a schematic flowchart of another image processing method for a virtual desktop provided by an embodiment of the present application;
图5为本申请另一实施例提供的一种虚拟桌面的图像处理方法的流程示意图;FIG. 5 is a schematic flowchart of a method for processing an image of a virtual desktop provided in another embodiment of the present application;
图6为本申请实施例提供的一种虚拟桌面的图像处理装置的结构示意图;FIG. 6 is a schematic structural diagram of an image processing device for a virtual desktop provided by an embodiment of the present application;
图7为本申请实施例提供的一种服务端的结构示意图。FIG. 7 is a schematic structural diagram of a server provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
应理解,说明书通篇中提到的“本申请实施例”或“前述实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“本申请实施例中”或“在前述实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。It should be understood that references to "an embodiment of the present application" or "the foregoing embodiment" throughout the specification mean that a specific feature, structure or characteristic related to the embodiment is included in at least one embodiment of the present application. Therefore, appearances of "in the embodiment of the present application" or "in the foregoing embodiment" throughout the specification do not necessarily refer to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, rather than the implementation process of the embodiments of the present application. constitute any limitation. The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.
在未做特殊说明的情况下,电子设备执行本申请实施例中的任一步骤,可以是电子设备的处理器执行该步骤。还值得注意的是,本申请实施例并不限定电子设备执行下述步骤的先后顺序。另外,不同实施例中对数据进行处理所采用的方式可以是相同的方法或不同的方法。还需说明的是,本申请实施例中的任一步骤是电子设备可以独立执行的,即电子设备执行下述实施例中的任一步骤时,可以不依赖于其它步骤的执行。Unless otherwise specified, the electronic device executes any step in the embodiments of the present application, and may be a processor of the electronic device executes the step. It should also be noted that the embodiment of the present application does not limit the order in which the electronic device executes the following steps. In addition, the methods for processing data in different embodiments may be the same method or different methods. It should also be noted that any step in the embodiments of the present application can be executed independently by the electronic device, that is, when the electronic device executes any step in the following embodiments, it may not depend on the execution of other steps.
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, not to limit the present application.
本申请实施例提供一种虚拟桌面的图像处理方法,该方法可以应用于服务端中,参照图1所示,该方法包括以下步骤:The embodiment of the present application provides an image processing method of a virtual desktop, which can be applied to a server, as shown in FIG. 1 , the method includes the following steps:
步骤101、在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,确定虚拟桌面当前的显示尺寸。Step 101: After receiving an operation instruction representing a change in the display size of the virtual desktop on the client, determine the current display size of the virtual desktop.
其中,虚拟桌面为在服务端上虚拟出来的且能够通过客户端进行访问的桌面。Wherein, the virtual desktop is a desktop that is virtualized on the server and can be accessed through the client.
在本申请实施例中,虚拟桌面可以为在服务端上虚拟出来的且能够通过客户端进行访问的桌面,虚拟桌面又称之为云桌面。操作指令用于表征虚拟桌面在客户端上的显示尺寸发生变化。虚拟桌面当前的显示尺寸可以为发生变化后的虚拟桌面的显示尺寸,在一种可行的实现方式中,在虚拟桌面从全屏状态变成窗口状态的情况下,确定虚拟桌面在客户端上的显示尺寸发生变化,此时虚拟桌面当前的显示尺寸为变成窗口状态下的显示尺寸,其中,窗口状态是指虚拟桌面处于非全屏状态;在虚拟桌面从第一窗口状态变成第二窗口状态的情况下,确定虚拟桌面在客户端的显示尺寸发生变化,此时虚拟桌面当前的显示尺寸为变成第二窗口状态下的显示尺寸,其中,第一窗口状态下的显示尺寸与第二窗口状态下的显示尺寸不同,也即第一窗口状态下的显示尺寸可能比第二窗口状态下的显示尺寸大,也可能比第二窗口状态下的显示尺寸小;在虚拟桌面从第一显示屏切换到第二显示屏的情况下,确定虚拟桌面在客户端的显示尺寸发生变化,此时虚拟桌面当前的显示尺寸为切换到第二显示屏的显示尺寸,其中,第一显示屏的屏幕尺寸与第二显示屏的屏幕尺寸不同。示例地,如图2(a)和图2(b)所示,图2(a)中虚拟桌面处于第一窗口状态,图2(b)中虚拟桌面处于第二窗口状态,明显地,图2(a)所示的第一窗口状态下的显示尺寸与图2(b)所示的第二窗口状态下的显示尺寸不同,如果虚拟桌面从图2(a)所示的第一窗口状态变成图2(b)所示的第二窗口状态,那么确定虚拟桌面在客户端上的显示尺寸发生变化。In the embodiment of the present application, the virtual desktop may be a desktop that is virtualized on the server and can be accessed through the client, and the virtual desktop is also called a cloud desktop. The operation instruction is used to indicate that the display size of the virtual desktop on the client changes. The current display size of the virtual desktop may be the changed display size of the virtual desktop. In a feasible implementation, when the virtual desktop changes from a full-screen state to a window state, determine the display of the virtual desktop on the client If the size changes, the current display size of the virtual desktop is the display size in the window state, where the window state means that the virtual desktop is in a non-full-screen state; when the virtual desktop changes from the first window state to the second window state, In this case, it is determined that the display size of the virtual desktop on the client has changed. At this time, the current display size of the virtual desktop is the display size in the second window state, wherein the display size in the first window state is the same as that in the second window state. different display sizes, that is, the display size in the first window state may be larger or smaller than the display size in the second window state; when the virtual desktop is switched from the first display screen to the In the case of the second display screen, it is determined that the display size of the virtual desktop changes on the client. At this time, the current display size of the virtual desktop is the display size switched to the second display screen, wherein the screen size of the first display screen is the same as that of the second display screen. Displays vary in screen size. Exemplarily, as shown in Figure 2(a) and Figure 2(b), the virtual desktop is in the first window state in Figure 2(a), and the virtual desktop is in the second window state in Figure 2(b), obviously, the The display size in the first window state shown in Figure 2(a) is different from the display size in the second window state shown in Figure 2(b), if the virtual desktop starts from the first window state shown in Figure 2(a) Change to the second window state shown in FIG. 2( b ), then it is determined that the display size of the virtual desktop on the client changes.
在一种可实现的方式中,可以通过虚拟桌面所在的客户端的鼠标、键盘等外部设备向服务端发送表征虚拟桌面的显示尺寸发生变化的操作指令,然后服务端在接收到客户端发送的操作指令后,基于操作指令确定虚拟桌面当前的显示尺寸。In an achievable manner, an operation command representing a change in the display size of the virtual desktop can be sent to the server through external devices such as the mouse and keyboard of the client where the virtual desktop is located, and then the server receives the operation command sent by the client. After the instruction, the current display size of the virtual desktop is determined based on the operation instruction.
步骤102、基于服务端的硬件编码器的对齐步长和当前的显示尺寸,对虚拟桌面的原始图像数据进行扩充处理,获得处理后的图像数据。Step 102 , based on the alignment step of the hardware encoder on the server side and the current display size, expand the original image data of the virtual desktop to obtain processed image data.
其中,对齐步长表征硬件编码器每次读取数据的字节数。Among them, the alignment step represents the number of bytes of data read by the hardware encoder each time.
在本申请实施例中,原始图像数据可以为发生变化后的虚拟桌面在客户端上显示的图像数据,示例地,原始图像数据可以为图2(b)中虚拟桌面处于第二窗口状态时窗口中的显示内容。处理后的图像数据是基于硬件编码器的对齐步长和当前的显示尺寸对原始图像数据进行处理后的图像数据,此时处理后的图像数据是与硬件编码器的对齐步长匹配的图像数据,也即,采用硬件编码器能够一次读取完处理后的图像数据;由于硬件编码器是按照对齐步长读取图像数据的,因此为防止硬件编码器不能一次读取完原始图像数据,需要基于硬件编码器的对齐步长和当前的显示尺寸对原始图像数据进行扩充处理,使处理后的图像数据能够被硬件编码器一次读取完,使之不存在需要逐字读取数据的情况。硬件编码器用于对原始图像数据进行处理,进一步地,硬件编码器用于读取虚拟桌面显示在客户端上的图像数据,并对该图像数据进行压缩后传输至客户端,通过对图像数据进行压缩,降低云桌面系统的通信流量,提高数据传输速率;在一种可行的实现方式中,硬件编码器可以为先进视频编码协议(Advanced Video Coding,H.264),也可以为高效率视频编码协议(HighEfficiency Video Coding,H.265),当然,硬件编码器还可以为其他编码器,本申请实施例对此不作限定。硬件编码器的对齐步长(Alignment)表征依次读取数据的字节数,该对齐步长可以预先设置,一般可以设置为2的倍数,可以根据实际业务需求设置为32以及其他数值,本申请实施例对此不作限定;通常,硬件编码器的对齐步长设置好之后,是不会随意改变的,也即是固定的。In the embodiment of the present application, the original image data can be the image data displayed on the client after the changed virtual desktop, for example, the original image data can be the window when the virtual desktop is in the second window state in Figure 2(b) display content in . The processed image data is the image data after processing the original image data based on the alignment step of the hardware encoder and the current display size. At this time, the processed image data is the image data that matches the alignment step of the hardware encoder , that is, the hardware encoder can read the processed image data at one time; since the hardware encoder reads the image data according to the alignment step, in order to prevent the hardware encoder from reading the original image data at one time, it is necessary Based on the alignment step of the hardware encoder and the current display size, the original image data is expanded, so that the processed image data can be read by the hardware encoder at one time, so that there is no need to read the data word by word. The hardware encoder is used to process the original image data. Further, the hardware encoder is used to read the image data displayed on the client by the virtual desktop, and compress the image data and transmit it to the client. By compressing the image data , reduce the communication traffic of the cloud desktop system, and increase the data transmission rate; in a feasible implementation, the hardware encoder can be Advanced Video Coding (Advanced Video Coding, H. (High Efficiency Video Coding, H.265), of course, the hardware encoder may also be other encoders, which is not limited in this embodiment of the present application. The alignment step size (Alignment) of the hardware encoder represents the number of bytes of data read in sequence. The alignment step size can be set in advance, generally can be set to a multiple of 2, and can be set to 32 or other values according to actual business needs. This application The embodiment does not limit this; usually, after the alignment step of the hardware encoder is set, it will not change arbitrarily, that is, it is fixed.
在本申请实施例中,基于硬件编码器的对齐步长和当前的显示尺寸对原始图像数据进行扩充处理得到数据大小与对齐步长匹配的处理后的图像数据,是为了在虚拟桌面的显示尺寸发生变化的情况下,也能够按照硬件编码器的对齐步长将变化后的图像数据(即原始图像数据)读取完,不会出现需要单独读取的字节,以提高数据的读取速率,进而提高编码速率,从而提升云桌面系统的整体性能。In this embodiment of the application, the original image data is expanded based on the alignment step of the hardware encoder and the current display size to obtain the processed image data whose data size matches the alignment step, so that the display size of the virtual desktop In the case of a change, the changed image data (that is, the original image data) can also be read according to the alignment step of the hardware encoder, and there will be no bytes that need to be read separately, so as to improve the data reading rate , and then increase the encoding rate, thereby improving the overall performance of the cloud desktop system.
在一种可行的实现方式中,可以确定硬件编码器的对齐步长,然后按照该对齐步长和当前的显示尺寸对原始图像数据进行扩充处理,以得到数据大小与对齐步长匹配的处理后的图像数据。In a feasible implementation, the alignment step size of the hardware encoder can be determined, and then the original image data is expanded according to the alignment step size and the current display size, so as to obtain a processed image whose data size matches the alignment step size. image data.
步骤103、通过硬件编码器读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码,获得桌面编码数据。Step 103, read the processed image data through the hardware encoder, and encode the original image data in the processed image data to obtain desktop coded data.
在本申请实施例中,桌面编码数据为对处理后的图像数据中的原始图像数据进行编码后的数据,也即,采用硬件编码器进行编码时,不是对处理后的图像数据进行编码,而是只对处理后的图像数据中的原始图像数据进行编码。通过硬件编码器读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码;实际是指,虽然读取的是处理后的图像数据,但是编码时只对原始图像数据进行编码,如此,由于处理后的图像数据的数据大小与硬件编码器的对齐步长匹配,因此通过硬件编码器能够按照对齐步长读取完处理后的图像数据,不会出现需要单独读取的字节,读取数据的速率较高;在编码时正常对原始图像数据进行编码,不对除原始图像数据之外的其余数据进行编码,因此保证了对原始图像数据进行编码的操作,所得到的桌面编码数据仅是对原始图像数据进行编码后的信息,不会产生多余操作对桌面云系统造成影响,从而提高了数据编码效率,提高了云桌面系统的整体性能。In the embodiment of the present application, the desktop encoded data is the data after encoding the original image data in the processed image data, that is, when encoding with a hardware encoder, the processed image data is not encoded, but It is to encode only the original image data in the processed image data. Read the processed image data through the hardware encoder, and encode the original image data in the processed image data; in fact, although the processed image data is read, only the original image data is encoded Encoding, so that since the data size of the processed image data matches the alignment step of the hardware encoder, the processed image data can be read according to the alignment step through the hardware encoder, and there will be no need to read it separately Bytes, the rate of reading data is high; during encoding, the original image data is normally encoded, and the rest of the data except the original image data is not encoded, so the operation of encoding the original image data is guaranteed, and the obtained The desktop encoding data is only the information after encoding the original image data, and no redundant operations will affect the desktop cloud system, thereby improving the data encoding efficiency and improving the overall performance of the cloud desktop system.
在一种可实现的方式中,可以通过硬件编码器按照对齐步长读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码得到桌面编码数据。In a practicable manner, the processed image data may be read by a hardware encoder according to the alignment step, and the original image data in the processed image data may be encoded to obtain desktop encoded data.
在本申请其他实施例中,可以在服务端中设置一个编码加速卡,该编码加速卡可以为专门用于对数据进行编码的芯片,如此,在编码加速卡上执行通过硬件编码器按照读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码得到桌面编码数据的步骤,能够进一步提高编码的效率,减少云桌面系统的资源占用率。In other embodiments of the present application, an encoding acceleration card can be set in the server, and the encoding acceleration card can be a chip specially used for encoding data, so that the encoding acceleration card is executed on the encoding acceleration card through the hardware encoder to read The step of processing the processed image data and encoding the original image data in the processed image data to obtain desktop coded data can further improve the coding efficiency and reduce the resource occupancy rate of the cloud desktop system.
步骤104、将桌面编码数据发送到客户端。Step 104, sending the desktop encoded data to the client.
在本申请实施例中,将桌面编码数据发送至客户端后,客户端就可以基于桌面编码数据在目标桌面上原始图像数据;在一种可实现的方式中,客户端可以在接收到桌面编码数据后,对桌面编码数据进行解码处理,得到原始图像数据,然后将原始图像数据显示在客户端的虚拟桌面上。In this embodiment of the application, after the desktop encoding data is sent to the client, the client can generate original image data on the target desktop based on the desktop encoding data; After receiving the data, the coded desktop data is decoded to obtain the original image data, and then the original image data is displayed on the virtual desktop of the client.
在本申请实施例中,相关技术中在虚拟桌面的显示尺寸发生变化的情况下,变化后的虚拟桌面对应的显示内容与目标编码器的步长不匹配,在读取时存在需要单独读取的字节,读取信息的速率较低;而本申请实施例中的虚拟桌面的图像处理方法通过硬件编码器读取的处理后的图像数据是与硬件编码器的对齐步长匹配的数据,因此通过对齐步长能够读取完处理后的图像数据,不存在需要单独读取的字节,读取数据的速率比相关技术中读取数据的速率高,且处理时只对处理后的图像数据中的原始图像数据进行处理,因此不会产生多余操作对桌面云系统造成影响,降低了处理时所消耗的时间,提高了信息编码效率,进而提高了云桌面系统的整体性能。In the embodiment of this application, when the display size of the virtual desktop changes in the related art, the display content corresponding to the changed virtual desktop does not match the step size of the target encoder, and there is a need to read it separately bytes, the rate of reading information is low; and the image processing method of the virtual desktop in the embodiment of the present application reads the processed image data through the hardware encoder is the data that matches the alignment step of the hardware encoder, Therefore, the processed image data can be read through the alignment step, and there are no bytes that need to be read separately. The rate of reading data is higher than the rate of reading data in the related art, and only the processed image is processed. The original image data in the data is processed, so redundant operations will not affect the desktop cloud system, reduce the time consumed in processing, improve the information coding efficiency, and then improve the overall performance of the cloud desktop system.
本申请实施例所提供的虚拟桌面的图像处理方法,由于处理后的图像数据是基于硬件编码器的对齐步长对虚拟桌面的原始图像数据进行扩充处理后得到的,因此处理的图像数据的数据大小与硬件编码器的对齐步长是匹配的,因此通过硬件编码器能够按照对齐步长读取完处理后的图像数据,不存在需要单独读取的字节,读取数据的速率较高,且编码时只对处理后的图像数据中的原始图像数据进行编码,不会增加多余操作,因此降低了处理所消耗的时间,提高了数据编码效率,进而提高了虚拟桌面的整体性能,解决了相关技术中的在云桌面的大小发生改变后,编码器无法按照固定字节数读取画面中的信息,只能逐字读取,导致编码器读取信息的效率降低且增加了编码的整体耗时的问题。In the image processing method of the virtual desktop provided by the embodiment of the present application, since the processed image data is obtained by expanding the original image data of the virtual desktop based on the alignment step of the hardware encoder, the data of the processed image data The size matches the alignment step of the hardware encoder, so the processed image data can be read by the hardware encoder according to the alignment step, there are no bytes that need to be read separately, and the rate of reading data is high. And when encoding, only the original image data in the processed image data is encoded, and no redundant operations are added, so the time consumed for processing is reduced, the data encoding efficiency is improved, and the overall performance of the virtual desktop is improved. In the related technology, after the size of the cloud desktop changes, the encoder cannot read the information in the screen according to the fixed number of bytes, but can only read word by word, which reduces the efficiency of the encoder to read information and increases the overall coding efficiency. time consuming problem.
基于前述实施例,本申请实施例提供一种虚拟桌面的图像处理方法,参照图3所示,该方法包括以下步骤:Based on the foregoing embodiments, an embodiment of the present application provides an image processing method for a virtual desktop, as shown in FIG. 3 , the method includes the following steps:
步骤201、在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,服务端根据客户端发送的虚拟桌面在客户端的显示屏上显示的坐标和虚拟桌面未发生变化前的显示尺寸,确定当前的显示尺寸。Step 201, after receiving the operation command representing the change of the display size of the virtual desktop on the client, the server sends the coordinates of the virtual desktop on the display screen of the client and the display size of the virtual desktop before the change, Determines the current display size.
其中,显示尺寸发生变化,包括:虚拟桌面从全屏状态变成窗口状态;或者,虚拟桌面从第一窗口状态变成第二窗口状态;或者,虚拟桌面从第一显示屏切换到第二显示屏。Wherein, the display size changes, including: the virtual desktop changes from the full screen state to the window state; or, the virtual desktop changes from the first window state to the second window state; or, the virtual desktop switches from the first display screen to the second display screen .
在本申请实施例中,操作指令可以携带有虚拟桌面在客户端的显示屏上显示的坐标,如此就可以确定虚拟桌面在客户端上显示的坐标,进而根据显示坐标和虚拟桌面未发生变化前的显示尺寸,确定当前的显示尺寸。当前的显示尺寸为虚拟桌面发生变化后的显示尺寸。示例地,未发生变化前的显示尺寸可以为图2(a)所示的虚拟桌面处于第一窗口状态下的显示尺寸,显示坐标为图2(b)所示的虚拟桌面处于第二窗口状态下的坐标,当前的显示尺寸为图2(b)所示的虚拟桌面处于第二窗口状态下的显示尺寸。In the embodiment of the present application, the operation command may carry the coordinates displayed on the display screen of the virtual desktop on the client, so that the coordinates displayed on the client can be determined, and then according to the display coordinates and the virtual desktop before the change Display size, to determine the current display size. The current display size is the display size after the virtual desktop changes. For example, the display size before no change can be the display size of the virtual desktop shown in Figure 2(a) in the first window state, and the display coordinates are the virtual desktop shown in Figure 2(b) in the second window state The coordinates below, the current display size is the display size of the virtual desktop shown in Figure 2(b) in the second window state.
在一种可实现的方式中,可以从服务端自身的存储器中获取虚拟桌面未发生变化前的显示尺寸,然后根据操作指令中携带的显示坐标和未发生变化前的显示尺寸确定虚拟桌面的变化情况,进而确定出虚拟桌面发生变化后的显示尺寸(即当前的显示尺寸)。In an achievable manner, the display size of the virtual desktop before the change can be obtained from the server's own storage, and then the change of the virtual desktop can be determined according to the display coordinates carried in the operation instruction and the display size before the change situation, and then determine the display size of the virtual desktop after the change (ie, the current display size).
步骤202、服务端基于当前的显示尺寸和对齐步长,得到处理后的图像数据具有的虚宽和虚高。Step 202, the server obtains the virtual width and virtual height of the processed image data based on the current display size and alignment step.
在本申请实施例中,处理后的图像数据具有的虚宽和虚高是基于对齐步长对当前的显示尺寸进行处理后得到的。在一种可实现的方式中,可以基于对齐步长对当前的显示尺寸进行扩充处理,得到处理后的图像数据具有的虚宽和虚高。In the embodiment of the present application, the virtual width and virtual height of the processed image data are obtained after processing the current display size based on the alignment step. In a practicable manner, the current display size may be expanded based on the alignment step to obtain the virtual width and virtual height of the processed image data.
其中,步骤202可以通过以下步骤来实现:Wherein, step 202 can be realized through the following steps:
步骤202a、服务端确定硬件编码器的对齐步长。Step 202a, the server determines the alignment step of the hardware encoder.
其中,对齐步长表征硬件编码器每次读取数据的字节数。Among them, the alignment step represents the number of bytes of data read by the hardware encoder each time.
在本申请实施例中,可以预先设置好硬件编码器的步长,如此服务端就可以基于硬件编码器的对齐步长进行后续处理。In the embodiment of this application, the step size of the hardware encoder can be set in advance, so that the server can perform subsequent processing based on the alignment step size of the hardware encoder.
步骤202b、服务端基于对齐步长对虚拟桌面的实际宽和实际高进行处理,得到虚宽和虚高。Step 202b, the server processes the actual width and height of the virtual desktop based on the alignment step to obtain the virtual width and virtual height.
其中,当前的显示尺寸包括实际宽和实际高。Wherein, the current display size includes actual width and actual height.
在本申请实施例中,由于硬件编码器在读取数据时是按照对齐步长读取的,因此需要将原始图像数据的显示尺寸调整为与对齐步长匹配的显示尺寸,便于后续读取图像数据。当前显示尺寸中的实际宽和实际高可以是图2(b)所示的虚拟桌面处于第二窗口状态下的宽和高,虚宽和虚高是对实际宽和实际高进行处理后得到的与对齐步长匹配的宽和高。In the embodiment of this application, since the hardware encoder reads data according to the alignment step, it is necessary to adjust the display size of the original image data to the display size that matches the alignment step, so as to facilitate subsequent image reading data. The actual width and actual height in the current display size can be the width and height of the virtual desktop shown in Figure 2(b) in the second window state, and the virtual width and virtual height are obtained after processing the actual width and actual height Width and height to match the alignment step.
在一种可实现的方式中,可以基于对齐步长分别对实际宽和实际高进行映射,以得到与对齐步长匹配的虚宽和虚高。In a practicable manner, the actual width and the actual height may be respectively mapped based on the alignment step to obtain virtual width and virtual height matching the alignment step.
在一种可行的方式中,如果对齐步长为32,实际宽为63,实际高为31,那么基于对齐步长对实际高进行映射得到的虚高为32,基于对齐步长对实际宽进行映射得到的虚宽为64;也就是说,基于对齐步长调整后的虚宽和虚高要能够被32整除,此时虚高和虚高均与对齐步长匹配。In a feasible way, if the alignment step is 32, the actual width is 63, and the actual height is 31, then the virtual height obtained by mapping the actual height based on the alignment step is 32, and the actual width is mapped based on the alignment step The virtual width obtained by mapping is 64; that is, the adjusted virtual width and virtual height based on the alignment step must be divisible by 32, and at this time, both the virtual height and virtual height match the alignment step.
步骤203、服务端根据虚宽和虚高对原始图像数据进行扩充处理,得到处理后的图像数据。Step 203, the server performs expansion processing on the original image data according to the virtual width and virtual height, and obtains the processed image data.
在本申请实施例中,根据虚宽和虚高对原始图像数据进行扩充处理,是为了使处理后的图像数据与对齐步长匹配,使通过硬件编码器读取数据时,能够一次读取完,不会存在需要单独读取的字节,以提高数据的读取效率。In the embodiment of this application, the purpose of expanding the original image data according to the virtual width and virtual height is to match the processed image data with the alignment step, so that when the data is read by the hardware encoder, it can be read at one time. , there will be no bytes that need to be read separately to improve the efficiency of data reading.
在本申请实施例中,可以将实际宽和实际高对应的显示尺寸(即当前的显示尺寸)称之为第一显示尺寸,将虚宽和虚高称之为第二显示尺寸,由于第二显示尺寸是基于对齐步长对第一显示尺寸进行扩充处理后的显示尺寸,因此第二显示尺寸大于第一显示尺寸,此时还需要将显示尺寸为第一显示尺寸的原始图像数据扩充为显示尺寸为第二显示尺寸的处理后的图像数据;由于第二显示尺寸与对齐步长匹配,因此得到的处理后的图像数据的信息大小与对齐步长匹配。In this embodiment of the application, the display size corresponding to the actual width and height (that is, the current display size) can be called the first display size, and the virtual width and virtual height can be called the second display size, because the second The display size is the display size after expanding the first display size based on the alignment step, so the second display size is larger than the first display size. At this time, the original image data whose display size is the first display size needs to be expanded to display The processed image data whose size is the second display size; since the second display size matches the alignment step, the information size of the obtained processed image data matches the alignment step.
在一种可实现的方式中,可以根据虚宽和虚高对原始图像数据中的内容进行填补以得到处理后的图像数据。In a practicable manner, content in the original image data may be filled according to the virtual width and virtual height to obtain processed image data.
步骤204、服务端通过硬件编码器按照对齐步长,读取处理后的图像数据。Step 204, the server reads the processed image data through the hardware encoder according to the alignment step.
在本申请实施例中,由于处理后的图像数据与硬件编码器的对齐步长匹配,因此通过硬件编码器按照对齐步长能够读取完处理后的图像数据,不会存在需要单独读取的字节,提高了数据读取的速率。In the embodiment of the present application, since the processed image data matches the alignment step of the hardware encoder, the processed image data can be read through the hardware encoder according to the alignment step, and there is no need to read it separately. bytes, increasing the rate at which data is read.
步骤205、服务端通过硬件编码器对原始图像数据进行编码,得到桌面编码数据。Step 205, the server encodes the original image data through the hardware encoder to obtain desktop encoded data.
在本申请实施例中,可以通过硬件编码器只对处理后的图像数据中的原始图像数据进行编码,实现对原始图像数据进行编码的操作,不增加对填补内容进行编码的操作,因此不会产生多余操作对桌面云系统造成影响。In the embodiment of this application, only the original image data in the processed image data can be encoded by the hardware encoder to realize the operation of encoding the original image data, without adding the operation of encoding the filling content, so there will be no The generation of redundant operations will affect the desktop cloud system.
步骤206、服务端将桌面编码数据发送到客户端。Step 206, the server sends the desktop coded data to the client.
在本申请实施例中,基于硬件编码器的对齐步长对第一显示尺寸进行调整得到与步长匹配的第二显示尺寸,进而基于第二显示尺寸对第一显示信息进行扩充处理得到数据大小与对齐步长匹配的处理后的图像数据,如此,在编码时,通过硬件编码器按照对齐步长读取处理后的图像数据,能够提高数据读取的速率,通过硬件编码器只对处理后的图像数据中的原始图像数据进行编码,不增加对增补内容编码的操作,因此不会产生多余操作对桌面云系统造成影响,从而提高了数据编码效率,提高了云桌面系统的整体性能。In this embodiment of the application, the first display size is adjusted based on the alignment step of the hardware encoder to obtain a second display size that matches the step, and then the first display information is expanded based on the second display size to obtain the data size The processed image data that matches the alignment step. In this way, when encoding, the processed image data is read by the hardware encoder according to the alignment step, which can improve the data reading rate. Only the processed image data is processed by the hardware encoder. The original image data in the image data is encoded, and the operation of encoding the supplementary content is not increased, so redundant operations will not affect the desktop cloud system, thereby improving the data encoding efficiency and improving the overall performance of the cloud desktop system.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for descriptions of the same steps and content in this embodiment as in other embodiments, reference may be made to the descriptions in other embodiments, and details are not repeated here.
本申请实施例所提供的虚拟桌面的图像处理方法,由于处理后的图像数据是基于硬件编码器的对齐步长对虚拟桌面的原始图像数据进行扩充处理后得到的,因此处理的图像数据的数据大小与硬件编码器的对齐步长是匹配的,因此通过硬件编码器能够按照对齐步长读取完处理后的图像数据,不存在需要单独读取的字节,读取数据的速率较高,且编码时只对处理后的图像数据中的原始图像数据进行编码,不会增加多余操作,因此降低了处理所消耗的时间,提高了数据编码效率,进而提高了虚拟桌面的整体性能,解决了相关技术中的在云桌面的大小发生改变后,编码器无法按照固定字节数读取画面中的信息,只能逐字读取,导致编码器读取信息的效率降低且增加了编码的整体耗时的问题。In the image processing method of the virtual desktop provided by the embodiment of the present application, since the processed image data is obtained by expanding the original image data of the virtual desktop based on the alignment step of the hardware encoder, the data of the processed image data The size matches the alignment step of the hardware encoder, so the processed image data can be read by the hardware encoder according to the alignment step, there are no bytes that need to be read separately, and the rate of reading data is high. And when encoding, only the original image data in the processed image data is encoded, and no redundant operations are added, so the time consumed for processing is reduced, the data encoding efficiency is improved, and the overall performance of the virtual desktop is improved. In the related technology, after the size of the cloud desktop changes, the encoder cannot read the information in the screen according to the fixed number of bytes, but can only read word by word, which reduces the efficiency of the encoder to read information and increases the overall coding efficiency. time consuming problem.
基于前述实施例,本申请实施例提供一种虚拟桌面的图像处理方法,参照图4所示,该方法包括以下步骤:Based on the foregoing embodiments, an embodiment of the present application provides an image processing method for a virtual desktop, as shown in FIG. 4 , the method includes the following steps:
步骤301、在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,服务端根据客户端发送的虚拟桌面在客户端的显示屏上显示的坐标和虚拟桌面未发生变化前的显示尺寸,确定当前的显示尺寸。Step 301. After receiving the operation command representing the change of the display size of the virtual desktop on the client, the server sends the virtual desktop according to the coordinates of the virtual desktop displayed on the client's display screen and the display size of the virtual desktop before the change. Determines the current display size.
其中,显示尺寸发生变化,包括:虚拟桌面从全屏状态变成窗口状态;或者,虚拟桌面从第一窗口状态变成第二窗口状态;或者,虚拟桌面从第一显示屏切换到第二显示屏。Wherein, the display size changes, including: the virtual desktop changes from the full screen state to the window state; or, the virtual desktop changes from the first window state to the second window state; or, the virtual desktop switches from the first display screen to the second display screen .
在本申请实施例中,服务端与客户端之间可以通过目标传输协议进行通信,目标传输协议包括但不限于SPICE协议、远程桌面协议(Remote Desktop Protocol,RDP)、个人计算机网络互连协议(Personal Computer over Internet Protocol,PCoIP)、独立计算体系结构(Independent Computing Architecture,ICA)协议、高清体验(High DefinitionExperience,HDX)协议、远程帧缓冲(Remote Frame Buffer,RFB)协议。In the embodiment of this application, the server and the client can communicate through the target transmission protocol, the target transmission protocol includes but not limited to SPICE protocol, Remote Desktop Protocol (Remote Desktop Protocol, RDP), personal computer network interconnection protocol ( Personal Computer over Internet Protocol, PCoIP), Independent Computing Architecture (Independent Computing Architecture, ICA) protocol, High Definition Experience (High Definition Experience, HDX) protocol, Remote Frame Buffer (Remote Frame Buffer, RFB) protocol.
在一种可实现的方式中,可以通过目标传输协议(SPICE协议)获取操作指令中携带的显示坐标,然后基于显示坐标和未发生变化前的显示尺寸得到当前的显示尺寸。In a practicable manner, the display coordinates carried in the operation instruction can be obtained through the object transfer protocol (SPICE protocol), and then the current display size can be obtained based on the display coordinates and the display size before the change.
步骤302、服务端确定硬件编码器的对齐步长。Step 302, the server determines the alignment step of the hardware encoder.
其中,步长表征目标编码器每次读取数据的字节数。Among them, the step size represents the number of bytes of data read by the target encoder each time.
步骤303、服务端确定对齐步长与实际宽和实际高之间的差异。Step 303, the server determines the difference between the alignment step and the actual width and height.
其中,当前的显示尺寸包括实际宽和实际高。Wherein, the current display size includes actual width and actual height.
在本申请实施例中,第二显示尺寸(即虚宽和虚高)与对齐步长匹配,也即,第二显示尺寸能够被对齐步长整除,也即,第二显示尺寸与对齐步长之间的关系为倍数关系,因此可以基于倍数关系,确定对齐步长与第一显示尺寸(即实际宽和实际高)之间的差异;在一种可行的方式中,如果对齐步长为32,虚拟桌面的实际宽为63,虚拟当前显示尺中的实际高为31,那么对齐步长与实际宽和实际高之间的差异均为1。In the embodiment of the present application, the second display size (that is, virtual width and virtual height) matches the alignment step, that is, the second display size can be divisible by the alignment step, that is, the second display size and the alignment step The relationship between is a multiple relationship, so the difference between the alignment step and the first display size (that is, the actual width and actual height) can be determined based on the multiple relationship; in a feasible way, if the alignment step is 32 , the actual width of the virtual desktop is 63, and the actual height in the virtual current display ruler is 31, then the difference between the alignment step and the actual width and height is 1.
步骤304、服务端根据差异对实际宽和实际高进行扩充处理,得到虚宽和虚高。Step 304, the server expands the actual width and height according to the difference to obtain the virtual width and height.
在本申请实施例中,可以将第一显示尺寸的实际宽与对应的差异进行运算处理,将第一显示尺寸的实际高与对应的差异进行运算处理,以得到第二显示尺寸下的虚高和虚宽;在一种可实现的方式中,可以实际宽与对应的差异进行相加,将实际高与对应的差异进行相加,得到虚宽和虚高(即第二显示尺寸)。In this embodiment of the application, the actual width of the first display size and the corresponding difference can be calculated, and the actual height of the first display size and the corresponding difference can be calculated to obtain the virtual height at the second display size and imaginary width; in an achievable manner, the actual width and the corresponding difference can be added, and the actual height and the corresponding difference can be added to obtain the imaginary width and the imaginary height (that is, the second display size).
步骤305、服务端根据虚宽和虚高对原始图像数据进行扩充,得到扩充后的图像数据。Step 305, the server expands the original image data according to the virtual width and virtual height, and obtains the expanded image data.
在本申请实施例中,基于虚宽和虚高对原始图像数据进行扩充,也即将原始图像数据的显示尺寸扩充为第二显示尺寸(即虚宽和虚高)。In the embodiment of the present application, the original image data is expanded based on the virtual width and virtual height, that is, the display size of the original image data is expanded to a second display size (ie virtual width and virtual height).
步骤306、服务端基于目标字符对扩充后的图像数据进行填补,得到处理后的图像数据。In step 306, the server fills the expanded image data based on the target character to obtain processed image data.
在本申请实施例中,目标字符可以为不对第一显示信息的显示内容产生影响的字符,如此,基于目标字符对扩充后的第一显示信息进行填补的内容,不会对后续编码产生影响。在一种可行的方式中,目标字符可以为0,这种情况下,将扩充后的图像数据中的扩充部分均填补为0,得到处理后的图像数据。In this embodiment of the present application, the target character may be a character that does not affect the display content of the first display information. In this way, content filled in the expanded first display information based on the target character will not affect subsequent encoding. In a feasible manner, the target character may be 0. In this case, the expanded part in the expanded image data is all filled with 0 to obtain the processed image data.
在本申请实施例中,由于处理后的图像数据是存储在服务端的内存中的,而数据是按照对齐步长的倍数进行存储的,因此处理后的图像数据在存储时也就实现了内存对齐,不会存在空闲内存。In the embodiment of this application, since the processed image data is stored in the memory of the server, and the data is stored in multiples of the alignment step, the processed image data is also stored in memory alignment , there will be no free memory.
步骤307、服务端通过硬件编码器按照对齐步长,读取处理后的图像数据。Step 307, the server reads the processed image data through the hardware encoder according to the alignment step.
在本申请实施例中,可以通过目标传输协议调用硬件编码器按照对齐步长读取处理后的图像数据,也即,可以通过SPICE协议调用H265编码器按照对齐步长读取处理后的图像数据。In the embodiment of this application, the hardware encoder can be called through the target transmission protocol to read the processed image data according to the alignment step, that is, the H265 encoder can be called through the SPICE protocol to read the processed image data according to the alignment step .
步骤308、服务端通过硬件编码器对原始图像数据进行编码,得到桌面编码数据。Step 308, the server encodes the original image data through the hardware encoder to obtain desktop encoded data.
在本申请实施例中,通过目标传输协议调用硬件编码器按照对齐步长将处理后的图像数据读取至编码加速卡,以在编码加速卡上执行对处理后的图像数据中的原始图像数据进行编码的操作,得到桌面编码数据。In the embodiment of the present application, the hardware encoder is invoked through the target transmission protocol to read the processed image data to the encoding accelerator card according to the alignment step, so that the original image data in the processed image data can be executed on the encoding accelerator card. Perform coding operations to obtain desktop coded data.
步骤309、服务端将桌面编码数据发送到客户端。Step 309, the server sends the desktop coded data to the client.
在本申请实施例中,基于目标字符对扩充后的图像数据进行填补得到处理后的图像数据,所填补的内容不会对原始图像数据产生影响,便于通过硬件编码器只对处理后的图像数据中的原始图像数据进行编码,不增加对填补内容编码的操作因此不会产生多余操作对桌面云系统造成影响,从而因此提高了数据编码效率,提高了云桌面系统的整体性能。In the embodiment of the present application, the processed image data is obtained by padding the expanded image data based on the target characters. The filled content will not affect the original image data, so that only the processed image data can be processed by the hardware encoder. The original image data in the image is encoded, and the operation of filling content encoding is not added, so redundant operations will not affect the desktop cloud system, thereby improving the data encoding efficiency and improving the overall performance of the cloud desktop system.
如图5所示,用户可以通过客户端任意伸缩云桌面的桌面大小,此时客户端会向服务端表征云桌面的桌面大小发生变化的操作指令;服务端在接收到该操作指令后,可以通过SPICE协议获取云桌面的实际宽和实际高,然后根据H265编码器的对齐步长对云桌面的实际宽和实际高进行调整得到对齐后的虚高和虚高,接着基于虚高和虚高对原始图像数据进行扩充处理得到处理后的图像数据,通过H265编码器按照对齐步长读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码得到桌面编码数据,发送桌面编码数据至客户端,以使客户端基于桌面编码数据在云桌面上显示原始图像数据对应的内容。As shown in Figure 5, the user can arbitrarily scale the desktop size of the cloud desktop through the client. At this time, the client will represent the operation command of the change in the size of the cloud desktop to the server; after receiving the operation command, the server can Obtain the actual width and height of the cloud desktop through the SPICE protocol, and then adjust the actual width and height of the cloud desktop according to the alignment step of the H265 encoder to obtain the aligned virtual height and virtual height, and then based on the virtual height and virtual height Expand the original image data to obtain the processed image data, read the processed image data according to the alignment step through the H265 encoder, and encode the original image data in the processed image data to obtain the desktop coded data, send The desktop coded data is sent to the client, so that the client displays the content corresponding to the original image data on the cloud desktop based on the desktop coded data.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for descriptions of the same steps and content in this embodiment as in other embodiments, reference may be made to the descriptions in other embodiments, and details are not repeated here.
本申请实施例所提供的虚拟桌面的图像处理方法,由于处理后的图像数据是基于硬件编码器的对齐步长对虚拟桌面的原始图像数据进行扩充处理后得到的,因此处理的图像数据的数据大小与硬件编码器的对齐步长是匹配的,因此通过硬件编码器能够按照对齐步长读取完处理后的图像数据,不存在需要单独读取的字节,读取数据的速率较高,且编码时只对处理后的图像数据中的原始图像数据进行编码,不会增加多余操作,因此降低了处理所消耗的时间,提高了数据编码效率,进而提高了虚拟桌面的整体性能,解决了相关技术中的在云桌面的大小发生改变后,编码器无法按照固定字节数读取画面中的信息,只能逐字读取,导致编码器读取信息的效率降低且增加了编码的整体耗时的问题。In the image processing method of the virtual desktop provided by the embodiment of the present application, since the processed image data is obtained by expanding the original image data of the virtual desktop based on the alignment step of the hardware encoder, the data of the processed image data The size matches the alignment step of the hardware encoder, so the processed image data can be read by the hardware encoder according to the alignment step, there are no bytes that need to be read separately, and the rate of reading data is high. And when encoding, only the original image data in the processed image data is encoded, and no redundant operations are added, so the time consumed for processing is reduced, the data encoding efficiency is improved, and the overall performance of the virtual desktop is improved. In the related technology, after the size of the cloud desktop changes, the encoder cannot read the information in the screen according to the fixed number of bytes, but can only read word by word, which reduces the efficiency of the encoder to read information and increases the overall coding efficiency. time consuming problem.
基于前述实施例,本申请实施例提供一种虚拟桌面的图像处理装置,该虚拟桌面的图像处理装置可以应用于图1和3~4对应的实施例提供的虚拟桌面的图像处理方法中,参照图6所示,该虚拟桌面的图像处理装置4可以包括:Based on the aforementioned embodiments, this embodiment of the present application provides an image processing device for a virtual desktop. The image processing device for a virtual desktop can be applied to the image processing method for a virtual desktop provided in the embodiments corresponding to FIGS. 1 and 3-4. Refer to As shown in Figure 6, the image processing device 4 of the virtual desktop can include:
处理单元41,用于在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,确定虚拟桌面当前的显示尺寸;The processing unit 41 is configured to determine the current display size of the virtual desktop after receiving an operation instruction representing a change in the display size of the virtual desktop on the client;
处理单元41,还用于基于服务端的硬件编码器的对齐步长和当前的显示尺寸,对虚拟桌面的原始图像数据进行扩充处理,获得处理后的图像数据;对齐步长表征硬件编码器每次读取数据的字节数;The processing unit 41 is also used to expand the original image data of the virtual desktop based on the alignment step of the hardware encoder on the server side and the current display size to obtain processed image data; the alignment step represents the hardware encoder each time The number of bytes of read data;
处理单元41,还用于通过硬件编码器读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码,获得桌面编码数据;The processing unit 41 is further configured to read the processed image data through a hardware encoder, and encode the original image data in the processed image data to obtain desktop coded data;
发送单元42,用于将桌面编码数据发送到客户端。The sending unit 42 is configured to send the desktop encoded data to the client.
在本申请的其他实施例中,显示尺寸发生变化,包括:In other embodiments of the application, the display size changes, including:
虚拟桌面从全屏状态变成窗口状态;或者,The virtual desktop changes from a full-screen state to a windowed state; or,
虚拟桌面从第一窗口状态变成第二窗口状态;或者,The virtual desktop changes from the first window state to the second window state; or,
虚拟桌面从第一显示屏切换到第二显示屏。The virtual desktop switches from the first display to the second display.
在本申请的其他实施例中,处理单元41还用于实现以下步骤:In other embodiments of the present application, the processing unit 41 is also configured to implement the following steps:
根据客户端发送的虚拟桌面在客户端的显示屏上显示的坐标和虚拟桌面未发生变化前的显示尺寸,确定当前的显示尺寸;Determine the current display size according to the coordinates displayed on the client's display screen of the virtual desktop sent by the client and the display size of the virtual desktop before it changes;
相应的,处理单元41,还用于实现以下步骤:Correspondingly, the processing unit 41 is also configured to implement the following steps:
基于当前的显示尺寸和对齐步长,得到处理后的图像数据具有的虚宽和虚高;Based on the current display size and alignment step, obtain the virtual width and virtual height of the processed image data;
根据虚宽和虚高对原始图像数据进行扩充处理,得到处理后的图像数据。The original image data is expanded according to the virtual width and virtual height to obtain the processed image data.
在本申请的其他实施例中,处理单元41还用于实现以下步骤:In other embodiments of the present application, the processing unit 41 is also configured to implement the following steps:
确定硬件编码器的对齐步长;Determine the alignment step size of the hardware encoder;
基于对齐步长对虚拟桌面的实际宽和实际高进行处理,得到虚高和虚高;当前的显示尺寸包括实际宽和实际高。Process the actual width and height of the virtual desktop based on the alignment step to obtain the virtual height and height; the current display size includes the actual width and height.
在本申请的其他实施例中,处理单元41还用于实现以下步骤:In other embodiments of the present application, the processing unit 41 is also configured to implement the following steps:
确定对齐步长与实际宽和实际高之间的差异;Determine the difference between the alignment step and the actual width and height;
根据差异对实际宽和实际高进行扩充处理,得到虚宽和虚高;虚宽和虚高是对齐步长的整数倍。The actual width and height are expanded according to the difference to obtain the virtual width and virtual height; the virtual width and virtual height are integer multiples of the alignment step.
在本申请的其他实施例中,处理单元41还用于实现以下步骤:In other embodiments of the present application, the processing unit 41 is also configured to implement the following steps:
根据虚高和虚宽对原始图像数据进行扩充,得到扩充后的图像数据;Expand the original image data according to the virtual height and virtual width to obtain the expanded image data;
根据目标字符对扩充后的图像数据进行填补,得到处理后的图像数据。The expanded image data is filled according to the target character to obtain the processed image data.
在本申请的其他实施例中,处理单元41还用于实现以下步骤:In other embodiments of the present application, the processing unit 41 is also configured to implement the following steps:
通过硬件编码器按照对齐步长,读取处理后的图像数据;Read the processed image data through the hardware encoder according to the alignment step;
通过硬件编码器对原始图像数据进行编码,得到桌面编码数据。The original image data is encoded by a hardware encoder to obtain desktop encoded data.
需要说明的是,各个单元所执行的步骤的具体说明可以参照图1和3~4对应的实施例提供的虚拟桌面的图像处理方法中的实现过程,此处不再赘述。It should be noted that, for a specific description of the steps performed by each unit, reference may be made to the implementation process in the image processing method for a virtual desktop provided in the embodiments corresponding to FIGS. 1 and 3-4 , which will not be repeated here.
本申请实施例所提供的虚拟桌面的图像处理装置,由于处理后的图像数据是基于硬件编码器的对齐步长对虚拟桌面的原始图像数据进行扩充处理后得到的,因此处理的图像数据的数据大小与硬件编码器的对齐步长是匹配的,因此通过硬件编码器能够按照对齐步长读取完处理后的图像数据,不存在需要单独读取的字节,读取数据的速率较高,且编码时只对处理后的图像数据中的原始图像数据进行编码,不会增加多余操作,因此降低了处理所消耗的时间,提高了数据编码效率,进而提高了虚拟桌面的整体性能,解决了相关技术中的在云桌面的大小发生改变后,编码器无法按照固定字节数读取画面中的信息,只能逐字读取,导致编码器读取信息的效率降低且增加了编码的整体耗时的问题。In the image processing device for the virtual desktop provided by the embodiment of the present application, since the processed image data is obtained by expanding the original image data of the virtual desktop based on the alignment step of the hardware encoder, the data of the processed image data The size matches the alignment step of the hardware encoder, so the processed image data can be read by the hardware encoder according to the alignment step, there are no bytes that need to be read separately, and the data is read at a high rate. And when encoding, only the original image data in the processed image data is encoded, and no redundant operations are added, so the time consumed for processing is reduced, the data encoding efficiency is improved, and the overall performance of the virtual desktop is improved. In the related technology, after the size of the cloud desktop changes, the encoder cannot read the information in the screen according to the fixed number of bytes, but can only read word by word, which reduces the efficiency of the encoder to read information and increases the overall coding efficiency. time consuming problem.
基于前述实施例,本申请的实施例提供一种服务端,该服务端可以应用于图1和3~4对应的实施例提供的虚拟桌面的图像处理方法中,参照图7所示,该服务端5可以包括:处理器51、存储器52和通信总线53,其中:Based on the foregoing embodiments, the embodiments of the present application provide a server, which can be applied to the image processing method of the virtual desktop provided in the embodiments corresponding to Figures 1 and 3-4, as shown in Figure 7, the service Terminal 5 may include: processor 51, memory 52 and communication bus 53, wherein:
通信总线53用于实现处理器51和存储器52之间的通信连接;The communication bus 53 is used to realize the communication connection between the processor 51 and the memory 52;
处理器51用于执行存储器52中的虚拟桌面的图像处理程序,以实现以下步骤:The processor 51 is used to execute the image processing program of the virtual desktop in the memory 52, so as to realize the following steps:
在接收到表征虚拟桌面在客户端的显示尺寸发生变化的操作指令后,确定虚拟桌面当前的显示尺寸;After receiving an operation instruction representing a change in the display size of the virtual desktop on the client, determine the current display size of the virtual desktop;
基于服务端的硬件编码器的对齐步长和当前的显示尺寸,对虚拟桌面的原始图像数据进行扩充处理,获得处理后的图像数据;对齐步长表征硬件编码器每次读取数据的字节数;Based on the alignment step of the server-side hardware encoder and the current display size, the original image data of the virtual desktop is expanded to obtain the processed image data; the alignment step represents the number of bytes of data read by the hardware encoder each time ;
通过硬件编码器读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码,获得桌面编码数据;The processed image data is read by a hardware encoder, and the original image data in the processed image data is encoded to obtain desktop encoded data;
将桌面编码数据发送到客户端。Send desktop encoded data to client.
在本申请的其他实施例中,显示尺寸发生变化,包括:In other embodiments of the application, the display size changes, including:
虚拟桌面从全屏状态变成窗口状态;或者,The virtual desktop changes from a full-screen state to a windowed state; or,
虚拟桌面从第一窗口状态变成第二窗口状态;或者,The virtual desktop changes from the first window state to the second window state; or,
虚拟桌面从第一显示屏切换到第二显示屏。The virtual desktop switches from the first display to the second display.
在本申请的其他实施例中,处理器51用于执行存储器52中的虚拟桌面的图像处理程序的确定虚拟桌面当前的显示尺寸,以实现以下步骤:In other embodiments of the present application, the processor 51 is used to execute the image processing program of the virtual desktop in the memory 52 to determine the current display size of the virtual desktop, so as to implement the following steps:
根据客户端发送的虚拟桌面在客户端的显示屏上显示的坐标和虚拟桌面未发生变化前的显示尺寸,确定当前的显示尺寸;Determine the current display size according to the coordinates displayed on the client's display screen of the virtual desktop sent by the client and the display size of the virtual desktop before it changes;
相应的,处理器51用于执行存储器52中的虚拟桌面的图像处理程序的基于服务端的硬件编码器的对齐步长和当前的显示尺寸,对虚拟桌面的原始图像数据进行扩充处理,获得处理后的图像数据,以实现以下步骤:Correspondingly, the processor 51 is used to execute the image processing program of the virtual desktop in the memory 52 based on the alignment step of the hardware encoder on the server side and the current display size, and expand the original image data of the virtual desktop to obtain the processed image data to achieve the following steps:
基于当前的显示尺寸和对齐步长,得到处理后的图像数据具有的虚宽和虚高;Based on the current display size and alignment step, obtain the virtual width and virtual height of the processed image data;
根据虚宽和虚高对原始图像数据进行扩充处理,得到处理后的图像数据。The original image data is expanded according to the virtual width and virtual height to obtain the processed image data.
在本申请的其他实施例中,处理器51用于执行存储器52中的虚拟桌面的图像处理程序的基于当前的显示尺寸和对齐步长,得到处理后的图像数据具有的虚宽和虚高,以实现以下步骤:In other embodiments of the present application, the processor 51 is used to execute the image processing program of the virtual desktop in the memory 52 based on the current display size and the alignment step to obtain the virtual width and virtual height of the processed image data, to achieve the following steps:
确定硬件编码器的对齐步长;Determine the alignment step size of the hardware encoder;
基于对齐步长对虚拟桌面的实际宽和实际高进行处理,得到虚高和虚高;当前的显示尺寸包括实际宽和实际高。Process the actual width and height of the virtual desktop based on the alignment step to obtain the virtual height and height; the current display size includes the actual width and height.
在本申请的其他实施例中,处理器51用于执行存储器52中的虚拟桌面的图像处理程序的基于对齐步长对虚拟桌面的实际宽和实际高进行处理,得到虚高和虚高,以实现以下步骤:In other embodiments of the present application, the processor 51 is used to execute the image processing program of the virtual desktop in the memory 52 to process the actual width and actual height of the virtual desktop based on the alignment step to obtain the virtual height and virtual height, so as to Implement the following steps:
确定对齐步长与实际宽和实际高之间的差异;Determine the difference between the alignment step and the actual width and height;
根据差异对实际宽和实际高进行扩充处理,得到虚宽和虚高;虚宽和虚高是对齐步长的整数倍。The actual width and height are expanded according to the difference to obtain the virtual width and virtual height; the virtual width and virtual height are integer multiples of the alignment step.
在本申请的其他实施例中,处理器51用于执行存储器52中的虚拟桌面的图像处理程序的根据虚高和虚高对原始图像数据进行扩充处理,得到处理后的图像数据,以实现以下步骤:In other embodiments of the present application, the processor 51 is used to execute the image processing program of the virtual desktop in the memory 52 to perform expansion processing on the original image data according to the virtual height and the virtual height to obtain the processed image data, so as to realize the following step:
根据虚高和虚宽对原始图像数据进行扩充,得到扩充后的图像数据;Expand the original image data according to the virtual height and virtual width to obtain the expanded image data;
根据目标字符对扩充后的图像数据进行填补,得到处理后的图像数据。The expanded image data is filled according to the target character to obtain the processed image data.
在本申请的其他实施例中,处理器51用于执行存储器52中的虚拟桌面的图像处理程序的通过硬件编码器读取处理后的图像数据,并对处理后的图像数据中的原始图像数据进行编码,获得桌面编码数据,以实现以下步骤:In other embodiments of the present application, the processor 51 is used to execute the image processing program of the virtual desktop in the memory 52, read the processed image data through the hardware encoder, and process the original image data in the processed image data Perform encoding to obtain desktop encoding data to achieve the following steps:
通过硬件编码器按照对齐步长,读取处理后的图像数据;Read the processed image data through the hardware encoder according to the alignment step;
通过硬件编码器对原始图像数据进行编码,得到桌面编码数据。The original image data is encoded by a hardware encoder to obtain desktop encoded data.
需要说明的是,处理器所执行的步骤的具体说明可以参照图1和3~4对应的实施例提供的虚拟桌面的图像处理方法中的实现过程,此处不再赘述。It should be noted that, for a specific description of the steps executed by the processor, reference may be made to the implementation process in the image processing method for a virtual desktop provided in the embodiments corresponding to FIGS. 1 and 3 to 4 , which will not be repeated here.
本申请实施例所提供的服务端,由于处理后的图像数据是基于硬件编码器的对齐步长对虚拟桌面的原始图像数据进行扩充处理后得到的,因此处理的图像数据的数据大小与硬件编码器的对齐步长是匹配的,因此通过硬件编码器能够按照对齐步长读取完处理后的图像数据,不存在需要单独读取的字节,读取数据的速率较高,且编码时只对处理后的图像数据中的原始图像数据进行编码,不会增加多余操作,因此降低了处理所消耗的时间,提高了数据编码效率,进而提高了虚拟桌面的整体性能,解决了相关技术中的在云桌面的大小发生改变后,编码器无法按照固定字节数读取画面中的信息,只能逐字读取,导致编码器读取信息的效率降低且增加了编码的整体耗时的问题。In the server provided by the embodiment of this application, since the processed image data is obtained by expanding the original image data of the virtual desktop based on the alignment step of the hardware encoder, the data size of the processed image data is the same as that of the hardware encoding The alignment step of the encoder is matched, so the processed image data can be read according to the alignment step by the hardware encoder, there is no byte that needs to be read separately, the rate of reading data is high, and only Coding the original image data in the processed image data will not increase redundant operations, thus reducing the time consumed by processing, improving the efficiency of data encoding, thereby improving the overall performance of the virtual desktop, and solving the problems in related technologies. After the size of the cloud desktop changes, the encoder cannot read the information in the screen according to the fixed number of bytes, but can only read word by word, which reduces the efficiency of the encoder to read information and increases the overall time-consuming problem of encoding .
基于前述实施例,本申请的实施例提供一种存储介质,该存储介质存储有一个或者多个程序,该一个或者多个程序可被一个或者多个处理器执行,以实现图1和3~4的实施例提供的虚拟桌面的图像处理方法的步骤。Based on the foregoing embodiments, the embodiments of the present application provide a storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors, so as to realize the The steps of the image processing method of the virtual desktop provided in the embodiment of 4.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310481623.4A CN116599942A (en) | 2023-04-27 | 2023-04-27 | Image processing method, device, server and storage medium for a virtual desktop |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310481623.4A CN116599942A (en) | 2023-04-27 | 2023-04-27 | Image processing method, device, server and storage medium for a virtual desktop |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116599942A true CN116599942A (en) | 2023-08-15 |
Family
ID=87607190
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310481623.4A Pending CN116599942A (en) | 2023-04-27 | 2023-04-27 | Image processing method, device, server and storage medium for a virtual desktop |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116599942A (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090013056A1 (en) * | 2006-11-09 | 2009-01-08 | Neil Weinstock | Architecture And Method For Remote Platform Control Management |
| US20190132381A1 (en) * | 2012-03-02 | 2019-05-02 | Citrix Systems, Inc. | Reverse Seamless Integration Between Local and Remote Computing Environments |
| CN110515686A (en) * | 2019-08-28 | 2019-11-29 | 联想(北京)有限公司 | A kind of image display method and apparatus |
| CN113891080A (en) * | 2021-12-06 | 2022-01-04 | 麒麟软件有限公司 | Optimization method for image processing in SPICE cloud desktop |
| CN114339305A (en) * | 2021-12-22 | 2022-04-12 | 深信服科技股份有限公司 | Virtual desktop image processing method and related device |
| CN115641251A (en) * | 2022-11-07 | 2023-01-24 | 长沙景嘉微电子股份有限公司 | 2D desktop image pre-fetching block fusion method, device and equipment |
-
2023
- 2023-04-27 CN CN202310481623.4A patent/CN116599942A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090013056A1 (en) * | 2006-11-09 | 2009-01-08 | Neil Weinstock | Architecture And Method For Remote Platform Control Management |
| US20190132381A1 (en) * | 2012-03-02 | 2019-05-02 | Citrix Systems, Inc. | Reverse Seamless Integration Between Local and Remote Computing Environments |
| CN110515686A (en) * | 2019-08-28 | 2019-11-29 | 联想(北京)有限公司 | A kind of image display method and apparatus |
| CN113891080A (en) * | 2021-12-06 | 2022-01-04 | 麒麟软件有限公司 | Optimization method for image processing in SPICE cloud desktop |
| CN114339305A (en) * | 2021-12-22 | 2022-04-12 | 深信服科技股份有限公司 | Virtual desktop image processing method and related device |
| CN115641251A (en) * | 2022-11-07 | 2023-01-24 | 长沙景嘉微电子股份有限公司 | 2D desktop image pre-fetching block fusion method, device and equipment |
Non-Patent Citations (1)
| Title |
|---|
| ZEGO即构科技: "图像宽高(Width、Height)与跨距(Stride)【音视频基础知识】", pages 1, Retrieved from the Internet <URL:https://www.zego.im/blog/604.html> * |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103440612B (en) | Image processing method and device in a kind of GPU vitualization | |
| AU2011314228B2 (en) | Entropy coder for image compression | |
| US8760453B2 (en) | Adaptive grid generation for improved caching and image classification | |
| US8654134B2 (en) | Command remoting | |
| US20230215076A1 (en) | Image frame display method, apparatus, device, storage medium, and program product | |
| US9235452B2 (en) | Graphics remoting using augmentation data | |
| CN104660687A (en) | Realization method and system for virtual desktop display | |
| TW201019263A (en) | Integrated GPU, NIC and compression hardware for hosted graphics | |
| JP2008538829A (en) | Method and apparatus for updating a graphic display in a distributed processing environment using compression | |
| US20140108940A1 (en) | Method and system of remote communication over a network | |
| CN111857550A (en) | Method, apparatus and computer readable medium for data deduplication | |
| CN115767092A (en) | Image transmission method, cloud desktop and image transmission system, equipment and product | |
| CN111930697A (en) | Data transmission method, computing device and system based on 3D information | |
| CN113613043A (en) | Screen display and image processing method, embedded device and cloud server | |
| JP2008526107A (en) | Using graphics processors in remote computing | |
| CN116346808A (en) | WASM-based multi-threaded local signature method, system, device and medium | |
| US11653009B2 (en) | Multi-pixel caching scheme for lossless encoding | |
| CN116599942A (en) | Image processing method, device, server and storage medium for a virtual desktop | |
| CN113835816A (en) | Virtual machine desktop display method, device, equipment and readable storage medium | |
| CN114520918B (en) | Data transmission method and related equipment | |
| CN115801747B (en) | Cloud server based on ARM architecture and audio/video data transmission method | |
| CN121998812A (en) | A cloud desktop image processing method and system that enables the SPICE protocol image caching mechanism on the virtio-gpu | |
| CN119671842A (en) | Data zero-copy rendering optimization method and device based on hard decoding | |
| CN120953454A (en) | Graphics rendering methods, apparatus and systems | |
| CN121353491A (en) | A method, apparatus and medium for image processing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |