CN108631914B - Bluetooth data checking and receiving method and device and Bluetooth equipment - Google Patents

Bluetooth data checking and receiving method and device and Bluetooth equipment Download PDF

Info

Publication number
CN108631914B
CN108631914B CN201710179109.XA CN201710179109A CN108631914B CN 108631914 B CN108631914 B CN 108631914B CN 201710179109 A CN201710179109 A CN 201710179109A CN 108631914 B CN108631914 B CN 108631914B
Authority
CN
China
Prior art keywords
data packet
packet
data
total length
preset
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
CN201710179109.XA
Other languages
Chinese (zh)
Other versions
CN108631914A (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.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
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 Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN201710179109.XA priority Critical patent/CN108631914B/en
Publication of CN108631914A publication Critical patent/CN108631914A/en
Application granted granted Critical
Publication of CN108631914B publication Critical patent/CN108631914B/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
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided are a Bluetooth data checking and receiving method and device and Bluetooth equipment. The verification method comprises the following steps: performing cyclic redundancy check code detection on an input data packet; and when the detection result is correct, acquiring the information of the preset part in the data packet, and verifying to obtain a verification result. By adopting the scheme, the success rate of data transmission can be improved.

Description

Bluetooth data checking and receiving method and device and Bluetooth equipment
Technical Field
The invention relates to the technical field of Bluetooth communication, in particular to a method and a device for checking and receiving Bluetooth data and Bluetooth equipment.
Background
In the process of data transmission by using bluetooth, due to the existence of interference factors, one or more frames in data may be damaged in the process of data transmission on a link, so that errors occur in the transmitted data.
To detect the correctness of the received data, error detection is typically performed on the received data packets. And if and only if the detection result is correct, replying confirmation information to the opposite terminal equipment to confirm that the received data packet is correct. In the prior art, a Cyclic Redundancy Check (CRC) method is usually adopted to detect a received data packet.
However, due to the limitation of the CRC detection principle, there is a possibility of missed detection, and if the received data packet has just missed detected data, the data packet may fail to be transmitted, which affects the success rate of data transmission.
Disclosure of Invention
The invention solves the technical problem of how to improve the success rate of data transmission.
In order to solve the above technical problem, an embodiment of the present invention provides a bluetooth data verification method, including: performing cyclic redundancy check code detection on an input data packet; and when the detection result is correct, acquiring the information of the preset part in the data packet, and verifying to obtain a verification result.
Optionally, the obtaining information of a preset part in the data packet, and performing verification to obtain a verification result includes: acquiring a transmission channel adopted by the data packet from the packet header of the data packet; when the adopted transmission channel is a logic link control and adaptation protocol, comparing the packet header length of the data packet with the data protocol unit length in the packet body of the data packet; and when the length of the packet header of the data packet is different from the length of the data protocol unit in the packet body, determining that the data packet is transmitted correctly.
Optionally, the obtaining information of a preset part in the data packet, and performing verification to obtain a verification result includes: acquiring the total length of the data packet and a frame check sequence; comparing the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively; when the total length of the data packet is not equal to a preset total length or the frame check sequence is different from a preset frame check sequence, determining that the data packet is transmitted in error; and taking the total length of the data packet as a preset total length, and taking the frame check sequence as a preset frame check sequence.
Optionally, the obtaining information of a preset part in the data packet, and performing verification to obtain a verification result includes: acquiring a transmission channel adopted by the data packet from the packet header of the data packet; when the adopted transmission channel is a logic link control and adaptation protocol, detecting whether the header length of the data packet is the same as the data protocol unit length in the packet body of the data packet; when the length of the packet header of the data packet is the same as the length of a data protocol unit in the packet body, acquiring the total length of the data packet and a frame check sequence; comparing the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively; when the total length of the data packet is not equal to a preset total length or the frame check sequence is different from a preset frame check sequence, determining that the data packet is transmitted in error; and taking the total length of the data packet as a preset total length, and taking the frame check sequence as a preset frame check sequence.
Optionally, when the data packet is checked for the first time, the preset total length is 0; the preset frame check sequence is 0.
Optionally, the length of the frame check sequence is 1 byte.
The embodiment of the invention also provides a method for receiving the Bluetooth data, which comprises the following steps: receiving a data packet sent by opposite terminal equipment; verifying the received data packet by adopting any one of the data verification methods; and when the check result is wrong, sending a retransmission request to the opposite terminal equipment.
Optionally, the receiving method further includes: and when the verification result is correct, sending confirmation information to the opposite terminal equipment.
An embodiment of the present invention further provides a bluetooth data verification apparatus, including: the detection unit is suitable for detecting the cyclic redundancy check code of the input data packet; and the checking unit is suitable for acquiring the information of the preset part in the data packet and checking to obtain a checking result when the detection result is correct.
Optionally, the verification unit includes: the device comprises a first acquisition subunit, a first comparison subunit and a first determination subunit, wherein: the first obtaining subunit is adapted to obtain a transmission channel adopted by the data packet from a packet header of the data packet; the first comparison subunit is suitable for comparing the packet header length of the data packet with the data protocol unit length in the packet body of the data packet when the adopted transmission channel is a logic link control and adaptation protocol; the first determining subunit is adapted to determine that the data packet is correctly transmitted when the header length of the data packet is the same as the data protocol unit length in the packet body, and determine that the data packet is incorrectly transmitted when the header length of the data packet is not the same as the data protocol unit length in the packet body.
Optionally, the verification unit includes: a second obtaining subunit, a second ratio subunit, a second determining subunit and a first updating subunit, wherein: the second obtaining subunit is adapted to obtain a total length of the data packet and a frame check sequence; the second comparison subunit is adapted to compare the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively; the second determining subunit is adapted to determine that the data packet is in a transmission error when the total length of the data packet is not equal to a preset total length or the frame check sequence is different from a preset frame check sequence; and the updating subunit is adapted to use the total length of the data packet as a preset total length and use the frame check sequence as a preset frame check sequence.
Optionally, the verification unit includes: a third obtaining subunit, a third ratio pair subunit, a fourth obtaining subunit, a fourth ratio pair subunit, a third determining subunit and a second updating subunit, wherein: the third obtaining subunit is adapted to obtain, from the packet header of the data packet, a transmission channel used by the data packet; the third comparison subunit is adapted to compare the packet header length of the data packet with the data protocol unit length in the packet body of the data packet when the adopted transmission channel is a logical link control and adaptation protocol; the fourth acquiring subunit is adapted to acquire the total length of the data packet and the frame check sequence when the packet header length of the data packet is the same as the data protocol unit length in the packet body; the fourth comparison subunit is adapted to compare the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively; the third determining subunit is adapted to determine that the data packet is in a transmission error when the total length of the data packet is not equal to a preset total length and the frame check sequence is not the same as a preset frame check sequence; the second updating subunit is adapted to use a total length of the data packet as a preset total length, and use the frame check sequence as a preset frame check sequence.
Optionally, when the checking unit checks the data packet for the first time, the preset total length is 0; the preset frame check sequence is 0.
An embodiment of the present invention further provides a bluetooth device, including: receiving element, above-mentioned any bluetooth data check device and sending unit, wherein: the receiving unit is suitable for receiving a data packet sent by the opposite terminal equipment; the Bluetooth data checking device is suitable for checking the received data packet; and the sending unit is suitable for sending a retransmission request to the opposite terminal equipment when the check result is wrong.
Optionally, the sending unit is further adapted to send confirmation information to the peer device when the verification result is correct.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
and for the data packet with the correct cyclic redundancy check code detection result, acquiring the information of the preset part in the data packet and checking. In the detection process of the cyclic redundancy check code, the data which is missed to be detected is checked, and the correctness of the received data packet is verified again, so that the probability that the received data packet is the correct data packet can be improved, and the success rate of data transmission can be improved.
The verification method provided in the above embodiment of the present invention is adopted to verify the received data, and when the verification result shows an error, a retransmission request is sent to the opposite terminal device to reacquire the data packet. The probability that the received data packet is the correct data packet can be improved, and therefore the success rate of data transmission can be improved.
Drawings
FIG. 1 is a diagram of a Bluetooth data format according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a header format according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for verifying Bluetooth data according to an embodiment of the present invention;
fig. 4 is a flowchart of a bluetooth data receiving method according to an embodiment of the present invention;
fig. 5 is a flowchart of another bluetooth data receiving method according to an embodiment of the present invention;
fig. 6 is a flowchart of another bluetooth data receiving method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a bluetooth data verification apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a bluetooth device in an embodiment of the present invention.
Detailed Description
Currently, to detect the correctness of received data, error detection is usually performed on received data packets. And if and only if the detection result is correct, replying confirmation information to the opposite terminal equipment to confirm that the received data packet is correct. For example, a Cyclic Redundancy Check (CRC) method is used to detect the received data packet.
CRC detection is performed by adding an r-bit binary check code sequence to a k-bit binary data sequence to form a binary sequence having a total length of n ═ k + r bits, and if a certain bit or bits in the data sequence are erroneous due to interference or the like, the certain relationship is destroyed, and thus, by checking the relationship, data correctness can be checked. This code is also called the (n, k) code.
For a generic CRC coding format (n, k), if the fixed r, k varies from 1 to an arbitrarily large integer, the input space of the CRC coding process [0,2 ]k-1]Can be arbitrarily large, and the output space [0,2 ]r]It is finite and from a mathematical point of view, mapping from a large input space to a fixed output space is necessarily many-to-one irreversible. The irreversible characteristic makes it infeasible to deduce the input from the output, and the many-to-one characteristic makes the CRC check not absolutely safe, so there is a possibility of missed detection due to the limitation of the CRC detection principle.
As shown in fig. 1, a diagram of a bluetooth data format, a packet generally includes: header (Header), Body (Body), and CRC sequence. The CRC sequence has 16 bits (bit) in total. When bluetooth file transmission is performed, data packets in the format of 3-DH5 are generally used for file transmission, wherein the maximum packet length can reach 1021 bytes (Byte), and because data is long, the possibility of interference is increased, and missed detection is more likely to occur. Fig. 2 is a schematic structural diagram of a packet header of a data packet, where the packet header of the data packet may include: a Logical channel indicator (LLID) field for determining a Logical channel to be used, a Flow Control indicator (Flow) field for Flow Control of a Logical Link Control and adaptation Protocol (L2 CAP), a Length (Length) field for indicating the number of bytes of data, and a Reserved entry (Reserved) field. Least Significant Bit (LSB), Most Significant Bit (MSB). If the interference happens to occur in the Length field, an exception must be caused. If the received data packet is just a data packet which is missed to be detected, the data packet is an error data packet, and therefore the success rate of data transmission is affected.
In order to solve the above problem, in the embodiment of the present invention, for a data packet with a correct crc result, information of a preset portion in the data packet is obtained, and verification is performed. In the detection process of the cyclic redundancy check code, the data which is missed to be detected is checked, and the correctness of the received data packet is verified again, so that the probability that the received data packet is the correct data packet can be improved, and the success rate of data transmission is improved.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Referring to fig. 3, a flowchart of a bluetooth data verification method according to an embodiment of the present invention is shown.
Step 31, performing cyclic redundancy check code detection on the input data packet.
In a specific implementation, after the local device receives a data packet input by the peer device, CRC detection may be performed on the received data packet.
And step 32, when the detection result is correct, acquiring the information of the preset part in the data packet, and checking to obtain a checking result.
In specific implementation, when the CRC of the received data packet is correctly detected, the information of the preset portion is obtained from the data packet, and the check is performed to obtain a check result.
In specific implementation, the preset position information in the data packet may be checked in various ways.
In an embodiment of the present invention, a transmission channel used by the data packet is obtained from a header of the data packet. Referring to fig. 2, if LLID is 01b/10b, it indicates that the transmission channel used by the data corresponding to the data packet is a Logical Link Control and adaptation Protocol (L2 CAP), that is, the transmitted data is L2CAP data. And when the adopted transmission channel is a logical link control and adaptation protocol, detecting whether the header length of the data packet is the same as the data protocol unit length in the packet body of the data packet. When the Length of the packet header of the Data packet is the same as the Length of a Data Protocol Unit (PDU) in the packet body, determining that the Data packet is transmitted correctly, and when the Length of the packet header of the Data packet is different from the Length of the PDU in the packet body, determining that the Data packet is transmitted incorrectly.
In another embodiment of the present invention, the total length of the data packet and a Frame Check Sequence (FCS) are obtained. Comparing the obtained total length of the data packet and the FCS with a preset total length and a preset FCS, respectively, and determining the data packet transmission error when the total length of the data packet is not equal to the preset total length or the FCS is different from the preset FCS. And taking the total length of the data packet as the preset total length, and taking the FCS as a preset FCS.
In a specific implementation, the packet length, i.e. the total length, of a data packet and the frame check sequence are recorded each time the data packet is received. When data of a file type is transmitted by bluetooth, the transmitted packet lengths are almost equal, and FCS is the same for the packets having the same packet length, so that it is possible to determine whether or not the received packet is correct by detecting the total length of the received packet and the FCS.
In another embodiment of the present invention, a transmission channel used by the data packet is obtained from the header of the data packet, and when the transmission channel used is a logical link control and adaptation protocol, it is detected whether the header length of the data packet is the same as the data protocol unit length in the packet body of the data packet. And when the length of the packet header of the data packet is the same as the length of the data protocol unit in the packet body, acquiring the total length of the data packet and the FCS. And comparing the total length of the acquired data packet with a preset total length, and comparing the FCS with a preset FCS. And when the total length of the data packet is not equal to a preset total length and the FCS is not the same as a preset FCS, determining that the data packet is transmitted in error. And taking the total length of the data packet as the preset total length, and taking the FCS as the preset FCS.
According to the above, for the data packet with the correct crc result, the information of the preset portion in the data packet is obtained for checking. In the detection process of the cyclic redundancy check code, the data which is missed to be detected is checked, and the correctness of the received data packet is verified again, so that the probability that the received data packet is the correct data packet can be improved, and the success rate of data transmission is improved.
In a specific implementation, when the data packet is first checked, the preset total length may be set to 0, and the preset FCS may also be set to 0. It is understood that the preset total length can be set to other values, and the preset FCS can also be set to other values, which are not limited herein.
In implementations, the FCS may be located at the end of the packet. In an embodiment of the present invention, the length of the FCS is 1 byte.
In order to facilitate better understanding and implementation of the present invention for those skilled in the art, embodiments of the present invention further provide a bluetooth data receiving method.
Referring to fig. 4, a flowchart of a bluetooth data receiving method according to an embodiment of the present invention is shown. In the process of receiving the bluetooth data, the received data packet is verified by adopting any data verification method provided by the above embodiment of the present invention. The details are described below with reference to specific steps.
Step 41, receiving a data packet sent by the peer device.
The received data packet is checked, step 42.
In the specific implementation, the specific verification method, principle and flow may refer to the descriptions in step 31 and step 32 in the above embodiments of the present invention, which are not described herein again.
And 43, when the check result is wrong, sending a retransmission request to the opposite terminal equipment.
In a specific implementation, when the check result is incorrect, it is determined that the received data is incorrect data, and a retransmission request may be sent to the peer device, so as to improve the correctness of the received data. It is understood that when the verification result is correct, confirmation information may be sent to the peer device.
As can be seen from the above, the verification method provided in the above embodiment of the present invention is used to verify the received data, and when the verification result shows an error, a retransmission request is sent to the peer device to reacquire the data packet. The probability that the received data packet is the correct data packet can be improved, and therefore the success rate of data transmission can be improved.
Referring to fig. 5, a flowchart of another bluetooth data receiving method according to an embodiment of the present invention is shown.
And step 51, receiving a data packet sent by the opposite terminal equipment.
And step 52, when the CRC check is correct, detecting whether the Header Length of the data packet is equal to the data protocol unit Length in the packet, that is, whether a Header Length ═ PDU Length is true.
The Header Length represents the Length of the packet Header of the data packet, and the PDU Length represents the Length of the data protocol unit in the packet body of the data packet. When the judgment result is yes, step 53 is executed. When the judgment result is no, step 54 is executed.
And step 53, sending confirmation information to the opposite terminal equipment.
In a specific implementation, when the Header Length is equal to the PDU Length, it is determined that the received packet is a correct packet, and a confirmation message is invented to the opposite device to confirm the reception of the packet. For example, an acknowledgement ACK may be sent to the peer device, and the peer device may acknowledge that the data packet has been received.
Step 54, sending a retransmission request to the peer device.
In a specific implementation, when the Header Length is not equal to the PDU Length, that is, the Header Length is not equal to the PDU Length, it is determined that the received packet is in error, and a retransmission request is sent to the peer device. In an embodiment of the present invention, a NAK may be sent to the peer device to request the peer device to retransmit the data packet.
Referring to fig. 6, a flowchart of another bluetooth data receiving method according to an embodiment of the present invention is shown.
And step 61, receiving the data packet sent by the opposite terminal equipment.
Step 62, obtain the total length of the data packet and the frame check sequence.
And step 63, judging whether the total length of the data packet is equal to a preset total length and the frame check sequence is the same as the preset frame check sequence.
In an embodiment, it is determined whether Current _ Packet _ length is equal to Packet _ length and Current _ Packet _ fcs is equal to Packet _ fcs. The Current _ Packet _ length represents the total length of the data Packet, the Packet _ length represents the preset length of the data Packet, the Current _ Packet _ FCS represents the FCS of the data Packet, and the Packet _ FCS represents the preset FCS.
When the judgment result is yes, step 64 is executed; when the judgment result is no, step 65 is executed.
And step 64, sending confirmation information to the opposite terminal equipment.
In a specific implementation, when the total length of the received data packet is equal to a preset total length and the frame check sequence is the same as the preset frame check sequence, it is determined that the received data packet is a correct data packet, and a confirmation message is sent to the peer device to confirm the reception of the data packet. For example, an acknowledgement ACK may be sent to the peer device, and the peer device may acknowledge that the data packet has been received.
And step 65, sending a retransmission request to the opposite terminal equipment.
In a specific implementation, when the total length of the received data packet is not equal to a preset total length, or the frame check sequence is not the same as a preset frame check sequence, or the total length of the data packet is not the same as the preset total length and the frame check sequence is not the same as the preset frame check sequence, it is determined that the received data packet is erroneous, and a retransmission request is sent to the peer device. In an embodiment of the present invention, a NAK may be sent to the peer device to request the peer device to retransmit the data packet.
And step 66, taking the total length of the data packet as a preset total length, and taking the frame check sequence as a preset frame check sequence.
In specific implementation, the total length of a currently received data packet is updated to a preset total length, a frame check sequence of the currently received data packet is updated to a preset frame check sequence, and the updated preset total length and frame check sequence are adopted to check a next received data packet.
In a specific implementation, the bluetooth data receiving methods shown in fig. 5 and fig. 6 may be used to receive a data packet sent by the peer device in one data receiving process, where the sequence of use is not limited. The received correctness can be further improved, thereby further improving the correctness of data transmission.
In order to facilitate better understanding and implementation of the present invention for those skilled in the art, the embodiment of the present invention further provides a bluetooth data verification apparatus.
Referring to fig. 7, a schematic structural diagram of a bluetooth data checking apparatus in an embodiment of the present invention is shown, where the bluetooth data checking apparatus 70 may include: a detection unit 71 and a verification unit 72, wherein:
the detection unit 71 is adapted to perform cyclic redundancy check code detection on the input data packet;
the checking unit 72 is adapted to, when the detection result is correct, obtain information of a preset portion in the data packet, and check to obtain a checking result.
In an embodiment of the present invention, the verification unit 72 may include: the device comprises a first acquisition subunit, a first comparison subunit and a first determination subunit, wherein:
the first obtaining subunit is adapted to obtain a transmission channel adopted by the data packet from a packet header of the data packet;
the first comparison subunit is suitable for comparing the packet header length of the data packet with the data protocol unit length in the packet body of the data packet when the adopted transmission channel is a logic link control and adaptation protocol;
the first determining subunit is adapted to determine that the data packet is correctly transmitted when the header length of the data packet is the same as the data protocol unit length in the packet body, and determine that the data packet is incorrectly transmitted when the header length of the data packet is not the same as the data protocol unit length in the packet body.
In another embodiment of the present invention, the verification unit 72 may include: a second obtaining subunit, a second ratio subunit, a second determining subunit and a first updating subunit, wherein:
the second obtaining subunit is adapted to obtain a total length of the data packet and a frame check sequence;
the second comparison subunit is adapted to compare the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively;
the second determining subunit is adapted to determine that the data packet is transmitted in error when any one of the following conditions is satisfied: the total length of the data packet is not equal to a preset total length, and the frame check sequence is different from a preset frame check sequence;
and the updating subunit is adapted to use the total length of the data packet as a preset total length and use the frame check sequence as a preset frame check sequence.
In another embodiment of the present invention, the verification unit 72 may include: a third obtaining subunit, a third ratio pair subunit, a fourth obtaining subunit, a fourth ratio pair subunit, a third determining subunit and a second updating subunit, wherein:
the third obtaining subunit is adapted to obtain, from the packet header of the data packet, a transmission channel used by the data packet;
the third comparison subunit is adapted to compare the packet header length of the data packet with the data protocol unit length in the packet body of the data packet when the adopted transmission channel is a logical link control and adaptation protocol;
the fourth obtaining subunit is adapted to obtain the total length of the data packet and a frame check sequence when the packet header length of the data packet is the same as the data protocol unit length in the packet body;
the fourth comparison subunit is adapted to compare the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively;
the third determining subunit is adapted to determine that the data packet is transmitted in error when any one of the following conditions is satisfied: the total length of the data packet is not equal to the preset total length, and the frame check sequence is different from the preset frame check sequence;
the second updating subunit is adapted to use a total length of the data packet as a preset total length, and use the frame check sequence as a preset frame check sequence.
In a specific implementation, when the checking unit 72 checks the data packet for the first time, the preset total length is 0; the preset frame check sequence is 0.
Referring to fig. 8, an embodiment of the present invention further provides a bluetooth device. The bluetooth device 80 may include a receiving unit 81, any one of the bluetooth data verification apparatuses 70 and a transmitting unit 82 provided in the above embodiments of the present invention, wherein:
the receiving unit 81 is adapted to receive a data packet sent by an opposite terminal device;
the bluetooth data verifying device 70 is adapted to verify the received data packet;
the sending unit 82 is adapted to send a retransmission request to the peer device when the check result is incorrect.
In a specific implementation, the sending unit 82 is further adapted to send confirmation information to the peer device when the verification result is correct.
In a specific implementation, the working principle and the working process of the bluetooth device 80 may refer to descriptions in the bluetooth data verification method, the bluetooth data receiving method, and the bluetooth data verification apparatus provided in the foregoing embodiments of the present invention, which are not described herein again.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (9)

1. A Bluetooth data checking method is characterized by comprising the following steps:
performing cyclic redundancy check code detection on an input data packet;
when the detection result is correct, acquiring information of a preset part in the data packet, and verifying to obtain a verification result;
the acquiring information of the preset part in the data packet, and checking to obtain a checking result includes: acquiring a transmission channel adopted by the data packet from the packet header of the data packet; when the adopted transmission channel is a logic link control and adaptation protocol, comparing the packet header length of the data packet with the data protocol unit length in the packet body of the data packet; when the length of the packet header of the data packet is the same as the length of the data protocol unit in the packet body, determining that the data packet is transmitted correctly, and when the length of the packet header of the data packet is different from the length of the data protocol unit in the packet body, determining that the data packet is transmitted incorrectly;
or, the obtaining information of the preset part in the data packet and checking to obtain a checking result includes: acquiring the total length of the data packet and a frame check sequence; comparing the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively; when the total length of the data packet is not equal to a preset total length or the frame check sequence is different from a preset frame check sequence, determining that the data packet is transmitted in error; taking the total length of the data packet as a preset total length, and taking the frame check sequence as a preset frame check sequence; or, the obtaining information of the preset part in the data packet and checking to obtain a checking result includes: acquiring a transmission channel adopted by the data packet from the packet header of the data packet; when the adopted transmission channel is a logic link control and adaptation protocol, detecting whether the header length of the data packet is the same as the data protocol unit length in the packet body of the data packet; when the length of the packet header of the data packet is the same as the length of a data protocol unit in the packet body, acquiring the total length of the data packet and a frame check sequence; comparing the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively; when the total length of the data packet is not equal to a preset total length or the frame check sequence is different from a preset frame check sequence, determining that the data packet is transmitted in error; and taking the total length of the data packet as a preset total length, and taking the frame check sequence as a preset frame check sequence.
2. The bluetooth data verification method according to claim 1, wherein when the data packet is verified for the first time, the preset total length is 0; the preset frame check sequence is 0.
3. The bluetooth data verification method according to claim 1, wherein the length of the frame check sequence is 1 byte.
4. A bluetooth data receiving method, comprising:
receiving a data packet sent by opposite terminal equipment;
checking the received data packet by using the data checking method of any one of claims 1 to 3;
and when the check result is wrong, sending a retransmission request to the opposite terminal equipment.
5. The bluetooth data receiving method according to claim 4, further comprising:
and when the verification result is correct, sending confirmation information to the opposite terminal equipment.
6. A Bluetooth data verification device, comprising:
the detection unit is suitable for detecting the cyclic redundancy check code of the input data packet;
the verification unit is suitable for acquiring the information of the preset part in the data packet when the detection result is correct, and verifying to obtain a verification result;
wherein the verification unit includes: the device comprises a first acquisition subunit, a first comparison subunit and a first determination subunit, wherein: the first obtaining subunit is adapted to obtain a transmission channel adopted by the data packet from a packet header of the data packet; the first comparison subunit is suitable for comparing the packet header length of the data packet with the data protocol unit length in the packet body of the data packet when the adopted transmission channel is a logic link control and adaptation protocol; the first determining subunit is adapted to determine that the data packet is correctly transmitted when the header length of the data packet is the same as the data protocol unit length in the packet body, and determine that the data packet is incorrectly transmitted when the header length of the data packet is not the same as the data protocol unit length in the packet body;
or, the verification unit includes: a second obtaining subunit, a second ratio subunit, a second determining subunit and a first updating subunit, wherein: the second obtaining subunit is adapted to obtain a total length of the data packet and a frame check sequence; the second comparison subunit is adapted to compare the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively; the second determining subunit is adapted to determine that the data packet is in a transmission error when the total length of the data packet is not equal to a preset total length or the frame check sequence is different from a preset frame check sequence; the updating subunit is adapted to use a total length of the data packet as a preset total length, and use the frame check sequence as a preset frame check sequence;
or, the verification unit includes: a third obtaining subunit, a third ratio pair subunit, a fourth obtaining subunit, a fourth ratio pair subunit, a third determining subunit and a second updating subunit, wherein: the third obtaining subunit is adapted to obtain, from the packet header of the data packet, a transmission channel used by the data packet; the third comparison subunit is adapted to compare the packet header length of the data packet with the data protocol unit length in the packet body of the data packet when the adopted transmission channel is a logical link control and adaptation protocol; the fourth acquiring subunit is adapted to acquire the total length of the data packet and the frame check sequence when the packet header length of the data packet is the same as the data protocol unit length in the packet body; the fourth comparison subunit is adapted to compare the total length of the acquired data packet and the frame check sequence with a preset total length and a preset frame check sequence respectively; the third determining subunit is adapted to determine that the data packet is in a transmission error when the total length of the data packet is not equal to a preset total length and the frame check sequence is not the same as a preset frame check sequence; the second updating subunit is adapted to use a total length of the data packet as a preset total length, and use the frame check sequence as a preset frame check sequence.
7. The bluetooth data verification apparatus according to claim 6, wherein the predetermined total length is 0 when the verification unit verifies the data packet for the first time; the preset frame check sequence is 0.
8. A bluetooth device, comprising: the receiving unit, the bluetooth data verification device and the transmitting unit of claim 6 or 7, wherein:
the receiving unit is suitable for receiving a data packet sent by the opposite terminal equipment;
the Bluetooth data checking device is suitable for checking the received data packet;
and the sending unit is suitable for sending a retransmission request to the opposite terminal equipment when the check result is wrong.
9. The bluetooth device according to claim 8, wherein the sending unit is further adapted to send a confirmation message to the peer device when the verification result is correct.
CN201710179109.XA 2017-03-23 2017-03-23 Bluetooth data checking and receiving method and device and Bluetooth equipment Active CN108631914B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710179109.XA CN108631914B (en) 2017-03-23 2017-03-23 Bluetooth data checking and receiving method and device and Bluetooth equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710179109.XA CN108631914B (en) 2017-03-23 2017-03-23 Bluetooth data checking and receiving method and device and Bluetooth equipment

