CN115865909B - SPICE protocol-based data transmission method and device and readable storage medium - Google Patents

SPICE protocol-based data transmission method and device and readable storage medium Download PDF

Info

Publication number
CN115865909B
CN115865909B CN202310039291.4A CN202310039291A CN115865909B CN 115865909 B CN115865909 B CN 115865909B CN 202310039291 A CN202310039291 A CN 202310039291A CN 115865909 B CN115865909 B CN 115865909B
Authority
CN
China
Prior art keywords
spice
data
transmission channel
server
encoder
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.)
Active
Application number
CN202310039291.4A
Other languages
Chinese (zh)
Other versions
CN115865909A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nfs China Software Co ltd
Original Assignee
Nfs China Software Co ltd
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 Nfs China Software Co ltd filed Critical Nfs China Software Co ltd
Priority to CN202310039291.4A priority Critical patent/CN115865909B/en
Publication of CN115865909A publication Critical patent/CN115865909A/en
Application granted granted Critical
Publication of CN115865909B publication Critical patent/CN115865909B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the application provides a data transmission method, a data transmission device and a readable storage medium based on SPICE protocol. The method comprises the following steps: acquiring video data output by the QEMU, wherein the video data comprises a complete desktop image; initializing an encoder according to configuration information of the encoder, and encoding the video data by using the encoder to obtain encoded data, wherein the configuration information comprises an encoding type, and the encoding type comprises H264 or H265; creating a first transmission channel with a SPICE client according to the modified SPICE protocol, wherein the first transmission channel is used for transmitting data from the SPICE server to the SPICE client; and transmitting the encoded data to the SPICE client through the first transmission channel. The video data processing method and device can improve the processing efficiency of video data and reduce the network blocking phenomenon.

Description

SPICE protocol-based data transmission method and device and readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data transmission method and apparatus based on SPICE protocol, and a readable storage medium.
Background
SPICE (Simple Protocol forIndependent Computing Environment, independent computing environment simple protocol) is an open-source remote desktop transport protocol, a high-performance, dynamically adaptive remote desktop delivery technology that can provide exactly the same end-user experience as a physical desktop.
SPICE clients can access remote desktops and use local devices (e.g., keyboard, USB, etc.) through SPICE protocols. The SPICE server is responsible for completing the interaction between the server virtual machine and SPICE client.
Currently, SPICE protocol is to transmit a changed part (called a dirty block) of a remote desktop image to a user terminal, and the transmission modes include a picture mode and a stream mode. The picture mode refers to that when the remote desktop image changes, the SPICE server compresses dirty blocks output by the QEMU in a lossy or lossless mode in a picture mode, and then sends the compressed dirty blocks to the SPICE client. QEMU is a versatile open source computer emulator and virtualizer. The stream mode refers to that when the remote desktop image changes, the SPICE server compresses dirty blocks output by the QEMU in a stream mode and sends the dirty blocks to the SPICE client. After receiving the dirty blocks output by the QEMU, the SPICE server judges the frame rate of each dirty block, and when the frame rate of a certain dirty block is lower than a preset critical value, the dirty block is transmitted in a picture mode; when the frame rate of a certain dirty block exceeds a preset critical value, stream mode transmission is adopted for the dirty block.
However, when the number of dirty blocks is large, the processing efficiency is low by judging the frame rate for each dirty block and determining the transmission mode. In addition, if the network condition is poor and the dirty block frame rate is always between the picture mode and the stream mode, the stream mode cannot be triggered, so that a vicious circle is caused, and the network jam phenomenon is difficult to solve.
Disclosure of Invention
The embodiment of the application provides a data transmission method, a data transmission device and a readable storage medium based on SPICE protocol, which can improve the processing efficiency of video data and reduce the network blocking phenomenon.
In a first aspect, an embodiment of the present application discloses a data transmission method based on SPICE protocol, which is applied to SPICE server, and the method includes:
acquiring video data output by the QEMU, wherein the video data comprises a complete desktop image;
initializing an encoder according to configuration information of the encoder, and encoding the video data by using the encoder to obtain encoded data, wherein the configuration information comprises an encoding type, and the encoding type comprises H264 or H265;
creating a first transmission channel with a SPICE client according to the modified SPICE protocol, wherein the first transmission channel is used for transmitting data from the SPICE server to the SPICE client;
And transmitting the encoded data to the SPICE client through the first transmission channel.
In a second aspect, an embodiment of the present application discloses a data transmission method based on SPICE protocol, applied to SPICE clients, the method includes:
creating a first transmission channel with a SPICE server according to the modified SPICE protocol, wherein the first transmission channel is used for transmitting data from the SPICE server to the SPICE client;
and receiving the coded data sent by the SPICE server through the first transmission channel, wherein the coded data is obtained by coding video data output by the QEMU by using an encoder by the SPICE server, the video data comprises a complete desktop image, and the coding type of the encoder comprises H264 or H265.
In a third aspect, an embodiment of the present application discloses a data transmission device based on SPICE protocol, applied to SPICE server, where the device includes:
the video data acquisition module is used for acquiring video data output by the QEMU, wherein the video data comprises a complete desktop image;
the video data coding module is used for initializing an encoder according to configuration information of the encoder, and coding the video data by using the encoder to obtain coded data, wherein the configuration information comprises coding types, and the coding types comprise H264 or H265;
The first establishing module is used for establishing a first transmission channel with the SPICE client according to the modified SPICE protocol, and the first transmission channel is used for transmitting data from the SPICE server to the SPICE client;
and the video data sending module is used for transmitting the coded data to the SPICE client through the first transmission channel.
In a fourth aspect, an embodiment of the present application discloses a data transmission device based on SPICE protocol, applied to SPICE clients, the device includes:
the third establishing module is used for establishing a first transmission channel with the SPICE server according to the modified SPICE protocol, and the first transmission channel is used for transmitting data from the SPICE server to the SPICE client;
the video data receiving module is configured to receive, through the first transmission channel, encoded data sent by the SPICE server, where the encoded data is obtained by encoding video data output by the SPICE server by using an encoder, the video data includes a complete desktop image, and an encoding type of the encoder includes H264 or H265.
In a fifth aspect, embodiments of the present application disclose an apparatus for SPICE protocol based data transmission, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs including instructions for performing SPICE protocol based data transmission methods as described in one or more of the foregoing.
In a sixth aspect, embodiments of the present application disclose a readable storage medium having instructions stored thereon that, when executed by one or more processors of an apparatus, cause the apparatus to perform a SPICE protocol based data transmission method as described in one or more of the foregoing.
Embodiments of the present application include the following advantages:
according to the SPICE protocol-based data transmission method, the original SPICE protocol is modified, so that QEMU outputs a complete desktop image instead of dirty blocks all the time, and therefore when the picture variation of the desktop image is large, the processing efficiency is not affected due to the fact that the number of dirty blocks is large, and the processing efficiency is high. In addition, the SPICE server transmits the video data subjected to H264 or H265 coding compression to the SPICE client, the occupied bandwidth is small and stable, and even if the bandwidth has a bottleneck, the operation is smooth, and the network clamping phenomenon is reduced. Furthermore, the QEMU outputs a complete desktop image each time, the resolution is fixed, and the size difference is smaller after encoding compression, so that the generated bandwidth fluctuation is smaller, and the stability of a network can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of steps of an embodiment of a SPICE protocol-based data transmission method of the present application;
FIG. 2 is a schematic diagram of a video data transmission flow of the present application;
FIG. 3 is a schematic diagram of a custom configuration data transmission flow according to the present application;
FIG. 4 is a flow chart of steps of an embodiment of a SPICE protocol-based data transmission method of the present application;
FIG. 5 is a block diagram of an embodiment of a SPICE protocol based data transmission device of the present application;
FIG. 6 is a block diagram of an embodiment of a SPICE protocol based data transmission device of the present application;
FIG. 7 is a block diagram of an apparatus 800 for SPICE protocol based data transmission of the present application;
fig. 8 is a schematic diagram of a server in some embodiments of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, the term "and/or" as used in the specification and claims to describe an association of associated objects means that there may be three relationships, e.g., a and/or B, may mean: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. The term "plurality" in the embodiments of the present application means two or more, and other adjectives are similar thereto.
Referring to fig. 1, a step flow diagram of an embodiment of a SPICE protocol-based data transmission method of the present application is shown, where the method is applied to SPICE server, and the method may include the following steps:
Step 101, obtaining video data output by QEMU, wherein the video data comprises a complete desktop image;
102, initializing an encoder according to configuration information of the encoder, and encoding the video data by using the encoder to obtain encoded data, wherein the configuration information comprises an encoding type, and the encoding type comprises H264 or H265;
step 103, creating a first transmission channel with a SPICE client according to the modified SPICE protocol, wherein the first transmission channel is used for transmitting data from the SPICE server to the SPICE client;
step 104, transmitting the encoded data to the SPICE client through the first transmission channel.
In the embodiment of the application, the SPICE server refers to a SPICE-server, and runs on a server. SPICE clients refer to SPICE-gtk for interacting with SPICE-servers to display virtual machines.
According to the SPICE protocol-based data transmission method, the display drive of the QEMU is modified, so that the QEMU outputs a complete desktop image instead of dirty blocks all the time, and the desktop in the embodiment of the application refers to a remote desktop of the SPICE server. The remote desktop image data of the SPICE server is transmitted in a video mode and displayed at the SPICE client.
In addition, the data transmission method based on SPICE protocol provided by the embodiment of the application modifies the original SPICE protocol (SPICE-protocol). According to the modified SPICE protocol, SPICE server and SPICE client can create a first transmission channel. The first transmission channel is a communication channel between a SPICE server and SPICE client, and is used for transmitting data from the SPICE server to the SPICE client. For example, the SPICE server may transmit video data output by QEMU to SPICE client through the first transmission channel, where the video data transmitted through the first transmission channel is a complete desktop image and is encoded by H264 or H265.
H264, i.e., h.264, is a new generation of digital video compression format following MPEG4, proposed by the international organization for standardization (ISO) and the International Telecommunications Union (ITU).
H265, i.e., h.265, is a new video coding standard established by ITU-t vceg followed by h.264. The h.265 standard surrounds the existing video coding standard h.264, retaining some of the original techniques, while improving some of the related techniques.
The SPICE server and SPICE client can also create a second transmission channel according to the modified SPICE protocol. The second transmission channel is a communication channel between the SPICE server and SPICE client, and is used for transmitting data from the SPICE client to the SPICE server. For example, the SPICE client may transmit custom configuration data to the SPICE server through the second transmission channel to dynamically modify encoder configuration parameters of the SPICE server, such as encoding type and code rate.
Further, the data transmission method based on SPICE protocol provided by the embodiment of the application performs encoding compression on video data output by QEMU. Specifically, the SPICE server performs H264 encoding or H265 encoding on video data output by the QEMU, and then sends the video data to the SPICE client through the first transmission channel.
According to the SPICE protocol-based data transmission method, as QEMU outputs a complete desktop image instead of dirty blocks, when the picture variation of the desktop image is large, the processing efficiency is not affected due to the large number of dirty blocks, and the processing efficiency is high. In addition, after the complete desktop image output by the QEMU is encoded by H264 or H265, the occupied bandwidth is small and stable, and even if the bandwidth has a bottleneck, the operation is smooth, and the network blocking phenomenon is reduced. Furthermore, the QEMU outputs a complete desktop image each time, the resolution is fixed, and the size difference is smaller after encoding compression, so that the generated bandwidth fluctuation is smaller, and the stability of a network can be improved.
According to the embodiment of the application, the QEMU outputs the complete desktop image by modifying the display driving code of the QEMU. The display driver of QEMU refers to the program for which QEMU is responsible for display. Specifically, modifying the display driving code of the QEMU, by acquiring the width and height of the remote desktop, display content corresponding to the resolution size of the remote desktop, i.e., a complete desktop image, can be generated.
The embodiment of the application modifies the original SPICE protocol, and the SPICE server and the SPICE client use the modified SPICE protocol for data transmission. In this embodiment of the present application, the data transmitted by the first transmission channel is referred to as first transmission channel data, and the data transmitted by the second transmission channel is referred to as second transmission channel data. The first transmission channel data contains video coding data sent to the SPICE client by the SPICE server. The second transmission channel data contains custom configuration data sent to the SPICE server by the SPICE client.
In an optional embodiment of the present application, the data transmission format of the first transmission channel is defined in the modified SPICE protocol, and the transmitting the encoded data to the SPICE client through the first transmission channel may include: and after the coded data are packaged according to the data transmission format of the first transmission channel, the coded data are transmitted to the SPICE client through the first transmission channel.
In the embodiment of the application, the original SPICE protocol is modified, specifically, a data transmission format definition of the first transmission channel is added in the SPICE.
The SPICE server acquires video data output by the QEMU, and codes the video data according to the coding type in the configuration information to obtain coded data; and encapsulating the coded data according to the data transmission format of the first transmission channel to obtain the data of the first transmission channel, and sending the data to the SPICE client.
Alternatively, the format defining the first transmission channel data may include the following: resolution, type of encoding, data length, and data content (i.e., encoded data). Where the resolution includes the width and height of the remote desktop. After receiving the first transmission channel data of the SPICE server, the SPICE client can analyze the first transmission channel data to obtain encoded data, determine a decoder according to the encoding type of the encoded data, and then decode and display the encoded data.
Similarly, the modified SPICE protocol also defines a data transmission format of the second transmission channel, and SPICE client packages the custom configuration data set by a user according to the data transmission format of the second transmission channel and transmits the custom configuration data to the SPICE server through the second transmission channel.
In the embodiment of the application, the original SPICE protocol is modified, specifically, a data transmission format definition of the second transmission channel is added in the SPICE.
After receiving the user-defined configuration data set by the user, the SPICE client encapsulates the user-defined configuration data according to the data transmission format of the second transmission channel to obtain second transmission channel data, and sends the second transmission channel data to the SPICE server. Custom configuration data may include, but is not limited to, coding type and code rate. After receiving the second transmission channel data of the SPICE client, the SPICE server can analyze the second transmission channel data to obtain custom configuration data, and the encoder can be reinitialized according to the custom configuration data to enable the custom configuration data to take effect.
Before encoding with the encoder, the SPICE server performs an initialization operation on the encoder according to the configuration information. The embodiment of the present application does not limit the specific form of the configuration information, and for example, a structure may be defined for recording the configuration information. The configuration information includes configuration parameters of the encoder, such as coding type, resolution, code rate, etc. The coding type may include H264 or H265. Resolution includes the width and height of the remote desktop. The code rate refers to the video code rate, and the higher the code rate, the more data is transmitted per second, and the clearer the image quality. The coding type and the code rate can adopt default coding type and code rate, and can be modified by SPICE client terminal self-definition. For example, assuming the default encoding type is H264, the user may customize the encoding type to H265 through the SPICE client. As another example, the default code rate is 5Mbps, and the user can customize the code rate to 7Mbps through the SPICE client. The resolution may be automatically changed according to a user operation, for example, the resolution may be automatically updated when the user changes the size of the remote desktop display window. Of course, the configuration parameters are not limited to the above-listed encoding types, resolutions, and code rates, and may include other parameters such as frame rates. The frame rate is the frequency (rate) at which bitmap images in frames called units appear continuously on the display.
In the embodiment of the application, the SPICE server side can automatically reinitialize the encoder when receiving the custom configuration data sent by the SPICE client side or when detecting that the resolution of the video data changes, so as to enable the changed configuration parameters to be effective.
In an alternative embodiment of the present application, the method may further include:
step S11, creating a second transmission channel with the SPICE client according to the modified SPICE protocol, wherein the second transmission channel is used for transmitting data from the SPICE client to the SPICE server;
step S12, receiving custom configuration data sent by the SPICE client through the second transmission channel, wherein the custom configuration data comprises a custom coding type and/or a custom code rate;
step S13, updating the configuration information according to the custom configuration data;
step S14, the encoder is reinitialized according to the updated configuration information.
The embodiment of the application modifies the original SPICE protocol (SPICE-protocol) and adds the macro definition of the video data of the H264 coding type and the macro definition of the video data of the H265 coding type.
In the embodiment of the application, interface function definitions of a first transmission channel and a second transmission channel are respectively added in a header file enum.h of the SPICE protocol. The first transmission channel is used for transmitting data from the SPICE server to the SPICE client, such as H264/H265 encoded video data from a SPICE-server to SPICE-gtk. The second transmission channel is used for transmitting data from the SPICE client to the SPICE server, such as transmitting custom configuration data from SPICE-gtk to SPICE-server.
In a specific implementation, when the SPICE server initializes the encoder for the first time, the configuration information of the encoder may be a default configuration parameter, and the SPICE server initializes the encoder according to the default configuration parameter.
The user-defined configuration data can be set through the SPICE client, such as setting a user-defined coding type and/or a user-defined code rate, and the SPICE client encapsulates the user-defined configuration data set by a user according to a data transmission format of a second transmission channel and transmits the encapsulated user-defined configuration data to the SPICE server through the second transmission channel. After receiving the second transmission channel data sent by the SPICE client, the SPICE server can obtain the custom configuration data of the SPICE client by analyzing the second transmission channel data, and write the custom configuration data (such as custom coding type and/or custom code rate) into a structural body of configuration information, and reinitialize the encoder by using the updated configuration information to enable the custom configuration data to take effect. Therefore, the embodiment of the application can realize the configuration parameters of the dynamic switching encoder, such as the dynamic switching encoding type and/or the code rate.
In the embodiment of the application, the user can customize the required coding type through the SPICE client, and in addition, the user can manually adjust the configuration parameters related to the bandwidth, such as the code rate, and the like, through the SPICE client, so that the problem of network blocking can be effectively solved when the network condition is poor.
In an alternative embodiment of the present application, before the encoding the video data with the encoder, the method may further include: converting the video data from a color space format to a luminance space format; the encoding of the video data with the encoder may include: and encoding the video data in the brightness space format by using the encoder.
Since the H264 and H265 codes do not support the color space format (RGB) but support the luminance space format (YUV), after the SPICE server acquires the video data output by the QEMU, the SPICE server converts the video data from the color space format (RGB) to the luminance space format (YUV); and then reading configuration parameters such as coding types from the structural body of the configuration information, initializing an encoder according to the read configuration parameters, and coding the video data in the YUV format by using the initialized encoder to obtain coded data. The encoded data is filled into the data structure of the first transmission channel and transmitted to the SPICE client through the first transmission channel.
Further, after the data of the first transmission channel is sent, the memory space occupied by the data of the first transmission channel can be released, so that the utilization rate of memory resources is improved. It should be noted that, since the process of sending the first transmission channel data is an asynchronous call process, the corresponding memory space should not be released immediately after the command of sending the first transmission channel data is called, otherwise, program crash may be caused. According to the embodiment of the application, the memory space occupied by the first transmission channel data is released through dereferencing, so that the problem is solved. Dereferencing refers to returning the corresponding object in the memory address.
In an alternative embodiment of the present application, the method may further include:
step S21, acquiring data transmitted by the first transmission channel;
step S22, if the data transmitted by the first transmission channel is detected not to meet the preset coding requirement, recoding the data transmitted by the first transmission channel; wherein the preset coding requirements include: when the data transmitted by the first transmission channel is video data, the coding type is H264 or H265.
In the embodiment of the application, an exception handling mechanism is added in the process that the SPICE server transmits video data to the SPICE client. In SPICE protocol, the flow direction of video data is: the QEMU generates video data that is sent over the network to SPICE clients by calling the marshall_ qxl _available function. The marshall_ qxl _available function is an interface for processing video data transmitted by Qemu by the SPICE server, and in the embodiment of the application, the interface for processing video data transmitted by Qemu by the SPICE server is modified, and an exception processing step is added. Specifically, the data transmitted by the first transmission channel is obtained, the data type and the coding type of the data transmitted by the first transmission channel are detected, when the video data transmitted by the first transmission channel is detected, whether the coding type is H264 or H265 is judged, if the coding type is not H264 or H265, it is determined that the data transmitted by the first transmission channel does not meet the preset coding requirement, at the moment, the data transmitted by the first transmission channel is taken over, and the data is re-encoded according to H264 or H264 and then sent.
In an alternative embodiment of the present application, the method may further include:
s31, analyzing the video data to obtain the current resolution of the desktop image;
step S32, when the current resolution is not consistent with the stored resolution, re-initializing the encoder according to the current resolution;
and step S33, updating the stored resolution to the current resolution.
When the resolution of the remote desktop changes, a SPICE server (SPICE-server) will call a display_channel_create_surface function in a display-channel.c file, so that in the embodiment of the application, code implementation steps S31 to S33 are added in the function, and when the current resolution is detected to change, the encoder is reinitialized according to the changed current resolution, and the current resolution is stored for judging whether the resolution changes next time.
In an alternative embodiment of the present application, the method may further include: and receiving a custom configuration data synchronization message sent by the SPICE client. After each start, the SPICE client can send a custom configuration data synchronization message to the SPICE server, that is, send custom configuration data once through the second transmission channel, so as to synchronize configuration parameters such as coding types and code rates of the two ends, and enable the encoder configuration parameters of the SPICE server to be matched with the decoder configuration parameters of the SPICE client.
Referring to fig. 2, a schematic diagram of a video data transmission flow in an embodiment of the present application is shown, as shown in fig. 2, a QEMU outputs video data to a SPICE server (SPICE-server), and the SPICE server encodes H264 or H265 the video data output by the QEMU and then sends the encoded video data to a SPICE client (SPICE-gtk) through a first transmission channel.
Referring to fig. 3, a custom configuration data transmission flow diagram according to an embodiment of the present application is shown. As shown in fig. 3, the SPICE client (SPICE-gtk) receives user-set custom configuration data (such as a custom coding type and/or a custom code rate) through a preset tab in the SPICE, the SPICE client (SPICE-gtk) sends the custom configuration data to the SPICE server (SPICE-server) through a second transmission channel, and the SPICE server (SPICE-server) reinitializes an encoder according to the received custom configuration data so as to enable the custom configuration data to be effective, encodes video data output by the QEMU by utilizing the reinitialized encoder, and then sends the video data to the SPICE client (SPICE-gtk) through a first transmission channel.
The Spicy is client software based on the spice-gtk and is used for connecting a virtual machine running on the spice-server. According to the embodiment of the application, the preset tab can be added in the Spicy, and user-defined configuration data set by a user can be received through the preset tab. Illustratively, the preset tab includes a tab for setting a coding type and a tab for setting a code rate.
In summary, according to the SPICE protocol-based data transmission method provided by the embodiment of the application, the original SPICE protocol is modified, so that the QEMU outputs a complete desktop image instead of dirty blocks all the time, and therefore, when the picture variation of the desktop image is large, the processing efficiency is not affected due to the large number of dirty blocks, and the processing efficiency is high. In addition, the SPICE server transmits the video data subjected to H264 or H265 coding compression to the SPICE client, so that the bandwidth occupation is small and stable, and even if the bandwidth has a bottleneck, the running smoothness can be ensured. Furthermore, since the QEMU outputs a complete desktop image each time, the resolution is fixed, and the size difference after encoding compression is smaller, the generated bandwidth fluctuation is smaller.
Referring to FIG. 4, a flowchart illustrating steps of an embodiment of a SPICE protocol based data transmission method of the present application, the method being applied to SPICE clients, the method may include the steps of:
step 401, creating a first transmission channel with a SPICE server according to the modified SPICE protocol, wherein the first transmission channel is used for transmitting data from the SPICE server to the SPICE client;
Step 402, receiving, by the first transmission channel, encoded data sent by the SPICE server, where the encoded data is obtained by encoding video data output by QEMU by the SPICE server with an encoder, where the video data includes a complete desktop image, and an encoding type of the encoder includes H264 or H265.
According to the embodiment of the application, the QEMU outputs the complete desktop image by modifying the display driving code of the QEMU. The SPICE server acquires video data output by the QEMU, wherein the video data comprises a complete desktop image. The SPICE server initializes an encoder according to configuration information of the encoder, and encodes the video data by the encoder to obtain encoded data, wherein the configuration information comprises an encoding type, and the encoding type comprises H264 or H265. The SPICE client creates a first transmission channel with the SPICE server by using a modified SPICE protocol (SPICE-protocol), and receives encoded data sent by the SPICE server through the first transmission channel.
The operation steps of the SPICE client side are described in the foregoing embodiments, and are not repeated here.
In addition, modifications to the SPICE protocol in embodiments of the present application include modifications to SPICE protocols on both sides of SPICE servers and SPICE clients. The modification modes at two sides are the same, and the modification modes of a SPICE client (SPICE-gtk) spice.pro file and an enums.h file are the same as those in a SPICE server (SPICE-server), and the modifications are not repeated herein and are mutually referred to.
In an alternative embodiment of the present application, the method may further include:
s41, analyzing the encoded data to obtain the encoding type of the encoded data;
step S42, initializing a decoder according to the coding type, and decoding the coded data by utilizing the decoder to obtain decoded data.
The data sent by the SPICE server through the first transmission channel is coded, and the SPICE client can be displayed after decoding according to the coding type of the corresponding coder.
In the embodiment of the present application, the format of the first transmission channel data may include the following: resolution, type of encoding, data length, and data content (i.e., encoded data).
In SPICE protocol, the channel_set_handles function in the channel-display.c file is a function for processing data transmission from a SPICE-server to SPICE-gtk, and in the embodiment of the present application, processing codes are added in the function to analyze the first transmission channel data.
Specifically, in the embodiment of the present application, a structure is created in a channel-display. C, and is used for storing various data transmitted from a service-server, for example, a service-gtk displays configuration parameters required by the ffmpeg video data sent from the service-server, including: resolution-width, resolution-height, coding type, data length, coded data, etc.
The SPICE client can obtain the encoded data and the encoding type, the data length, the resolution-width and the resolution-height of the encoded data by analyzing the first transmission channel data sent by the SPICE server. The SPICE client creates a first transmission channel with the SPICE server by using the modified SPICE protocol, and receives encoded data sent by the SPICE server through the first transmission channel. The SPICE client analyzes the encoded data to obtain the encoding type of the encoded data, so that a decoder can be initialized according to the encoding type, and the encoded data is decoded by the decoder to obtain decoded data, so that rendering and displaying can be performed.
In one example of an embodiment of the present application, the process of initializing a decoder may include: initializing a decoder-related component; determining a decoder according to the coding type; initialization parameters are set by the incoming resolution.
Further, the embodiment of the present application further increases the judgment condition when decoding is performed by the decoder, and reinitializes the decoder when the judgment condition is satisfied. The judging conditions include: the decoder is not initialized or the decoding type is changed or the resolution is changed. Wherein the decoding type corresponds to an encoding type of the SPICE server, for example, when the SPICE server encodes using the H264 encoding type, the SPICE client decodes encoded data transmitted by the SPICE server through the first transmission channel using the H264 decoding type. The SPICE client can display the video data obtained after decoding the encoded data.
In spice-gtk, a canvas_get_bits function in a canvas_base.c file is usually used for drawing, but other external files cannot access the canvas_get_bits function, so that the canvas_get_bits function is packaged into a target structure body for external function call, and the target structure body is named as Spicecanvas Ops. Specifically, a special drawing function is firstly created for drawing the video data coded by H264 or H265; a function pointer member is then added to the Spicecanvas structure for initializing to the specific drawing function. At initialization, the special drawing function pointer is written into the newly added member in the spic graphic structures, and then the H264 or H265 encoded video data can be displayed in the channel-display.c.
In an optional embodiment of the present application, the data transmission format of the second transmission channel is defined in the modified SPICE protocol, and the sending, by the second transmission channel, the custom configuration data to the SPICE server may include: and after the custom configuration data is packaged according to the data transmission format of the second transmission channel, the custom configuration data is transmitted to the SPICE server through the second transmission channel.
In an alternative embodiment of the present application, the method may further include:
step S51, receiving custom configuration data through a preset tab, wherein the custom configuration data comprises a custom coding type and/or a custom code rate;
step S52, creating a second transmission channel with the SPICE client according to the modified SPICE protocol, wherein the second transmission channel is used for transmitting data from the SPICE client to the SPICE server;
and step S53, the custom configuration data is sent to the SPICE server through the second transmission channel, so that the SPICE server updates the configuration information of the encoder according to the custom configuration data, and the encoder is re-initialized.
Spicy is a client software based on spice-gtk for connecting to a virtual machine running on spice-server. According to the embodiment of the application, the preset tab can be added in the Spicy, and user-defined configuration data set by a user can be received through the preset tab. Illustratively, the preset tab includes a tab for setting a coding type and a tab for setting a code rate.
It should be noted that, in the embodiment of the present application, the type of the preset tab is not limited, and in a specific implementation, a preset tab interface for customizing other configuration parameters may be reserved.
Optionally, the method may further include: and sending a custom configuration data synchronization message to the SPICE server. After each start, the SPICE client can send a custom configuration data synchronization message to the SPICE server, that is, send custom configuration data once through the second transmission channel, so as to synchronize configuration parameters such as coding types and code rates of the two ends, and enable the encoder configuration parameters of the SPICE server to be matched with the decoder configuration parameters of the SPICE client.
In summary, according to the SPICE protocol-based data transmission method provided by the embodiment of the application, the original SPICE protocol is modified, so that the QEMU outputs a complete desktop image instead of dirty blocks all the time, and therefore, when the picture variation of the desktop image is large, the processing efficiency is not affected due to the large number of dirty blocks, and the processing efficiency is high. In addition, the SPICE server transmits the video data subjected to H264 or H265 coding compression to the SPICE client, the occupied bandwidth is small and stable, and even if the bandwidth has a bottleneck, the operation is smooth, and the network clamping phenomenon is reduced. Furthermore, the QEMU outputs a complete desktop image each time, the resolution is fixed, and the size difference is smaller after encoding compression, so that the generated bandwidth fluctuation is smaller, and the stability of a network can be improved.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments and that the acts referred to are not necessarily required by the embodiments of the present application.
Referring to FIG. 5, there is shown a block diagram of an embodiment of a SPICE protocol-based data transmission device of the present application, the device being applied to SPICE servers, the device may include:
a video data obtaining module 501, configured to obtain video data output by the QEMU, where the video data includes a complete desktop image;
the video data encoding module 502 is configured to initialize an encoder according to configuration information of the encoder, and encode the video data by using the encoder to obtain encoded data, where the configuration information includes an encoding type, and the encoding type includes H264 or H265;
a first establishing module 503, configured to create a first transmission channel with a SPICE client according to the modified SPICE protocol, where the first transmission channel is used to transmit data from the SPICE server to the SPICE client;
A video data sending module 504, configured to transmit the encoded data to the SPICE client through the first transmission channel.
Optionally, the apparatus further comprises:
the second establishing module is used for establishing a second transmission channel with the SPICE client according to the modified SPICE protocol, and the second transmission channel is used for transmitting data from the SPICE client to the SPICE server;
the configuration data receiving module is used for receiving the custom configuration data sent by the SPICE client through the second transmission channel, wherein the custom configuration data comprises a custom coding type and/or a custom code rate;
the configuration information updating module is used for updating the configuration information according to the custom configuration data;
and the first initialization module is used for re-initializing the encoder according to the updated configuration information.
Optionally, the apparatus further comprises:
the resolution obtaining module is used for analyzing the video data to obtain the current resolution of the desktop image;
a second initialization module, configured to reinitialize the encoder according to the current resolution when it is determined that the current resolution is inconsistent with the stored resolution;
And the resolution saving module is used for updating the stored resolution to the current resolution.
Optionally, the apparatus further comprises:
a format conversion module for converting the video data from a color space format to a luminance space format;
the video data encoding module is specifically configured to encode the video data in the luminance spatial format by using the encoder.
Optionally, the modified SPICE protocol defines a data transmission format of the first transmission channel, and the video data sending module is specifically configured to encapsulate the encoded data according to the data transmission format of the first transmission channel, and then transmit the encoded data to the SPICE client through the first transmission channel.
Optionally, the apparatus further comprises:
the data interception module is used for acquiring the data transmitted by the first transmission channel;
the data take-over module is used for recoding the data transmitted by the first transmission channel if the data transmitted by the first transmission channel is detected to be not in accordance with the preset coding requirement; wherein the preset coding requirements include: when the data transmitted by the first transmission channel is video data, the coding type is H264 or H265.
Referring to FIG. 6, there is shown a block diagram of an embodiment of a SPICE protocol-based data transmission device of the present application, for use with SPICE clients, which may include:
a third establishing module 601, configured to establish a first transmission channel with a SPICE server according to the modified SPICE protocol, where the first transmission channel is used to transmit data from the SPICE server to the SPICE client;
the video data receiving module 602 is configured to receive, through the first transmission channel, encoded data sent by the SPICE server, where the encoded data is obtained by encoding, by the SPICE server, video data output by QEMU with an encoder, where the video data includes a complete desktop image, and an encoding type of the encoder includes H264 or H265.
Optionally, the apparatus further comprises:
the video data analysis module is used for analyzing the coded data to obtain the coding type of the coded data;
and the video data decoding module is used for initializing a decoder according to the coding type and decoding the coded data by utilizing the decoder to obtain decoded data.
Optionally, the apparatus further comprises:
The configuration data acquisition module is used for receiving custom configuration data through a preset tab, wherein the custom configuration data comprises a custom coding type and/or a custom code rate;
a fourth establishing module, configured to establish a second transmission channel with the SPICE client according to the modified SPICE protocol, where the second transmission channel is used to transmit data from the SPICE client to the SPICE server;
and the configuration data sending module is used for sending the custom configuration data to the SPICE server through the second transmission channel so that the SPICE server can update the configuration information of the encoder according to the custom configuration data and reinitialize the encoder.
Optionally, the modified SPICE protocol defines a data transmission format of the second transmission channel, and the configuration data sending module is specifically configured to package the custom configuration data according to the data transmission format of the second transmission channel, and then transmit the custom configuration data to the SPICE server through the second transmission channel.
In summary, according to the SPICE protocol-based data transmission device provided by the embodiment of the application, an original SPICE protocol is modified, so that a complete desktop image is output by the QEMU instead of dirty blocks all the time, and therefore, when the picture variation of the desktop image is large, the processing efficiency is not affected due to the large number of dirty blocks, and the processing efficiency is high. In addition, the SPICE server transmits the video data subjected to H264 or H265 coding compression to the SPICE client, the occupied bandwidth is small and stable, and even if the bandwidth has a bottleneck, the operation is smooth, and the network clamping phenomenon is reduced. Furthermore, the QEMU outputs a complete desktop image each time, the resolution is fixed, and the size difference is smaller after encoding compression, so that the generated bandwidth fluctuation is smaller, and the stability of a network can be improved.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Embodiments of the present application provide an apparatus for SPICE protocol based data transmission, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and configured to be executed by one or more processors, include a method for SPICE protocol based data transmission as described in one or more embodiments above.
FIG. 7 is a block diagram illustrating an apparatus 800 for SPICE protocol based data transmission, according to one exemplary embodiment. For example, apparatus 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 7, apparatus 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the apparatus 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing element 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 806 provides power to the various components of the device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen between the device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the device 800 is in an operational mode, such as a call mode, a recording mode, and a voice information processing mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the apparatus 800. For example, the sensor assembly 814 may detect the on/off state of the device 800, the relative positioning of the components, such as the display and keypad of the apparatus 800, the sensor assembly 814 may also search for a change in position of the apparatus 800 or one component of the apparatus 800, the presence or absence of user contact with the apparatus 800, the orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the apparatus 800 and other devices, either in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on radio frequency information processing (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions executable by processor 820 of apparatus 800 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 8 is a schematic diagram of a server in some embodiments of the present application. The server 1900 may vary considerably in configuration or performance and may include one or more central processing units (central processing units, CPU) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) that store applications 1942 or data 1944. Wherein the memory 1932 and storage medium 1930 may be transitory or persistent. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Still further, a central processor 1922 may be provided in communication with a storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input/output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as windows server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
A non-transitory computer readable storage medium, which when executed by a processor of an apparatus (server or terminal), enables the apparatus to perform the SPICE protocol based data transmission method shown in fig. 1.
A non-transitory computer readable storage medium, when executed by a processor of an apparatus (server or terminal), enables the apparatus to perform the description of the SPICE protocol-based data transmission method in the corresponding embodiment of fig. 1, and thus, a detailed description thereof will be omitted herein. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the computer program product or the computer program embodiments related to the present application, please refer to the description of the method embodiments of the present application.
In addition, it should be noted that: embodiments of the present application also provide a computer program product or computer program that may include computer instructions that may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor can execute the computer instructions, so that the computer device performs the description of the data transmission method based on SPICE protocol in the embodiment corresponding to fig. 1, and thus, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the computer program product or the computer program embodiments related to the present application, please refer to the description of the method embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.
The foregoing description of the preferred embodiments of the present application is not intended to limit the invention to the particular embodiments of the present application, but to limit the scope of the invention to the particular embodiments of the present application.
The foregoing has described in detail a SPICE-protocol-based data transmission method, a SPICE-protocol-based data transmission device and a readable storage medium, to which specific examples are applied to illustrate the principles and embodiments of the present application, and the above examples are only used to help understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (12)

1. A SPICE protocol-based data transmission method, which is characterized by being applied to SPICE servers, the method comprising:
acquiring video data output by the QEMU, wherein the video data comprises a complete desktop image;
initializing an encoder according to configuration information of the encoder, and encoding the video data by using the encoder to obtain encoded data, wherein the configuration information comprises an encoding type, and the encoding type comprises H264 or H265; the configuration information also comprises resolution and code rate;
creating a first transmission channel with a SPICE client according to the modified SPICE protocol, wherein the first transmission channel is used for transmitting data from the SPICE server to the SPICE client; the format of the data transmitted by the first transmission channel comprises the following contents: resolution, coding type, data length, and coded data;
transmitting the encoded data to the SPICE client through the first transmission channel;
the method further comprises the steps of:
creating a second transmission channel with the SPICE client according to the modified SPICE protocol, wherein the second transmission channel is used for transmitting data from the SPICE client to the SPICE server;
Receiving custom configuration data sent by the SPICE client through the second transmission channel, wherein the custom configuration data comprises a custom coding type and/or a custom code rate;
updating the configuration information according to the custom configuration data;
reinitializing the encoder according to the updated configuration information or when detecting that the resolution of the video data changes;
the method further comprises the steps of: and receiving a self-defined configuration data synchronization message sent by the SPICE client after each start so as to synchronize configuration parameters of two ends.
2. The method according to claim 1, wherein the method further comprises:
analyzing the video data to obtain the current resolution of the desktop image;
reinitializing the encoder according to the current resolution when it is determined that the current resolution is inconsistent with the stored resolution;
updating the stored resolution to the current resolution.
3. The method of claim 1, wherein prior to encoding the video data with the encoder, the method further comprises:
converting the video data from a color space format to a luminance space format;
The encoding the video data with the encoder includes:
and encoding the video data in the brightness space format by using the encoder.
4. The method of claim 1, wherein the modified SPICE protocol defines a data transmission format of the first transmission channel, the transmitting the encoded data to the SPICE client via the first transmission channel comprising:
and after the coded data are packaged according to the data transmission format of the first transmission channel, the coded data are transmitted to the SPICE client through the first transmission channel.
5. The method according to claim 1, wherein the method further comprises:
acquiring data transmitted by the first transmission channel;
if the data transmitted by the first transmission channel is detected not to meet the preset coding requirement, recoding the data transmitted by the first transmission channel; wherein the preset coding requirements include: when the data transmitted by the first transmission channel is video data, the coding type is H264 or H265.
6. A SPICE protocol-based data transmission method, which is applied to SPICE clients, the method comprising:
Creating a first transmission channel with a SPICE server according to the modified SPICE protocol, wherein the first transmission channel is used for transmitting data from the SPICE server to the SPICE client;
receiving coded data sent by the SPICE server through the first transmission channel, wherein the coded data is obtained by initializing an encoder by the SPICE server according to configuration information of the encoder and encoding video data output by QEMU by using the encoder, the video data comprises a complete desktop image, and the encoding type of the encoder comprises H264 or H265; the configuration information comprises a coding type, resolution and code rate; the format of the data transmitted by the first transmission channel comprises the following contents: resolution, coding type, data length, and coded data;
the method further comprises the steps of:
receiving custom configuration data through a preset tab, wherein the custom configuration data comprises a custom coding type and/or a custom code rate;
creating a second transmission channel with the SPICE client according to the modified SPICE protocol, wherein the second transmission channel is used for transmitting data from the SPICE client to the SPICE server;
The custom configuration data is sent to the SPICE server through the second transmission channel, so that the SPICE server updates the configuration information of the encoder according to the custom configuration data, and the encoder is reinitialized according to the updated configuration information or when the change of the resolution of the video data is detected;
the method further comprises the steps of: after each start, a custom configuration data synchronization message is sent to the SPICE server to synchronize configuration parameters of both ends.
7. The method of claim 6, wherein the method further comprises:
analyzing the encoded data to obtain the encoding type of the encoded data;
initializing a decoder according to the coding type, and decoding the coded data by utilizing the decoder to obtain decoded data.
8. The method of claim 6, wherein the modified SPICE protocol defines a data transmission format of the second transmission channel, and the sending the custom configuration data to the SPICE server through the second transmission channel comprises:
and after the custom configuration data is packaged according to the data transmission format of the second transmission channel, the custom configuration data is transmitted to the SPICE server through the second transmission channel.
9. A SPICE protocol-based data transmission device, which is applied to SPICE service end, the device comprising:
the video data acquisition module is used for acquiring video data output by the QEMU, wherein the video data comprises a complete desktop image;
the video data coding module is used for initializing an encoder according to configuration information of the encoder, and coding the video data by using the encoder to obtain coded data, wherein the configuration information comprises coding types, and the coding types comprise H264 or H265; the configuration information also comprises resolution and code rate;
the first establishing module is used for establishing a first transmission channel with the SPICE client according to the modified SPICE protocol, and the first transmission channel is used for transmitting data from the SPICE server to the SPICE client; the format of the data transmitted by the first transmission channel comprises the following contents: resolution, coding type, data length, and coded data;
the video data sending module is used for transmitting the coded data to the SPICE client through the first transmission channel;
the apparatus further comprises:
the second establishing module is used for establishing a second transmission channel with the SPICE client according to the modified SPICE protocol, and the second transmission channel is used for transmitting data from the SPICE client to the SPICE server;
The configuration data receiving module is used for receiving the custom configuration data sent by the SPICE client through the second transmission channel, wherein the custom configuration data comprises a custom coding type and/or a custom code rate;
the configuration information updating module is used for updating the configuration information according to the custom configuration data;
the first initialization module is used for reinitializing the encoder according to the updated configuration information or when detecting that the resolution of the video data changes;
the apparatus further comprises:
and the synchronous message receiving module is used for receiving the self-defined configuration data synchronous message sent by the SPICE client after each start so as to synchronize the configuration parameters of the two ends.
10. A SPICE protocol based data transmission apparatus, applied to SPICE clients, the apparatus comprising:
the third establishing module is used for establishing a first transmission channel with the SPICE server according to the modified SPICE protocol, and the first transmission channel is used for transmitting data from the SPICE server to the SPICE client;
the video data receiving module is used for receiving the coded data sent by the SPICE server through the first transmission channel, wherein the coded data is obtained by initializing an encoder by the SPICE server according to the configuration information of the encoder and encoding the video data output by the QEMU by the encoder, the video data comprises a complete desktop image, and the encoding type of the encoder comprises H264 or H265; the configuration information comprises a coding type, resolution and code rate; the format of the data transmitted by the first transmission channel comprises the following contents: resolution, coding type, data length, and coded data;
The apparatus further comprises:
the configuration data acquisition module is used for receiving custom configuration data through a preset tab, wherein the custom configuration data comprises a custom coding type and/or a custom code rate;
a fourth establishing module, configured to establish a second transmission channel with the SPICE client according to the modified SPICE protocol, where the second transmission channel is used to transmit data from the SPICE client to the SPICE server;
the configuration data sending module is used for sending the custom configuration data to the SPICE server through the second transmission channel, so that the SPICE server updates the configuration information of the encoder according to the custom configuration data, and reinitializes the encoder according to the updated configuration information or when the change of the resolution of the video data is detected;
the apparatus further comprises:
and the synchronous message sending module is used for sending a custom configuration data synchronous message to the SPICE server after each start so as to synchronize configuration parameters of the two ends.
11. An apparatus for SPICE protocol based data transmission comprising a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for performing SPICE protocol based data transmission methods as recited in any one of claims 1-5 or 6-8.
12. A readable storage medium having instructions stored thereon, which when executed by one or more processors of an apparatus, cause the apparatus to perform the SPICE protocol based data transmission method of any of claims 1 to 5 or 6 to 8.
CN202310039291.4A 2023-01-13 2023-01-13 SPICE protocol-based data transmission method and device and readable storage medium Active CN115865909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310039291.4A CN115865909B (en) 2023-01-13 2023-01-13 SPICE protocol-based data transmission method and device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310039291.4A CN115865909B (en) 2023-01-13 2023-01-13 SPICE protocol-based data transmission method and device and readable storage medium

