Remote desktop protocol data transmission method and device, equipment and storage medium
By adopting multi-threaded data packet processing on the SPICE client, the high latency and slow response problems of the SPICE protocol in situations where network bandwidth is limited or unstable are solved, the data packet receiving and processing capabilities are improved, and the system throughput and response speed are enhanced.
Patent Information
- Application Number
- CN202510830752.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-09-05
AI Technical Summary
When network bandwidth is limited or unstable, cloud desktops based on the SPICE protocol suffer from high latency and slow response, especially due to the delay and single-threaded processing bottleneck caused by TCP zero window notification, which affects user experience and system throughput.
Using a multi-threaded mode, a message data receiving sub-thread, a message data parsing sub-thread and a message data processing sub-thread are created. Data packets from the SPICE server are processed in parallel through data transmission channels, including the main channel and non-main channel, to optimize the data reception, parsing and processing processes.
The SPICE client's packet reception and processing capabilities have been improved, the number of TCP zero window notifications has been reduced, high latency and slow response issues have been alleviated, and the overall throughput and response speed of the system have been improved.
Smart Images

Figure CN120602478A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud desktop technology, and in particular to a remote desktop protocol data transmission method, device, equipment and storage medium. Background Art
[0002] The Simple Protocol for Independent Computing Environment (SPICE) protocol, a remote desktop transmission protocol designed specifically for virtualized environments, has been widely used in fields such as cloud desktop infrastructure.
[0003] However, in actual applications, especially when network bandwidth is limited or unstable, cloud desktops based on the SPICE protocol often have the following problems: (1) High latency and slow response: TCP (Transmission Control Protocol) is the transport layer protocol of SPICE. If the SPICE client cannot process the received data packets in time due to a full buffer, a large number of TCP zero window (Transmission Control Protocol) notifications will be generated and sent to the SPICE server, resulting in high latency and long response time when using the cloud desktop, which will directly affect the user's operating experience; (2) Single-threaded processing bottleneck: Traditional SPICE clients usually use a single-threaded mode for data reception, parsing and processing. This serial processing method is prone to form a performance bottleneck when facing a large amount of concurrent data, limiting the overall throughput and response speed of the system. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a remote desktop protocol data transmission method, apparatus, device, and storage medium that can effectively implement parallel processing of data packets from a SPICE server through a multi-threaded approach, thereby improving the packet reception and processing capabilities of the SPICE client, reducing the number of TCP zero window notifications that occur during data packet transmission, and further alleviating the high latency and slow response problems that occur when network bandwidth is limited or unstable. The specific solution is as follows:
[0005] In a first aspect, the present application provides a remote desktop protocol data transmission method, applied to a SPICE client, comprising:
[0006] In the process of connecting the data transmission channel by executing the handshake process between the SPICE server and the client, a message data receiving sub-thread, a message data parsing sub-thread and a message data processing sub-thread are created and started; the data transmission channel includes a main channel and a non-main channel;
[0007] Iteratively reading the GIO input stream through the connected data transmission channel to detect whether there is a message data packet in a to-be-read state sent by the SPICE server based on the SPICE protocol, and determining a data packet detection result;
[0008] If the data packet detection result is yes, then determining whether the message data packet in the to-be-read state meets a preset data receiving condition to obtain a data packet determination result;
[0009] If the data packet judgment result shows that it is satisfied, the data reception, data parsing and data processing corresponding to the message data packet are completed in sequence through the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread to complete the corresponding remote desktop protocol data transmission operation.
[0010] Optionally, after determining the packet detection result, the method further includes:
[0011] If the data packet detection result is no, then jump back to the step of iteratively reading the GIO input stream through the connected data transmission channel until the determined data packet detection result indicates that there is currently the message data packet in the to-be-read state sent by the SPICE server based on the SPICE protocol.
[0012] Optionally, if the data packet detection result is yes, determining whether the message data packet in the to-be-read state meets a preset data receiving condition to obtain a data packet determination result includes:
[0013] If the data packet detection result is yes, triggering a data receiving buffer creation operation;
[0014] After completing the data receiving buffer creation operation, reading the message header of the message data packet in a to-be-read state through the data transmission channel;
[0015] Determine whether the message header complies with the specification of the SPICE protocol to obtain a data packet determination result.
[0016] Optionally, if the data packet judgment result indicates that the condition is satisfied, completing the data reception corresponding to the message data packet through the message data receiving sub-thread includes:
[0017] If the data packet judgment result indicates that the message header of the message data packet complies with the specification information of the SPICE protocol, the size of the message data packet is determined based on the message header through the message data receiving sub-thread, and memory space corresponding to the message data packet is allocated according to the size of the message data packet and the created data receiving buffer;
[0018] The message data packet is stored in the data receiving buffer based on the memory space to complete a message data receiving operation corresponding to the message data packet.
[0019] Optionally, completing data parsing corresponding to the message data packet by the message data parsing sub-thread includes:
[0020] After completing the message data receiving operation, reading the message data packet from the data receiving buffer through the message data parsing sub-thread;
[0021] Performing message type parsing on the message data packet based on the specification information of the SPICE protocol to determine a parsing result and parsed data;
[0022] By determining whether the message format field of the parsed data complies with the specification information of the SPICE protocol, a data verification operation is completed to complete the message data parsing operation corresponding to the message data packet.
[0023] Optionally, completing data processing corresponding to the message data packet by the message data processing sub-thread includes:
[0024] After completing the message data parsing operation, determining a target message processing function through the message data processing sub-thread and based on a preset mapping rule and the parsing result;
[0025] Processing the message data packet by calling the target message processing function to determine a processing result;
[0026] A data transmission log corresponding to the message data packet is determined and output based on the processing result to complete a message data processing operation corresponding to the message data packet.
[0027] Optionally, after obtaining the data packet judgment result, the method further includes:
[0028] If the data packet judgment result indicates that the preset data receiving condition is not met, the reception of the message data packet is terminated, and the process jumps again to the step of iteratively reading the GIO input stream through the connected data transmission channel.
[0029] In a second aspect, the present application provides a remote desktop protocol data transmission device, which is applied to a SPICE client, including:
[0030] A channel connection module is configured to create and start a message data receiving sub-thread, a message data parsing sub-thread, and a message data processing sub-thread during the process of connecting a data transmission channel by executing a handshake process with a SPICE server; the data transmission channel includes a primary channel and a non-primary channel;
[0031] A data packet detection module is configured to iteratively read a GIO input stream through the connected data transmission channel to detect whether there is a message data packet in a to-be-read state sent by the SPICE server based on the SPICE protocol, and determine a data packet detection result;
[0032] A data packet determination module is configured to determine whether the message data packet in the to-be-read state meets a preset data receiving condition if the data packet detection result is yes, so as to obtain a data packet determination result;
[0033] The data packet transmission completion module is used to complete the data reception, data parsing and data processing corresponding to the message data packet through the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread in sequence if the data packet judgment result shows that it is satisfied, so as to complete the corresponding remote desktop protocol data transmission operation.
[0034] In a third aspect, the present application provides an electronic device, comprising:
[0035] Memory, used to store computer programs;
[0036] The processor is configured to execute the computer program to implement the steps of the aforementioned remote desktop protocol data transmission method.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the steps of the aforementioned remote desktop protocol data transmission method.
[0038] It can be seen that in this application, the SPICE client creates and starts a message data receiving sub-thread, a message data parsing sub-thread and a message data processing sub-thread in the process of connecting the data transmission channel by executing the handshake process between the SPICE server and the SPICE server; the data transmission channel includes a main channel and a non-main channel; the GIO input stream is iteratively read through the connected data transmission channel to detect whether there is a message data packet in a to-be-read state sent by the SPICE server based on the SPICE protocol, and determine the data packet detection result; if the data packet detection result is yes, it is determined whether the message data packet in the to-be-read state meets the preset data reception condition to obtain a data packet judgment result; if the data packet judgment result indicates that it meets the condition, the data reception, data parsing and data processing corresponding to the message data packet are completed in sequence through the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread to complete the corresponding remote desktop protocol data transmission operation. That is to say, in this application, a data transmission channel is first established with the SPICE server through the SPICE client, and a message data receiving sub-thread, a message data parsing sub-thread and a message data processing sub-thread are created and started. Then, based on the data transmission channel, it is detected whether there is a message data packet in a waiting-to-be-read state sent by the SPICE server based on the SPICE protocol. If so, it is determined whether the message data packet meets the preset data reception conditions, and when the conditions are met, the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread are used to complete the data reception, parsing and processing corresponding to the message data packet in sequence to complete the data transmission. In this way, the parallel processing of data packets from the SPICE server can be effectively achieved by adopting a multi-threaded approach, thereby improving the data packet receiving and processing capabilities of the SPICE client, reducing the number of TCP zero window notifications that occur during the channel transmission of data packets, and further alleviating the high latency and slow response problems that occur when the network bandwidth is limited or unstable. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0040] Figure 1 A flow chart of a remote desktop protocol data transmission method provided by this application;
[0041] Figure 2A flowchart of a specific remote desktop protocol data transmission method provided in this application;
[0042] Figure 3 A schematic diagram of the execution flow of a message data receiving sub-thread provided by this application;
[0043] Figure 4 A schematic diagram of the execution flow of a message data parsing sub-thread provided by this application;
[0044] Figure 5 A schematic diagram of the execution flow of a message data processing sub-thread provided by this application;
[0045] Figure 6 This is a schematic diagram of the structure of a remote desktop protocol data transmission device provided by this application;
[0046] Figure 7 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0048] In practical applications, especially when network bandwidth is limited or unstable, cloud desktops based on the SPICE protocol often have the following problems: (1) High latency and slow response: TCP is the transport layer protocol of SPICE. If the SPICE client cannot process the received data packets in time due to a full buffer, a large number of TCP zero window notifications will be generated and sent to the SPICE server, resulting in high latency and long response time when using the cloud desktop, which will directly affect the user's operating experience; (2) Single-threaded processing bottleneck: Traditional SPICE clients usually use a single-threaded mode for data reception, parsing, and processing. This serial processing method is prone to forming a performance bottleneck when facing a large amount of concurrent data, limiting the overall throughput and response speed of the system.
[0049] To this end, this application provides a remote desktop protocol data transmission solution that can improve the packet reception and processing capabilities of the SPICE client, reduce the number of TCP zero window notifications that appear during packet channel transmission, and further alleviate the high latency and slow response problems that occur when network bandwidth is limited or unstable.
[0050] See also Figure 1As shown, an embodiment of the present invention discloses a remote desktop protocol data transmission method, which is applied to a SPICE client, including:
[0051] Step S11: In the process of connecting the data transmission channel by executing the handshake process between the SPICE server and the server, a message data receiving sub-thread, a message data parsing sub-thread and a message data processing sub-thread are created and started; the data transmission channel includes a main channel and a non-main channel.
[0052] Specifically, this embodiment optimizes the data receiving and processing process of the SPICE client, combining Figure 2 As shown in the figure, in the SPICE client, the data reception and processing process is managed by a main thread. This main thread creates three sub-threads responsible for data reception, parsing, and processing tasks, which are executed in parallel. In this main thread, a data transmission channel is first established. The SPICE server and SPICE client establish a channel connection through a handshake process, including the main channel and non-main channels (such as the display channel and cursor channel). The TCP protocol is used to communicate in this established channel.
[0053] At the same time, this embodiment will also create and start a message data receiving sub-thread, a message data parsing sub-thread, and a message data processing sub-thread. It should be understood that the creation and startup of the above three sub-threads are completed when the channel is established, and these three sub-threads will run continuously thereafter.
[0054] Step S12: iteratively read the GIO input stream through the connected data transmission channel to detect whether there is a message data packet in a to-be-read state sent by the SPICE server based on the SPICE protocol, and determine the data packet detection result.
[0055] It should be understood that in this embodiment, after the data transmission channel is established, the server can send message data (in the form of data packets) through the channel. Specifically, the SPICE server generates message data packets based on the SPICE protocol and sends them to the SPICE client through the GIO output stream in the channel. Simultaneously, the SPICE client continuously iteratively reads the GIO input stream in the channel to detect whether there is any readable message data. If there is no readable message data, the client waits until it detects that there is readable message data before proceeding to the next step.
[0056] Step S13: If the data packet detection result is yes, determine whether the message data packet in the to-be-read state meets the preset data receiving condition to obtain a data packet determination result.
[0057] Combine Figure 2As shown, in this embodiment, when data is detected to be readable, the SPICE client creates a buffer for receiving message data, which is used to subsequently store the received message data. The client then reads the packet header to check whether its length complies with the protocol specifications. If not, the packet reception process is terminated; otherwise, the process proceeds to the next step. Specifically, if the packet detection result is positive, the creation of a data receive buffer is triggered. After completing the data receive buffer creation operation, the header of the message packet in the pending read state is read through the data transmission channel. A determination is made as to whether the header complies with the SPICE protocol specifications to obtain a packet verification result.
[0058] In addition, it can be understood that, in this embodiment, if the data packet detection result is negative, the process jumps again to the step of iteratively reading the GIO input stream through the connected data transmission channel until the determined data packet detection result indicates that there is currently the message data packet in the to-be-read state sent by the SPICE server based on the SPICE protocol.
[0059] Step S14: If the data packet judgment result shows that it is satisfied, the data reception, data parsing and data processing corresponding to the message data packet are completed in sequence through the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread to complete the corresponding remote desktop protocol data transmission operation.
[0060] Combine Figure 2 As shown, in this embodiment, if it is detected that the length of the message header meets the specification, the data packet is processed successively by the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread.
[0061] Regarding the data reception of the data packet by the message data receiving sub-thread, combined with Figure 3 As shown, in this embodiment, if the packet determination result indicates that the message header of the message packet complies with the specification information of the SPICE protocol, the message data receiving sub-thread, which has been created and started by running the above steps, determines the size of the message packet based on the message header, and allocates memory space corresponding to the message packet based on the size of the message packet and the created data receiving buffer; based on the memory space, the message packet is stored in the data receiving buffer to complete the message data receiving operation. That is, in this sub-thread, the message data, i.e., the size of the packet, is obtained based on the message header, and corresponding memory space is allocated in the buffer for storing the message data in the next step, and then the message data is stored in the receiving buffer to complete the data reception operation.
[0062] Regarding the data analysis of the data packet by the message data analysis sub-thread, combined with Figure 4 As shown, in this embodiment, after completing the message data reception operation, the message data packet is read from the data reception buffer by running the message data parsing sub-thread that has been created and started in the above steps; the message type of the message packet is parsed based on the SPICE protocol specification information to determine the parsing result and the parsed data; and the data format field of the parsed data is determined to comply with the SPICE protocol specification information to complete the message data parsing operation. In other words, in this sub-thread, the data packet stored in the SPICE client receive buffer is first read, and then the received binary data stream is parsed into a specific message type according to the SPICE protocol specification. To ensure that the data received by the SPICE client is complete and consistent after parsing, the message format field is verified to comply with the protocol specification to complete the data parsing.
[0063] Regarding the data processing of the data packet by the message data processing sub-thread, combined with Figure 5 As shown, in this embodiment, after completing the message data parsing sub-thread, the message data processing sub-thread, which has been created and started in the above steps, is run. A target message processing function is determined based on preset mapping rules and the parsing results. The message data packet is processed by calling the target message processing function to determine the processing result. Based on the processing result, a data transmission log corresponding to the message data packet is determined and output to complete the message data processing operation. In other words, in this sub-thread, based on the parsed message type, the SPICE client calls the corresponding message processing function to perform operations. This mapping relationship (i.e., the binding relationship between protocol message type and message processing function) is configured when the channel is successfully created. After the message data packet is processed, a log is output to record the processing results.
[0064] It should be understood that as long as the above three sub-threads will continue to run in a loop to process the message data packets that need to be read, they will not end until the program stops. Figure 3 、 4 The end of the sub-thread shown in Figure 5 only means that the sub-thread has completed the reception / parsing / processing of the message data by running it once. In fact, the sub-thread does not end its operation, but will continue to receive / parse / process the next message data until the program stops.
[0065] It is understandable that after the processing of the data packet is completed through the above three sub-threads, the receiving buffer memory will be cleared to facilitate the subsequent reception and processing of other data packets.
[0066] At the same time, in this embodiment, after obtaining the data packet judgment result, if the data packet judgment result indicates that the preset data reception condition is not met, the reception of the message data packet is terminated, and the process jumps again to the step of iteratively reading the GIO input stream through the connected data transmission channel.
[0067] In summary, the data transmission solution described in this embodiment uses a multi-threaded mode to process data packets from the SPICE server in parallel. While one sub-thread is processing a data packet, other sub-threads can continue to receive and parse new data packets, reducing the waiting time between stages. The multi-threaded architecture enables each task (such as receiving, parsing, and processing) to be completed more quickly, which can effectively improve the data reception and processing capabilities of the SPICE client, thereby alleviating the high latency and slow response problems of the cloud desktop in situations where network bandwidth is limited or unstable, and improving the overall throughput and response speed of the system. In other words, by enhancing the speed and efficiency of the SPICE client's data packet reception, parsing, and processing, it is possible to break through the performance bottleneck of single-threaded processing, thereby improving the overall throughput and response speed of the system.
[0068] It can be seen that in this application, a data transmission channel is first established with the SPICE server through the SPICE client, and a message data receiving sub-thread, a message data parsing sub-thread and a message data processing sub-thread are created and started. Then, based on the data transmission channel, it is detected whether there is a message data packet in a waiting-to-be-read state sent by the SPICE server based on the SPICE protocol. If so, it is determined whether the message data packet meets the preset data receiving conditions, and when the conditions are met, the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread are used to complete the data reception, parsing and processing corresponding to the message data packet in sequence to complete the data transmission. In this way, the parallel processing of data packets from the SPICE server can be effectively achieved by adopting a multi-threaded approach, which improves the data packet receiving and processing capabilities of the SPICE client, reduces the number of TCP zero window notifications that occur during the channel transmission of data packets, and further alleviates the high latency and slow response problems that occur when the network bandwidth is limited or unstable.
[0069] See also Figure 6 As shown, the embodiment of the present application also discloses a remote desktop protocol data transmission device, which is applied to a SPICE client, including:
[0070] The channel connection module 11 is used to create and start a message data receiving sub-thread, a message data parsing sub-thread, and a message data processing sub-thread in the process of connecting the data transmission channel by executing the handshake process between the SPICE server and the SPICE server; the data transmission channel includes a primary channel and a non-primary channel;
[0071] The data packet detection module 12 is configured to iteratively read the GIO input stream through the connected data transmission channel to detect whether there is a message data packet in a to-be-read state sent by the SPICE server based on the SPICE protocol, and determine a data packet detection result;
[0072] The data packet determination module 13 is configured to determine whether the message data packet in the to-be-read state meets a preset data receiving condition if the data packet detection result is yes, so as to obtain a data packet determination result;
[0073] The data packet transmission completion module 14 is used to complete the data reception, data parsing and data processing corresponding to the message data packet through the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread in sequence if the data packet judgment result shows that it is satisfied, so as to complete the corresponding remote desktop protocol data transmission operation.
[0074] It can be seen that in this application, a data transmission channel is first established with the SPICE server through the SPICE client, and a message data receiving sub-thread, a message data parsing sub-thread and a message data processing sub-thread are created and started. Then, based on the data transmission channel, it is detected whether there is a message data packet in a waiting-to-be-read state sent by the SPICE server based on the SPICE protocol. If so, it is determined whether the message data packet meets the preset data receiving conditions, and when the conditions are met, the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread are used to complete the data reception, parsing and processing corresponding to the message data packet in sequence to complete the data transmission. In this way, the parallel processing of data packets from the SPICE server can be effectively achieved by adopting a multi-threaded approach, which improves the data packet receiving and processing capabilities of the SPICE client, reduces the number of TCP zero window notifications that occur during the channel transmission of data packets, and further alleviates the high latency and slow response problems that occur when the network bandwidth is limited or unstable.
[0075] In some specific embodiments, the remote desktop protocol data transmission device may further include:
[0076] A step jumping unit is used to jump back to the step of iteratively reading the GIO input stream through the connected data transmission channel if the data packet detection result is negative, until the determined data packet detection result indicates that there is currently the message data packet in the to-be-read state sent by the SPICE server based on the SPICE protocol.
[0077] In some specific embodiments, the data packet determination module 13 may specifically include:
[0078] a buffer creation unit, configured to trigger a data receiving buffer creation operation if the data packet detection result is yes;
[0079] A message header reading unit, configured to read the message header of the message data packet in a to-be-read state through the data transmission channel after completing the data receiving buffer creation operation;
[0080] The data packet judgment unit is used to judge whether the message header complies with the specification of the SPICE protocol to obtain a data packet judgment result.
[0081] In some specific embodiments, the remote desktop protocol data transmission device may specifically include:
[0082] a memory allocation unit configured to, if the data packet judgment result indicates that the message header of the message data packet complies with the specification information of the SPICE protocol, determine the size of the message data packet based on the message header through the message data receiving sub-thread, and allocate memory space corresponding to the message data packet according to the size of the message data packet and the created data receiving buffer;
[0083] A data storage unit is used to store the message data packet in the data receiving buffer based on the memory space to complete a message data receiving operation corresponding to the message data packet.
[0084] In some specific embodiments, the remote desktop protocol data transmission device may specifically include:
[0085] A data reading unit, configured to read the message data packet from the data receiving buffer through the message data parsing sub-thread after completing the message data receiving operation;
[0086] A data parsing unit, configured to perform message type parsing on the message data packet based on the specification information of the SPICE protocol to determine a parsing result and parsed data;
[0087] The data verification unit is used to complete the data verification operation by judging whether the message format field of the parsed data conforms to the specification information of the SPICE protocol, so as to complete the message data parsing operation corresponding to the message data packet.
[0088] In some specific embodiments, the remote desktop protocol data transmission device may specifically include:
[0089] a function determination unit configured to determine, after completing the message data parsing operation, a target message processing function through the message data processing sub-thread and based on a preset mapping rule and the parsing result;
[0090] A data packet processing unit, configured to process the message data packet by calling the target message processing function to determine a processing result;
[0091] The sub-thread completion unit is used to determine and output the data transmission log corresponding to the message data packet based on the processing result, so as to complete the message data processing operation corresponding to the message data packet.
[0092] In some specific embodiments, the remote desktop protocol data transmission device may further include:
[0093] The receiving termination unit is configured to terminate receiving the message data packet and re-jump to the step of iteratively reading the GIO input stream through the connected data transmission channel if the data packet judgment result indicates that the preset data receiving condition is not met.
[0094] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation to the scope of application of the present application.
[0095] Figure 7 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the remote desktop protocol data transmission method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0096] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0097] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0098] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of implementing the remote desktop protocol data transmission method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program capable of completing other specific tasks.
[0099] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned remote desktop protocol data transmission method. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.
[0100] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0101] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0102] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0103] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0104] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A remote desktop protocol data transmission method, characterized in that: Applied to SPICE clients, including: In the process of connecting the data transmission channel by executing the handshake process between the SPICE server and the client, a message data receiving sub-thread, a message data parsing sub-thread and a message data processing sub-thread are created and started; the data transmission channel includes a main channel and a non-main channel; Iteratively reading the GIO input stream through the connected data transmission channel to detect whether there is a message data packet in a to-be-read state sent by the SPICE server based on the SPICE protocol, and determining a data packet detection result; If the data packet detection result is yes, then determining whether the message data packet in the to-be-read state meets a preset data receiving condition to obtain a data packet determination result; If the data packet judgment result shows that it is satisfied, the data reception, data parsing and data processing corresponding to the message data packet are completed in sequence through the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread to complete the corresponding remote desktop protocol data transmission operation.
2. The remote desktop protocol data transmission method according to claim 1, wherein: After determining the data packet detection result, the method further includes: If the data packet detection result is no, then jump back to the step of iteratively reading the GIO input stream through the connected data transmission channel until the determined data packet detection result indicates that there is currently the message data packet in the to-be-read state sent by the SPICE server based on the SPICE protocol.
3. The remote desktop protocol data transmission method according to claim 1, wherein: If the data packet detection result is yes, determining whether the message data packet in the to-be-read state meets a preset data receiving condition to obtain a data packet determination result includes: If the data packet detection result is yes, triggering a data receiving buffer creation operation; After completing the data receiving buffer creation operation, reading the message header of the message data packet in a to-be-read state through the data transmission channel; Determine whether the message header complies with the specification of the SPICE protocol to obtain a data packet determination result.
4. The remote desktop protocol data transmission method according to claim 3, wherein: If the data packet judgment result indicates that the message data packet is satisfied, the data receiving sub-thread completes the data receiving corresponding to the message data packet, including: If the data packet judgment result indicates that the message header of the message data packet complies with the specification information of the SPICE protocol, the size of the message data packet is determined based on the message header through the message data receiving sub-thread, and memory space corresponding to the message data packet is allocated according to the size of the message data packet and the created data receiving buffer; The message data packet is stored in the data receiving buffer based on the memory space to complete a message data receiving operation corresponding to the message data packet.
5. The remote desktop protocol data transmission method according to claim 4, characterized in that: The data parsing corresponding to the message data packet is completed by the message data parsing sub-thread, including: After completing the message data receiving operation, reading the message data packet from the data receiving buffer through the message data parsing sub-thread; Performing message type parsing on the message data packet based on the specification information of the SPICE protocol to determine a parsing result and parsed data; By determining whether the message format field of the parsed data complies with the specification information of the SPICE protocol, a data verification operation is completed to complete the message data parsing operation corresponding to the message data packet.
6. The remote desktop protocol data transmission method according to claim 5, characterized in that: The data processing corresponding to the message data packet is completed by the message data processing sub-thread, including: After completing the message data parsing operation, determining a target message processing function through the message data processing sub-thread and based on a preset mapping rule and the parsing result; Processing the message data packet by calling the target message processing function to determine a processing result; A data transmission log corresponding to the message data packet is determined and output based on the processing result to complete a message data processing operation corresponding to the message data packet.
7. The remote desktop protocol data transmission method according to claim 1, wherein: After obtaining the data packet judgment result, the method further includes: If the data packet judgment result indicates that the preset data receiving condition is not met, the reception of the message data packet is terminated, and the process jumps again to the step of iteratively reading the GIO input stream through the connected data transmission channel.
8. A remote desktop protocol data transmission device, characterized in that: Applied to SPICE clients, including: A channel connection module is configured to create and start a message data receiving sub-thread, a message data parsing sub-thread, and a message data processing sub-thread during the process of connecting a data transmission channel by executing a handshake process with a SPICE server; the data transmission channel includes a primary channel and a non-primary channel; A data packet detection module is configured to iteratively read a GIO input stream through the connected data transmission channel to detect whether there is a message data packet in a to-be-read state sent by the SPICE server based on the SPICE protocol, and determine a data packet detection result; a data packet determination module, configured to determine whether the message data packet in a to-be-read state satisfies a preset data receiving condition if the data packet detection result is yes, so as to obtain a data packet determination result; The data packet transmission completion module is used to complete the data reception, data parsing and data processing corresponding to the message data packet through the message data receiving sub-thread, the message data parsing sub-thread and the message data processing sub-thread in sequence if the data packet judgment result shows that it is satisfied, so as to complete the corresponding remote desktop protocol data transmission operation.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the remote desktop protocol data transmission method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Used to store a computer program, which, when executed by a processor, implements the remote desktop protocol data transmission method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Request message processing method and device and computer readable storage medium
CN111193690A
Streaming media data processing method and system and storage server
CN112333475A
Method, device and equipment for multiplexing with data verification based on TCP / IP (Transmission Control Protocol / Internet Protocol)
CN115765925A
Data transmission method and device based on SPICE protocol and readable storage medium
CN115865909A
Message processing method and device, electronic equipment and readable storage medium
CN118132292A