Method, apparatus and terminal device for communication protocol compatibility
First Claim
1. A computer-implemented method for communication protocol compatibility, comprising executing on a processor steps of:
- receiving a handshake instruction transmitted by an external device, wherein the handshake instruction comprises an external protocol list, the external protocol list comprises a correspondence relationship between an external protocol and version information of the external protocol;
retrieving a locally stored local protocol list, wherein the local protocol list comprises a correspondence relationship between a local protocol and version information of the local protocol;
determining whether there is a same version information in the external protocol list and the local protocol list;
taking one of the same version information of the external protocol list and the local protocol list as matched version information, if the external protocol list and the local protocol list have the same version information;
taking the local protocol corresponding to the matched version information as the protocol for communicating with the external device, and transmitting the matched version information to the external device; and
transmitting a service protocol mismatch response to the external device, if there is no the same version information in the external protocol list and the local protocol list, wherein the service protocol mismatch response is used to notify the external device that related service data cannot be received, transmitted or parsed.
1 Assignment
0 Petitions
Accused Products
Abstract
The present disclosure provides a method, an apparatus and a terminal device for communication protocol compatibility. The method includes: receiving an external protocol list transmitted by an external device and retrieving a locally stored local protocol list; taking one of a same version information of the external protocol list and the local protocol list as matched version information, if the external protocol list and the local protocol list have the same version information; and taking the local protocol corresponding to the snatched version information as the protocol for communicating with the external device, and transmitting the matched version information to the external device. As a result, when the terminal device and the external device have the same communication protocol, they can perform data exchange using the same communication protocol automatically, which reduces the possibility of the incompatibility in the communication protocol so as to improve the communication success rate.
6 Citations
20 Claims
-
1. A computer-implemented method for communication protocol compatibility, comprising executing on a processor steps of:
-
receiving a handshake instruction transmitted by an external device, wherein the handshake instruction comprises an external protocol list, the external protocol list comprises a correspondence relationship between an external protocol and version information of the external protocol; retrieving a locally stored local protocol list, wherein the local protocol list comprises a correspondence relationship between a local protocol and version information of the local protocol; determining whether there is a same version information in the external protocol list and the local protocol list; taking one of the same version information of the external protocol list and the local protocol list as matched version information, if the external protocol list and the local protocol list have the same version information; taking the local protocol corresponding to the matched version information as the protocol for communicating with the external device, and transmitting the matched version information to the external device; and transmitting a service protocol mismatch response to the external device, if there is no the same version information in the external protocol list and the local protocol list, wherein the service protocol mismatch response is used to notify the external device that related service data cannot be received, transmitted or parsed. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. An apparatus for communication protocol compatibility comprising a processor and a memory, wherein the processor is electronically coupled to the memory and an external device, the memory stores instructions that are executable by the processor, and the instructions comprise:
-
a receiving module configured to receive a handshake instruction transmitted by the external device, wherein the handshake instruction comprises an external protocol list, the external protocol list comprises a correspondence relationship between an external protocol and version information of the external protocol; a retrieving module configured to retrieve a locally stored local protocol list, wherein the local protocol list comprises a correspondence relationship between a local protocol and version information of the local protocol, and determine whether there is a same version information in the external protocol list and the local protocol list; a matching module configured to take one of a same version information of the external protocol list and the local protocol list as matched version information, if the external protocol list and the local protocol list have the same version information; and a setting module configured to take the local protocol corresponding to the matched version information as the protocol for communicating with the external device, and transmitting the matched version information to the external device; wherein a service protocol mismatch response is transmitted to the external device, if there is no the same version information in the external protocol list and the local protocol list, and wherein the service protocol mismatch response is used to notify the external device that related service data cannot be received, transmitted or parsed. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A terminal device for communication protocol compatibility, comprising:
-
one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprises; instructions for receiving a handshake instruction transmitted by an external device, wherein the handshake instruction comprises an external protocol list, the external protocol list comprises a correspondence relationship between an external protocol and version information of the external protocol; instructions for retrieving a locally stored local protocol list, wherein the local protocol list comprising a correspondence relationship between a local protocol and version information of the local protocol; instructions for determining whether there is a same version information in the external protocol list and the local protocol list; instructions for taking one of the same version information of the external protocol list and the local protocol list as matched version information, if the external protocol list and the local protocol list have the same version information; instructions for taking the local protocol corresponding to the matched version information as the protocol for communicating with the external device, and transmitting the matched version information to the external device; and instructions for transmitting a service protocol mismatch response to the external device, if there is no the same version information in the external protocol list and the local protocol list, wherein the service protocol mismatch response is used to notify the external device that related service data cannot be received, transmitted or parsed. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification