CN111416889B - Communication method and system adapted through GATT and exception handling - Google Patents

Communication method and system adapted through GATT and exception handling Download PDF

Info

Publication number
CN111416889B
CN111416889B CN202010048951.1A CN202010048951A CN111416889B CN 111416889 B CN111416889 B CN 111416889B CN 202010048951 A CN202010048951 A CN 202010048951A CN 111416889 B CN111416889 B CN 111416889B
Authority
CN
China
Prior art keywords
gatt
cpa
layer
pdu
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010048951.1A
Other languages
Chinese (zh)
Other versions
CN111416889A (en
Inventor
曹小英
赵杰
冯海玲
唐艺
贺学兵
李祥臣
段小炼
钟代笛
黄智勇
仲元红
韩术
印强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University
Original Assignee
Chongqing University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing University filed Critical Chongqing University
Priority to CN202010048951.1A priority Critical patent/CN111416889B/en
Publication of CN111416889A publication Critical patent/CN111416889A/en
Application granted granted Critical
Publication of CN111416889B publication Critical patent/CN111416889B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/40Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass for recovering from a failure of a protocol instance or entity, e.g. service redundancy protocols, protocol state redundancy or protocol service redirection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention belongs to the technical field of data communication, and particularly relates to a communication system and a method which are adapted through GATT and exception handling, wherein the communication system comprises a CPA layer with an exception handling method, and the exception handling method comprises the following steps: the invention solves the problem that communication between two communication parties fails due to errors or exceptions such as time interval overtime, GATT subprogram execution errors, GATT protocol errors and the like or link loss and the like which often occur in the data exchange process or CPA data exchange process of the two communication parties, and has the beneficial technical effects of identifying the types of errors generated in the data exchange process and carrying out active or automatic fault-tolerant processing, thereby ensuring the effectiveness of the data communication process.

Description

Communication method and system adapted through GATT and exception handling
Technical Field
The invention belongs to the technical field of data communication, and particularly relates to a communication method and a communication system which are adaptive through GATT and exception handling.
Background
The generic Attribute protocol gatt (generic Attribute profile) is responsible for data interaction between two BLE devices. The GATT uses the ATT (attribute protocol) protocol, the GATT groups attributes defined in the ATT, and includes "Service" and "feature (Characteristic)", one Service includes one or more features, each feature is described by multiple attributes, the collection of services forms GATT Profile, Bluetooth SIG officially defines some standard services for developers to use, and the data corresponding to these services and features are stored in a lookup table by the ATT, and the assigned UUID is used as an index for each item. The GATT also defines subroutines to implement different functions, i.e., GATT Feature, using the attribute operation methods in the ATT. The GATT defines 11 subroutines, and the GATT data exchange process in the present invention uses a "Write Characteristic Value subroutine (managed Value Write)", an "Indication subroutine (managed Value Indication)", and a "Write Characteristic Descriptor subroutine (managed Descriptor Value Write)", among them. For the GATT, the interaction with the application layer is carried out upwards, a proper GATT profile structure is provided for the application layer, and the task subprogram is handed to the ATT to be completed downwards.
When a device uses a CPA (Communication Protocol adaptation) layer constructed based on a GATT layer to perform Communication, errors that may occur may be classified into four types: the first category is that the interval timeout for managing CPA state, CPA layer CC feature error (including but not limited to CC feature indication sent without CC feature value indication function enabled), and changes in the value of the ASN field of the CPA PDU violate the rules defined by the CPA; the second type of errors are the GATT subprogram execution errors in the communication process, and the error feedback is in the form of corresponding error response codes which are defined in the ATT protocol; the third type of error is that the error response code defined in the ATT protocol cannot completely cover the error which may occur in the communication method of the present invention, so that GATT cannot perform corresponding error processing, and therefore, in order to support CPA layer data exchange, a new error code for the error which may occur in CPA PDU exchange is defined in the application layer error code range reserved in ATT; the fourth type of error is that connection parameters of the BLE device may be set according to actual application requirements to achieve low power consumption and transmission rate, where the three parameters include a connection interval (ConnectionInterval), slave device delay (slave latency), and timeout (SupervisionTimeout), and the three parameters need to meet requirements of SupervisionTimeout > (1+ slave latency) × (connection interval), otherwise, the connection may be disconnected abnormally. Therefore, during the communication process, if the link layer connection is in disconnection error due to timeout, the GATT layer and the CPA layer need to perform corresponding subsequent processing to maintain the communication.
The invention is based on a communication method and a communication system which are adaptive through ATT and exception handling and have the patent number of 201910783902. X;
the invention is based on a data communication method and a system which rely on ATT and indication for adaptation, and the patent number is 201910766067.9;
in the existing communication mode, when two communication parties exchange data or CPA data, errors or abnormalities such as time interval overtime, CPA layer CC characteristic errors, GATT subprogram execution errors, GATT protocol errors and the like or link loss and the like often occur, so that the communication between the two communication parties fails.
Disclosure of Invention
The invention provides a communication method and a system adapted through GATT and exception handling, which solve the problem that communication between two communication parties fails because errors or exceptions such as time interval overtime, CPA layer CC characteristic error, GATT subprogram execution error, GATT protocol error and the like or link loss and the like often occur in the data exchange process or CPA data exchange process of the two communication parties in the background technology.
The technical problem solved by the invention is realized by adopting the following technical scheme: before data exchange is carried out between master equipment and slave equipment, the two sides of communication respectively establish a data communication protocol stack layer structure which sequentially comprises a bottom layer transmission layer, an attribute protocol ATT layer, a general attribute specification GATT layer, a general attribute specification protocol adaptation CPA layer, a data exchange protocol PHD layer and an application layer from bottom to top;
the CPA layer includes an exception handling method, the exception handling method including:
if the two communication parties generate time interval overtime or CC characteristic abnormity or ASN field value abnormity in the data exchange process, executing corresponding active abnormal event intervention;
if the two communication parties generate a GATT subprogram execution error in the CPA data exchange process, executing corresponding active GATT error intervention;
if the two communication parties send a CPA PDU to the receiving party in the CPA data exchange process, the original sending party may receive the errors which are thrown on the GATT layer, defined in the range of the application layer error codes reserved by the ATT and used by the GATT, and then corresponding active CPA PDU error intervention is executed;
and if the link loss is detected, executing corresponding non-active abnormal event processing.
Further, if the two communication parties generate time interval timeout or CC characteristic exception or value exception of ASN field in the data exchange process, executing corresponding active exception event intervention includes:
the method comprises the steps that the indication function of CC characteristics of the default slave equipment of the master equipment is closed, working state data are cleared, event notification that the bottom layer connection is disconnected is sent to a PHD layer in a semantic mode, and other data sent by the slave equipment are not processed before the next connection;
and the slave device closes the indication function of the CC characteristic, clears the working state data, sends an event notice that the bottom layer connection is disconnected according to the semantics to the PHD layer, and does not process other data sent by the master device except the connection request.
Further, if the two communicating parties generate a GATT subprogram execution error in the CPA data exchange process, executing corresponding active GATT error intervention includes:
the semantics of the error response used by the GATT protocol include, but are not limited to, insufficient GATT authentication, insufficient GATT encryption, GATT unexpected errors, and other related errors;
if the GATT authentication of the two communication parties is insufficient, the main equipment can carry out the GATT authentication operation and execute the GATT writing feature descriptor subprogram again;
if the GATT encryption of the two communication parties is insufficient, the main equipment can carry out the GATT encryption operation and execute the GATT writing feature descriptor subprogram again;
if the GATT unexpected error occurs between the two parties, and the two parties are in the CPA connection sub-flow, the master device may attempt to re-execute the GATT write feature descriptor sub-routine.
Further, if the link loss is detected, executing corresponding inactive exception handling, including:
if both communication parties detect that a link is lost at any moment after the last CPA PDU transmission is finished, the GATT executes corresponding first inactive abnormal event processing;
or;
and if the two communication parties detect the link loss at any time after the transmission of any segment of any CPA PDU is completed, the GATT executes second active abnormal event processing.
Further, the step of, if both parties of the communication detect a link loss at any time after completing the transmission of the last CPA PDU, the GATT performing corresponding first inactive exception handling includes:
the working state data includes the ASN value in the last CPA PDU, and when the bottom layer link is disconnected:
if the sender is sending CPA PDU through the GATT layer, the working state data also comprises the current CPA PDU, and the current CPA PDU is sent again through the GATT after the bottom layer link is reconnected;
if the receiver is receiving the current CPA PDU via the GATT layer, all fragments belonging to the current CPA PDU that have been received are discarded.
Further, the step of, if the two communicating parties detect a link loss at any time after completing transmission of any segment of any CPA PDU, the GATT performing corresponding second inactive exception handling includes:
the working state data comprises an ASN value and an SAR value in the CPA PDU, and when the bottom layer link is disconnected:
if the sender is sending the next segment of the CPA PDU through the GATT layer, the working state data also comprises the CPA PDU, and the sender continues to send the next segment of the CPA PDU through the GATT after the bottom layer link is reconnected;
if the receiver is receiving the next segment of the CPA PDU through the GATT layer, the working state data also comprises the received partial segment of the CPA PDU, and waits to receive the next segment of the CPA PDU after the bottom layer link is reconnected.
The invention also provides a communication system adapted by the GATT and exception handling, wherein before the communication system exchanges data based on the master device and the slave device, the two communication parties respectively establish a data communication protocol stack level structure which sequentially comprises a bottom layer transmission layer, an attribute protocol ATT layer, a general attribute specification GATT layer, a general attribute specification protocol adaptation CPA layer, a data exchange protocol PHD layer and an application layer from bottom to top;
the exception handling module is configured to:
implementing the exception handling method of any of the above.
The beneficial technical effects are as follows:
if the two communication parties generate time interval overtime or CC characteristic abnormity or ASN field value abnormity in the data exchange process, executing corresponding active abnormal event intervention; if the two communication parties generate a GATT subprogram execution error in the CPA data exchange process, executing corresponding active GATT error intervention; if the two communication parties send a CPA PDU to the receiving party in the CPA data exchange process, the original sending party may receive the errors which are thrown on the GATT layer, defined in the range of the application layer error codes reserved by the ATT and used by the GATT, and then corresponding active CPA PDU error intervention is executed; if detecting that the link is lost, executing corresponding non-active abnormal event processing;
compared with a communication method and a communication system which are adaptive through ATT and exception handling and have the patent number of 201910783902.X, the invention is characterized in that:
1. different error sources of the CPA layer, the object of the CPA layer which can generate errors is CC characteristic, and the object of the communication method and the communication system which are provided with patent number 201910783902.X and are adapted through ATT and exception handling is CC attribute and IE attribute.
2. The error handling objects are different, the operation object of the invention is a CC feature in CPA service, and the operation object of the communication method and system adapted by ATT and exception handling with patent number 201910783902.X is a CC attribute and an IE attribute. Compared with the latter, the former reduces the number of the operated target objects by 50% for application layer developers, and is simpler and more convenient to operate; it is also simpler for the slave to manage internal timing.
3. The invention adopts a write characteristic descriptor subprogram, an indication subprogram and a write characteristic subprogram defined in the GATT to ensure the reliable transmission of data, and the communication method and the system which are adaptive through ATT and exception processing and have the patent number of 201910783902.X adopt the request, response, indication and confirmation defined by ATT to realize the fault-tolerant function. The former is equivalent to the latter, provides the main device and the slave device with conversational interactive capability at the application layer, hides some details in the conversation process, simplifies the workload of application layer developers, and enables the developers to better concentrate on the implementation of application layer business logic. Essentially, this is a simplification of application layer development at the expense of some detail customization capability.
The invention defines the error of the processing process and the error which is automatically processed and does not need to be intervened, actively repairs the error of the processing process through an error correction mechanism, and automatically repairs the error which does not need to be intervened.
Drawings
FIG. 1 is a flow chart of a communication method of the present invention adapted by GATT and exception handling;
FIG. 2 is a timing diagram of an active exception intervention process;
FIG. 3 is a timing diagram of an example of proactive CPA PDU error intervention;
FIG. 4 is a diagram of a first example of inactive exception handling;
FIG. 5 is a diagram illustrating a second example of inactive exception handling.
The technical scheme provided by the invention has flexibility in implementation, and a preferable scheme can be provided for the technical effect to be achieved by the invention by setting part of parameters in the technical scheme and setting up a better application design related to the parameters, and the invention is further described by combining the accompanying drawings as follows:
the numbers in the figures represent the following:
1-a bottom layer transmission layer, 2-an ATT layer, 3-a GATT layer, 4-CPA layer, 5-PHD layer and 6-an application layer;
ST 401: if the two communication parties are in the data exchange process, time interval overtime or CC characteristic abnormity or ASN field value abnormity is generated;
ST 402: executing corresponding active abnormal event intervention;
ST 403: if both communication parties generate a GATT subprogram execution error in the CPA data exchange process;
ST 404: performing a corresponding proactive GATT error intervention;
ST 405: if two communication parties send a CPA PDU to a receiving party in the CPA data exchange process, an original sending party may receive errors which are thrown on a GATT layer, defined in an application layer error code range reserved by ATT and used by the GATT;
ST 406: executing corresponding active CPA PDU error intervention;
ST 407: if detecting the loss of the link;
ST 408: executing corresponding inactive abnormal event processing;
example (b):
as shown in fig. 1, the types of errors that may occur during data exchange between two communication parties are classified into four types:
the first category is time interval overtime used for managing CPA connection state, CC characteristic error of CPA layer and ASN field error, the time interval for managing CPA state is 3 redefined time intervals on the basis of the time interval defined in the communication method and system which is adapted by ATT and exception handling and has the patent number of 201910783902.X, and the first time interval is the longest waiting time from the time interval until the link reconnection is successful after the CPA layer receives the link connection overtime error sent by the bottom transmission layer; the second time interval is the longest waiting time from the beginning of sending a bottom layer connection establishing internal instruction to the bottom layer transmission layer until the bottom layer transmission layer completes reconnection when the CPA layer receives the APDU from the PHD layer after the bottom layer transmission layer is actively disconnected; the third time interval is the longest waiting time until the master device executes the feature descriptor sub-program written in the GATT to close the indication function of the CC feature after the CPA layer receives the fact that the semantics sent by the PHD layer is that the internal instruction of the bottom layer connection is disconnected or the CPA connection sub-process or the CPA operation sub-process is wrong.
CC characteristic error includes, but is not limited to, sending a CC characteristic indication from the device without the CC characteristic value indication function enabled.
An ASN field error means that a change in value of the ASN field of the CPA PDU violates the rules defined by the CPA.
Fig. 2 shows an active exception intervention procedure for handling a first type of error.
The second type of error is the execution error of the GATT subprogram in the communication process, the error feedback is in the form of corresponding error response codes, the GATT subprogram is handed to the ATT to be completed, and therefore the error response codes used by the execution error of the GATT subprogram are defined in the ATT protocol.
The third kind of errors are CPA PDU transmission errors, and the CPA layer is an adaptation layer created by the invention, so error response codes defined in the ATT protocol cannot completely cover errors which may occur in the communication method of the invention.
Fig. 3 is an example of a proactive CPA PDU error intervention procedure to cope with a third type of error, which is defined by error codes including but not limited to semantics of "CPA PDU reception error" and "CPA PDU info too long".
The fourth type of error is a link connection timeout error, and the device may set connection parameters of the BLE device to achieve low power consumption and transmission rate according to actual application requirements during implementation, where the three parameters include a connection interval (ConnectionInterval), a slave device delay (slave latency), and a timeout time (supervision timeout), and the three parameters need to satisfy requirements of supervision timeout > (1+ slave latency), otherwise, the connection may be disconnected abnormally. Therefore, in data transmission, when a link layer connection timeout disconnection error is detected, the GATT layer and the CPA layer need to perform corresponding subsequent processing, if the link reconnection is successful, a first inactive abnormal event processing procedure or a second inactive abnormal event processing procedure is executed, otherwise, a corresponding time interval timeout processing procedure is executed.
Fig. 4 is a first inactive exception handling process for handling a fourth type of error, where the communication device retransmits all segments of the current CPA PDU after the link connection is disconnected due to timeout and reconnected successfully.
Fig. 5 is a second inactive exception handling process for handling a fourth type of error, where the communications device retransmits a next segment of the current CPA PDU after the link connection is disconnected due to timeout and reconnected successfully.
As shown in fig. 1 to 5, the communication method adapted through GATT and exception handling includes that before data exchange is performed between a master device and a slave device, both communication parties respectively establish a data communication protocol stack hierarchical structure sequentially including a bottom layer transmission layer 1, an attribute protocol ATT layer 2, a generic attribute specification GATT layer 3, a generic attribute specification protocol adaptation CPA layer 4, a data exchange protocol PHD layer 5 and an application layer 6 from bottom to top;
the CPA layer 4 includes an exception handling method including:
if both communication parties generate time interval overtime or CC characteristic abnormity or ASN field value abnormity ST401 in the data exchange process, executing corresponding active abnormal event intervention ST 402;
if the two communication parties generate a GATT subprogram execution error ST403 in the CPA data exchange process, executing corresponding active GATT error intervention ST 404;
if the two communication parties send a CPA PDU to the receiving party in the CPA data exchange process, the original sending party may receive an error ST405 which is thrown on a GATT layer 3, defined in the error code range of an application layer 6 reserved by ATT and used by the GATT, and then corresponding active CPA PDU error intervention ST406 is executed;
if a link loss is detected ST407, a corresponding inactive exception handling is performed ST 408.
Due to the fact that the data communication protocol stack comprises a communication protocol adaptation layer (CPA layer), a data communication protocol stack hierarchical structure to which the CPA layer belongs is respectively a bottom layer transmission layer, a GATT layer, a CPA layer, a PHD layer and an application layer from bottom to top. The CPA consists of data units CPA PDU and CPA data exchange procedures. The CPA layer provided by the invention manages the operation of the bottom layer transmission layer, so that the PHD depending on reliable bottom layer transmission (connection-oriented) can normally operate on the GATT which is characterized by stateless communication, is not influenced by frequent disconnection and reconnection of the GATT and the bottom layer transmission, is not limited by the protocol message length of the GATT, not only fully utilizes the low power consumption characteristic of the GATT, but also can realize the synchronous interaction of two communication parties on an application layer;
due to the CPA layer data exchange process, the generated errors and the fault tolerance processing include:
in the CPA connection subprocess, before the CPA connection is unsuccessful, after the master device or the slave device receives the data message irrelevant to the CC characteristic, a proactive abnormal event intervention process is executed.
In the CPA operation sub-process, if the value of the ASN field in the CPA PDU received by the master device or the slave device is not the ASN value plus 1 in the CPA PDU successfully interacted (transmitted or received) last time, the active exception event processing process is executed.
In the CPA operation sub-process, if the CPA layer receives the APDU from the PHD layer, after sending the internal instruction with the semantic of "establish bottom layer connection" to the disconnected bottom layer transmission layer, and after waiting for the second time interval and not receiving the "bottom layer connection established" event notification sent by the bottom layer transmission layer, the active abnormal event intervention process is executed.
In the CPA disconnection subprocess, if the master device does not execute the "write feature descriptor subprogram" in the GATT within the third time interval, a proactive abnormal event intervention process is executed.
If the two communication parties generate time interval overtime or CC characteristic abnormity or ASN field value abnormity ST401 in the data exchange process, executing corresponding active abnormity event intervention ST402 comprises:
the indication function of the CC characteristic of the default slave equipment of the master equipment is closed, the working state data is cleared, an event notice that the bottom layer connection is disconnected is sent to the PHD layer 5, and other data sent by the slave equipment are not processed before the next connection;
the slave device closes the indication function of the CC characteristic, clears the working state data, sends a notice that the bottom layer connection is disconnected to the PHD layer 5, and does not process other data sent by the master device except the connection request.
If the two communicating parties generate a GATT subprogram execution error ST403 in the CPA data exchange process, executing corresponding active GATT error intervention ST404 includes:
the semantics of the error response used by the GATT protocol include, but are not limited to, insufficient GATT authentication, insufficient GATT encryption, GATT unexpected errors, and other related errors;
if the GATT authentication of the two communication parties is insufficient, the main equipment can carry out the GATT authentication operation and execute the GATT writing feature descriptor subprogram again;
if the GATT encryption of the two communication parties is insufficient, the main equipment can carry out the GATT encryption operation and execute the GATT writing feature descriptor subprogram again;
if the GATT unexpected error occurs between the two parties, and the two parties are in the CPA connection sub-flow, the master device may attempt to re-execute the GATT write feature descriptor sub-routine.
The error due to the GATT layer is a GATT error. In the CPA connection sub-flow, during the master device executing the "write feature descriptor subroutine" in the GATT, an error response may be received from the slave device to be thrown on the GATT, and the semantics thereof include but are not limited to the following situations:
first, the authentication is insufficient. At this point the master device may perform an authentication operation and re-execute the "write feature descriptor subroutine".
Secondly, encryption is insufficient. At this point the master device may perform the encryption operation and re-execute the "write feature descriptor subroutine".
And thirdly, unexpected mistakes. At which point the master device may attempt to re-execute the "write feature descriptor subroutine".
Fourth, other errors in addition to the above;
if one error of one to four occurs repeatedly, the application layer determines the subsequent error processing operation.
If a link loss is detected ST407, then corresponding inactive exception handling is performed ST408, which includes:
if both communication parties detect that a link is lost at any moment after the last CPA PDU transmission is finished, the GATT executes corresponding first inactive abnormal event processing;
or;
and if the two communication parties detect the link loss at any time after the transmission of any segment of any CPA PDU is completed, the GATT executes second active abnormal event processing.
Due to the first inactive exception handling procedure of the fourth type of error, the communication device retransmits all segments of the current CPA PDU after the link connection is disconnected due to timeout and reconnected successfully.
Due to the second inactive exception handling process for handling the fourth type of error, the communication device retransmits the next segment of the current CPA PDU after the link connection is disconnected due to timeout and reconnected successfully.
If both communication parties detect the link loss at any time after the last CPA PDU transmission is completed, the GATT executes corresponding first inactive abnormal event processing, and the processing comprises the following steps:
the working state data includes the ASN value in the last CPA PDU, and when the bottom layer link is disconnected:
if the sender is sending CPA PDU through GATT layer 3, the working state data also includes current CPA PDU, and sends CPA PDU through GATT again after the bottom layer link is reconnected;
if the receiver is receiving the current CPA PDU via GATT layer 3, all fragments belonging to the current CPA PDU that have been received are discarded.
If both communication parties detect the link loss at any time after completing the transmission of any segment of any CPA PDU, the GATT executes corresponding second inactive abnormal event processing, and the processing comprises the following steps:
since the working state data includes the ASN value and SAR value in the CPA PDU, and when the underlying link is disconnected:
if the sender is sending the next segment of the CPA PDU through the GATT layer, the working state data also comprises the CPA PDU, and the sender continues to send the next segment of the CPA PDU through the GATT after the bottom layer link is reconnected;
if the receiver is receiving the next segment of the CPA PDU through the GATT layer 3, the working state data also comprises the received partial segment of the CPA PDU, and waits to receive the next segment of the CPA PDU after the bottom link is reconnected.
Meanwhile, the invention also provides a communication system adapted through the GATT and exception handling, wherein before the communication system exchanges data based on the master device and the slave device, both communication sides respectively establish a data communication protocol stack hierarchical structure which sequentially comprises a bottom layer transmission layer 1, an attribute protocol ATT layer 2, a general attribute specification GATT layer 3, a general attribute specification protocol adaptation CPA layer 4, a data exchange protocol PHD layer 5 and an application layer 6 from bottom to top;
the exception handling module is configured to:
implementing the exception handling method of any of the above.
The technical solutions of the present invention or similar technical solutions designed by those skilled in the art based on the teachings of the technical solutions of the present invention are all within the scope of the present invention to achieve the above technical effects.

Claims (3)

1. The communication method is characterized in that before data exchange is carried out between master equipment and slave equipment, the two sides of the communication respectively establish a data communication protocol stack level structure which sequentially comprises a bottom layer transmission layer, an attribute protocol ATT layer, a generic attribute specification GATT layer, a generic attribute specification protocol adaptation CPA layer, a data exchange protocol PHD layer and an application layer from bottom to top;
the CPA layer includes an exception handling method, the exception handling method including:
if the two communication parties generate time interval overtime or CC characteristic abnormity or ASN field value abnormity in the data exchange process, executing corresponding active abnormal event intervention;
if the two communication parties generate a GATT subprogram execution error in the CPA data exchange process, executing corresponding active GATT error intervention;
if the two communication parties send a CPA PDU to the receiving party in the CPA data exchange process, the original sending party may receive the errors which are thrown on the GATT layer, defined in the range of the application layer error codes reserved by the ATT and used by the GATT, and then corresponding active CPA PDU error intervention is executed;
if detecting that the link is lost, executing corresponding non-active abnormal event processing;
if the two communication parties generate time interval overtime or CC characteristic abnormity or ASN field value abnormity in the data exchange process, executing corresponding active abnormal event intervention comprises the following steps:
the method comprises the steps that the indication function of CC characteristics of the default slave equipment of the master equipment is closed, working state data are cleared, event notification that the bottom layer connection is disconnected is sent to a PHD layer in a semantic mode, and other data sent by the slave equipment are not processed before the next connection;
the slave device closes the indication function of the CC characteristic, clears the working state data, sends an event notice that the bottom layer connection is disconnected according to the semantics to the PHD layer, and does not process other data sent by the master device except the connection request;
if the two communication parties generate a GATT subprogram execution error in the CPA data exchange process, executing corresponding active GATT error intervention comprises the following steps:
the semantics of the error response used by the GATT protocol include, but are not limited to, insufficient GATT authentication, insufficient GATT encryption, GATT unexpected errors, and other related errors;
if the GATT authentication of the two communication parties is insufficient, the main equipment can carry out the GATT authentication operation and execute the GATT writing feature descriptor subprogram again;
if the GATT encryption of the two communication parties is insufficient, the main equipment can carry out the GATT encryption operation and execute the GATT writing feature descriptor subprogram again;
if the GATT of the two communication parties is in unexpected error and the two communication parties are in the CPA connection subprogram, the master device can try to execute the GATT writing feature descriptor subprogram again;
if the link loss is detected, executing corresponding non-active abnormal event processing, including:
if both communication parties detect that a link is lost at any moment after the last CPA PDU transmission is finished, the GATT executes corresponding first inactive abnormal event processing;
or;
if the two communication parties detect the link loss at any moment after the transmission of any segment of any CPA PDU is completed, the GATT executes a second active abnormal event processing;
if both communication parties detect the link loss at any time after completing the transmission of any segment of any CPA PDU, the GATT executes corresponding second inactive abnormal event processing, and the processing comprises the following steps:
the working state data comprises an ASN value and an SAR value in the CPA PDU, and when the bottom layer link is disconnected:
if the sender is sending the next segment of the CPA PDU through the GATT layer, the working state data also comprises the CPA PDU, and the sender continues to send the next segment of the CPA PDU through the GATT after the bottom layer link is reconnected;
if the receiver is receiving the next segment of the CPA PDU through the GATT layer, the working state data also comprises the received partial segment of the CPA PDU, and waits to receive the next segment of the CPA PDU after the bottom layer link is reconnected.
2. The communication method of claim 1, wherein the GATT performing a corresponding first inactive exception handling if both communication parties detect a link loss at any time after completing the transmission of the last CPA PDU comprises:
the working state data includes the ASN value in the last CPA PDU, and when the bottom layer link is disconnected:
if the sender is sending CPA PDU through the GATT layer, the working state data also comprises the current CPA PDU, and the current CPA PDU is sent again through the GATT after the bottom layer link is reconnected;
if the receiver is receiving the current CPA PDU via the GATT layer, all fragments belonging to the current CPA PDU that have been received are discarded.
3. The communication system is characterized in that before the communication system exchanges data based on the master device and the slave device, two communication parties respectively establish a data communication protocol stack level structure which sequentially comprises a bottom layer transmission layer, an attribute protocol ATT layer, a generic attribute specification GATT layer, a generic attribute specification protocol adaptation CPA layer, a data exchange protocol PHD layer and an application layer from bottom to top;
the communication system includes an exception handling module to:
an exception handling method according to any one of claim 1 to claim 2 is implemented.
CN202010048951.1A 2020-01-16 2020-01-16 Communication method and system adapted through GATT and exception handling Active CN111416889B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010048951.1A CN111416889B (en) 2020-01-16 2020-01-16 Communication method and system adapted through GATT and exception handling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010048951.1A CN111416889B (en) 2020-01-16 2020-01-16 Communication method and system adapted through GATT and exception handling

Publications (2)

Publication Number Publication Date
CN111416889A CN111416889A (en) 2020-07-14
CN111416889B true CN111416889B (en) 2022-03-04

Family

ID=71492690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010048951.1A Active CN111416889B (en) 2020-01-16 2020-01-16 Communication method and system adapted through GATT and exception handling

Country Status (1)

Country Link
CN (1) CN111416889B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111417116B (en) * 2020-03-10 2023-09-19 国家体育总局体育科学研究所 Communication method and system adapted through ATT, read-write and exception handling

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107018554A (en) * 2017-03-07 2017-08-04 广东欧珀移动通信有限公司 A kind of data transmission method, device and intelligent terminal
CN107153710A (en) * 2017-05-19 2017-09-12 肇庆市智高电机有限公司 A kind of big data processing method and system
CN110493775A (en) * 2019-08-23 2019-11-22 重庆大学 The communication means and system being adapted to by ATT and abnormality processing
CN110545318A (en) * 2019-08-19 2019-12-06 钟代笛 data communication method and system for carrying out adaptation depending on GATT and indication

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10042607B2 (en) * 2016-08-22 2018-08-07 Altera Corporation Variable precision floating-point multiplier
CN110545265B (en) * 2019-08-19 2021-12-31 重庆大学 Data communication system and method for carrying out adaptation depending on ATT and indication

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107018554A (en) * 2017-03-07 2017-08-04 广东欧珀移动通信有限公司 A kind of data transmission method, device and intelligent terminal
CN107153710A (en) * 2017-05-19 2017-09-12 肇庆市智高电机有限公司 A kind of big data processing method and system
CN110545318A (en) * 2019-08-19 2019-12-06 钟代笛 data communication method and system for carrying out adaptation depending on GATT and indication
CN110493775A (en) * 2019-08-23 2019-11-22 重庆大学 The communication means and system being adapted to by ATT and abnormality processing

Also Published As

Publication number Publication date
CN111416889A (en) 2020-07-14

Similar Documents

Publication Publication Date Title
CN110493775B (en) Communication method and system adapted by ATT and exception handling
EP2611226B1 (en) Processing method and system for over-the-air bootstrap
WO2005045608A2 (en) System and method for establishing a communication between a peripheral device and a wireless device
MXPA04002731A (en) Message delivery with configurable assurances and features between two endpoints.
CN110545265B (en) Data communication system and method for carrying out adaptation depending on ATT and indication
CN108390950A (en) A kind of information push method, device and equipment
CN112788074A (en) Data transmitting method, processing method, receiving method and equipment and storage medium
CN101335758B (en) Method and system for access service in SIM card by dual-processor terminal
CN110545318B (en) Data communication method and system for carrying out adaptation depending on GATT and indication
CN103888441A (en) Information transmitting method between application and protocol stack and processing device
CN110808948A (en) Remote procedure calling method, device and system
US20090106401A1 (en) System and method for Intra Network Internet Protocol (IP) address modification by dual controller
CN111416889B (en) Communication method and system adapted through GATT and exception handling
CN117480067A (en) Electric vehicle charge management and client device
EP1499086B1 (en) Internet service synchronization method for mobile communication terminal
EP2894912A1 (en) Method and apparatus for gateway management terminal
CN110417876A (en) Node server and main control device in session method, distributed system
CN101001213B (en) Short message transmission system and method
CN117336346A (en) IPPBX and PMS docking state conversion method, terminal equipment and medium
JP5142413B2 (en) System and method for adaptive message retransmission
CN110519160A (en) Things-internet gateway multimode communication means, device and computer readable storage medium
CN102710666B (en) RADIUS (remote authentication dial in user service) client overtime treating method in WLAN (wireless local area network) system
CN111314448B (en) Data communication system and method adapted based on CPA field protection
US7143313B2 (en) Support interface module bug submitter
CN113259404A (en) Industrial communication middleware based on TCP/IP protocol and use method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant