Communication methods, systems, electronic devices, media and products
By adopting the first protocol to encapsulate and transmit messages in the remote desktop system, commands are only processed by the remote desktop service unit, which solves the problem that the network service unit failure affects the remote desktop function, and improves the stability of the remote desktop function and user experience.
Patent Information
- Application Number
- CN202510888755.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-27
AI Technical Summary
In the remote desktop function, the server's network service unit is susceptible to excessive load, network failure or software errors, resulting in the inability to process commands normally, affecting the stability of the remote desktop function and user experience.
The target command is encapsulated as a first message through the first protocol and sent to the network service unit of the server through a communication channel based on the first protocol. The first message is only processed by the remote desktop service unit to avoid the impact of the remote desktop service unit on the failure of the network service unit.
Improves the stability and user experience of the Remote Desktop feature, ensuring that the Remote Desktop Services unit can still process commands normally even when there are problems with the Network Services unit.
Smart Images

Figure CN120416240B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of desktop virtualization technology, and in particular to communication methods, systems, electronic devices, media, and products. Background Art
[0002] In the application scenario of remote desktop, by leveraging the remote desktop function of the server, you can remotely view and manage the operating system desktop at any time, achieving convenient management.
[0003] In related technologies, commands are received and processed through the server's network service unit. If the server encounters problems such as excessive load, network failure, software errors, etc., the network service unit will not be able to process commands normally, thereby affecting the normal use of the remote desktop function. Summary of the Invention
[0004] The present application provides a communication method, system, electronic device, medium and product to at least solve the problem in the related art that the remote desktop function cannot be used normally.
[0005] The present application provides a communication method, which is applied to a terminal device. The communication method includes:
[0006] Determine target command;
[0007] encapsulating the target command according to the first protocol to obtain a first message;
[0008] A first message is sent to a server via a first communication channel. The first communication channel is a communication channel based on a first protocol. The server includes: a network service unit and a remote desktop service unit. The network service unit sends the first message to the remote desktop service unit. The remote desktop service unit is used to process the first message.
[0009] The present application provides a communication method, which is applied to a server. The server includes: a network service unit and a remote desktop service unit. The communication method includes:
[0010] Using a network service unit to receive a first message sent by a terminal device through a first communication channel, where the first communication channel is a communication channel based on a first protocol;
[0011] Using the network service unit to send a first message to the remote desktop service unit;
[0012] The first message is processed using a remote desktop service unit.
[0013] The present application also provides a communication device, which is applied to a terminal device. The communication device includes:
[0014] A determination module, used to determine the target command;
[0015] an encapsulation module, configured to encapsulate a target command according to a first protocol to obtain a first message;
[0016] A sending module is used to send a first message to a server through a first communication channel. The first communication channel is a communication channel based on a first protocol. The server includes: a network service unit and a remote desktop service unit. The network service unit sends the first message to the remote desktop service unit, and the remote desktop service unit is used to process the first message.
[0017] The present application also provides a communication device, which is applied to a server. The server includes: a network service unit and a remote desktop service unit. The communication device includes:
[0018] a receiving module, configured to use a network service unit to receive a first message sent by a terminal device through a first communication channel, where the first communication channel is a communication channel based on a first protocol;
[0019] A sending module, configured to send a first message to a remote desktop service unit using a network service unit;
[0020] The processing module is configured to process the first message using a remote desktop service unit.
[0021] The present application also provides a communication system, including: a terminal device and a server, wherein:
[0022] The terminal device is used to determine a target command; encapsulate the target command according to a first protocol to obtain a first message; and send the first message to the server through a first communication channel, where the first communication channel is a communication channel based on the first protocol.
[0023] The server is used to: use a network service unit to receive a first message sent by a terminal device through a first communication channel; use the network service unit to send the first message to a remote desktop service unit; and use the remote desktop service unit to process the first message.
[0024] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the above-mentioned communication method when executing the computer program.
[0025] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned communication method are implemented.
[0026] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned communication method when executed by a processor.
[0027] In an embodiment of the present application, a first message is obtained by encapsulating a target command through a first protocol, and the first message can be sent to a network service unit of a server through a first communication channel based on the first protocol, wherein the network service unit of the server is only used to forward the first message and does not need to process the first message. The present application uses a remote desktop service unit of the server to process the first message, so even if some problems occur in the network service unit, it will not affect the remote desktop service unit's processing of the first message, thereby improving the stability of the remote desktop function. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0029] Figure 1 A schematic diagram of a communication system provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of a communication method provided in an embodiment of the present application Figure 1 ;
[0031] Figure 3 A schematic diagram of a communication method provided in an embodiment of the present application Figure 2 ;
[0032] Figure 4 A schematic diagram of a communication method provided in an embodiment of the present application Figure 3 ;
[0033] Figure 5 A schematic diagram of a communication method provided in an embodiment of the present application;
[0034] Figure 6 A schematic diagram of a communication method provided in an embodiment of the present application Figure 4 ;
[0035] Figure 7 A schematic diagram of a communication method provided in an embodiment of the present application Figure 5 ;
[0036] Figure 8 A flowchart of an authentication process provided in an embodiment of the present application;
[0037] Figure 9 A schematic diagram of the structure of a communication device provided in an embodiment of the present application Figure 1 ;
[0038] Figure 10A schematic diagram of the structure of a communication device provided in an embodiment of the present application Figure 2 ;
[0039] Figure 11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0041] It should be noted that, in the description of this application, the terms "comprises," "includes," 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. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0042] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0043] The server's remote desktop feature is a key service of the server's BMC (Baseboard Management Controller). It allows users to remotely view the operating system desktop for convenient management. This feature requires no modifications to the server software, supports remote access to the server at any time, and provides motherboard-level permissions.
[0044] In related technologies, remote desktop functionality relies on Redfish / Restful over HTTPS (Hypertext Transfer Protocol Secure) to remotely control server power on / off, view the BWC's IP (Internet Protocol) address, and check the server's SN (Serial Number). Redfish is a standard based on the RESTful architecture, a software architecture. Redfish / Restful commands over HTTPS require the server's web server to receive and process commands. However, the web server is susceptible to factors such as excessive server load, network failures, and software errors. These factors can affect the web server's ability to process messages properly, rendering the remote desktop functionality unusable and reducing the user experience.
[0045] Based on the above problems, the present application encapsulates the target command through the first protocol to obtain a first message, and the first message can be sent to the network service unit of the server through a first communication channel based on the first protocol, wherein the network service unit of the server is only used to forward the first message and does not need to process the first message. The present application uses the remote desktop service unit of the server to process the first message, so even if some problems occur in the network service unit, it will not affect the remote desktop service unit's processing of the first message, thereby improving the stability of the remote desktop function and improving the user experience.
[0046] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0047] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the communication method depends, the specific application environment architecture or specific hardware architecture is described herein. Figure 1 , Figure 1 This is an example diagram of an application scenario of the communication method. Figure 1 The communication system 10 includes a terminal device 11 and a server 12, and the server includes: a network service unit 121 and a remote desktop service unit 122, wherein the terminal device 11 sends a first message to the server 12 through a first communication channel, the network service unit 121 in the server 12 receives the first message, the network service unit 121 forwards the first message to the remote desktop service unit 122, and the remote desktop service unit 122 processes the first message.
[0048] Combined with the scene example, refer to Figure 1The network service unit 121 is not used to process the first message sent by the terminal device. The first message is processed by the remote desktop service unit 122. Therefore, when the processing capability of the network service unit 121 is affected, the remote desktop function of the server will not be affected, thereby improving the stability of remote desktop use.
[0049] Figure 2 A flow chart of the steps of a communication method is shown, which is applied to a terminal device and specifically includes the following steps:
[0050] S201, determining the target command.
[0051] The target command refers to a command to be sent to the server. For example, the target command may be an authentication command, a mouse command, a keyboard command, or a video command.
[0052] In the embodiment of the present application, the terminal device determines the target command according to demand, which is not limited here.
[0053] S202: Encapsulate the target command according to the first protocol to obtain a first message.
[0054] In some embodiments, the first protocol may be a Web Socket (WS) protocol, specifically, the first protocol may be a Web Socket Secure (WSS) protocol, which is a WebSocket secure communication protocol based on TLS / SSL (Transport Layer Security / Secure Sockets Layer) encryption.
[0055] In an embodiment of the present application, the target command is encapsulated according to the requirements of the first protocol to obtain a first message.
[0056] In some embodiments, encapsulating a target command according to a first protocol to obtain a first message includes: determining a first message header according to the first protocol; encapsulating the target command according to the first protocol to obtain a first message body; and encapsulating the first message header and the first message body according to the first protocol to obtain the first message.
[0057] In the embodiment of the present application, the designed first protocol stipulates that each message communicated between the terminal device and the server includes a message header and a message body.
[0058] Furthermore, based on the first protocol, a first message header and a first message body can be determined, and the first message header and the first message body are encapsulated to obtain a first message. It can be understood that the first message includes the first message header and the first message body, and the target command is encapsulated in the first message body.
[0059] In some embodiments, determining the first message header according to the first protocol includes: obtaining a first magic number, a first message type, a first data packet status, a first cyclic redundancy check, and a first message body length of the target command; encapsulating the first magic number, the first message type, the first data packet status, the first cyclic redundancy check, and the first message body length according to the first protocol to obtain the first message header.
[0060] In an embodiment of the present application, the first protocol may specify that each message header includes: a magic number, a message type, a data packet status, a CRC (Cyclic Redundancy Check), and a message body length.
[0061] Specifically, the first protocol can refer to Table 1:
[0062] Table 1
[0063]
[0064] In Table 1, the first protocol specifies that the message header contains a magic number of 2 bytes, a message type of 1 byte, a packet status of 1 byte, a CRC of 2 bytes, a message body length of 4 bytes, and zero bytes of data, meaning the message header contains no data. The first protocol does not specify the number of bytes in the message body.
[0065] In addition, the magic number is a fixed value. The first protocol uses the magic number as the starting identifier of the message to facilitate rapid identification and parsing of the message. Other messages that do not contain the magic number may not be parsed or processed. It can be understood that the magic number is used to indicate that the message containing the magic number is a message that needs to be processed.
[0066] The message type is used to indicate that the message is a message of the first protocol type, or the message type can also indicate whether the message body contains commands or data. This application does not limit the type of message type indication. It can be understood that the first protocol clearly states that the message header contains the message type, which helps the terminal device or server receiving the message to determine the purpose and processing method of the message.
[0067] The data packet status is used to indicate whether the message body needs to be replied, whether the message body is encrypted, or whether the message body needs CRC check. The data packet status can be flexibly configured according to needs.
[0068] CRC is used to indicate the CRC verification algorithm of the message body. Exemplarily, an algorithm such as SHA256 (Secure Hash Algorithm 256-bit, a cryptographic hash function) is used. It can be understood that using CRC to verify the first message body can enhance the accuracy and reliability of the transmission of the first message body and promptly detect data errors during the transmission process.
[0069] Furthermore, the message body length refers to the length of the message body, which facilitates the terminal device or server receiving the message to receive and parse the message in its entirety. The content of the message body can be matched according to the message type.
[0070] In some embodiments, determining the first message header according to the first protocol includes: obtaining a first magic number, a first message type, a first data packet status, a first cyclic redundancy check, and a first message body length of the target command; encapsulating the first magic number, the first message type, the first data packet status, the first cyclic redundancy check, and the first message body length according to the first protocol to obtain the first message header.
[0071] Among them, the target command has a mapping relationship with the first magic number, the first message type, the first data packet status, the first cyclic redundancy check and the first message body length. The mapping relationship can be stored on the terminal device side and the server side. After the terminal device determines the target command, it can obtain the first magic number, the first message type, the first data packet status, the first cyclic redundancy check and the first message body length of the target command according to the mapping relationship.
[0072] In the embodiments of the present application, referring to Table 1, the first magic number can be a fixed value, such as 0x3132, or the ASCII "11." Different target commands can use the same or different first magic numbers, without limitation. The first magic number serves as the starting identifier of the first message, allowing the server to quickly identify the first message as a message of the first protocol that requires parsing.
[0073] In some embodiments, the first message type indicates that the first message is a message of a first protocol type.
[0074] Furthermore, the first data packet status includes at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate whether the first message body needs to be replied, the second indication information is used to indicate whether the first message body is encrypted, and the third indication information is used to indicate whether the first message body needs cyclic redundancy check.
[0075] Exemplarily, referring to Table 1, the first indication information is the value of bit 0. If the value of bit 0 is 1, the first indication information indicates that the first message requires a reply; if the value of bit 0 is 0, the first indication information indicates that the first message does not require a reply. The second indication information is the value of bit 1. If the value of bit 1 is 1, the second indication information indicates that the first message body requires encryption; if the value of bit 1 is 0, the first indication information indicates that the first message body does not require encryption. The third indication information is the value of bit 2. If the value of bit 2 is 1, the third indication information indicates that the first message body requires CRC check; if the value of bit 2 is 0, the third indication information indicates that the third message body does not require CRC check.
[0076] Furthermore, if the first message header includes CRC, the server may be instructed to verify the first message body according to the CRC verification algorithm specified in the first protocol, thereby ensuring the accuracy and security of the first message transmission process.
[0077] In the present application, the first message header includes the length of the first message body, so that the server can completely receive and parse the first message.
[0078] Referring to Tables 2 to 4, which are command designs for the first protocol, the terminal device and the server can determine the specific command to be executed based on the command number.
[0079] Table 2
[0080]
[0081] Table 3
[0082]
[0083] Table 4
[0084]
[0085] In Tables 2 to 4, each command includes a command number, a command name, a command description, and command data. Tables 2 to 4 are merely exemplary, and the specific command number, command name, command description, and command data can be adjusted as needed.
[0086] In some embodiments, encapsulating a target command according to a first protocol to obtain a first message body includes: obtaining a command number corresponding to the target command according to the first protocol; determining whether the target command has corresponding command data; if so, encapsulating the command number and command data to obtain the first message body; if not, encapsulating the command number to obtain the first message body.
[0087] In some embodiments, only the value in the command data may be encapsulated in the first message body, or other content may be encapsulated as needed, which is not limited here.
[0088] For example, if the command name of the target command is an authentication command, then the command number of the target command can be determined to be 02. The target command includes command data, the command data has an authentication type of 2, and the authentication content is the username and password, the terminal device IP address, and the terminal device MAC (Media Access Control Address). During the encapsulation process, the command number 02 and the command data can be encapsulated into a first message. After receiving the first message, the server can parse the command number and command data in the first message and determine to execute the authentication command based on the command number. Specifically, the authentication command can be executed based on the command data. For example, the username and password, the terminal device IP address, and the terminal device MAC can be authenticated.
[0089] Also exemplarily, if the command name of the target command is a keep-alive response command, it can be determined that the command number of the target command is 09. The target command does not include command data. During the encapsulation process, the command number 09 can be encapsulated as the first message. After receiving the first message, the server can obtain the command number 09 in the first message through parsing, determine the keep-alive response command based on the command number 09, and then execute the keep-alive response command.
[0090] S203: Send a first message to the server through the first communication channel.
[0091] The first communication channel is a communication channel based on the first protocol. The server includes: a network service unit and a remote desktop service unit. The network service unit sends the first message to the remote desktop service unit, and the remote desktop service unit is used to process the first message.
[0092] In the embodiment of the present application, a first message is sent to a server via a first communication channel of a network socket protocol, so that a remote desktop service unit in the server can process the first message. It is understood that the first message sent via the first communication channel is received by the network service unit and forwarded to the remote desktop service unit for processing. The network service unit also processes the first message. Therefore, even if problems with the server affect the processing capabilities of the network service unit, this does not affect the remote desktop service unit's ability to process the first message, thereby improving the stability of the remote desktop function.
[0093] In some embodiments, referring to Figure 3 After sending the first message to the server through the first communication channel, the communication method further includes the following steps:
[0094] S301: Receive a third message sent by a server.
[0095] In this embodiment of the present application, the third message is a reply to the first message. It is understood that the first communication channel is the communication channel between the terminal device and the server. If the first message is sent from the terminal device to the server via the first communication channel, then the third message is sent from the server to the terminal device via the first communication channel.
[0096] The third message is also encapsulated according to the first protocol.
[0097] S302: Parse the third message according to the first protocol to obtain a third message header and a third message body.
[0098] It can be understood that, on the server side, the server encapsulates the third message header and the third message body according to the first protocol to obtain the third message.
[0099] S303: Parse the third message header according to the first protocol to obtain a third magic number.
[0100] Among them, by parsing the third message header according to the first protocol, a third message type, a third data packet status, a third cyclic redundancy check, and a third message body length can also be obtained.
[0101] S304: When the third magic number is a preset value, parse the third message body according to the first protocol to obtain target data.
[0102] In the embodiment of the present application, the target data is encapsulated in the third message body.
[0103] In some embodiments, the third message header is parsed according to the first protocol to obtain a third cyclic redundancy check, and the third message body is parsed according to the first protocol to obtain the target data, including: verifying the third message body according to the third cyclic redundancy check; if the third message body passes the verification, parsing the third message body according to the first protocol to obtain the target data.
[0104] It can be understood that if the third cyclic redundancy check is parsed from the third message header, the CRC algorithm corresponding to the third cyclic redundancy check can be determined according to the first protocol, and the third message body can be verified according to the CRC algorithm. It can be understood that using CRC to verify the third message body can enhance the accuracy and reliability of the transmission of the third message body and promptly detect data errors during the transmission process.
[0105] Furthermore, the terminal device can encapsulate the target data according to the display protocol, and the encapsulated target data can be displayed on the terminal device, thereby realizing remote desktop control of the server by the terminal device.
[0106] In an embodiment of the present application, the terminal device encapsulates a first message according to the first protocol and a specific command request, and sends the first message to the server via the first protocol. Furthermore, the terminal device also has a function of receiving a third message according to the first protocol. Upon receiving the third message, the terminal device performs steps such as parsing, validating, and displaying the third message according to the first protocol.
[0107] In summary, the present application can encapsulate the first message according to the first protocol, and the terminal device sends the first message to the server through the first communication channel. In addition, the terminal device can receive the third message through the first communication channel and parse the third message according to the first protocol to obtain the target data, thereby realizing stable transmission of messages between the terminal device and the server, thereby improving the stability of remote desktop control.
[0108] Reference Figure 4 , showing a flowchart of another communication method of the present application, applied to a terminal device, specifically comprising the following steps:
[0109] S401, determining the target command.
[0110] The specific implementation process of this step can refer to S201 and will not be repeated here.
[0111] S402: Encapsulate the target command according to the first protocol to obtain a first message.
[0112] Reference Figure 5 The interaction between the terminal device and the server is a client-server architecture (CS). Two communication channels exist between the terminal device and the server: a first communication channel and a second communication channel. The first communication channel is based on a first protocol, and the second communication channel is based on a second protocol. Furthermore, the first protocol can be the Web Sockets protocol, and the second protocol can be the Hypertext Transfer Protocol (HTTP) secure protocol.
[0113] In the embodiment of the present application, the communication with the server may be performed preferentially through the first communication channel based on user selection, or may be pre-configured to preferentially communicate with the server through the first communication channel, which is not limited to this.
[0114] It is understood that if the first communication channel is used to communicate with the server first, the terminal device encapsulates the target command according to the first protocol to obtain the first message. The specific encapsulation process can refer to the above S202 and will not be repeated here.
[0115] S403: Send a first message to the server through the first communication channel.
[0116] The specific implementation process of this step is referred to S203 and will not be repeated here.
[0117] S404: When the first message fails to be sent, encapsulate the target command according to the second protocol to obtain a second message.
[0118] It can be understood that in the embodiment of the present application, the first communication channel is preferentially used to send the first message to the server. If the first message fails to be sent, that is, the first message is not sent to the server, the target command is encapsulated according to the second protocol to obtain the second message.
[0119] In an embodiment of the present application, the second protocol is Hypertext Transfer Protocol Secure (HTTP).
[0120] S405: Send a second message to the server through the second communication channel.
[0121] The second communication channel is a communication channel based on the second protocol.
[0122] It can be understood that the second information encapsulated according to the second protocol is sent to the server through the second communication channel.
[0123] In the embodiment of the present application, the network service unit receives and parses the second message.
[0124] Furthermore, if the server needs to return target data to the terminal device, the server encapsulates the target data according to the second protocol to obtain a fourth message, and the server sends the fourth message to the terminal device through the second communication channel.
[0125] It is understood that if the terminal device successfully sends the first message to the server via the first communication channel, the server encapsulates the target data according to the first protocol to obtain a third message, and the third message is sent to the terminal device via the first communication channel. If the terminal device successfully sends the second message to the server via the second communication channel, the server encapsulates the target data according to the second protocol to obtain a fourth message, and the fourth message is sent to the terminal device via the second communication channel.
[0126] For example, referring to Figure 5If the first communication channel is used first, after the terminal device determines the target command, it uses the first protocol to encapsulate the target command to obtain a first message, and then the terminal device 11 sends the first message to the server 12. If the sending is successful, the network service unit 121 of the server 12 receives the first message and sends the first message to the remote desktop service unit 122. After receiving the first message, the remote desktop service unit 122 parses the first message to obtain the target command, and then executes the target command. If data needs to be returned, the target data is obtained, and then the target data is encapsulated to obtain a third message. The server 12 sends the third message to the terminal device 11 through the first communication channel through the network service unit 121. The terminal device parses the third message to obtain the target data and displays the target data on the terminal device.
[0127] If the terminal device 11 sends a first message to the server 12 but fails to send the message, the second protocol is used to encapsulate the target command to obtain a second message, and the second message is sent to the server 12 through the second communication channel. The network service unit 121 parses the second message to obtain the target command, and then sends the target command to the remote desktop service unit 122 for execution. After execution, the target data is sent to the network service unit 121. The network service unit 121 encapsulates the target data according to the second protocol to obtain a fourth message, and then sends the fourth message to the terminal device 11 through the second communication channel. The terminal device 11 parses the fourth message through the second protocol to obtain the target data, and then displays the target data on the terminal device 11.
[0128] In an embodiment of the present application, the target data may be a remote desktop image, power on / off status data, server IP or server SN.
[0129] Furthermore, the server includes D-BUS (Desktop Bus), which is a free software that provides a simple way for applications to communicate with each other.
[0130] In summary, the command channel switching function integrated in the terminal device allows users to manually choose to use the first communication channel to send the first message first. If the first message fails to be sent through the first communication channel, it will automatically switch to using another second communication channel to send the second message. This can ensure the normal operation of the remote desktop function, greatly reduce the probability of problems occurring during the use of the remote desktop function, and make users use the remote desktop function more smoothly and efficiently, significantly improving the user experience.
[0131] Reference Figure 6 , showing a flowchart of another communication method of the present application, applied to a terminal device, specifically comprising the following steps:
[0132] S601, determining the target command.
[0133] The specific implementation process of the step can refer to S201 and will not be repeated here.
[0134] S602: Encapsulate the target command according to the second protocol to obtain a second message.
[0135] Reference Figure 5 There are two communication channels between the terminal device and the server, namely a first communication channel and a second communication channel. The first communication channel is a communication channel based on a first protocol, and the second communication channel is a communication channel based on a second protocol. Furthermore, the first protocol can be the Internet Sockets Protocol, and the second protocol is the Hypertext Transfer Protocol Secure (HTTS).
[0136] In the embodiment of the present application, the communication with the server may be performed preferentially through the second communication channel based on user selection, or may be pre-configured to preferentially communicate with the server through the second communication channel, which is not limited to this.
[0137] It can be understood that if communication with the server is performed preferentially through the second communication channel, the terminal device encapsulates the target command according to the second protocol to obtain the second message.
[0138] S603: Send a second message to the server through the second communication channel.
[0139] The second communication channel is a communication channel based on the second protocol.
[0140] It can be understood that the second information is encapsulated according to the second protocol and sent to the server through the second communication channel.
[0141] S604: When the second message fails to be sent, encapsulate the target command according to the first protocol to obtain a first message.
[0142] It can be understood that in the embodiment of the present application, the second communication channel is preferentially used to send the first message to the server. If the second message fails to be sent, that is, the second message is not sent to the server, the target command is encapsulated according to the first protocol to obtain the first message. The specific encapsulation process refers to S202 and will not be repeated here.
[0143] S605: Send a first message to the server through the first communication channel.
[0144] The specific implementation process of this step is referred to S203 and will not be repeated here.
[0145] In summary, the command channel switching function integrated in the terminal device allows users to manually choose to use the second communication channel to send the second message first. If the second message fails to be sent through the second communication channel, it will automatically switch to using another first communication channel to send the first message, which can ensure the normal operation of the remote desktop function, greatly reduce the probability of problems occurring during the use of the remote desktop function, and make users use the remote desktop function more smoothly and efficiently, significantly improving the user experience.
[0146] Figure 7 The communication method provided in the embodiment of the present application is a flow chart, which is applied to a server, and the server includes a network service unit and a remote desktop service unit, such as Figure 7 The communication method shown includes the following steps:
[0147] S701: Use a network service unit to receive a first message sent by a terminal device through a first communication channel.
[0148] S702: Use the network service unit to send a first message to the remote desktop service unit.
[0149] Reference Figure 1 The network service unit is used to receive the first message and forward the first message to the remote desktop service unit. The network service unit is not used to process the first message.
[0150] Reference Figure 5 In the case where the first communication channel and the second communication channel are configured simultaneously between the terminal device and the server, if the network service unit receives the second message, the network service unit processes the second message to obtain the target command.
[0151] S703: Use the remote desktop service unit to process the first message.
[0152] In some embodiments, using a remote desktop service unit to process the first message includes: using the remote desktop service unit to perform the following steps: parsing the first message according to a first protocol to obtain a first message header and a first message body; parsing the first message header according to the first protocol to obtain a first magic number; when the first magic number is a preset value, parsing the first message body according to the first protocol to obtain a target command.
[0153] In an embodiment of the present application, on the terminal device side, the first message is obtained by encapsulating the first message header and the first message body according to the first protocol. Therefore, the first message can be parsed in the server according to the first protocol to obtain the first message header and the first message body.
[0154] Furthermore, the first message header is obtained by the terminal device encapsulating the first magic number, the first message type, the first data packet status, the first cyclic redundancy check, and the first message body length according to the first protocol. On the server side, the first message header can be parsed according to the first protocol to obtain the first magic number, the first message type, the first data packet status, the first cyclic redundancy check, and the first message body length.
[0155] In an embodiment of the present application, the preset value may be specified by the first protocol. For example, in Table 1, the preset value is 0x3132. If the first magic number is the preset value, the target command encapsulated in the first message is determined to be a processable command, and the first message body is further parsed to obtain the target command. If the first magic number is not the preset value, the first message body is determined to be unprocessable and the first message is discarded, i.e., no further parsing of the first message body is performed.
[0156] It can be understood that the first magic number facilitates the server to quickly identify whether the first message can be further parsed, thereby improving the processing efficiency of the first message.
[0157] In some embodiments, it also includes: parsing the first message header according to the first protocol to obtain a first data packet status; wherein the first data packet status includes at least one of a first indication information, a second indication information and a third indication information, the first indication information is used to indicate whether the first message body needs to be replied, the second indication information is used to indicate whether the first message body is encrypted, and the third indication information is used to indicate whether the first message body needs a cyclic redundancy check.
[0158] The specific description of the data packet status can be found in Figure 2 The corresponding content will not be repeated here.
[0159] In some embodiments, parsing the first message body according to the first protocol to obtain the target command includes: if the second indication information indicates that the first message body is encrypted, decrypting the first message body according to a preset key to obtain the target number; and determining that the command corresponding to the target number is the target command.
[0160] It can be understood that, referring to Table 1, if the value of bit 1 of the data packet status is 1, indicating that the second message body is encrypted, the first message body can be decrypted using the preset key. The preset key may be specified by the first protocol and is not limited here. In the embodiment of the present application, the encrypted second message body can improve data transmission security.
[0161] Furthermore, decrypting the first message body may also obtain command data, which can be used to execute the target command. This application does not limit the specific role of the command data.
[0162] In some embodiments, the first message header is parsed according to the first protocol to obtain a first cyclic redundancy check, and the first message body is parsed according to the first protocol to obtain a target command, including: if the third indication information indicates that the first message body requires a cyclic redundancy check, the first message body is verified according to the first cyclic redundancy check; if the first message body passes the verification, the first message body is parsed according to the first protocol to obtain the target command.
[0163] In an embodiment of the present application, referring to Table 1, if the value of bit 2 of the first data packet status is 1, it indicates that the first message body needs to be verified. The server can determine a CRC algorithm in Table 1 based on the first CRC and verify the first message body according to the CRC algorithm. It can be understood that using the first CRC to verify the first message body can enhance the accuracy and reliability of the first message body during transmission.
[0164] In some embodiments, the method also includes: if the first indication information indicates that the first message body needs to be replied, obtaining target data according to the target command; determining a third message header; encapsulating the target data according to the first protocol to obtain a third message body; encapsulating the third message header and the third message body according to the first protocol to obtain a third message; and sending the third message to the terminal device through the first communication channel.
[0165] Referring to Table 1, if the value of bit 0 of the first packet status is 1, it indicates that the first message requires a reply. The target command is further executed. After executing the target command, target data is obtained. This target data is encapsulated in a third message body. A third magic number, a third message type, a third packet status, a third cyclic redundancy check, and a third message body length are then encapsulated according to the first protocol to obtain a third message header. The third message body and the third message header are further encapsulated to obtain a third message. The third message is then sent to the terminal device via the second communication channel.
[0166] In an embodiment of the present application, the command number of the command can also be encapsulated in the third message body to enable the terminal device to execute the command, such as the receive connection command, authentication response command, human-machine interface device mouse command, human-machine interface device keyboard command, disconnect session command, keep-alive command, get power status response command, set power status response command, get session list response command, and delete session response command in Table 2.
[0167] The target command obtained by processing the first message by the remote desktop service unit is executed by the remote desktop service unit to implement the remote desktop function. In addition, if the network service unit processes the second message to obtain the target command, the target command is also executed by the remote desktop service unit to implement the remote desktop function.
[0168] In the embodiment of the present application, after the server authenticates the terminal device, the terminal device needs to control the server through the remote desktop. Figure 8 , shows the authentication flow chart, which specifically includes the following steps:
[0169] S801: The terminal device sends a network connection request to the server.
[0170] S802: The server sends a connection receiving command to the terminal device.
[0171] The connection receiving command may be encapsulated into a message according to the first protocol or the second protocol and sent to the terminal device. The specific encapsulation and sending process may refer to the above embodiment and will not be described in detail here.
[0172] S803: The terminal device sends an authentication command to the server.
[0173] The authentication command may be encapsulated into a message according to the first protocol or the second protocol and sent to the server. The specific encapsulation and sending process may refer to the above embodiment and will not be described in detail here.
[0174] S804: The server sends an authentication response command to the terminal device.
[0175] The authentication response command may be encapsulated into a message according to the first protocol or the second protocol and sent to the terminal device. The specific encapsulation and sending process may refer to the above embodiment and will not be described in detail here.
[0176] If the authentication fails, the connection between the server and the terminal device is disconnected. If the authentication succeeds, the server and the terminal device can exchange messages.
[0177] In an embodiment of the present application, after receiving the first message, the server performs steps such as parsing, verification, command execution, and data collection on the first message according to the first protocol. Command execution and data collection are typically common data communication methods used by BMCs, and data communication can be performed through D-Bus, databases, and the like. Furthermore, if the status of the data packet received by the server from the first message indicates that a reply is required, the server is required to encapsulate the third message header and the third message body according to the first protocol, place the target data to be replied to in the third message body, and then send the third message directly to the terminal device via the first communication channel.
[0178] In summary, in the present application, the network service unit can receive the first message through the first communication channel and forward the first message to the remote desktop service unit for processing, so that the server can efficiently and stably process the target command of the terminal device.
[0179] Furthermore, this application adopts the first protocol and the corresponding message processing method, allowing the server to more reliably process terminal device commands when faced with complex network environments and a large number of requests, reducing anomalies caused by communication failures or improper message processing, and enhancing the stability of remote desktop functions. In addition, the integrated communication channel switching function in the terminal device can easily cope with various network conditions without the need for users to have professional technical knowledge, thus improving the user experience. At the same time, the simple and efficient front-end and back-end communication protocol design makes the server response faster and the user operation more convenient, further improving the server's usability.
[0180] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0181] Figure 9 This is a schematic diagram of the structure of the communication device provided in the embodiment of the present application. Figure 9 As shown, an embodiment of the present application further provides a communication device, which may include: a determination module 91, an encapsulation module 92, and a sending module 93, wherein:
[0182] A determination module 91 is used to determine a target command;
[0183] An encapsulation module 92 is configured to encapsulate a target command according to a first protocol to obtain a first message;
[0184] The sending module 93 is used to send a first message to the server through a first communication channel. The first communication channel is a communication channel based on a first protocol. The server includes: a network service unit and a remote desktop service unit. The network service unit sends the first message to the remote desktop service unit, and the remote desktop service unit is used to process the first message.
[0185] Optionally, after sending the first message to the server through the first communication channel, the encapsulation module 92 is further configured to: if the first message fails to be sent, encapsulate the target command according to the second protocol to obtain a second message;
[0186] The sending module 93 is further configured to send a second message to the server via a second communication channel, where the second communication channel is a communication channel based on a second protocol.
[0187] Optionally, before encapsulating the target command according to the first protocol to obtain the first message, the encapsulation module 92 is further configured to: encapsulate the target command according to the second protocol to obtain a second message;
[0188] The sending module 93 is further configured to send a second message to the server via a second communication channel, where the second communication channel is a communication channel based on a second protocol;
[0189] When encapsulating the target command according to the first protocol to obtain the first message, the encapsulation module 92 is specifically configured to: when the second message fails to be sent, encapsulate the target command according to the first protocol to obtain the first message.
[0190] Optionally, when the encapsulation module 92 encapsulates the target command according to the first protocol to obtain the first message, it is specifically used to: determine the first message header according to the first protocol; encapsulate the target command according to the first protocol to obtain the first message body; encapsulate the first message header and the first message body according to the first protocol to obtain the first message.
[0191] Optionally, when determining the first message header according to the first protocol, the encapsulation module 92 is specifically used to: obtain a first magic number, a first message type, a first data packet status, a first cyclic redundancy check, and a first message body length of the target command; and encapsulate the first magic number, the first message type, the first data packet status, the first cyclic redundancy check, and the first message body length according to the first protocol to obtain the first message header.
[0192] Optionally, the first data packet status includes at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate whether the first message body needs to be replied, the second indication information is used to indicate whether the first message body is encrypted, and the third indication information is used to indicate whether the first message body needs cyclic redundancy check.
[0193] Optionally, when the encapsulation module 92 encapsulates the target command according to the first protocol to obtain the first message body, it is specifically used to: obtain the command number corresponding to the target command according to the first protocol; determine whether the target command has corresponding command data; if so, encapsulate the command number and command data to obtain the first message body; if not, encapsulate the command number to obtain the first message body.
[0194] Optionally, also include:
[0195] The receiving module (not shown) is used to: receive a third message sent by the server;
[0196] The parsing module (not shown) is used to: parse the third message according to the first protocol to obtain a third message header and a third message body; parse the third message header according to the first protocol to obtain a third magic number; and when the third magic number is a preset value, parse the third message body according to the first protocol to obtain target data.
[0197] Optionally, the third message header is parsed according to the first protocol to obtain a third cyclic redundancy check. When the parsing module parses the third message body according to the first protocol to obtain the target data, it is specifically used to: verify the third message body according to the third cyclic redundancy check; if the third message body passes the verification, parse the third message body according to the first protocol to obtain the target data.
[0198] Optionally, the first protocol is the Internet Sockets Protocol, and the second protocol is the Hypertext Transfer Protocol Secure (HTTS).
[0199] It should be noted that the communication device shown in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principles and beneficial effects are similar, which will not be repeated here.
[0200] Figure 10 This is a schematic diagram of the structure of the communication device provided in the embodiment of the present application. Figure 10 As shown, an embodiment of the present application further provides a communication device, the communication device 100 may include: a receiving module 101, a sending module 102 and a processing module 103, wherein:
[0201] A receiving module 101 is configured to use a network service unit to receive a first message sent by a terminal device through a first communication channel, where the first communication channel is a communication channel based on a first protocol;
[0202] A sending module 102 is configured to send a first message to a remote desktop service unit using a network service unit;
[0203] The processing module 103 is configured to process the first message using a remote desktop service unit.
[0204] Optionally, the processing module 103 is specifically used for: the remote desktop service unit performs the following steps: parsing the first message according to the first protocol to obtain a first message header and a first message body; parsing the first message header according to the first protocol to obtain a first magic number; when the first magic number is a preset value, parsing the first message body according to the first protocol to obtain a target command.
[0205] Optionally, the processing module 103 is further used to: parse the first message header according to the first protocol to obtain a first data packet status; wherein the first data packet status includes at least one of a first indication information, a second indication information and a third indication information, the first indication information is used to indicate whether the first message body needs to be replied, the second indication information is used to indicate whether the first message body is encrypted, and the third indication information is used to indicate whether the first message body needs a cyclic redundancy check.
[0206] Optionally, also include:
[0207] An acquisition module (not shown), configured to acquire target data according to a target command if the first indication information indicates that the first message body requires a reply;
[0208] a determining module (not shown), configured to determine a third message header;
[0209] an encapsulation module (not shown), configured to encapsulate the target data according to the first protocol to obtain a third message body; and encapsulate the third message header and the third message body according to the first protocol to obtain a third message;
[0210] The sending module 102 is further configured to send a third message to the terminal device through the first communication channel.
[0211] Optionally, when the processing module 103 parses the first message body according to the first protocol to obtain the target command, it is specifically used to: if the second indication information indicates that the first message body is encrypted, decrypt the first message body according to the preset key to obtain the target number; and determine that the command corresponding to the target number is the target command.
[0212] Optionally, the first message header is parsed according to the first protocol and a first cyclic redundancy check is also obtained. When the processing module 103 parses the first message body according to the first protocol to obtain the target command, it is specifically used to: if the third indication information indicates that the first message body requires a cyclic redundancy check, verify the first message body according to the first cyclic redundancy check; if the first message body passes the verification, parse the first message body according to the first protocol to obtain the target command.
[0213] It should be noted that the communication device shown in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principles and beneficial effects are similar, which will not be repeated here.
[0214] Reference Figure 1 , the present application also provides a communication system, including: a terminal device and a server, wherein:
[0215] The terminal device is used to determine a target command; encapsulate the target command according to a first protocol to obtain a first message; and send the first message to the server through a first communication channel, where the first communication channel is a communication channel based on the first protocol.
[0216] The server is used to: use a network service unit to receive a first message sent by a terminal device through a first communication channel; use the network service unit to send the first message to a remote desktop service unit; and use the remote desktop service unit to process the first message.
[0217] Among them, the specific implementation process of the communication system can execute the technical solution shown in the above method embodiment, and its implementation principles and beneficial effects are similar, which will not be repeated here.
[0218] Figure 11 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 11 As shown, the electronic device 110 provided in this embodiment includes: at least one processor 1101 and a memory 1102. Optionally, the electronic device 110 further includes a communication component 1103. The processor 1101, the memory 1102 and the communication component 1103 are connected via a bus.
[0219] During the specific implementation process, at least one processor 1101 executes the computer-executable instructions stored in the memory 1102, so that the at least one processor 1101 executes the above-mentioned communication method embodiment.
[0220] The specific implementation process of the processor 1101 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0221] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0222] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), exemplarily at least one disk storage.
[0223] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0224] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above-mentioned communication method embodiments when running.
[0225] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0226] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above communication method embodiments are implemented.
[0227] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned communication method embodiments are implemented.
[0228] 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.
[0229] The above is a detailed introduction to a communication method 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 intended to help understand the method and core ideas of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications may be made to the present application, and such improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A communication method, characterized in that: Applied to a terminal device, the method includes: Determine target command; encapsulating the target command according to the first protocol to obtain a first message; sending the first message to a server via a first communication channel, where the first communication channel is a communication channel based on the first protocol, the server comprising: a network service unit and a remote desktop service unit, the network service unit sending the first message to the remote desktop service unit without parsing or processing the first message, and the remote desktop service unit being configured to process the first message; After sending the first message to the server through the first communication channel, the method further includes: If the first message fails to be sent, encapsulating the target command according to a second protocol to obtain a second message; The second message is sent to the server through a second communication channel, where the second communication channel is a communication channel based on the second protocol.
2. The communication method according to claim 1, wherein: Before encapsulating the target command according to the first protocol to obtain the first message, the method further includes: encapsulating the target command according to the second protocol to obtain a second message; sending the second message to the server through a second communication channel, where the second communication channel is a communication channel based on the second protocol; Encapsulating the target command according to the first protocol to obtain a first message includes: In the case that the second message fails to be sent, the target command is encapsulated according to the first protocol to obtain a first message.
3. The communication method according to any one of claims 1 to 2, characterized in that: Encapsulating the target command according to the first protocol to obtain a first message includes: determining a first message header according to the first protocol; encapsulating the target command according to the first protocol to obtain a first message body; The first message header and the first message body are encapsulated according to the first protocol to obtain the first message.
4. The communication method according to claim 3, wherein: The determining the first message header according to the first protocol includes: Obtaining a first magic number, a first message type, a first data packet status, a first cyclic redundancy check, and a first message body length of the target command; The first magic number, the first message type, the first data packet status, the first cyclic redundancy check, and the first message body length are encapsulated according to the first protocol to obtain the first message header.
5. The communication method according to claim 4, wherein: The first data packet status includes at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate whether the first message body needs to be replied, the second indication information is used to indicate whether the first message body is encrypted, and the third indication information is used to indicate whether the first message body needs cyclic redundancy check. The communication method according to claim 3 , wherein: Encapsulating the target command according to the first protocol to obtain a first message body includes: According to the first protocol, obtaining a command number corresponding to the target command; determining whether the target command has corresponding command data; If yes, encapsulate the command number and the command data to obtain the first message body; If not, encapsulate the command number to obtain the first message body.
7. The communication method according to claim 1 or 2, characterized in that: Also includes: receiving a third message sent by the server; Parsing the third message according to the first protocol to obtain a third message header and a third message body; parsing the third message header according to the first protocol to obtain a third magic number; When the third magic number is a preset value, the third message body is parsed according to the first protocol to obtain target data.
8. The communication method according to claim 7, wherein: The parsing the third message header according to the first protocol to obtain a third cyclic redundancy check, and the parsing the third message body according to the first protocol to obtain target data include: verifying the third message body according to the third cyclic redundancy check; When the third message body passes verification, the third message body is parsed according to the first protocol to obtain the target data.
9. The communication method according to claim 2, wherein: The first protocol is the Internet Sockets Protocol, and the second protocol is the Hypertext Transfer Protocol Secure (HTTS).
10. A communication method, characterized in that: Applied to a server, the server comprising: a network service unit and a remote desktop service unit, the method comprising: Determine target command; encapsulating the target command according to the first protocol to obtain a first message; Receiving, using the network service unit, a first message sent by a terminal device through a first communication channel, where the first communication channel is a communication channel based on a first protocol; Using the network service unit to send the first message to the remote desktop service unit without parsing and processing the first message; Processing the first message using the remote desktop service unit; After the network service unit receives the first message sent by the terminal device through the first communication channel, the method further includes: When the terminal device fails to send the first message, the terminal device encapsulates the target command according to the second protocol to obtain a second message; the server receives the second message sent by the terminal device through the second communication channel, and the second communication channel is a communication channel based on the second protocol.
11. The communication method according to claim 10, wherein: The remote desktop service unit processes the first message, including: using the remote desktop service unit to perform the following steps: Parsing the first message according to the first protocol to obtain a first message header and a first message body; parsing the first message header according to the first protocol to obtain a first magic number; When the first magic number is a preset value, the first message body is parsed according to the first protocol to obtain a target command.
12. The communication method according to claim 11, wherein: Also includes: Parsing the first message header according to the first protocol to obtain a first data packet status; Among them, the first data packet status includes at least one of first indication information, second indication information and third indication information, the first indication information is used to indicate whether the first message body needs to be replied, the second indication information is used to indicate whether the first message body is encrypted, and the third indication information is used to indicate whether the first message body needs cyclic redundancy check.
13. The communication method according to claim 12, wherein: The method further comprises: If the first indication information indicates that the first message body requires a reply, obtaining target data according to the target command; Determine the third message header; encapsulate the target data according to the first protocol to obtain a third message body; encapsulate the third message header and the third message body according to the first protocol to obtain a third message; The third message is sent to the terminal device through the first communication channel.
14. The communication method according to claim 12, wherein: The parsing the first message body according to the first protocol to obtain the target command includes: If the second instruction information indicates that the first message body is encrypted, decrypt the first message body according to a preset key to obtain a target number; Determine that the command corresponding to the target number is the target command.
15. The communication method according to claim 12, wherein: The parsing the first message header according to the first protocol to obtain a first cyclic redundancy check, and the parsing the first message body according to the first protocol to obtain the target command include: If the third indication information indicates that the first message body requires a cyclic redundancy check, verifying the first message body according to the first cyclic redundancy check; When the first message body passes verification, the first message body is parsed according to the first protocol to obtain the target command.
16. A communication system, characterized in that: include: Terminal devices and servers, including: The terminal device is configured to determine a target command; encapsulate the target command according to a first protocol to obtain a first message; send the first message to a server via a first communication channel, where the first communication channel is a communication channel based on the first protocol; if sending the first message fails, encapsulate the target command according to a second protocol to obtain a second message; and send the second message to the server via a second communication channel, where the second communication channel is a communication channel based on the second protocol; The server is used to: use a network service unit to receive a first message sent by a terminal device through a first communication channel, without parsing and processing the first message; use the network service unit to send the first message to a remote desktop service unit; and use the remote desktop service unit to process the first message.
17. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the communication method according to any one of claims 1 to 15 when executing the computer program.
18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the communication method according to any one of claims 1 to 15 when executed by a processor.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the communication method according to any one of claims 1 to 15 are implemented.
Citation Information
Patent Citations
Remote desktop realizing system, method, client-side and service center
CN103634364A
Long connection method and device and communication equipment
CN118018587A