Publications (2)

Publication Number Publication Date
CN108631914A CN108631914A (en) 2018-10-09
CN108631914B true CN108631914B (en) 2020-11-17

Family

ID=63707191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710179109.XA Active CN108631914B (en) 2017-03-23 2017-03-23 Bluetooth data checking and receiving method and device and Bluetooth equipment

Country Status (1)

Country Link
CN (1) CN108631914B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525370B (en) * 2018-11-29 2020-07-17 苏州德姆斯信息技术有限公司 Data packet sending method based on zigbee
CN116137723B (en) * 2023-04-04 2023-07-11 北京全路通信信号研究设计院集团有限公司 Method, device, equipment and storage medium for judging broken link triggering

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2390513A (en) * 2002-07-02 2004-01-07 Hewlett Packard Co Improved error detection using forward error correction and a CRC check
CN104333401A (en) * 2014-10-27 2015-02-04 深圳市冠旭电子有限公司 Methods, devices and systems for sending and receiving Bluetooth data
CN104836659A (en) * 2015-05-28 2015-08-12 神州融安科技(北京)有限公司 Control method of Bluetooth communication interaction

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8401120B1 (en) * 2010-05-13 2013-03-19 Qualcomm Incorporated Symbol error detection for bluetooth enhanced data rate packets

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2390513A (en) * 2002-07-02 2004-01-07 Hewlett Packard Co Improved error detection using forward error correction and a CRC check
CN104333401A (en) * 2014-10-27 2015-02-04 深圳市冠旭电子有限公司 Methods, devices and systems for sending and receiving Bluetooth data
CN104836659A (en) * 2015-05-28 2015-08-12 神州融安科技(北京)有限公司 Control method of Bluetooth communication interaction

