CN115412890B - Data transmission method and device and terminal equipment - Google Patents

Data transmission method and device and terminal equipment Download PDF

Info

Publication number
CN115412890B
CN115412890B CN202110591551.XA CN202110591551A CN115412890B CN 115412890 B CN115412890 B CN 115412890B CN 202110591551 A CN202110591551 A CN 202110591551A CN 115412890 B CN115412890 B CN 115412890B
Authority
CN
China
Prior art keywords
data
checking
terminal equipment
bluetooth
result
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
CN202110591551.XA
Other languages
Chinese (zh)
Other versions
CN115412890A (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.)
China Mobile Communications Group Co Ltd
China Mobile IoT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile IoT 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 China Mobile Communications Group Co Ltd, China Mobile IoT Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110591551.XA priority Critical patent/CN115412890B/en
Publication of CN115412890A publication Critical patent/CN115412890A/en
Application granted granted Critical
Publication of CN115412890B publication Critical patent/CN115412890B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a data transmission method, a device and terminal equipment, wherein the data transmission method comprises the following steps: splitting data to be transmitted into a plurality of data frames; for each data frame, sending a bluetooth packet to the second terminal device, where the bluetooth packet includes: an exclusive or checksum of the data frame and the bluetooth packet; receiving a verification result sent by the second terminal equipment; wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frames in the Bluetooth sub-packets according to the exclusive OR checksum of the Bluetooth sub-packets; a second checking result obtained by checking the single page data; the single page data includes data frames contained in a predetermined number of bluetooth packets. The scheme of the invention can improve the sending efficiency of the Bluetooth data, realize the verification of a single data frame through the exclusive OR checksum of the Bluetooth sub-packets, and/or realize the verification of single page data, and ensure the integrity of data transmission.

Description

Data transmission method and device and terminal equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data transmission method, apparatus, and terminal device.
Background
Bluetooth low energy, also known as bluetooth low energy, is a personal area network technology designed and marketed by the bluetooth technology alliance, and is intended for emerging applications in the fields of healthcare, sports fitness, beacons, security, home entertainment, etc. Compared with classical bluetooth, bluetooth low energy aims at significantly reducing power consumption and cost while maintaining an equivalent communication range.
However, the existing low-power consumption bluetooth transmission technology has the following problems: the data transmission is not checked, and a data retransmission strategy is not set, so that the data is easy to lose when the data is large, and the transmission is easy to fail.
Disclosure of Invention
The embodiment of the invention provides a data transmission method, a data transmission device and terminal equipment, which are used for solving the problem that in the prior art, in the transmission process of Bluetooth data, data transmission failure is easy to occur due to data loss when the data is large.
In order to solve the technical problems, the embodiment of the invention provides the following technical scheme:
the embodiment of the invention provides a data transmission method, which is applied to first terminal equipment and comprises the following steps:
Splitting data to be transmitted into a plurality of data frames;
for each data frame, sending a bluetooth packet to the second terminal device, where the bluetooth packet includes: an exclusive or checksum of said data frame and said bluetooth packet;
Receiving a verification result sent by the second terminal equipment;
Wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive OR checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
Optionally, before receiving the verification result sent by the second terminal device, the method further includes:
After the Bluetooth sub-packets with the preset number are sent, a first check instruction is sent to the second terminal equipment; the first checking instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets, and the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, in the case that the verification result includes the second verification result, after the receiving the verification result sent by the second terminal device, the method further includes:
And retransmitting the first target single-page data to the second terminal equipment under the condition that the second checking result indicates that the checking of the first target single-page data fails.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
in the case that the check result includes the first check result, after the receiving the check result sent by the second terminal device, the method further includes:
Determining at least one abnormal target data frame according to the data frame sequence number fed back by the second terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And retransmitting the at least one target data frame to the second terminal device.
Optionally, the method further comprises:
And re-receiving a second check result sent by the second terminal equipment and aiming at the second target single page data after retransmitting the at least one target data frame to the second terminal equipment.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, before the receiving the verification result sent by the second terminal device, the method further includes:
after the whole data frames are sent to the second terminal equipment, a second check instruction is sent to the second terminal equipment; the second verification instruction comprises a second secure hash algorithm SHA1 value of the whole data frame, and the second verification instruction is used for indicating the second terminal equipment to send the third verification result to the first terminal equipment.
Optionally, the method further comprises:
And retransmitting the whole data frame to the second terminal equipment under the condition that the third check result indicates that the check of the whole data frame fails.
Optionally, the single page data comprises 512 byte data frames.
The embodiment of the invention also provides a data transmission method applied to the second terminal equipment, comprising the following steps:
for each data frame, receiving a bluetooth packet sent by the first terminal device, where the bluetooth packet includes: an exclusive or checksum of a data frame and the bluetooth packet;
Sending a verification result to the first terminal equipment;
wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive-or checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
Optionally, before the sending of the verification result to the first terminal device, the method further includes:
After receiving the Bluetooth sub-packets with the preset number, receiving a first check instruction sent by the first terminal equipment; the first verification instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets; the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, in the case that the check result includes a second check result, after the sending of the check result to the first terminal device, the method further includes:
And re-receiving the first target single page data sent by the first terminal equipment under the condition that the second checking result indicates that the checking of the first target single page data fails.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
In case the verification result comprises a first verification result, after the sending of the verification result to the first terminal device, the method further comprises:
Feeding back a data frame sequence number of at least one abnormal target data frame to the first terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And re-receiving the at least one target data frame sent by the first terminal equipment.
Optionally, the method further comprises:
and retransmitting a second check result aiming at the second target single page data to the first terminal equipment after re-receiving the at least one target data frame sent by the first terminal equipment.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, before the sending of the check result to the first terminal device, the method further includes:
After receiving all the data frames sent by the first terminal equipment, receiving a second check instruction sent by the first terminal equipment; the second verification instruction includes a second secure hash algorithm SHA1 value for the entire data frame; the second checking instruction is used for indicating the second terminal equipment to send the third checking result to the first terminal equipment.
Optionally, the method further comprises:
And re-receiving all the data frames sent by the first terminal equipment under the condition that the third checking result indicates that the checking of all the data frames fails.
Optionally, the single page data comprises 512 byte data frames.
The embodiment of the invention also provides a data transmission device, which is applied to the first terminal equipment and comprises:
The splitting module is used for splitting the data to be sent into a plurality of data frames;
The first sending module is configured to send, for each data frame, a bluetooth packet to the second terminal device, where the bluetooth packet includes: an exclusive or checksum of said data frame and said bluetooth packet;
The first receiving module is used for receiving the verification result sent by the second terminal equipment;
Wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive OR checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
Optionally, the apparatus further comprises:
the first checking instruction sending module is used for sending a first checking instruction to the second terminal equipment after sending the Bluetooth sub-packets with the preset number; the first checking instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets, and the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, the apparatus further comprises:
And the first data retransmission module is used for retransmitting the first target single-page data to the second terminal equipment under the condition that the second check result indicates that the first target single-page data fails to check.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
The apparatus further comprises:
The first determining module is used for determining at least one abnormal target data frame according to the data frame sequence number fed back by the second terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And the second data retransmission module is used for retransmitting the at least one target data frame to the second terminal equipment.
Optionally, the apparatus further comprises:
And the result re-receiving module is used for re-receiving a second check result aiming at the second target single page data sent by the second terminal equipment after retransmitting the at least one target data frame to the second terminal equipment.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, the apparatus further comprises:
A second checking instruction sending module, configured to send a second checking instruction to the second terminal device after sending the all data frames to the second terminal device; the second verification instruction comprises a second secure hash algorithm SHA1 value of the whole data frame, and the second verification instruction is used for indicating the second terminal equipment to send the third verification result to the first terminal equipment.
Optionally, the apparatus further comprises:
And the third data retransmission module is used for retransmitting the whole data frame to the second terminal equipment under the condition that the third check result indicates that the check of the whole data frame fails.
Optionally, the single page data comprises 512 byte data frames.
The embodiment of the invention also provides a data transmission device, which is applied to the second terminal equipment and comprises:
The second receiving module is configured to receive, for each data frame, a bluetooth packet sent by the first terminal device, where the bluetooth packet includes: an exclusive or checksum of a data frame and the bluetooth packet;
The second sending module is used for sending a verification result to the first terminal equipment;
wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive-or checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
Optionally, the apparatus further comprises:
The first checking instruction receiving module is used for receiving a first checking instruction sent by the first terminal equipment after receiving the Bluetooth sub-packets with the preset number; the first verification instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets; the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, the apparatus further comprises:
And the first data re-receiving module is used for re-receiving the first target single-page data sent by the first terminal equipment under the condition that the second checking result indicates that the first target single-page data fails to check.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
The apparatus further comprises:
The data frame sequence number feedback module is used for feeding back the data frame sequence number of at least one abnormal target data frame to the first terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And the second data re-receiving module is used for re-receiving the at least one target data frame sent by the first terminal equipment.
Optionally, the apparatus further comprises:
And the result retransmitting module is used for retransmitting a second check result aiming at the second target single page data to the first terminal equipment after re-receiving the at least one target data frame sent by the first terminal equipment.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, the apparatus further comprises:
The second checking instruction receiving module is used for receiving a second checking instruction sent by the first terminal equipment after receiving all the data frames sent by the first terminal equipment; the second verification instruction includes a second secure hash algorithm SHA1 value for the entire data frame; the second checking instruction is used for indicating the second terminal equipment to send the third checking result to the first terminal equipment.
Optionally, the apparatus further comprises:
And the third data re-receiving module is used for re-receiving all the data frames sent by the first terminal equipment under the condition that the third check result indicates that the check of all the data frames fails.
Optionally, the single page data comprises 512 byte data frames.
The embodiment of the invention also provides a terminal device, which is a first terminal device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the data transmission method as claimed in any one of the preceding claims.
The embodiment of the invention also provides a terminal device, which is a second terminal device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the data transmission method as claimed in any one of the preceding claims.
Embodiments of the present invention also provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the data transmission method as described in any of the above.
The beneficial effects of the invention are as follows:
The invention splits the data to be transmitted into a plurality of data frames; for each data frame, sending a bluetooth packet to the second terminal device, where the bluetooth packet includes: the exclusive or checksum of the data frame and the Bluetooth sub-packet can improve the sending efficiency of Bluetooth data; receiving a verification result sent by the second terminal equipment; wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive OR checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data; the single page data comprises the data frames contained in the Bluetooth sub-packets with the preset number, and the check of the single data frame can be realized through the exclusive or check sum of the Bluetooth sub-packets, and/or the check of the single page data is realized, so that the integrity of data transmission is ensured.
Drawings
Fig. 1 shows one of flowcharts of a data transmission method according to an embodiment of the present invention;
FIG. 2 is a flow chart showing a second method for data transmission according to an embodiment of the present invention;
FIG. 3 is a third flowchart of a data transmission method according to an embodiment of the present invention;
fig. 4 shows one of schematic structural diagrams of a data transmission device according to an embodiment of the present invention;
FIG. 5 is a second schematic diagram of a data transmission method according to an embodiment of the present invention;
Fig. 6 shows a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the drawings and the specific embodiments thereof in order to make the objects, technical solutions and advantages of the present invention more apparent.
The invention provides a data transmission method, a device and terminal equipment, aiming at the problem that in the prior art, transmission failure is easy to occur due to data loss when data are large in the Bluetooth data transmission process.
As shown in fig. 1, an embodiment of the present invention provides a data transmission method, which is applied to a first terminal device, and includes:
step 101: splitting data to be transmitted into a plurality of data frames.
It should be noted that the first terminal device may be an electronic device, which may be an intelligent terminal capable of receiving and sending bluetooth data, such as a mobile phone, a tablet computer, a palm computer, and the like, or may be a processor with bluetooth data receiving, sending and processing functions.
In the embodiment of the invention, the data to be sent is sent after a plurality of data frames are obtained through framing, so that the data transmission efficiency can be improved under the conditions of low-power consumption Bluetooth data transmission and large data transmission quantity, such as Over-the-Air Technology (OTA) firmware upgrading, synchronous data, log files and other scenes.
Alternatively, in an embodiment of the present invention, the data is split into a single frame of data of up to 32 bytes.
Step 102: for each data frame, sending a bluetooth packet to the second terminal device, where the bluetooth packet includes: and an exclusive or checksum of the data frame and the Bluetooth sub-packet.
In the embodiment of the invention, since one bluetooth packet can transmit 20 bytes of data frames, the 32 bytes of data frames are transmitted to the second terminal device through two bluetooth transmitting packets, the two bluetooth packets further comprise a data frame sequence number (2 bytes), a packet header sequence number (2 bytes) of the bluetooth packet, a data length (2 bytes) of the bluetooth packet, an exclusive-or checksum (1 byte) of the bluetooth packet and an instruction word (1 byte) for transmitting the data frames, which are 40 bytes in total, and the two bluetooth transmitting packets are transmitted to the second terminal device as one bluetooth packet, so that the transmission of a single data frame is completed. Wherein the exclusive or checksum of the bluetooth packet is used for the second terminal device to check the transmission of the single data frame.
It should be noted that, in order to accelerate the data transmission efficiency, after the single data frame is sent, the second terminal device does not need to confirm whether it has been received or is successful in receiving.
Step 103: receiving a verification result sent by the second terminal equipment;
Wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive OR checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
In the embodiment of the invention, the data frames in the Bluetooth sub-packets with the preset number are used as single-page data to be sent to the second terminal equipment, and after the single-page data is sent, the second terminal equipment sends a verification result to the first terminal equipment.
The check result comprises at least one of a first check result obtained by the second terminal equipment according to the exclusive or check sum of the Bluetooth sub-packet and a second check result obtained by the second terminal equipment according to the single page data, so that repeated check of the single data frame and the single page data can be realized, and the integrity of data transmission is ensured.
Optionally, the preset number is 16, that is, the first terminal device sends 16 data frames of 32 bytes, and the total number of data frames of 512 bytes is taken as single-page data to the second terminal device, and further, if the number of data frames sent by the first terminal device to the second terminal device is less than 16, the number of actually sent data frames is taken as the standard.
It should be further noted that, the scheme provided by the embodiment of the invention does not relate to the low-power consumption bluetooth read-write strategy of the terminal equipment of the sender and the terminal equipment of the receiver, can better adapt to different equipment and scenes, and can automatically set the timeout time of the low-power consumption bluetooth read-write according to the attribute of the terminal equipment of the sender and the terminal equipment of the receiver.
Optionally, before receiving the verification result sent by the second terminal device, the method further includes:
After the Bluetooth sub-packets with the preset number are sent, a first check instruction is sent to the second terminal equipment; the first checking instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets, and the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
In the embodiment of the invention, after 16 bluetooth packets are sent, that is, after one single page of data is sent, a first verification instruction is sent to the second terminal device, where the first verification instruction includes a first secure hash algorithm (Secure Hash Algorithm, sha1) value of the single page of data, the second terminal device verifies the single page of data according to the first verification instruction, verifies each data frame in the single page of data, and returns a receiving state of each data frame to the first terminal device.
After the single page data transmission is finished, the first terminal device sends a first check instruction to the second terminal device, and the second terminal device checks the single data frame and the single page data according to the first check instruction, so that the problem of transmission rate reduction caused by waiting for the response of the second terminal device of the receiver can be solved, the data transmission efficiency is improved, and the integrity of the data frame transmission is ensured.
Optionally, in the case that the verification result includes the second verification result, after the receiving the verification result sent by the second terminal device, the method further includes:
And retransmitting the first target single-page data to the second terminal equipment under the condition that the second checking result indicates that the checking of the first target single-page data fails.
In the embodiment of the invention, under the condition that the first target single-page data verification fails according to the first SHA1 value in the first verification instruction, the first target single-page data is retransmitted to the second terminal equipment.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
in the case that the check result includes the first check result, after the receiving the check result sent by the second terminal device, the method further includes:
Determining at least one abnormal target data frame according to the data frame sequence number fed back by the second terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And retransmitting the at least one target data frame to the second terminal device.
In the embodiment of the invention, when the first check result indicates that the second target single page data has abnormal data frames, for example, when packet loss occurs or the data frames are abnormal due to error codes, the data frame sequence numbers corresponding to the abnormal data frames are returned, the first terminal equipment determines at least one abnormal target data frame according to the returned data frame sequence numbers, and the first terminal equipment resends the target data frames to the second terminal equipment.
It should be noted that, according to the data frame sequence number, it may be determined whether the data frame transmission is continuous, so as to determine whether to drop a packet. If the packet loss abnormality exists, the first check result also indicates the packet loss abnormality.
According to the embodiment of the invention, the data transmission integrity can be ensured by retransmitting the abnormal data frame.
Optionally, the method further comprises:
And re-receiving a second check result sent by the second terminal equipment and aiming at the second target single page data after retransmitting the at least one target data frame to the second terminal equipment.
In the embodiment of the invention, aiming at the strategy of the retransmitted abnormal data frame, when retransmitting, the second terminal equipment is required to confirm the receiving condition of the target data frame, after all the abnormal target data frames are retransmitted, the whole single page data is checked according to the first SHA1 value, and a second check result is sent, so that the integrity of single page data transmission is ensured.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
In the embodiment of the invention, after the first terminal device sends the complete data frame, the second terminal device sends a third verification result for verifying all the data to the first terminal device. And ensuring the integrity of all data frame transmission.
Optionally, before the receiving the verification result sent by the second terminal device, the method further includes:
after the whole data frames are sent to the second terminal equipment, a second check instruction is sent to the second terminal equipment; the second verification instruction comprises a second secure hash algorithm SHA1 value of the whole data frame, and the second verification instruction is used for indicating the second terminal equipment to send the third verification result to the first terminal equipment.
In the embodiment of the invention, after the second terminal equipment receives all the single page data, that is, after receiving all the data frames, the first terminal equipment actively transmits a second checking instruction to the second terminal equipment, wherein the second checking instruction comprises a second secure hash algorithm SHA1 value of all the data frames, and if the second terminal equipment confirms that all the data frames pass the checking according to the second SHA1 value, all the data frames are transmitted. If the verification fails, the next operation is performed.
Optionally, the method further comprises:
And retransmitting the whole data frame to the second terminal equipment under the condition that the third check result indicates that the check of the whole data frame fails.
In the embodiment of the invention, under the condition that the verification of all the data frames fails according to the second SHA1 value, the first terminal equipment resends all the data frames to the second terminal equipment again, so that the integrity of data transmission is ensured.
Optionally, the single page data comprises 512 byte data frames.
In the embodiment of the invention, a 512-byte data frame is adopted as single page data, which is beneficial to data operation of some low-performance ground Bluetooth power consumption devices.
The flow of the data transmission method is specifically described below with reference to fig. 2.
After data transmission starts, the first terminal equipment splits data to be transmitted into data frames, and for each data frame, the first terminal equipment transmits a Bluetooth sub-packet to the second terminal equipment, wherein the Bluetooth sub-packet comprises 40 bytes of data frames and framing information, the single data frame is 32 bytes, the framing information comprises a data frame sequence number (2 bytes), a packet header sequence number (2 bytes) of the Bluetooth sub-packet, a data length (2 bytes) of the Bluetooth sub-packet, an exclusive-or checksum (1 byte) of the Bluetooth sub-packet and an instruction word (1 byte) of the transmitted data frame, and after the single data frame is transmitted, the second terminal equipment does not need to confirm whether the single data frame is received. After at most 16 data frames (single page data) of 32 bytes are continuously transmitted, that is, after at most 16 bluetooth packets are continuously transmitted (when the number of the data frames is less than 16, the actual data frames are taken as the standard), a first check instruction is further transmitted to the second terminal device, the first check instruction includes a first SHA1 value of the single page data, at this time, the second terminal device of the receiving party needs to check the received single page data, and returns the receiving state of each data frame in the single page data, if the check is not passed, the second terminal device returns the data frame sequence number of the abnormal data frame to the first terminal device, and the first terminal device retransmits the abnormal or failed data frame according to the returned result of the second terminal device, if the single page data check fails, the first terminal device retransmits the single page data. When retransmitting the data frame, the second terminal equipment of the receiving party needs to confirm the receiving condition of the data frame, and after all abnormal data frames are transmitted, the second terminal equipment checks the whole page of data to ensure the integrity of the data frame. After the second terminal device receives all the single page data, the first terminal device sends a second checking instruction, which can also be called an ending instruction, wherein the second checking instruction comprises a second SHA1 value of all the data frames, if the second terminal device passes the checking according to the second SHA1 value, the data sending is successful, and if the checking is not passed, the first terminal device retransmits all the data frames.
The embodiment of the invention adopts a framing mode, is not limited by hardware limitation of single data transmission of low-power consumption Bluetooth, adopts a mode of combining framing information and data frames, can judge whether to lose frames according to the continuity of data frame serial numbers in the framing information in the transmission process, and simultaneously, judges the accuracy of single data frame transmission by combining with the exclusive or checksum of Bluetooth packets in the framing information; the verification mode adopted by the embodiment of the invention does not directly return a receiving result after each data frame is successfully received, but returns a receiving and verification result once after each single page of data (16 data frames) is received, so that the problem of transmission rate reduction caused by waiting for response of a receiver can be effectively solved, the transmission efficiency of data is improved under the condition of large transmission data quantity, and meanwhile, abnormal data frames can be retransmitted in a targeted manner; according to the embodiment of the invention, the data verification is divided into three layers, firstly, the single data frame is verified through the exclusive OR checksum of the Bluetooth packet, secondly, the first SHA1 value of the single page data is verified, and finally, the second SHA1 value of all the data frames is verified for all the data transmitted, so that errors in the transmission process can be found in time, retransmission can be carried out on the error data, the efficiency of retransmitting the data frame due to transmission errors is improved, the cost of data retransmission caused by transmission abnormality is reduced, and the integrity of data transmission is ensured.
As shown in fig. 3, an embodiment of the present invention further provides a data transmission method, which is applied to a second terminal device, including:
Step 301: for each data frame, receiving a bluetooth packet sent by the first terminal device, where the bluetooth packet includes: an exclusive or checksum of a data frame and the bluetooth packet.
In the embodiment of the present invention, the second terminal device may be an electronic device, which may be an intelligent terminal capable of receiving and sending bluetooth data, such as a mobile phone, a tablet computer, a palm computer, or a processor with bluetooth data receiving, sending and processing functions.
Step 302: sending a verification result to the first terminal equipment;
wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive-or checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
According to the embodiment of the invention, the check of the single data frame is realized through the exclusive OR checksum of the Bluetooth sub-packets, and/or the check of the single page data is realized, so that the data transmission efficiency is ensured, and the data transmission integrity is also ensured.
Optionally, before the sending of the verification result to the first terminal device, the method further includes:
After receiving the Bluetooth sub-packets with the preset number, receiving a first check instruction sent by the first terminal equipment; the first verification instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets; the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, in the case that the check result includes a second check result, after the sending of the check result to the first terminal device, the method further includes:
And re-receiving the first target single page data sent by the first terminal equipment under the condition that the second checking result indicates that the checking of the first target single page data fails.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
In case the verification result comprises a first verification result, after the sending of the verification result to the first terminal device, the method further comprises:
Feeding back a data frame sequence number of at least one abnormal target data frame to the first terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And re-receiving the at least one target data frame sent by the first terminal equipment.
Optionally, the method further comprises:
and retransmitting a second check result aiming at the second target single page data to the first terminal equipment after re-receiving the at least one target data frame sent by the first terminal equipment.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, before the sending of the check result to the first terminal device, the method further includes:
After receiving all the data frames sent by the first terminal equipment, receiving a second check instruction sent by the first terminal equipment; the second verification instruction includes a second secure hash algorithm SHA1 value for the entire data frame; the second checking instruction is used for indicating the second terminal equipment to send the third checking result to the first terminal equipment.
Optionally, the method further comprises:
And re-receiving all the data frames sent by the first terminal equipment under the condition that the third checking result indicates that the checking of all the data frames fails.
Optionally, the single page data comprises 512 byte data frames.
As shown in fig. 4, an embodiment of the present invention further provides a data transmission apparatus, which is applied to a first terminal device, including:
A splitting module 401, configured to split data to be sent into a plurality of data frames;
a first sending module 402, configured to send, for each of the data frames, a bluetooth packet to a second terminal device, where the bluetooth packet includes: an exclusive or checksum of said data frame and said bluetooth packet;
a first receiving module 403, configured to receive a verification result sent by the second terminal device;
Wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive OR checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
The data transmission device provided by the embodiment of the invention splits the data to be transmitted into a plurality of data frames; for each data frame, sending a bluetooth packet to the second terminal device, where the bluetooth packet includes: the exclusive or checksum of the data frame and the Bluetooth sub-packet can improve the sending efficiency of Bluetooth data; receiving a verification result sent by the second terminal equipment; wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive OR checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data; the single page data comprises the data frames contained in the Bluetooth sub-packets with the preset number, and the check of the single data frame can be realized through the exclusive or check sum of the Bluetooth sub-packets, and/or the check of the single page data is realized, so that the integrity of data transmission is ensured.
Optionally, the apparatus further comprises:
the first checking instruction sending module is used for sending a first checking instruction to the second terminal equipment after sending the Bluetooth sub-packets with the preset number; the first checking instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets, and the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, the apparatus further comprises:
And the first data retransmission module is used for retransmitting the first target single-page data to the second terminal equipment under the condition that the second check result indicates that the first target single-page data fails to check.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
The apparatus further comprises:
The first determining module is used for determining at least one abnormal target data frame according to the data frame sequence number fed back by the second terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And the second data retransmission module is used for retransmitting the at least one target data frame to the second terminal equipment.
Optionally, the apparatus further comprises:
And the result re-receiving module is used for re-receiving a second check result aiming at the second target single page data sent by the second terminal equipment after retransmitting the at least one target data frame to the second terminal equipment.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, the apparatus further comprises:
A second checking instruction sending module, configured to send a second checking instruction to the second terminal device after sending the all data frames to the second terminal device; the second verification instruction comprises a second secure hash algorithm SHA1 value of the whole data frame, and the second verification instruction is used for indicating the second terminal equipment to send the third verification result to the first terminal equipment.
Optionally, the apparatus further comprises:
And the third data retransmission module is used for retransmitting the whole data frame to the second terminal equipment under the condition that the third check result indicates that the check of the whole data frame fails.
Optionally, the single page data comprises 512 byte data frames.
It should be noted that, the data transmission apparatus provided in the embodiment of the present invention is an apparatus capable of executing the above-mentioned data transmission method applied to the first terminal device, and all embodiments of the above-mentioned data transmission method applied to the first terminal device are applicable to the apparatus, and can achieve the same or similar technical effects.
As shown in fig. 5, an embodiment of the present invention further provides a data transmission apparatus, which is applied to a second terminal device, including:
The second receiving module 501 is configured to receive, for each data frame, a bluetooth packet sent by the first terminal device, where the bluetooth packet includes: an exclusive or checksum of a data frame and the bluetooth packet;
A second sending module 502, configured to send a verification result to the first terminal device;
wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive-or checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
The device provided by the embodiment of the invention realizes the verification of a single data frame and the verification of single page data through the exclusive OR checksum of the Bluetooth sub-packets, thereby ensuring the transmission efficiency of the data and the integrity of the data transmission.
Optionally, the apparatus further comprises:
The first checking instruction receiving module is used for receiving a first checking instruction sent by the first terminal equipment after receiving the Bluetooth sub-packets with the preset number; the first verification instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets; the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, the apparatus further comprises:
And the first data re-receiving module is used for re-receiving the first target single-page data sent by the first terminal equipment under the condition that the second checking result indicates that the first target single-page data fails to check.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
The apparatus further comprises:
The data frame sequence number feedback module is used for feeding back the data frame sequence number of at least one abnormal target data frame to the first terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And the second data re-receiving module is used for re-receiving the at least one target data frame sent by the first terminal equipment.
Optionally, the apparatus further comprises:
And the result retransmitting module is used for retransmitting a second check result aiming at the second target single page data to the first terminal equipment after re-receiving the at least one target data frame sent by the first terminal equipment.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, the apparatus further comprises:
The second checking instruction receiving module is used for receiving a second checking instruction sent by the first terminal equipment after receiving all the data frames sent by the first terminal equipment; the second verification instruction includes a second secure hash algorithm SHA1 value for the entire data frame; the second checking instruction is used for indicating the second terminal equipment to send the third checking result to the first terminal equipment.
Optionally, the apparatus further comprises:
And the third data re-receiving module is used for re-receiving all the data frames sent by the first terminal equipment under the condition that the third check result indicates that the check of all the data frames fails.
Optionally, the single page data comprises 512 byte data frames.
It should be noted that, the data transmission apparatus provided in the embodiment of the present invention is an apparatus capable of executing the data transmission method applied to the second terminal device, and all embodiments of the data transmission method applied to the second terminal device are applicable to the apparatus, and the same or similar technical effects can be achieved.
As shown in fig. 6, an embodiment of the present invention further provides a terminal device, where the terminal device is a first terminal device, and includes: a processor 600; and a memory 610 connected to the processor 600 through a bus interface, the memory 610 storing programs and data used by the processor 600 in performing operations, the processor 600 calling and executing the programs and data stored in the memory 610.
Wherein the terminal device further comprises a transceiver 620, the transceiver 620 being connected to the bus interface for receiving and transmitting data under the control of the processor 600; the processor 600 is used to read a program in the memory 610.
Specifically, the processor 600 is configured to split data to be transmitted into a plurality of data frames.
The transceiver 620 is configured to send, for each of the data frames, a bluetooth packet to the second terminal device, where the bluetooth packet includes: an exclusive or checksum of said data frame and said bluetooth packet; and receiving a verification result sent by the second terminal equipment; wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive OR checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data; the single page data includes the data frames included in a predetermined number of bluetooth packets.
Optionally, the transceiver 620 is further configured to send a first check instruction to the second terminal device after sending the preset number of bluetooth packets; the first checking instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets, and the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, the transceiver 620 is further configured to retransmit the first target single page data to the second terminal device if the second check result indicates that the first target single page data fails to check.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
the processor 600 is further configured to determine, when the first check result indicates that the data frame in the second target single page data is abnormal, at least one target data frame that is abnormal according to the data frame sequence number fed back by the second terminal device.
The transceiver 620 is further configured to retransmit the at least one target data frame to the second terminal device.
Optionally, the transceiver 620 is further configured to re-receive, after retransmitting the at least one target data frame to the second terminal device, a second check result for the second target single page data sent by the second terminal device.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, the transceiver 620 is further configured to send a second check instruction to the second terminal device after sending the all data frames to the second terminal device; the second verification instruction comprises a second secure hash algorithm SHA1 value of the whole data frame, and the second verification instruction is used for indicating the second terminal equipment to send the third verification result to the first terminal equipment.
Optionally, the transceiver 620 is further configured to retransmit the entire data frame to the second terminal device if the third check result indicates that the check of the entire data frame fails.
Optionally, the single page data comprises 512 byte data frames.
Wherein in fig. 6, a bus architecture may comprise any number of interconnected buses and bridges, and in particular, one or more processors represented by processor 600 and various circuits of a memory represented by memory 610, linked together. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are well known in the art and, therefore, will not be described further herein. The bus interface provides an interface. The transceiver 620 may be a number of elements, including a transmitter and a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The user interface 630 may also be an interface capable of interfacing with an inscribed desired device for different terminals, including but not limited to a keypad, display, speaker, microphone, joystick, etc. The processor 600 is responsible for managing the bus architecture and general processing, and the memory 610 may store data used by the processor 600 in performing operations.
The embodiment of the invention also provides a terminal device, which is a second terminal device and comprises a processor; and the memory is connected with the processor through a bus interface and is used for storing programs and data used by the processor when executing operations, and the processor calls and executes the programs and data stored in the memory.
The user equipment also comprises a transceiver which is connected with the bus interface and used for receiving and transmitting data under the control of the processor; the processor is used for reading the program in the memory.
It should be noted that, the structure of the second terminal device provided by the embodiment of the present invention is similar to the structure of the first terminal device shown in fig. 6.
Specifically, the transceiver is configured to receive, for each data frame, a bluetooth packet sent by the first terminal device, where the bluetooth packet includes: an exclusive or checksum of a data frame and the bluetooth packet; and sending a verification result to the first terminal equipment; wherein the verification result comprises at least one of the following: a first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive-or checksum of the Bluetooth sub-packet; a second checking result obtained by checking the single page data; the single page data includes the data frames included in a predetermined number of bluetooth packets.
Optionally, the transceiver is further configured to receive a first check instruction sent by the first terminal device after receiving the preset number of bluetooth packets; the first verification instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets; the first checking instruction is used for indicating the second terminal equipment to send the first checking result and/or the second checking result to the first terminal equipment.
Optionally, the transceiver is further configured to re-receive the first target single page data sent by the first terminal device when the second check result indicates that the first target single page data fails to check.
Optionally, the bluetooth sub-packet further includes: a data frame sequence number;
the transceiver is further configured to, when the first check result indicates that the data frame in the second target single page data is abnormal, feed back, to the first terminal device, a data frame sequence number of at least one target data frame in which the abnormality occurs; and re-receiving the at least one target data frame sent by the first terminal device.
Optionally, the transceiver is further configured to retransmit a second check result for the second target single page data to the first terminal device after re-receiving the at least one target data frame sent by the first terminal device.
Optionally, the verification result further includes a third verification result obtained by verifying all the transmitted data frames.
Optionally, the transceiver is further configured to receive a second check instruction sent by the first terminal device after receiving the all data frames sent by the first terminal device; the second verification instruction includes a second secure hash algorithm SHA1 value for the entire data frame; the second checking instruction is used for indicating the second terminal equipment to send the third checking result to the first terminal equipment.
Optionally, the transceiver is further configured to re-receive the all data frames sent by the first terminal device if the third check result indicates that the all data frames fail to check.
Optionally, the single page data comprises 512 byte data frames.
Embodiments of the present invention also provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the data transmission method as described in any of the above.
Furthermore, it should be noted that in the apparatus and method of the present invention, it is apparent that the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. Also, the steps of performing the series of processes described above may naturally be performed in chronological order in the order of description, but are not necessarily performed in chronological order, and some steps may be performed in parallel or independently of each other. It will be appreciated by those of ordinary skill in the art that all or any of the steps or components of the methods and apparatus of the present invention may be implemented in hardware, firmware, software, or a combination thereof in any computing device (including processors, storage media, etc.) or network of computing devices, as would be apparent to one of ordinary skill in the art after reading this description of the invention.
The object of the invention can thus also be achieved by running a program or a set of programs on any computing device. The computing device may be a well-known general purpose device. The object of the invention can thus also be achieved by merely providing a program product containing program code for implementing said method or apparatus. That is, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. It is apparent that the storage medium may be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is apparent that the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. The steps of executing the series of processes may naturally be executed in chronological order in the order described, but are not necessarily executed in chronological order. Some steps may be performed in parallel or independently of each other.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and changes can be made without departing from the principles of the present invention, and such modifications and changes are intended to be within the scope of the present invention.