Publications (2)

Publication Number Publication Date
CN115865909A CN115865909A (en) 2023-03-28
CN115865909B true CN115865909B (en) 2023-06-02

Family

ID=85657262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310039291.4A Active CN115865909B (en) 2023-01-13 2023-01-13 SPICE protocol-based data transmission method and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN115865909B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1687893A (en) * 2005-04-30 2005-10-26 广东威创日新电子有限公司 Computer structure for displaying single whole desktop by multiple output channels
CN101447998A (en) * 2008-12-25 2009-06-03 广东威创视讯科技股份有限公司 Desktop sharing method and system
CN104144349A (en) * 2014-07-09 2014-11-12 中电科华云信息技术有限公司 SPICE video coding and decoding expansion method and system based on H264
WO2017041551A1 (en) * 2015-09-11 2017-03-16 中兴通讯股份有限公司 Spice protocol-based image transmission method and apparatus
CN110018873A (en) * 2019-03-31 2019-07-16 山东超越数控电子股份有限公司 A method of based on FPGA optimization virtual desktop transmission
CN110647375A (en) * 2019-09-23 2020-01-03 天津卓朗科技发展有限公司 Image rendering method and device of cloud desktop and cloud server
CN111399964A (en) * 2020-03-27 2020-07-10 重庆海云捷迅科技有限公司 Cloud desktop platform based on video streaming technology
CN111953986A (en) * 2020-07-23 2020-11-17 西安万像电子科技有限公司 Image processing method and device
CN112422868A (en) * 2020-10-14 2021-02-26 西安万像电子科技有限公司 Data processing method, terminal device and server
CN114629897A (en) * 2022-03-08 2022-06-14 阿里巴巴(中国)有限公司 Data processing method and system
CN115174917A (en) * 2022-06-30 2022-10-11 中国科学技术大学 H264-based video display method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2913164B1 (en) * 2007-02-27 2009-04-17 Sagem Comm METHOD FOR BROADCASTING AUDIO AND VIDEO DATA SEQUENCES BY A SERVER

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1687893A (en) * 2005-04-30 2005-10-26 广东威创日新电子有限公司 Computer structure for displaying single whole desktop by multiple output channels
CN101447998A (en) * 2008-12-25 2009-06-03 广东威创视讯科技股份有限公司 Desktop sharing method and system
CN104144349A (en) * 2014-07-09 2014-11-12 中电科华云信息技术有限公司 SPICE video coding and decoding expansion method and system based on H264
WO2017041551A1 (en) * 2015-09-11 2017-03-16 中兴通讯股份有限公司 Spice protocol-based image transmission method and apparatus
CN110018873A (en) * 2019-03-31 2019-07-16 山东超越数控电子股份有限公司 A method of based on FPGA optimization virtual desktop transmission
CN110647375A (en) * 2019-09-23 2020-01-03 天津卓朗科技发展有限公司 Image rendering method and device of cloud desktop and cloud server
CN111399964A (en) * 2020-03-27 2020-07-10 重庆海云捷迅科技有限公司 Cloud desktop platform based on video streaming technology
CN111953986A (en) * 2020-07-23 2020-11-17 西安万像电子科技有限公司 Image processing method and device
CN112422868A (en) * 2020-10-14 2021-02-26 西安万像电子科技有限公司 Data processing method, terminal device and server
CN114629897A (en) * 2022-03-08 2022-06-14 阿里巴巴(中国)有限公司 Data processing method and system
CN115174917A (en) * 2022-06-30 2022-10-11 中国科学技术大学 H264-based video display method and device

