CN111416889A - 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
CN111416889A
CN111416889A CN202010048951.1A CN202010048951A CN111416889A CN 111416889 A CN111416889 A CN 111416889A CN 202010048951 A CN202010048951 A CN 202010048951A CN 111416889 A CN111416889 A CN 111416889A
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.)
Granted
Application number
CN202010048951.1A
Other languages
Chinese (zh)
Other versions
CN111416889B (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 GATT uses ATT (Attribute protocol) protocol, the GATT groups attributes defined in ATT, including "Service" and "feature (Characteristic)", one Service includes one or more features, each feature is described by a plurality of attributes, the collection of services forms GATT Profile, Bluetooth SIG officially defines some standard Service for developers to use, the data corresponding to these services and features are stored in a lookup table by ATT, and the ATT uses the assigned UUID as the index of each item.
When the device uses a CPA (Communication Protocol adaptation) layer constructed based on a GATT layer to carry out Communication, possible errors can be divided into four types, wherein the first type is that a time interval used for managing CPA state is overtime, a CC characteristic error (including but not limited to sending a CC characteristic indication without enabling a CC characteristic value indication function) of the CPA layer and the change of the value of an ASN field of the CPA PDU violates a rule defined by the CPA, the second type is that a GATT subprogram executes errors in the Communication process, and error feedback is in the form of corresponding error response codes, the error response codes are defined in the ATT Protocol, the third type is that the error response codes defined in the ATT Protocol cannot completely cover the errors which can occur in the Communication method, so that the GATT cannot carry out corresponding error processing, therefore, in order to support the data exchange of the ATT, new error codes aiming at the errors which can occur in the exchange of the PDUs are defined in the range of the application layer error codes reserved by the ATT, the fourth type is that a B24 can set according to actual application requirements, the Communication Protocol adaptation layer can carry out the Communication Protocol, and the subsequent connection interruption process can be carried out if three parameters (timeout interval parameters are required, otherwise, the Communication process is carried out, and the subsequent Communication process is carried out, so that the Communication process is carried out, and the Communication process is carried out can be carried out, and the Communication process is carried out if the Communication process is carried out, and the three Communication process is carried out, the Communication process is carried out, and the Communication process is carried out if the Communication process is carried out, the Communication process is carried out from the.
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 from the error source of the CPA layer, the object of the CPA layer of the present invention which may generate errors is CC characteristic, and the object of the communication method and system adapted by ATT and exception handling with patent number 201910783902.X which may generate errors 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;
Detailed Description
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 B L E device according to actual application requirements to implement low power consumption and transmission rate, where the three parameters include a connection interval (ConnectionInterval), a Slave device delay (Slave L latency), and a timeout time (supervision timeout), and the three parameters need to satisfy the requirements of supervision timeout > (1+ Slave L latency), otherwise, the connection is not normally disconnected.
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 (7)

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;
and if the link loss is detected, executing corresponding non-active abnormal event processing.
2. The communication method according to claim 1, wherein if the two communicating parties generate a time interval timeout or a CC characteristic exception or a value exception of an ASN field during the data exchange process, performing corresponding proactive exception event intervention comprises:
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.
3. The communication method according to claim 1, wherein if the GATT subroutine execution error occurs during the CPA data exchange, the performing corresponding active GATT error intervention comprises:
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.
4. The communication method according to claim 1, wherein if the link loss is detected, performing corresponding non-proactive exception handling comprises:
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.
5. The communication method of claim 4, 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.
6. The communication method according to claim 4, wherein the GATT performing the corresponding second inactive exception handling if both communication parties detect a link loss at any time after completing transmission of any segment of any CPA PDU comprises:
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.
7. 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 exception handling module is configured to:
an exception handling method according to any one of claim 1 to claim 6 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 true CN111416889A (en) 2020-07-14
CN111416889B 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)

Cited By (1)

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

Citations (6)

* 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
US20180052661A1 (en) * 2016-08-22 2018-02-22 Altera Corporation Variable precision floating-point multiplier
CN110493775A (en) * 2019-08-23 2019-11-22 重庆大学 The communication means and system being adapted to by ATT and abnormality processing
CN110545265A (en) * 2019-08-19 2019-12-06 重庆大学 data communication system and method for carrying out adaptation depending on ATT and indication
CN110545318A (en) * 2019-08-19 2019-12-06 钟代笛 data communication method and system for carrying out adaptation depending on GATT and indication

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180052661A1 (en) * 2016-08-22 2018-02-22 Altera Corporation Variable precision floating-point multiplier
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
CN110545265A (en) * 2019-08-19 2019-12-06 重庆大学 data communication system and method for carrying out adaptation depending on ATT and indication
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

Cited By (2)

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

Also Published As

Publication number Publication date
CN111416889B (en) 2022-03-04

Similar Documents

Publication Publication Date Title
CN101394400B (en) Method for establishing network connection for avoiding damage of ARP cache
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
US20030163580A1 (en) Data transmission protocol using short message service
CN110545265B (en) Data communication system and method for carrying out adaptation depending on ATT and indication
CN112788074A (en) Data transmitting method, processing method, receiving method and equipment and storage medium
CN110545318B (en) Data communication method and system for carrying out adaptation depending on GATT and indication
CN110808948A (en) Remote procedure calling method, device and system
CN114338650A (en) File transmission method and device, electronic equipment and readable storage medium
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
US7107345B2 (en) Method for managing socket in mobile communication system
CN101001213B (en) Short message transmission system and method
CN117336346A (en) IPPBX and PMS docking state conversion method, terminal equipment and medium
CN110519160A (en) Things-internet gateway multimode communication means, device and computer readable storage medium
JP5142413B2 (en) System and method for adaptive message retransmission
US7143313B2 (en) Support interface module bug submitter
CN111314448B (en) Data communication system and method adapted based on CPA field protection
CN104333515A (en) Method and device for processing SWIFT messages
CN111431911B (en) Method for collecting basic information of equipment in network, network edge equipment and network equipment
CN113259404A (en) Industrial communication middleware based on TCP/IP protocol and use method thereof
CN112312394A (en) Wireless fidelity Wi-Fi management method, device and related equipment

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