Claims (17)

1. A data transmission method applied to a first terminal device, comprising:
Splitting data to be transmitted into a plurality of data frames;
for each data frame, sending a bluetooth packet to the second terminal device, where the bluetooth packet includes: an exclusive or checksum of said data frame and said bluetooth packet;
After a preset number of Bluetooth sub-packets are sent, a first check instruction is sent to the second terminal equipment; the first verification instruction comprises a first secure hash algorithm SHA1 value of the Bluetooth sub-packets with the preset number, and the first verification instruction is used for indicating the second terminal equipment to send a first verification result and/or a second verification result to the first terminal equipment;
After all data frames are sent to the second terminal equipment, a second check instruction is sent to the second terminal equipment; the second checking instruction comprises a second secure hash algorithm SHA1 value of the whole data frame, and the second checking instruction is used for indicating the second terminal equipment to send a third checking result to the first terminal equipment;
Receiving a verification result sent by the second terminal equipment;
Wherein the verification result comprises at least one of the following: the first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive or checksum of the Bluetooth sub-packet; the second checking result is obtained by checking the single page data;
the verification result further comprises the following steps: the third checking result is obtained by checking all the transmitted data frames;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
2. The data transmission method according to claim 1, wherein in the case where the check result includes a second check result, after the receiving of the check result sent by the second terminal device, the method further comprises:
And retransmitting the first target single-page data to the second terminal equipment under the condition that the second checking result indicates that the checking of the first target single-page data fails.
3. The data transmission method according to claim 1, wherein the bluetooth packet further comprises: a data frame sequence number;
in the case that the check result includes the first check result, after the receiving the check result sent by the second terminal device, the method further includes:
Determining at least one abnormal target data frame according to the data frame sequence number fed back by the second terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And retransmitting the at least one target data frame to the second terminal device.
4. A data transmission method according to claim 3, characterized in that the method further comprises:
And re-receiving a second check result sent by the second terminal equipment and aiming at the second target single page data after retransmitting the at least one target data frame to the second terminal equipment.
5. The data transmission method according to claim 1, characterized in that the method further comprises:
And retransmitting the whole data frame to the second terminal equipment under the condition that the third check result indicates that the check of the whole data frame fails.
6. The data transmission method according to claim 1, wherein the single page data comprises 512 byte data frames.
7. A data transmission method applied to a second terminal device, comprising:
for each data frame, receiving a bluetooth packet sent by the first terminal device, where the bluetooth packet includes: an exclusive or checksum of a data frame and the bluetooth packet;
After receiving a preset number of Bluetooth sub-packets, receiving a first check instruction sent by the first terminal equipment; the first verification instruction comprises a first secure hash algorithm SHA1 value of the preset number of Bluetooth sub-packets; the first checking instruction is used for indicating the second terminal equipment to send a first checking result and/or a second checking result to the first terminal equipment;
after receiving all data frames sent by the first terminal equipment, receiving a second check instruction sent by the first terminal equipment; the second verification instruction includes a second secure hash algorithm SHA1 value for the entire data frame; the second checking instruction is used for indicating the second terminal equipment to send a third checking result to the first terminal equipment;
Sending a verification result to the first terminal equipment;
wherein the verification result comprises at least one of the following: the first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive-or checksum of the Bluetooth sub-packet; the second checking result is obtained by checking the single page data;
the verification result further comprises the following steps: the third checking result is obtained by checking all the transmitted data frames;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
8. The data transmission method according to claim 7, wherein in the case where the check result includes a second check result, after the transmission of the check result to the first terminal device, the method further comprises:
And re-receiving the first target single page data sent by the first terminal equipment under the condition that the second checking result indicates that the checking of the first target single page data fails.
9. The data transmission method according to claim 7, wherein the bluetooth packet further comprises: a data frame sequence number;
In case the verification result comprises a first verification result, after the sending of the verification result to the first terminal device, the method further comprises:
Feeding back a data frame sequence number of at least one abnormal target data frame to the first terminal equipment under the condition that the first check result indicates that the data frame in the second target single page data is abnormal;
And re-receiving the at least one target data frame sent by the first terminal equipment.
10. The data transmission method according to claim 9, characterized in that the method further comprises:
and retransmitting a second check result aiming at the second target single page data to the first terminal equipment after re-receiving the at least one target data frame sent by the first terminal equipment.
11. The data transmission method according to claim 7, characterized in that the method further comprises:
And re-receiving all the data frames sent by the first terminal equipment under the condition that the third checking result indicates that the checking of all the data frames fails.
12. The data transmission method of claim 7, wherein the single page data comprises 512 byte data frames.
13. A data transmission apparatus applied to a first terminal device, comprising:
The splitting module is used for splitting the data to be sent into a plurality of data frames;
The first sending module is configured to send, for each data frame, a bluetooth packet to the second terminal device, where the bluetooth packet includes: an exclusive or checksum of said data frame and said bluetooth packet;
The first checking instruction sending module is used for sending a first checking instruction to the second terminal equipment after sending a preset number of Bluetooth sub-packets; the first verification instruction comprises a first secure hash algorithm SHA1 value of the Bluetooth sub-packets with the preset number, and the first verification instruction is used for indicating the second terminal equipment to send a first verification result and/or a second verification result to the first terminal equipment;
The second checking instruction sending module is used for sending a second checking instruction to the second terminal equipment after sending all data frames to the second terminal equipment; the second checking instruction comprises a second secure hash algorithm SHA1 value of the whole data frame, and the second checking instruction is used for indicating the second terminal equipment to send a third checking result to the first terminal equipment;
The first receiving module is used for receiving the verification result sent by the second terminal equipment;
Wherein the verification result comprises at least one of the following: the first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive or checksum of the Bluetooth sub-packet; the second checking result is obtained by checking the single page data;
the verification result further comprises the following steps: the third checking result is obtained by checking all the transmitted data frames; the single page data includes the data frames included in a predetermined number of bluetooth packets.
14. A data transmission apparatus applied to a second terminal device, comprising:
The second receiving module is configured to receive, for each data frame, a bluetooth packet sent by the first terminal device, where the bluetooth packet includes: an exclusive or checksum of a data frame and the bluetooth packet;
The first checking instruction sending module is used for sending a first checking instruction to the second terminal equipment after sending a preset number of Bluetooth sub-packets; the first verification instruction comprises a first secure hash algorithm SHA1 value of the Bluetooth sub-packets with the preset number, and the first verification instruction is used for indicating the second terminal equipment to send a first verification result and/or a second verification result to the first terminal equipment;
The second checking instruction sending module is used for sending a second checking instruction to the second terminal equipment after sending all data frames to the second terminal equipment; the second checking instruction comprises a second secure hash algorithm SHA1 value of the whole data frame, and the second checking instruction is used for indicating the second terminal equipment to send a third checking result to the first terminal equipment;
The second sending module is used for sending a verification result to the first terminal equipment;
wherein the verification result comprises at least one of the following: the first check result is obtained by checking the data frame in the Bluetooth sub-packet according to the exclusive-or checksum of the Bluetooth sub-packet; the second checking result is obtained by checking the single page data;
the verification result further comprises the following steps: the third checking result is obtained by checking all the transmitted data frames;
The single page data includes the data frames included in a predetermined number of bluetooth packets.
15. A terminal device, the terminal device being a first terminal device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the data transmission method according to any one of claims 1 to 6.
16. A terminal device, the terminal device being a second terminal device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the data transmission method according to any one of claims 7 to 12.
17. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the data transmission method according to any of claims 1 to 12.
CN202110591551.XA 2021-05-28 2021-05-28 Data transmission method and device and terminal equipment Active CN115412890B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110591551.XA CN115412890B (en) 2021-05-28 2021-05-28 Data transmission method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110591551.XA CN115412890B (en) 2021-05-28 2021-05-28 Data transmission method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN115412890A CN115412890A (en) 2022-11-29
CN115412890B true CN115412890B (en) 2024-07-02