Also Published As

Publication number Publication date
CN115865909A (en) 2023-03-28

Similar Documents

Publication Publication Date Title
US11824913B2 (en) Video stream management for remote graphical user interfaces
Lu et al. Virtualized screen: A third element for cloud–mobile convergence
CN109981607B (en) Media stream processing method and device, electronic equipment and storage medium
WO2019001347A1 (en) Screen projection method for mobile device, storage medium, terminal and screen projection system
US10108386B2 (en) Content provisioning for wireless back channel
US9699099B2 (en) Method of transmitting data in a communication system
US8934887B2 (en) System and method for running mobile devices in the cloud
CN110740363A (en) Screen projection method and system and electronic equipment
CN111221491A (en) Interaction control method and device, electronic equipment and storage medium
CN109040792B (en) Processing method for video redirection, cloud terminal and cloud desktop server
KR101596505B1 (en) Apparatus and method of an user interface in a multimedia system
US20190268601A1 (en) Efficient streaming video for static video content
US11109012B2 (en) Carriage of PCC in ISOBMFF for flexible combination
CN112601096B (en) Video decoding method, device, equipment and readable storage medium
US20230162324A1 (en) Projection data processing method and apparatus
CN113407142A (en) Display device and screen projection method
WO2020108033A1 (en) Transcoding method, transcoding device, and computer readable storage medium
KR20140088924A (en) Display control apparatus and method for the fast display
CN110996122B (en) Video frame transmission method, device, computer equipment and storage medium
CN114173183A (en) Screen projection method and electronic equipment
CN115865909B (en) SPICE protocol-based data transmission method and device and readable storage medium
CN108156414B (en) WebRTC data encoding method, equipment and computer readable storage medium
CN113825016A (en) Video rendering method, device, equipment, storage medium and computer program product
CN106851134B (en) Method, device and system for transmitting image data
EP4042690A1 (en) Av1 codec for real-time video communication

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
GR01 Patent grant
GR01 Patent grant