Also Published As

Publication number Publication date
CN108631914A (en) 2018-10-09

Similar Documents

Publication Publication Date Title
JP6067637B2 (en) Packet level erasure protection coding in transmission of aggregated packets
JP4456608B2 (en) Acknowledgment message processing at the terminal
CN112217599B (en) Data frame receiving method and device, and communication method and system
US20080267190A1 (en) Method of, and System for, Communicating Data, and a Station for Transmitting Data
TWI526019B (en) Method and device for processing a packet in a wlan system
EP3758265A1 (en) Harq transmission scheme using multiple parallel harq threads
US20210075542A1 (en) Phy-based hybrid automatic repeat request (harq)
CN111565094A (en) Method and apparatus for dynamic ARQ acknowledgement in wireless networks
US8335958B2 (en) Method of communication, in particular with capability of frame abortion or retransmission indication, between a transmitter and a receiver based on frames and corresponding communication node
CN108631914B (en) Bluetooth data checking and receiving method and device and Bluetooth equipment
JP5651191B2 (en) Method and apparatus for requesting retransmission of datagram in physical layer
EP3912289B1 (en) Method of transmission of a data packet, computer program, and transceiver device
CN108988990A (en) A method of processing link layer data mistake
US7565584B2 (en) Setting transmission length based on estimated error rate
EP1932268B1 (en) Method, apparatuses and system for error detection and selective retransmission
CN114095117A (en) Retransmission method and related device for Ethernet error frame
US10554334B2 (en) Nominally unguaranteed error-detection codes for sub-data packets
CN111459707B (en) Error detection and correction method and device for serial port communication
WO2015196566A1 (en) Method and apparatus for detecting faulty data in radio link control layer
WO2013080481A1 (en) Communication device, communication method, and communication program
CN112217601A (en) Data frame communication method and system
CN112217600A (en) Data frame receiving method and device, and communication method and system
US10938516B1 (en) Systems and methods for ethernet packet error detection and correction in automotive environments
KR20140116769A (en) Data Communication Method and Apparatus Using Forward Error Correction
CN113055133B (en) Hybrid automatic repeat request HARQ response method, device, equipment and medium

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