Family

ID=84156606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110591551.XA Active CN115412890B (en) 2021-05-28 2021-05-28 Data transmission method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN115412890B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116015544A (en) * 2022-12-13 2023-04-25 东信和平科技股份有限公司 Data communication method, system, controller and storage medium based on BLE4.0 channel

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107835040A (en) * 2017-11-30 2018-03-23 深圳市文鼎创数据科技有限公司 A kind of method, equipment and the storage medium of the data communication based on bluetooth
CN207251670U (en) * 2017-04-27 2018-04-17 腾讯科技(深圳)有限公司 The relevant device and system of a kind of data transfer
CN110213020A (en) * 2019-05-31 2019-09-06 杭州涂鸦信息技术有限公司 Data transmission method, terminal, system and device based on bluetooth peripheral hardware
CN111124744A (en) * 2019-12-26 2020-05-08 苏州浪潮智能科技有限公司 Data integrity checking method and system, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1912364A1 (en) * 2006-10-09 2008-04-16 Axalto SA Integrity of low bandwidth communications
US9658854B2 (en) * 2014-09-26 2017-05-23 Intel Corporation Instructions and logic to provide SIMD SM3 cryptographic hashing functionality
CN104539739B (en) * 2015-01-26 2019-03-29 浙江大学 A kind of system, method and device that file uploads
US11388597B2 (en) * 2016-04-21 2022-07-12 Signify Holding B.V. Systems and methods for authenticating wireless modules

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN207251670U (en) * 2017-04-27 2018-04-17 腾讯科技(深圳)有限公司 The relevant device and system of a kind of data transfer
CN107835040A (en) * 2017-11-30 2018-03-23 深圳市文鼎创数据科技有限公司 A kind of method, equipment and the storage medium of the data communication based on bluetooth
CN110213020A (en) * 2019-05-31 2019-09-06 杭州涂鸦信息技术有限公司 Data transmission method, terminal, system and device based on bluetooth peripheral hardware
CN111124744A (en) * 2019-12-26 2020-05-08 苏州浪潮智能科技有限公司 Data integrity checking method and system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115412890A (en) 2022-11-29

Similar Documents

Publication Publication Date Title
CN102546784B (en) Method for conducting batch upgrading for device firmware based on controller area network (CAN) bus
CN104539739A (en) System, method and device for uploading files
CN102281121A (en) Method, equipment and system for transmitting and verifying data file
US9622147B2 (en) System and method for performing hybrid automatic repeat request (HARQ) in a WLAN system
CN106031072A (en) Harq frame data structure and method of transmitting and receiving with harq in systems using blind detection
CN104917586A (en) Verification method, device and system of transmitted data
WO2018171455A1 (en) Method and device for sending feedback information
CN108933642B (en) Downlink retransmission method based on code block grouping, base station and terminal
WO2011137640A1 (en) File transmission method, file transmission apparatus and file reception apparatus
CN106407065A (en) Password keyboard USB communication abnormality recovery method and system
CN115412890B (en) Data transmission method and device and terminal equipment
CN111181698B (en) Data processing method, device, equipment and medium
US20220140955A1 (en) Sidelink information transmission method, terminal, and control node
CN111736866A (en) One-to-one and one-to-many compatible online upgrading method and terminal equipment
CN109120385B (en) Data transmission method, device and system based on data transmission system
CN101453479A (en) Fast document transmission system
JP7408833B2 (en) Uplink channel multiplexing method and device, and terminal
CN106375064A (en) Password keyboard USB communication anomaly recovery method and system
CN116466986B (en) Equipment software upgrading method and device of energy storage system, communication module and medium
US10949645B2 (en) Method, apparatus, and storage medium for data verification
CN110958084B (en) Method and communication equipment for transmitting acknowledgement message
CN116582826A (en) Message transmission method, electronic equipment and storage medium
WO2019242526A1 (en) Method for sending uplink control information, terminal device, and network side device
CN111246428A (en) Network reliable communication method, system, device and storage medium
CN103918210A (en) Fault-tolerant method and device for PHICH channel transmit information

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