WO2017070855A1 - Bluetooth-based data transmission method and device - Google Patents

Bluetooth-based data transmission method and device Download PDF

Info

Publication number
WO2017070855A1
WO2017070855A1 PCT/CN2015/092997 CN2015092997W WO2017070855A1 WO 2017070855 A1 WO2017070855 A1 WO 2017070855A1 CN 2015092997 W CN2015092997 W CN 2015092997W WO 2017070855 A1 WO2017070855 A1 WO 2017070855A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
sequence number
strips
sequence
strip
Prior art date
Application number
PCT/CN2015/092997
Other languages
French (fr)
Chinese (zh)
Inventor
刘均
焦典
Original Assignee
深圳还是威健康科技有限公司
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 深圳还是威健康科技有限公司 filed Critical 深圳还是威健康科技有限公司
Priority to CN201580002059.7A priority Critical patent/CN105900347B/en
Priority to PCT/CN2015/092997 priority patent/WO2017070855A1/en
Publication of WO2017070855A1 publication Critical patent/WO2017070855A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/70Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes
    • H04B5/72Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes for local intradevice communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/38Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
    • H04B1/3827Portable transceivers
    • H04B1/385Transceivers carried on the body, e.g. in helmets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/38Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
    • H04B1/3827Portable transceivers
    • H04B1/385Transceivers carried on the body, e.g. in helmets
    • H04B2001/3861Transceivers carried on the body, e.g. in helmets carried in a hand or on fingers

Definitions

  • the present invention relates to the field of terminals, and in particular, to a Bluetooth-based data transmission method and apparatus.
  • the firmware of the smart bracelet has been fixed in the smart bracelet by the manufacturer after leaving the factory. After shipment, users need to upgrade the firmware in the smartphone due to bug fixes, firmware upgrades, etc.
  • the user can transmit the updated firmware to the smart bracelet through the Bluetooth module in the smart terminal to upgrade the firmware in the smart bracelet.
  • the smart terminal sends all the data to the smart bracelet through the Bluetooth module, and the smart bracelet saves the data once, even if the order of the data sent by the smart terminal to the smart bracelet is wrong, the smart bracelet The data is also saved as it is, which causes the following smart bracelet to be upgraded according to the updated firmware received, because the data saved in the smart bracelet is incorrect and the upgrade fails.
  • the technical problem to be solved by the embodiments of the present invention is to provide a Bluetooth-based data transmission method, device, and system, which can ensure the accuracy of the data transmission sequence.
  • the present invention provides a Bluetooth-based data transmission method, including:
  • the sender divides the data segment that needs to be transmitted into multiple data strips
  • the sender adds a sequence number to the plurality of data strips to obtain a plurality of data strips of the join sequence number, wherein the Nth data strip is added with a sequence number M, and the sequence number M is used to represent the Nth data. Sorting of strips in adjacent k strips including the Nth strip;
  • the sender sends the data strips of the multiple join sequence numbers to the receiver
  • the receiving party receives the data strips of the multiple join sequence numbers, and determines whether the sequence in which the receiver receives the data strips of the multiple join sequence numbers and the sequence numbers in the data strips of the multiple join sequence numbers Consistent
  • the recipient requests the sender to resend the erroneous data segment.
  • the manner in which the sender sends the data strips of the multiple join sequence numbers to the receiver includes: the sender sends the data strips of the h join sequence numbers from the Nth data strip in sequence. , the h is not greater than k [0014] the receiving party receives the data strips of the plurality of joining serial numbers, and determines whether the receiving party receives the sequence of the plurality of joining serial number data strips and the serial number in the plurality of joining serial number data strips Consistently, the receiving party receives the data strips of the h joining sequence numbers from the Nth data strip, and determines that the receiving party receives the data of the h joining serial numbers from the Nth data strip. Whether the order of the strips is consistent with the serial number in the data strips of the h joined serial numbers from the Nth data strip;
  • the receiver stores the h data strips in the h join sequence data strips from the Nth data strip, and requests the sender to send from the N+th joins.
  • the recipient requests the sender to resend the h data strips of the join sequence number from the Nth data strip.
  • the method further includes:
  • the receiving party uses the serial number of the last received data strip as a comparison serial number
  • the determining, in the order in which the receiving party receives the data strips of the h joining serial numbers from the Nth data strip, and the data strips of the h joining serial numbers from the Nth data strip Whether the serial number is consistent or not includes:
  • the determining, by the receiving party, whether the sequence of the h join sequence data strips from the Nth data strip is consistent with the sequence number of the h join sequence numbers includes: determining whether, after the comparison sequence number, the sequence number of the data column of the join sequence number received for the first time in the data strip of the h join sequence numbers received by the receiving party from the Nth data strip, in order of receiving Determining whether the serial number of the h numbered data strips from the Nth data strip is the sequence number after the serial number of the data strip of the previous received join sequence number;
  • the receiving party requesting the sender to resend the data strips of the h joining sequence numbers from the Nth data strip further includes:
  • the receiver stores the correct data strip in the h join sequence data strips from the Nth data strip and uses the sequence number of the last correct data strip as the comparison sequence number, and requests the Sender Newly send the N+h-1 data strips with the serial number;
  • the sender sends the data strip of the N+h-1th join sequence number
  • the receiving party receives the data strip of the N+h-1 joining sequence number, and determines whether the sequence number of the data strip of the N+h-1 joining sequence number received by the receiving party is The sequence number after the sequence number is compared, and if not, the receiver requests the sender to send the data strip of the N+h-2th join sequence number. If yes, the receiving party stores the N+h-1 data strips and the N+h-1 data strip numbers as the comparison sequence number, and requests the sender to send the h data strips with sequence numbers from the N+thth join data strip.
  • the method further includes:
  • the receiving direction sends a receiving success instruction to the sender
  • the sender determines whether the reception success instruction is received within the first inter-threshold threshold, and if not, the sender re-transmits the h join sequence data from the Nth data strip.
  • the sender determines whether the reception success instruction is received within the second inter-threshold threshold, and if not, stores the data information of the Nth join sequence data strip, where the data information includes the current N The value and the sequence number of the Nth data strip;
  • the sender sends the data strips of the join sequence number in batches, and each batch sends h data strips of the join sequence number in advance:
  • the sender determines whether the sender has the stored data information, and if yes, sends h datagrams of the join sequence number headed by the N+h according to the stored information.
  • a Bluetooth-based data transmission device comprising:
  • a dividing unit configured to divide a data segment that needs to be transmitted into multiple data strips
  • a combination unit configured to respectively add a sequence number to the plurality of data strips to obtain a plurality of data strips of the join sequence number
  • the sequence number M is added to the Nth data strip, and the sequence number M is used to indicate the order of the Nth data strip in the adjacent k data strips including the Nth data strip;
  • a first sending unit configured to send the multiple data strips of the added sequence number to the receiver
  • a receiving unit configured to receive the data strips of the multiple join sequence numbers
  • a first determining unit configured to determine a sequence in which the receiving party receives the data strips of the multiple join sequence numbers Whether the serial numbers in the plurality of data columns of the added serial number are consistent;
  • a requesting unit configured to request, when the receiving party receives the data strips of the plurality of joining serial numbers, that the sequence of the data strips in the plurality of joining serial numbers is inconsistent with the serial number in the data strips of the plurality of joining serial numbers The segment is resent.
  • the first sending unit is further configured to sequentially send h data sequences of the join sequence number from the Nth data strip, where h is not greater than k;
  • the receiving unit is further configured to receive the data strips of the h join sequence numbers from the Nth data strip;
  • the first determining unit is further configured to determine that the receiver receives the slave data Whether the order of the h data columns of the join sequence number from the Nth data strip is consistent with the sequence number of the h data strips of the join sequence number from the Nth data strip;
  • the requesting unit is further configured to: if the receiving party receives the sequence of the h numbered data strips from the Nth data strip, and the h joining sequence numbers from the Nth data strip The number of the data strips is the same, the receiver stores the h data strips of the h numbered data strips from the Nth data strip, and requests the sender to send from the N+h h data strips added with serial numbers from the data strips of the serial number;
  • the requesting unit is further configured to: if the receiving party receives the sequence of the h joining sequence data strips from the Nth data strip and the h joining sequence numbers from the Nth data strip The sequence numbers in the data strips are inconsistent, and the receiver requests the sender to resend the data strips of the h join sequence numbers from the Nth data strip.
  • the device further includes: a comparison sequence number unit, configured to use a sequence number of the last received data strip as a comparison sequence number;
  • the first determining unit is further configured to determine, after the comparison sequence number, whether the receiving party first receives the joining sequence number received by the h joining numbered data strips from the Nth data strip. The serial number of the data strip.
  • the first determining unit is further configured to determine whether the comparison sequence number is the first time that the receiver receives the h join sequence data strips from the Nth data strip.
  • the serial number of the data strip of the received serial number is sequentially determined according to the receiving order, and the serial number of the h data number of the joining serial number from the Nth data strip is the serial number after the serial number of the data strip of the previous received joining serial number ;
  • the requesting unit further includes storing the correct data strip in the data strip of the h joining sequence numbers from the Nth data strip and using the sequence number of the last correct data strip as the comparison serial number, and Requesting the sender to resend the data strip of the N+h-1 joining sequence number;
  • the first sending unit is further configured to send the data strip of the N+h-1th join sequence number
  • the receiving unit is further configured to receive the data strip of the N+h-1th join sequence number
  • the first determining unit is further configured to determine whether the sequence number of the data strip of the N+h-1 join sequence number received by the receiver is a sequence number after the comparison sequence number;
  • the requesting unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is not the sequence number after the comparison sequence number, the receiver requests the sending The party sends the N+h-2 data strips with the serial number;
  • the comparison sequence number unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is the sequence number after the comparison sequence number, the receiver will The N+h-1 data strip number is used as the comparison sequence number;
  • the requesting unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is a sequence number after the comparison sequence number, the receiver stores the N+h-1 data strips, and requesting the sender to send the h datagrams of the join sequence number from the data strip of the N+thth join sequence number
  • the device further includes:
  • a second sending unit configured to send a receiving success instruction to the sender
  • a second determining unit configured to determine whether the receiving success instruction is not received within the first inter-threshold threshold, and if not, the sending end resending the Nth data strip H data strips with serial numbers added;
  • the second determining unit is further configured to determine whether the receiving success instruction is received within the second inter-threshold threshold;
  • a storage unit configured to: if the sending party is not within the second inter-threshold threshold Receiving the receiving success instruction, storing data information of the Nth join sequence data strip, where the data information includes a current N value and a sequence number of the Nth data strip;
  • the second determining unit is further configured to determine whether the sender has the stored data information, and if
  • the sender divides the data segment that needs to be transmitted into a plurality of data strips, and adds a sequence number to the plurality of data strips respectively to obtain a plurality of data strips with the added sequence number, and the plurality of data of the added sequence number
  • the strip is sent to the receiver, wherein the number N is added to the Nth data strip, and the sequence number M is used to indicate the order of the Nth data strip in the adjacent k data strips including the Nth data strip;
  • the party receives the data strips of the plurality of join sequence numbers, and determines whether the sequence of receiving the data strips of the plurality of join sequence numbers is consistent with the sequence numbers of the plurality of data strips of the join sequence number. If not, the request sender sends the data segment of the error again. send.
  • Embodiment 1 is a flowchart of Embodiment 1 of a Bluetooth-based data transmission method according to the present invention
  • Embodiment 2 is a flowchart of Embodiment 2 of a Bluetooth-based data transmission method according to the present invention
  • Embodiment 3 is a flowchart of Embodiment 3 of a Bluetooth-based data transmission method according to the present invention.
  • FIG. 4 is a schematic structural diagram of an embodiment of a Bluetooth-based data transmission device according to the present invention.
  • FIG. 5 is a schematic structural diagram of another embodiment of a Bluetooth-based data transmission apparatus according to the present invention.
  • FIG. 1 is a flowchart of Embodiment 1 of a Bluetooth-based data transmission method according to the present invention.
  • the method can be applied to a smart terminal having a Bluetooth module, the method comprising:
  • Step S101 The sender divides the data segment that needs to be transmitted into multiple data strips.
  • the sender transmits data to the receiver through the Bluetooth.
  • the receiver receives the transmission data and first puts it in the cache.
  • the cache memory reaches a certain amount, the data is written into the memory and the transmission data is stored.
  • the sender divides the data segment that needs to be transmitted into multiple data strips.
  • Step S102 The sender adds a sequence number to each of the plurality of data strips to obtain a plurality of data strips of the added sequence number.
  • the sending direction sends the data strips in sequence.
  • the receiving party cannot identify whether the order of the accepted data strips is correct.
  • the sequence number M is added to the Nth data strip, and the serial number M is used to indicate Sorting the Nth data strips in adjacent k data strips including the Nth data strip. For example, a frame flag bit may be added after each data strip, and the frame flag bit may be stored.
  • the serial number for example, the first to tenth data strips, the serial numbers are 10, 20, 30, 40, 50, 10, 20, 30, 40, 50, and the serial number of the second data strip 20 indicates the data strip.
  • the serial number may be a specific order of numbers, symbols or letters, or a combination thereof, and the present invention is not limited.
  • Step S103 The sender sends the data strips of the multiple join sequence numbers to the receiver.
  • the sender sends multiple data strips of the added sequence number to the receiver, where the sender can send the data strips of the join sequence number one by one, and the receivers receive and determine the received join sequence number one by one.
  • the order of the data strips is correct; the sender may also continuously send h data strips with the serial number added, and the receiving party receives the data strip of the h join sequence number, and then determines whether the order of the received data strips of the added number is correct.
  • Step S104 The receiver receives the data strips of the multiple join sequence numbers.
  • Step S105 It is determined whether the order in which the receiver receives the data strips of the plurality of join sequences is consistent with the sequence numbers in the data strips of the plurality of join sequence numbers.
  • the receiving party determines whether the order in which the receiving party receives the data strips of the plurality of joining serial numbers is consistent with the sequence numbers in the data strips of the plurality of joining serial numbers. For example, suppose the numbers of the 1-10th data strips are a, b, c, d, e, f, g, h, ⁇ , j, respectively. The order in which the receiver receives the data strips of the 10 join sequences is the same.
  • Step S106 The receiver requests the sender to resend the erroneous data segment.
  • the receiver is an allocation judgment receiver.
  • the order of receiving the batch number is correct. If the receiver determines that the order of the receiver receiving the batch number is incorrect, the receiver requests the sender to resend the batch data strip, or the receiver stores the batch data strip. In the correct data strip, and request the sender to send the data strip after the correct data strip.
  • the sender divides the data segment that needs to be transmitted into a plurality of data strips, and adds a sequence number to the plurality of data strips to obtain a plurality of data strips with the added sequence number, and the plurality of data of the added sequence number
  • the strip is sent to the receiver, wherein the number N is added to the Nth data strip, and the sequence number M is used to indicate the order of the Nth data strip in the adjacent k data strips including the Nth data strip;
  • the party receives the data strips of the plurality of join sequence numbers, and determines whether the sequence of receiving the data strips of the plurality of join sequence numbers is consistent with the sequence numbers of the plurality of data strips of the join sequence number. If not, the request sender sends the data segment of the error again. send.
  • FIG. 2 is a flowchart of Embodiment 2 of a Bluetooth-based data transmission method according to the present invention.
  • the method can be applied to a smart terminal having a Bluetooth module, the method comprising:
  • Step S201 The sender divides the data segment that needs to be transmitted into multiple data strips.
  • the sender transmits data to the receiver through the Bluetooth.
  • the receiver receives the transmission data and first puts it in the cache.
  • the cache memory reaches a certain amount, the data is written into the memory and the transmission data is stored.
  • the sender divides the data segment that needs to be transmitted into multiple data strips.
  • Step S202 The sender adds a sequence number to the plurality of data strips respectively to obtain a plurality of data strips of the added sequence number.
  • the sending direction receives the data strips in sequence, and the receiving party cannot identify whether the order of the accepted data strips is correct for the receiving party, and then adds the serial number M to the Nth data strip, and the serial number M is used to indicate Sorting the Nth data strips in adjacent k data strips including the Nth data strip. For example, a frame flag bit may be added after each data strip, and the frame flag bit may be stored.
  • the serial number for example, the first to tenth data strips, the serial numbers are 10, 20, 30, 40, 50, 10, 20, 30, 40, 50, and the serial number of the second data strip 20 indicates the data strip.
  • Step S203 Determine whether N is greater than the total number of data.
  • Step S204 The sender sequentially sends h data strips of the join sequence number from the Nth data strip.
  • h is not greater than k, and the sequence numbers of the transmitted h data strips are guaranteed to be different.
  • the sender sequentially sends the first data strip, the second data strip, the third data strip, and the third data strip to the receiver.
  • the fourth data bar is not greater than k, and the sequence numbers of the transmitted h data strips.
  • N is not greater than the total number of data and N+h is greater than the total number of data, indicating that the sender has not sent more than h data strips, then the remaining unsent is sent. Data strip.
  • Step S205 The receiver receives the data strips of the h join sequence numbers from the Nth data strip.
  • the receiving party receives the data strips of the h joining sequence numbers from the Nth data strip sent by the sender through the Bluetooth, and puts them into the cache.
  • the receiver receives the first data strip sent by the sender via Bluetooth
  • Step S206 It is judged whether the order of the data strips of the h join sequence numbers received from the Nth data strip received by the receiver is correct.
  • the receiving party determines whether the sequence number of the comparison sequence is the number of the data strip of the join sequence number first received by the receiver in the data strip of the h join sequence number from the Nth data strip, and determines the judgment and reception. Whether the order of the h-added data strips from the Nth data strip is consistent with the sequence number of the h-joined data strips, and when both judgment results are "Yes", the judgment result of step S206 Only "is
  • the order of the received data strips of the h-joined number from the Nth data strip is consistent with the sequence number of the h-joined data strips.
  • the order of the data strips received by the receiver is 1
  • the above judgment result is "Yes", and if the order of the data strips received by the receiver is 10, 30, 20, 40, the above judgment result is "No".
  • the above judgment result is ⁇
  • the four data strips are stored, and the last one, that is, the serial number 40 of the fourth data strip is used as the comparison serial number.
  • the order of the data strips received by the receiver is 50, 10, 20, 30, then the comparison number 40 is followed by 50, and the order of the data strips received by the receiver 50, 10, 20, 30 is the same as the order of the sequence numbers of the added data strips, the above judgment result is "Yes", otherwise, the above judgment result is "No".
  • Step S207 The receiver stores the h data strips in the data strips of the h join sequence numbers and uses the sequence numbers of the N+h-1 data strips as the comparison sequence numbers.
  • Step S208 The receiver requests the sender to send the data strips of the join sequence number from the Nth data strip.
  • the receiver requests the sender to continue to send the data strip of the join sequence number; if the judgment result of step S206 is "No", the order received by the receiver is wrong, N is unchanged, and the receiver requests the sender to resend the sequence number from the Nth join. Data strip.
  • Step S206 may also only perform "determining the order of determining the received data strips of the h join sequence numbers from the Nth data strip and from the Nth Whether the serial numbers in the h-added data strips from the data strips are consistent "A judgment, step S207 may also only execute "the recipient stores the h data strips in the h-joined data strips”.
  • the data is sent in batches to determine whether the order of the h numbered data strips received from the Nth data strip received by the receiver is correct, and if so, the data of the h join sequence numbers is stored.
  • the requesting sender sends the next batch of data strips with the serial number. Otherwise, the requesting sender resends the h data strips with the serial number, and the data transmission method can ensure the accuracy of the data transmission sequence.
  • FIG. 3 is a flowchart of Embodiment 3 of a Bluetooth-based data transmission method according to the present invention.
  • the method can be applied to a smart terminal having a Bluetooth module, the method comprising:
  • Step S301 The sender divides the data segment that needs to be transmitted into multiple data strips.
  • Step S302 The sender adds a sequence number to each of the plurality of data strips to obtain a plurality of data strips of the added sequence number.
  • step S202 in the embodiment described in FIG. 2 can be referred to.
  • Step S303 Determine whether the sender has stored data information: N and the sequence number of the Nth data.
  • Step S304 determines whether N is greater than the total number of strips.
  • step S203 in the embodiment described in FIG. 2 can be referred to.
  • Step S305 The sender sequentially sends h data strips of the join sequence number from the Nth data.
  • step S204 in the embodiment described in FIG. 2 can be referred to.
  • Step S306 The receiver receives the data strips of the h joining sequence numbers from the Nth data.
  • step S205 in the embodiment described in FIG. 2 can be referred to.
  • Step S307 The receiving direction sends a receiving success instruction to the sender.
  • the receiving party when the receiving party receives the data successfully, that is, the receiving party writes the h-added data strips from the Nth data into the buffer, and the receiving direction sends a receiving success instruction, indicating that the Bluetooth connection is normal, and the sending The party can continue to transfer data to the recipient.
  • Step S308 The sender determines whether a reception success instruction is received within the first inter-threshold threshold.
  • the Bluetooth connection is normal; if the sender does not receive the reception success instruction within the first inter-threshold threshold, the Bluetooth connection is unstable. , requesting the sender to resend the h-added data strips from the Nth data.
  • the first inter-turn threshold may be set to 0.5s, ls, 2s, etc., and the invention is not limited.
  • Step S309 The sender determines whether a reception success instruction is received within the second time threshold.
  • the Bluetooth connection is normal; if the sender does not receive the reception success instruction within the second inter-threshold threshold, the Bluetooth connection is interrupted.
  • the second inter-turn threshold is greater than the first inter-threshold threshold, and the second inter-threshold threshold may be set to 2s, 3s, 5s Etc., the invention is not limited.
  • Step S310 The sender stores the data information of the Nth data column of the added sequence number.
  • the Bluetooth connection is interrupted, and the sender stores the data information of the Nth added sequence data strip, where the data information includes The current N value and the sequence number of the Nth data strip, and the data transmission is suspended.
  • Step S311 It is determined whether the order of the data strips of the h joining sequence numbers received from the Nth data strip accepted by the receiver is correct.
  • the receiving party determines whether the sequence number of the sequence number of the first number of the data sequence of the number of the join number received from the Nth data strip received by the receiver after the comparison sequence number is received, in the order of receiving It is sequentially determined whether the sequence number of the h number-added data strips received from the Nth data strip received by the receiver is the sequence number after the serial number in the data strip of the previous received join sequence number.
  • the serial number 50 after the comparison number 40 is the same as the sequence number 50 of the data strip of the first received join sequence number
  • the data strip received for the first time is the serial number 10 after the serial number 50 and the serial number 10 of the second received data strip, and so on, and the serial number 30 and the fourth received data after the serial number 20 of the third received data strip. If the serial number of the bar is 30, the above judgment result is "Yes", otherwise, the above judgment result is "No".
  • Step S312 The receiver stores the h data strips in the h data strips of the join sequence number and uses the sequence number of the last received data strip as the comparison sequence number.
  • Step S313 The receiver requests the sender to send the data strip from the Nth join sequence number.
  • Step S314 The receiver stores the correct data strip and the comparison sequence number.
  • Step S311 when the result of the determination in step S311 is "NO", the receiver stores the correct data strip in the data strip of the h join sequence numbers from the Nth data strip and the last correct data strip
  • Step S315 The receiver requests the sender to send the data strip of the N+h-1th join sequence number.
  • Step S316 The sender sends N+h-1 data strips with the added sequence number.
  • Step S317 The receiver receives the data strip of the sequence number of the N+h-1 data strips.
  • Step S318 It is determined whether the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is the next sequence number of the comparison sequence number.
  • Step S319 The receiver stores the N+h-1 data strips and the N+h-1 data strip numbers as the comparison sequence numbers.
  • the data is sent in batches and judged one by one whether the order of the h-joined data strips received from the Nth data strip received by the receiver is correct, if the receiving party receives the Nth data strip
  • the sequence of the h data columns added with the serial number is correct.
  • the data strips of the h join sequence numbers are stored, and the sequence number of the last received data strip is used as the comparison sequence number, so ⁇ 1, the request sender sends the next The data strip of the serial number is added in batches. Otherwise, the correct data strip is stored and the sequence number of the last correct data strip is used as the comparison sequence number, and the sender is requested to send the data strip of the N+h-1 join sequence number and judge the received data.
  • step S303 is added after the step S202 of the embodiment described in FIG. Step S205 is followed by adding steps S307, S308, S309 and S310.
  • FIG. 4 is a schematic structural diagram of an embodiment of a Bluetooth-based data transmission apparatus according to the present invention.
  • the apparatus 400 includes:
  • a dividing unit 401 configured to divide a data segment that needs to be transmitted into multiple data strips
  • the combining unit 402 is configured to respectively add a sequence number to the plurality of data strips to obtain a plurality of data strips of the join sequence number, where the number N is added to the Nth data strip, and the sequence number M is used to indicate that the Nth data strip is Sorting among adjacent k data strips including the Nth data strip;
  • the first sending unit 403 is configured to send, by using a plurality of data strips of the added sequence number to the receiver;
  • the receiving unit 404 is configured to receive a plurality of data strips of the added sequence number
  • the first determining unit 405 is configured to determine whether the sequence in which the receiver receives the data strips of the multiple join sequence numbers is consistent with the sequence numbers in the data strips of the multiple join sequence numbers;
  • the requesting unit 406 is configured to: when the receiving party receives the sequence of the data strips of the multiple joining serial numbers and the sequence numbers of the data strips of the multiple joining serial numbers, the requesting sender resends the data segment that is in error.
  • the dividing unit 401, the combining unit 402, and the first transmitting unit 403 are located at the transmitting side; the receiving unit 404, the first determining unit 405, and the requesting unit 406 are located at the receiving side.
  • FIG. 5 is a schematic structural diagram of another embodiment of a Bluetooth-based data transmission apparatus according to the present invention.
  • the apparatus 500 includes:
  • a dividing unit 401 configured to divide a data segment that needs to be transmitted into multiple data strips
  • the combining unit 402 is configured to separately add a sequence number to the plurality of data strips to obtain a plurality of data strips of the added sequence number.
  • the first sending unit 403 is configured to send, by using a plurality of data strips of the added sequence number to the receiver;
  • the receiving unit 404 is configured to receive multiple data strips of the added sequence number
  • the first determining unit 405 is configured to determine whether the order in which the receiver receives the data strips of the multiple join sequence numbers is consistent with the sequence numbers in the data strips of the multiple join sequence numbers;
  • the requesting unit 406 is configured to: when the receiving party receives the sequence of the data strips of the plurality of joining serial numbers and the sequence numbers of the data strips of the plurality of joining serial numbers, the requesting party resends the data segment that is in error.
  • the first sending unit 403 is further configured to sequentially send h data columns of the join sequence number from the Nth data strip, where h is not greater than k;
  • the receiving unit 404 is further configured to receive h data strips of the join sequence number from the Nth data strip;
  • the first determining unit 405 is further configured to determine, in the data strip of the h join sequence numbers from the Nth data strip, that the receiver receives the data strips of the h join sequence numbers from the Nth data strip. Whether the serial numbers are consistent; [0159]
  • the requesting unit 404 is further configured to: if the receiving party receives the data sequences of the h joining serial numbers from the Nth data strip, the sequence of the data strips of the h joining serial numbers from the Nth data strip is consistent , the receiver stores h data strips of the h join sequence data strips from the Nth data strip, and requests the sender to send h join sequence numbers from the N+thth join sequence number data strip.
  • the requesting unit 406 is further configured to: if the receiving party receives the data sequence of the h joining sequence numbers from the Nth data bar, the sequence of the data sequence of the h joining sequence numbers from the Nth data bar is inconsistent Then, the receiver requests the sender to resend the h-joined data strips from the Nth data strip.
  • the apparatus 500 further includes: a comparison sequence number unit 407, configured to use a sequence number of the last received data strip as a comparison sequence number;
  • the first determining unit 405 is further configured to determine, after the comparison sequence number, whether the receiver receives the sequence number of the data sequence of the join sequence number received for the first time in the data strip of the h join sequence numbers from the Nth data strip.
  • the first determining unit 405 is further configured to determine, after the comparison sequence number, whether the receiving party receives the first received sequence number of the data sequence of the h joining sequence numbers from the Nth data strip.
  • the serial number in the order of receiving, sequentially determines whether the serial number of the h numbered data strips from the Nth data strip is the serial number after the serial number of the previously received data strip of the added serial number;
  • the requesting unit 406 further includes storing the correct data strip in the h joined sequence data strips from the Nth data strip and using the sequence number of the last correct data strip as the comparison sequence number, and requesting the sender to resend Dijon + hl data strips added to the serial number;
  • the first sending unit 403 is further configured to send the data strip of the N+h-1th join sequence number
  • the receiving unit 404 is further configured to receive the data strip of the N+h-1th join sequence number
  • the first determining unit 405 is further configured to determine whether the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is a sequence number after the comparison sequence number;
  • the requesting unit 406 is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is not the sequence number after the sequence number, the receiver requests the sender to send the N+h-2 Add a serial number strip
  • the comparison sequence number unit 407 is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is the sequence number after the comparison sequence number, the receiver will input the N+h-1 data. The sequence number is used as the comparison sequence number; [0170] the request unit 406 is further configured to: if the number of the N+h-1 join sequence data strips received by the receiver is After comparing the serial numbers after the serial number, the receiver stores the ⁇ +hl data strips, and requests the sender to send the h data strips of the join sequence number from the data strip of the N+thth join sequence number.
  • the apparatus 500 further includes:
  • the second sending unit 408 is configured to send a receiving success instruction to the sender.
  • the second determining unit 409 is configured to determine whether the receiving success instruction is not received within the first inter-threshold threshold, and if not, the sending end resends the h joining serial numbers from the Nth data strip. a data strip; [0174] the second determining unit is further configured to determine whether a receiving success instruction is received within the second inter-threshold threshold;
  • the storage unit 410 is configured to: if the sender does not receive the reception success instruction within the second inter-threshold threshold, store the data information of the Nth join sequence data strip, where the data information includes the current N value and the Nth The serial number of the data strip;
  • the second determining unit 409 is further configured to determine whether the sender has stored data information, and if yes, send h data sequences of the added sequence number from the data strip of the N+h joining sequence number according to the stored information.
  • the dividing unit 401, the combining unit 402, the first transmitting unit 403, the second determining unit 409, and the storage unit 410 are located at the transmitting side; the receiving unit 404, the first determining unit 405, the request unit 406, and the ratio The sequence number unit 407 and the second transmission unit 408 are located at the receiving side.
  • Computer readable media includes both computer storage media and communication media, including communication media including any medium that facilitates transfer of a computer program from one location to another.
  • the storage medium can be any of the available media that the computer can access.
  • the computer readable medium may include random access memory (Random Access).
  • ROM Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • CD-ROM Compact Disc Read-Only Memory
  • Any of the connectables may suitably be a computer readable medium.
  • a disk and a disc include a compact disc (CD), a laser disc, a disc, a digital versatile disc (DVD), a floppy disc, and a Blu-ray disc, wherein the disc is usually magnetically copied, and the disc is The laser is used to optically replicate the data. Combinations of the above should also be included within the scope of the computer readable media.

Landscapes

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

Abstract

Provided are a Bluetooth-based data transmission method and device, said method comprising: a sender dividing into a plurality of data a data segment needing to be transmitted; said sender adding sequence numbers to the plurality of data to obtain a plurality of data to which sequence numbers have been added, a sequence number M being added to the data N, the sequence number M being used for representing the order of the Nth data in an adjacent number k of data comprising said Nth data; the sender sending to a recipient the plurality of data to which sequence numbers have been added; the recipient receiving said plurality of data to which sequence numbers have been added, and determining whether the order in which said recipient receives said plurality of data to which sequence numbers have been added is consistent with the order of the sequence numbers in the plurality of data to which sequence numbers have been added; if not, then the recipient requesting the sender to resend the data in which the error has occurred. Using the described method, it is possible to achieve accuracy in the order of data transmitted using Bluetooth.

Description

说明书 发明名称:一种基于蓝牙的数据传输方法以及装置  Description: A Bluetooth-based data transmission method and device
[0001] 技术领域  [0001] Technical Field
[0002] 本发明涉及终端领域, 特别涉及一种基于蓝牙的数据传输方法以及装置。  [0002] The present invention relates to the field of terminals, and in particular, to a Bluetooth-based data transmission method and apparatus.
[0003] 背景技术 BACKGROUND
[0004] 智能手环的固件在出厂吋已经由生产者固定在智能手环中。 出厂后, 由于 bug 修复, 固件升级等原因, 需要用户对智能手机中的固件进行升级。 当用户需要 对智能手环中的固件进行升级吋, 用户可以通过智能终端中的蓝牙模块将更新 的固件传输给智能手环, 以使得智能手环中的固件进行升级。 伹是, 现有技术 中, 智能终端通过蓝牙模块向智能手环发送完所有的数据, 智能手环就保存一 次数据, 即使智能终端向智能手环发送的数据的顺序出现了错误, 智能手环也 照样保存数据, 这就使得后面智能手环根据接收到的更新后的固件进行升级吋 , 因为智能手环中保存的数据不正确而升级失败。  [0004] The firmware of the smart bracelet has been fixed in the smart bracelet by the manufacturer after leaving the factory. After shipment, users need to upgrade the firmware in the smartphone due to bug fixes, firmware upgrades, etc. When the user needs to upgrade the firmware in the smart bracelet, the user can transmit the updated firmware to the smart bracelet through the Bluetooth module in the smart terminal to upgrade the firmware in the smart bracelet. In the prior art, the smart terminal sends all the data to the smart bracelet through the Bluetooth module, and the smart bracelet saves the data once, even if the order of the data sent by the smart terminal to the smart bracelet is wrong, the smart bracelet The data is also saved as it is, which causes the following smart bracelet to be upgraded according to the updated firmware received, because the data saved in the smart bracelet is incorrect and the upgrade fails.
[0005] 发明内容  SUMMARY OF THE INVENTION
[0006] 本发明实施例所要解决的技术问题在于, 提供一种基于蓝牙的数据传输方法以 及装置、 ***, 能够保证数据传输的顺序的准确。  The technical problem to be solved by the embodiments of the present invention is to provide a Bluetooth-based data transmission method, device, and system, which can ensure the accuracy of the data transmission sequence.
[0007] 本发明提供了一种基于蓝牙的数据传输方法, 包括: The present invention provides a Bluetooth-based data transmission method, including:
[0008] 发送方将需要进行传输的数据段划分成多个数据条; [0008] The sender divides the data segment that needs to be transmitted into multiple data strips;
[0009] 所述发送方为所述多个数据条分别加入序号以获得多个加入序号的数据条, 其 中, 第 N个数据条中加入序号 M, 序号 M用于表示所述第 N个数据条在包括所述 第 N个数据条在内的相邻的 k个数据条中的排序;  [0009] The sender adds a sequence number to the plurality of data strips to obtain a plurality of data strips of the join sequence number, wherein the Nth data strip is added with a sequence number M, and the sequence number M is used to represent the Nth data. Sorting of strips in adjacent k strips including the Nth strip;
[0010] 所述发送方将所述多个加入序号的数据条向接收方发送;  [0010] the sender sends the data strips of the multiple join sequence numbers to the receiver;
[0011] 所述接收方接收所述多个加入序号的数据条, 并判断所述接收方接收所述多个 加入序号的数据条的顺序与所述多个加入序号的数据条中的序号是否一致; [0011] the receiving party receives the data strips of the multiple join sequence numbers, and determines whether the sequence in which the receiver receives the data strips of the multiple join sequence numbers and the sequence numbers in the data strips of the multiple join sequence numbers Consistent
[0012] 如果否, 则所述接收方请求所述发送方将出错的数据段重新发送。 [0012] If no, the recipient requests the sender to resend the erroneous data segment.
[0013] 可选地, 所述发送方将所述多个加入序号的数据条向接收方发送的方式包括: 所述发送方依次发送从第 N个数据条起的 h个加入序号的数据条, 所述 h不大于 k [0014] 所述接收方接收所述多个加入序号的数据条, 并判断所述接收方接收所述多个 加入序号的数据条的顺序与所述多个加入序号的数据条中的序号是否一致具体 为: 所述接收方接收所述从第 N个数据条起的 h个加入序号的数据条, 并判断所 述接收方接收所述从第 N个数据条起的 h个加入序号的数据条的顺序与所述从第 N个数据条起的 h个加入序号的数据条中的序号是否一致; [0013] Optionally, the manner in which the sender sends the data strips of the multiple join sequence numbers to the receiver includes: the sender sends the data strips of the h join sequence numbers from the Nth data strip in sequence. , the h is not greater than k [0014] the receiving party receives the data strips of the plurality of joining serial numbers, and determines whether the receiving party receives the sequence of the plurality of joining serial number data strips and the serial number in the plurality of joining serial number data strips Consistently, the receiving party receives the data strips of the h joining sequence numbers from the Nth data strip, and determines that the receiving party receives the data of the h joining serial numbers from the Nth data strip. Whether the order of the strips is consistent with the serial number in the data strips of the h joined serial numbers from the Nth data strip;
[0015] 如果是, 则所述接收方储存所述从第 N个数据条起的 h个加入序号的数据条中 的 h个数据条, 并请求所述发送方发送从第 N+h个加入序号的数据条起的 h个加 入序号的数据条;  [0015] If yes, the receiver stores the h data strips in the h join sequence data strips from the Nth data strip, and requests the sender to send from the N+th joins. H data strips with sequence numbers from the data strip of the serial number;
[0016] 如果否, 则所述接收方请求所述发送方重新发送所述从第 N个数据条起的 h个 加入序号的数据条。  [0016] If not, the recipient requests the sender to resend the h data strips of the join sequence number from the Nth data strip.
[0017] 可选地, 所述接收方储存所述从第 N个数据条起的 h个加入序号的数据条中的 h 个数据条之后还包括:  [0017] Optionally, after the receiving, by the receiving party, the h data strips in the h-added data strips from the Nth data strip, the method further includes:
[0018] 所述接收方将最后一个接收的数据条的序号作为比对序号;  [0018] the receiving party uses the serial number of the last received data strip as a comparison serial number;
[0019] 所述判断所述接收方接收所述从第 N个数据条起的 h个加入序号的数据条的顺 序与所述从第 N个数据条起的 h个加入序号的数据条中的序号是否一致还包括: [0019] the determining, in the order in which the receiving party receives the data strips of the h joining serial numbers from the Nth data strip, and the data strips of the h joining serial numbers from the Nth data strip Whether the serial number is consistent or not includes:
[0020] 判断所述比对序号的之后是否为所述接收方接收所述从第 N个数据条起的 h个 加入序号的数据条中首次接收的加入序号的数据条的序号。 And determining, after the comparison sequence number, a sequence number of the data strip of the join sequence number received for the first time in the data strip of the h join sequence numbers received by the receiver from the Nth data strip.
[0021] 可选地, 所述判断所述接收方接收所述从第 N个数据条起的 h个加入序号的数 据条的顺序与所述 h个加入序号的数据条中的序号是否一致还包括: 判断所述比 对序号的之后是否为所述接收方接收所述从第 N个数据条起的 h个加入序号的数 据条中首次接收的加入序号的数据条的序号, 按照接收顺序依次判断所述从第 N 个数据条起的 h个加入序号的数据条的序号是否为前一个接收的加入序号的数据 条的序号之后的序号;  [0021] Optionally, the determining, by the receiving party, whether the sequence of the h join sequence data strips from the Nth data strip is consistent with the sequence number of the h join sequence numbers The method includes: determining whether, after the comparison sequence number, the sequence number of the data column of the join sequence number received for the first time in the data strip of the h join sequence numbers received by the receiving party from the Nth data strip, in order of receiving Determining whether the serial number of the h numbered data strips from the Nth data strip is the sequence number after the serial number of the data strip of the previous received join sequence number;
[0022] 所述接收方请求所述发送方重新发送所述从第 N个数据条起的 h个加入序号的 数据条还包括:  [0022] the receiving party requesting the sender to resend the data strips of the h joining sequence numbers from the Nth data strip further includes:
[0023] 所述接收方储存所述从第 N个数据条起的 h个加入序号的数据条中正确的数据 条并将最后一个正确的数据条的序号作为所述比对序号, 并请求所述发送方重 新发送第 N+h-1个加入序号的数据条; [0023] the receiver stores the correct data strip in the h join sequence data strips from the Nth data strip and uses the sequence number of the last correct data strip as the comparison sequence number, and requests the Sender Newly send the N+h-1 data strips with the serial number;
[0024] 所述发送方发送所述第 N+h-1个加入序号的数据条; [0024] the sender sends the data strip of the N+h-1th join sequence number;
[0025] 所述接收方接收所述第 N+h-1个加入序号的数据条, 并判断所述接收方接收的 所述第 N+h-1个加入序号的数据条的序号是否为所述比对序号之后的序号, 如果 否, 则所述接收方请求所述发送方发送第 N+h-2个加入序号的数据条。 如果是, 则所述接收方储存所述第 N+h-1个数据条以及将所述第 N+h-1个数据条序号作为 所述比对序号, 并请求所述发送方发送所述从第 N+h个加入序号的数据条起的 h 个加入序号的数据条。  [0025] the receiving party receives the data strip of the N+h-1 joining sequence number, and determines whether the sequence number of the data strip of the N+h-1 joining sequence number received by the receiving party is The sequence number after the sequence number is compared, and if not, the receiver requests the sender to send the data strip of the N+h-2th join sequence number. If yes, the receiving party stores the N+h-1 data strips and the N+h-1 data strip numbers as the comparison sequence number, and requests the sender to send the h data strips with sequence numbers from the N+thth join data strip.
[0026] 可选地, 所述接收方接收所述从第 N个数据条起的 h个加入序号的数据条之后 还包括:  [0026] Optionally, after receiving, by the receiving party, the data strips of the h joining sequence numbers from the Nth data strip, the method further includes:
[0027] 所述接收方向所述发送方发送接收成功指令;  [0027] the receiving direction sends a receiving success instruction to the sender;
[0028] 所述发送方判断在第一吋间阈值内是否收到所述接收成功指令, 如果否, 则所 述发送方重新发送所述从第 N个数据条起的 h个加入序号的数据条;  [0028] the sender determines whether the reception success instruction is received within the first inter-threshold threshold, and if not, the sender re-transmits the h join sequence data from the Nth data strip. Article
[0029] 所述发送方判断在第二吋间阈值内是否收到所述接收成功指令, 如果否, 则储 存所述第 N个加入序号的数据条的数据信息, 所述数据信息包括当前 N值以及第 N个数据条的序号;  [0029] the sender determines whether the reception success instruction is received within the second inter-threshold threshold, and if not, stores the data information of the Nth join sequence data strip, where the data information includes the current N The value and the sequence number of the Nth data strip;
[0030] 所述发送方分批发送所述加入序号的数据条, 每批依次发送 h个加入序号的数 据条之前还包括:  [0030] The sender sends the data strips of the join sequence number in batches, and each batch sends h data strips of the join sequence number in advance:
[0031] 所述发送方判断所述发送方是否有储存的所述数据信息, 如果是, 则根据所述 储存信息发送以第 N+h为首的 h个加入序号的数据条。  And [0031] the sender determines whether the sender has the stored data information, and if yes, sends h datagrams of the join sequence number headed by the N+h according to the stored information.
[0032] 一种基于蓝牙的数据传输装置, 包括: [0032] A Bluetooth-based data transmission device, comprising:
[0033] 划分单元, 用于将需要进行传输的数据段划分成多个数据条;  [0033] a dividing unit, configured to divide a data segment that needs to be transmitted into multiple data strips;
[0034] 组合单元, 用于为所述多个数据条分别加入序号以获得多个加入序号的数据条  [0034] a combination unit, configured to respectively add a sequence number to the plurality of data strips to obtain a plurality of data strips of the join sequence number
, 其中, 第 N个数据条中加入序号 M, 序号 M用于表示所述第 N个数据条在包括 所述第 N个数据条在内的相邻的 k个数据条中的排序;  The sequence number M is added to the Nth data strip, and the sequence number M is used to indicate the order of the Nth data strip in the adjacent k data strips including the Nth data strip;
[0035] 第一发送单元, 用于将所述多个加入序号的数据条向接收方发送; [0035] a first sending unit, configured to send the multiple data strips of the added sequence number to the receiver;
[0036] 接收单元, 用于接收所述多个加入序号的数据条; [0036] a receiving unit, configured to receive the data strips of the multiple join sequence numbers;
[0037] 第一判断单元, 用于判断所述接收方接收所述多个加入序号的数据条的顺序与 所述多个加入序号的数据条中的序号是否一致; [0037] a first determining unit, configured to determine a sequence in which the receiving party receives the data strips of the multiple join sequence numbers Whether the serial numbers in the plurality of data columns of the added serial number are consistent;
[0038] 请求单元, 用于当所述接收方接收所述多个加入序号的数据条的顺序与所述多 个加入序号的数据条中的序号不一致吋, 请求所述发送方将出错的数据段重新 发送。  [0038] a requesting unit, configured to request, when the receiving party receives the data strips of the plurality of joining serial numbers, that the sequence of the data strips in the plurality of joining serial numbers is inconsistent with the serial number in the data strips of the plurality of joining serial numbers The segment is resent.
[0039] 可选地, 所述第一发送单元还用于依次发送从第 N个数据条起的 h个加入序号 的数据条, 所述 h不大于 k;  [0039] Optionally, the first sending unit is further configured to sequentially send h data sequences of the join sequence number from the Nth data strip, where h is not greater than k;
[0040] 所述接收单元还用于接收所述从第 N个数据条起的 h个加入序号的数据条; [0041] 所述第一判断单元还用于判断所述接收方接收所述从第 N个数据条起的 h个加 入序号的数据条的顺序与所述从第 N个数据条起的 h个加入序号的数据条中的序 号是否一致; [0040] the receiving unit is further configured to receive the data strips of the h join sequence numbers from the Nth data strip; [0041] the first determining unit is further configured to determine that the receiver receives the slave data Whether the order of the h data columns of the join sequence number from the Nth data strip is consistent with the sequence number of the h data strips of the join sequence number from the Nth data strip;
[0042] 所述请求单元还用于如果所述接收方接收所述从第 N个数据条起的 h个加入序 号的数据条的顺序与所述从第 N个数据条起的 h个加入序号的数据条中的序号一 致, 则所述接收方储存所述从第 N个数据条起的 h个加入序号的数据条中的 h个 数据条, 并请求所述发送方发送从第 N+h个加入序号的数据条起的 h个加入序号 的数据条;  [0042] the requesting unit is further configured to: if the receiving party receives the sequence of the h numbered data strips from the Nth data strip, and the h joining sequence numbers from the Nth data strip The number of the data strips is the same, the receiver stores the h data strips of the h numbered data strips from the Nth data strip, and requests the sender to send from the N+h h data strips added with serial numbers from the data strips of the serial number;
[0043] 所述请求单元还用于如果所述接收方接收所述从第 N个数据条起的 h个加入序 号的数据条的顺序与所述从第 N个数据条起的 h个加入序号的数据条中的序号不 一致, 则所述接收方请求所述发送方重新发送所述从第 N个数据条起的 h个加入 序号的数据条。  [0043] the requesting unit is further configured to: if the receiving party receives the sequence of the h joining sequence data strips from the Nth data strip and the h joining sequence numbers from the Nth data strip The sequence numbers in the data strips are inconsistent, and the receiver requests the sender to resend the data strips of the h join sequence numbers from the Nth data strip.
[0044] 可选地, 所述装置还包括: 比对序号单元, 用于将最后一个接收的数据条的序 号作为比对序号;  [0044] Optionally, the device further includes: a comparison sequence number unit, configured to use a sequence number of the last received data strip as a comparison sequence number;
[0045] 所述第一判断单元还用于判断所述比对序号的之后是否为所述接收方接收所述 从第 N个数据条起的 h个加入序号的数据条中首次接收的加入序号的数据条的序 号。  [0045] the first determining unit is further configured to determine, after the comparison sequence number, whether the receiving party first receives the joining sequence number received by the h joining numbered data strips from the Nth data strip. The serial number of the data strip.
[0046] 可选地, 所述第一判断单元还用于判断所述比对序号的之后是否为所述接收方 接收所述从第 N个数据条起的 h个加入序号的数据条中首次接收的加入序号的数 据条的序号, 按照接收顺序依次判断所述从第 N个数据条起的 h个加入序号的数 据条的序号是否为前一个接收的加入序号的数据条的序号之后的序号; [0047] 所述请求单元还包括储存所述从第 N个数据条起的 h个加入序号的数据条中正 确的数据条并将最后一个正确的数据条的序号作为所述比对序号, 并请求所述 发送方重新发送第 N+h-1个加入序号的数据条; [0046] Optionally, the first determining unit is further configured to determine whether the comparison sequence number is the first time that the receiver receives the h join sequence data strips from the Nth data strip. The serial number of the data strip of the received serial number is sequentially determined according to the receiving order, and the serial number of the h data number of the joining serial number from the Nth data strip is the serial number after the serial number of the data strip of the previous received joining serial number ; [0047] the requesting unit further includes storing the correct data strip in the data strip of the h joining sequence numbers from the Nth data strip and using the sequence number of the last correct data strip as the comparison serial number, and Requesting the sender to resend the data strip of the N+h-1 joining sequence number;
[0048] 所述第一发送单元还用于发送所述第 N+h-1个加入序号的数据条; [0048] the first sending unit is further configured to send the data strip of the N+h-1th join sequence number;
[0049] 所述接收单元还用于接收所述第 N+h-1个加入序号的数据条; [0049] the receiving unit is further configured to receive the data strip of the N+h-1th join sequence number;
[0050] 所述第一判断单元还用于判断所述接收方接收的所述第 N+h-1个加入序号的数 据条的序号是否为所述比对序号之后的序号; [0050] the first determining unit is further configured to determine whether the sequence number of the data strip of the N+h-1 join sequence number received by the receiver is a sequence number after the comparison sequence number;
[0051] 所述请求单元还用于如果所述接收方接收的第 N+h-1个加入序号的数据条的序 号不是所述比对序号之后的序号, 则所述接收方请求所述发送方发送第 N+h-2个 加入序号的数据条; [0051] the requesting unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is not the sequence number after the comparison sequence number, the receiver requests the sending The party sends the N+h-2 data strips with the serial number;
[0052] 所述比对序号单元还用于如果所述接收方接收的第 N+h-1个加入序号的数据条 的序号为所述比对序号的之后的序号, 所述接收方将所述第 N+h-1个数据条序号 作为所述比对序号;  [0052] the comparison sequence number unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is the sequence number after the comparison sequence number, the receiver will The N+h-1 data strip number is used as the comparison sequence number;
[0053] 所述请求单元还用于如果所述接收方接收的第 N+h-1个加入序号的数据条的序 号为所述比对序号之后的序号, 则所述接收方储存所述第 N+h-1个数据条, 并请 求所述发送方发送所述从第 N+h个加入序号的数据条起的 h个加入序号的数据条  [0053] the requesting unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is a sequence number after the comparison sequence number, the receiver stores the N+h-1 data strips, and requesting the sender to send the h datagrams of the join sequence number from the data strip of the N+thth join sequence number
[0054] 可选地, 所述装置还包括: [0054] Optionally, the device further includes:
[0055] 第二发送单元, 用于向所述发送方发送接收成功指令;  [0055] a second sending unit, configured to send a receiving success instruction to the sender;
[0056] 第二判断单元, 用于判断在第一吋间阈值内是否收到所述未接收到所述接收成 功指令, 如果否, 则所述发送方重新发送所述从第 N个数据条起的 h个加入序号 的数据条;  [0056] a second determining unit, configured to determine whether the receiving success instruction is not received within the first inter-threshold threshold, and if not, the sending end resending the Nth data strip H data strips with serial numbers added;
[0057] 所述第二判断单元还用于判断在第二吋间阈值内是否收到所述接收成功指令; [0058] 储存单元, 用于如果所述发送方在第二吋间阈值内未收到所述接收成功指令, 则储存所述第 N个加入序号的数据条的数据信息, 所述数据信息包括当前 N值以 及第 N个数据条的序号;  [0057] the second determining unit is further configured to determine whether the receiving success instruction is received within the second inter-threshold threshold; [0058] a storage unit, configured to: if the sending party is not within the second inter-threshold threshold Receiving the receiving success instruction, storing data information of the Nth join sequence data strip, where the data information includes a current N value and a sequence number of the Nth data strip;
[0059] 所述第二判断单元还用于判断所述发送方是否有储存的所述数据信息, 如果是 [0059] the second determining unit is further configured to determine whether the sender has the stored data information, and if
, 则根据所述储存信息发送从第 N+h加入序号的数据条起的 h个加入序号的数据 条。 And sending, according to the stored information, h join sequence data from the data strip of the N+h join sequence number Article.
[0060] 上述发明, 发送方将需要进行传输的数据段划分成多个数据条, 并为多个数据 条分别加入序号以获得多个加入序号的数据条, 将所述多个加入序号的数据条 向接收方发送, 其中, 第 N个数据条中加入序号 M, 序号 M用于表示第 N个数据 条在包括第 N个数据条在内的相邻的 k个数据条中的排序; 接收方接收该多个加 入序号的数据条, 并判断接收多个加入序号的数据条的顺序与多个加入序号的 数据条中的序号是否一致, 如果否, 则请求发送方将出错的数据段重新发送。 通过上述方法可以实现在使用蓝牙传输数据吋数据顺序的准确。  [0060] In the above invention, the sender divides the data segment that needs to be transmitted into a plurality of data strips, and adds a sequence number to the plurality of data strips respectively to obtain a plurality of data strips with the added sequence number, and the plurality of data of the added sequence number The strip is sent to the receiver, wherein the number N is added to the Nth data strip, and the sequence number M is used to indicate the order of the Nth data strip in the adjacent k data strips including the Nth data strip; The party receives the data strips of the plurality of join sequence numbers, and determines whether the sequence of receiving the data strips of the plurality of join sequence numbers is consistent with the sequence numbers of the plurality of data strips of the join sequence number. If not, the request sender sends the data segment of the error again. send. Through the above method, the accuracy of the data sequence in the data transmission using Bluetooth can be realized.
[0061] 附图说明  BRIEF DESCRIPTION OF THE DRAWINGS
[0062] 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施例中 所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发 明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提 下, 还可以根据这些附图获得其他的附图。  [0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings to be used in the embodiments will be briefly described below. Obviously, the drawings in the following description are only the present drawings. Some embodiments of the invention may be obtained by those of ordinary skill in the art from the drawings without departing from the scope of the invention.
[0063] 图 1是本发明一种基于蓝牙的数据传输方法实施方式一的流程图; 1 is a flowchart of Embodiment 1 of a Bluetooth-based data transmission method according to the present invention;
[0064] 图 2是本发明一种基于蓝牙的数据传输方法实施方式二的流程图; 2 is a flowchart of Embodiment 2 of a Bluetooth-based data transmission method according to the present invention;
[0065] 图 3是本发明一种基于蓝牙的数据传输方法实施方式三的流程图; 3 is a flowchart of Embodiment 3 of a Bluetooth-based data transmission method according to the present invention;
[0066] 图 4是本发明一种基于蓝牙的数据传输装置一种实施方式的结构示意图; 4 is a schematic structural diagram of an embodiment of a Bluetooth-based data transmission device according to the present invention;
[0067] 图 5是本发明一种基于蓝牙的数据传输装置另一种实施方式的结构示意图。 5 is a schematic structural diagram of another embodiment of a Bluetooth-based data transmission apparatus according to the present invention.
[0068] 具体实施方式 DETAILED DESCRIPTION
[0069] 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部 的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳 动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. example. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
[0070] 请参阅图 1 , 图 1是本发明一种基于蓝牙的数据传输方法实施方式一的流程图。  Please refer to FIG. 1. FIG. 1 is a flowchart of Embodiment 1 of a Bluetooth-based data transmission method according to the present invention.
该方法可以应用于具有蓝牙模块的智能终端, 该方法包括:  The method can be applied to a smart terminal having a Bluetooth module, the method comprising:
[0071] 步骤 S101: 发送方将需要进行传输的数据段划分成多个数据条。  [0071] Step S101: The sender divides the data segment that needs to be transmitted into multiple data strips.
[0072] 具体地, 发送方通过蓝牙向接收方传输数据吋, 一般地, 接收方接收该传输数 据先放在缓存中, 当缓存内存达到一定量后再写入内存器中并储存该传输数据 。 由于缓冲内存容量和蓝牙传输的限制, 当传输数据较大吋需要将该传输数据 分批发送, 发送方将需要进行传输的数据段划分成多个数据条。 [0072] Specifically, the sender transmits data to the receiver through the Bluetooth. Generally, the receiver receives the transmission data and first puts it in the cache. When the cache memory reaches a certain amount, the data is written into the memory and the transmission data is stored. . Due to the limitation of buffer memory capacity and Bluetooth transmission, when the transmission data is large, the transmission data needs to be sent in batches, and the sender divides the data segment that needs to be transmitted into multiple data strips.
[0073] 步骤 S102: 发送方为多个数据条分别加入序号以获得多个加入序号的数据条  [0073] Step S102: The sender adds a sequence number to each of the plurality of data strips to obtain a plurality of data strips of the added sequence number.
[0074] 发送方向接收方依次发送数据条, 对于接收方来说, 接收方不能识别所接受的 数据条的顺序是否正确, 此吋在第 N个数据条中加入序号 M , 序号 M用于表示所 述第 N个数据条在包括所述第 N个数据条在内的相邻的 k个数据条中的排序, 例 如, 可以在每一个数据条后增加帧标志位, 该帧标志位可以储存序号, 比如, 第 1至第 10个数据条, 序号分别为 10、 20、 30、 40、 50、 10、 20、 30、 40、 50, 第二个数据条的序号 20序号则表示该数据条在相邻的 5个数据条中的排序, 需要 说明的是, 序号可以为特定顺序的数字、 符号或字母, 或其组合, 本分明不作 限制。 [0074] The sending direction sends the data strips in sequence. For the receiving party, the receiving party cannot identify whether the order of the accepted data strips is correct. Then, the sequence number M is added to the Nth data strip, and the serial number M is used to indicate Sorting the Nth data strips in adjacent k data strips including the Nth data strip. For example, a frame flag bit may be added after each data strip, and the frame flag bit may be stored. The serial number, for example, the first to tenth data strips, the serial numbers are 10, 20, 30, 40, 50, 10, 20, 30, 40, 50, and the serial number of the second data strip 20 indicates the data strip. In the order of the adjacent five data strips, it should be noted that the serial number may be a specific order of numbers, symbols or letters, or a combination thereof, and the present invention is not limited.
[0075] 步骤 S103: 发送方将多个加入序号的数据条向接收方发送。  [0075] Step S103: The sender sends the data strips of the multiple join sequence numbers to the receiver.
[0076] 具体地, 发送方将多个加入序号的数据条向接收方发送, 其中发送方可以将加 入序号的数据条一个一个的发送, 接收方一个一个的接收和判断所接收的加入 序号的数据条的顺序是否正确; 发送方也可以连续发送 h个加入序号的数据条, 接收方接收该 h加入序号的数据条后再判断接收的该 h个加入序号的数据条的顺 序是否正确。 [0076] Specifically, the sender sends multiple data strips of the added sequence number to the receiver, where the sender can send the data strips of the join sequence number one by one, and the receivers receive and determine the received join sequence number one by one. The order of the data strips is correct; the sender may also continuously send h data strips with the serial number added, and the receiving party receives the data strip of the h join sequence number, and then determines whether the order of the received data strips of the added number is correct.
[0077] 步骤 S104: 接收方接收所述多个加入序号的数据条。  [0077] Step S104: The receiver receives the data strips of the multiple join sequence numbers.
[0078] 步骤 S105: 判断接收方接收多个加入序号的数据条的顺序与多个加入序号的数 据条中的序号是否一致。  [0078] Step S105: It is determined whether the order in which the receiver receives the data strips of the plurality of join sequences is consistent with the sequence numbers in the data strips of the plurality of join sequence numbers.
[0079] 具体地, 接收方判断接收方接收多个加入序号的数据条的顺序与多个加入序号 的数据条中的序号是否一致。 例如, 假设第 1-10个数据条加入的序号分别为 a、 b、 c、 d、 e、 f、 g、 h、 ί、 j , 接收方接收该 10个加入序号的数据条的顺序为同 样为 a、 b、 c、 d、 e、 f、 g、 h、 ί、 j , 则接收方接收多个加入序号的数据条的顺 序与多个加入序号的数据条中的序号一致, 否则上述判断结果为"否"。  [0079] Specifically, the receiving party determines whether the order in which the receiving party receives the data strips of the plurality of joining serial numbers is consistent with the sequence numbers in the data strips of the plurality of joining serial numbers. For example, suppose the numbers of the 1-10th data strips are a, b, c, d, e, f, g, h, ί, j, respectively. The order in which the receiver receives the data strips of the 10 join sequences is the same. For a, b, c, d, e, f, g, h, ί, j, the order in which the receiver receives the data strips of the multiple join sequence numbers is consistent with the sequence numbers in the data strips of the multiple join sequence numbers, otherwise the above judgment The result is "No".
[0080] 步骤 S106: 接收方请求发送方将出错的数据段重新发送。  [0080] Step S106: The receiver requests the sender to resend the erroneous data segment.
[0081] 具体地, 当发送方是分批发送的加入序号的数据条, 接收方是分配判断接收方 接收该接批加入序号的顺序是否正确, 如果接收方判断接收方接收该接批加入 序号的顺序不正确, 则接收方请求发送方将该批数据条重新发送, 或者接收方 储存该批数据条中正确的数据条, 并请求发送方发送该正确的数据条之后的加 入序号的数据条。 [0081] Specifically, when the sender is a data strip of a join sequence number sent in batches, the receiver is an allocation judgment receiver. The order of receiving the batch number is correct. If the receiver determines that the order of the receiver receiving the batch number is incorrect, the receiver requests the sender to resend the batch data strip, or the receiver stores the batch data strip. In the correct data strip, and request the sender to send the data strip after the correct data strip.
[0082] 上述发明, 发送方将需要进行传输的数据段划分成多个数据条, 并为多个数据 条分别加入序号以获得多个加入序号的数据条, 将所述多个加入序号的数据条 向接收方发送, 其中, 第 N个数据条中加入序号 M, 序号 M用于表示第 N个数据 条在包括第 N个数据条在内的相邻的 k个数据条中的排序; 接收方接收该多个加 入序号的数据条, 并判断接收多个加入序号的数据条的顺序与多个加入序号的 数据条中的序号是否一致, 如果否, 则请求发送方将出错的数据段重新发送。 通过上述方法可以实现在使用蓝牙传输数据吋数据顺序的准确。  [0082] In the above invention, the sender divides the data segment that needs to be transmitted into a plurality of data strips, and adds a sequence number to the plurality of data strips to obtain a plurality of data strips with the added sequence number, and the plurality of data of the added sequence number The strip is sent to the receiver, wherein the number N is added to the Nth data strip, and the sequence number M is used to indicate the order of the Nth data strip in the adjacent k data strips including the Nth data strip; The party receives the data strips of the plurality of join sequence numbers, and determines whether the sequence of receiving the data strips of the plurality of join sequence numbers is consistent with the sequence numbers of the plurality of data strips of the join sequence number. If not, the request sender sends the data segment of the error again. send. Through the above method, the accuracy of the data sequence in the data transmission using Bluetooth can be realized.
[0083] 请参阅图 2, 图 2是本发明一种基于蓝牙的数据传输方法实施方式二的流程图。  Please refer to FIG. 2. FIG. 2 is a flowchart of Embodiment 2 of a Bluetooth-based data transmission method according to the present invention.
该方法可以应用于具有蓝牙模块的智能终端, 该方法包括:  The method can be applied to a smart terminal having a Bluetooth module, the method comprising:
[0084] 步骤 S201: 发送方将需要进行传输的数据段划分成多个数据条。  [0084] Step S201: The sender divides the data segment that needs to be transmitted into multiple data strips.
[0085] 具体地, 发送方通过蓝牙向接收方传输数据吋, 一般地, 接收方接收该传输数 据先放在缓存中, 当缓存内存达到一定量后再写入内存器中并储存该传输数据 。 由于缓冲内存容量和蓝牙传输的限制, 当传输数据较大吋需要将该传输数据 分批发送, 发送方将需要进行传输的数据段划分成多个数据条。  [0085] Specifically, the sender transmits data to the receiver through the Bluetooth. Generally, the receiver receives the transmission data and first puts it in the cache. When the cache memory reaches a certain amount, the data is written into the memory and the transmission data is stored. . Due to the limitation of buffer memory capacity and Bluetooth transmission, when the transmission data is large, the transmission data needs to be sent in batches, and the sender divides the data segment that needs to be transmitted into multiple data strips.
[0086] 步骤 S202: 发送方为多个数据条分别加入序号以获得多个加入序号的数据条  [0086] Step S202: The sender adds a sequence number to the plurality of data strips respectively to obtain a plurality of data strips of the added sequence number.
[0087] 发送方向接收方依次发送数据条, 对于接收方来说, 接收方不能识别所接受的 数据条的顺序是否正确, 此吋在第 N个数据条中加入序号 M , 序号 M用于表示所 述第 N个数据条在包括所述第 N个数据条在内的相邻的 k个数据条中的排序, 例 如, 可以在每一个数据条后增加帧标志位, 该帧标志位可以储存序号, 比如, 第 1至第 10个数据条, 序号分别为 10、 20、 30、 40、 50、 10、 20、 30、 40、 50, 第二个数据条的序号 20序号则表示该数据条在相邻的 5个数据条中的排序, 需要 说明的是, 序号可以为特定顺序的数字、 符号或字母, 或其组合, 本分明不作 限制。 [0088] 步骤 S203: 判断 N是否大于数据总条数。 [0087] The sending direction receives the data strips in sequence, and the receiving party cannot identify whether the order of the accepted data strips is correct for the receiving party, and then adds the serial number M to the Nth data strip, and the serial number M is used to indicate Sorting the Nth data strips in adjacent k data strips including the Nth data strip. For example, a frame flag bit may be added after each data strip, and the frame flag bit may be stored. The serial number, for example, the first to tenth data strips, the serial numbers are 10, 20, 30, 40, 50, 10, 20, 30, 40, 50, and the serial number of the second data strip 20 indicates the data strip. In the order of the adjacent five data strips, it should be noted that the serial number may be a specific order of numbers, symbols or letters, or a combination thereof, and the present invention is not limited. [0088] Step S203: Determine whether N is greater than the total number of data.
[0089] 具体地, 当 N大于数据总条数, 说明发送方已经将所需要传输的数据传输完成  [0089] Specifically, when N is greater than the total number of data, the sender has completed the transmission of the data to be transmitted.
, 则此吋传输数据结束。  , then the data transfer ends.
[0090] 步骤 S204: 发送方依次发送从第 N个数据条起的 h个加入序号的数据条。 [0090] Step S204: The sender sequentially sends h data strips of the join sequence number from the Nth data strip.
[0091] 具体地, 发送方从 N=l幵始, 将从第 1个数据起的 h个加入序号的数据条发送给 接收方。 h不大于 k , 保证所发送的 h个数据条的序号各不相同, 例如 h=4, 则发 送方依次向接收方发送第 1个数据条、 第 2个数据条、 第 3个数据条、 第 4个数据 条。 [0091] Specifically, the sender starts from N=l, and sends h data strips of the join sequence number from the first data to the receiver. h is not greater than k, and the sequence numbers of the transmitted h data strips are guaranteed to be different. For example, h=4, the sender sequentially sends the first data strip, the second data strip, the third data strip, and the third data strip to the receiver. The fourth data bar.
[0092] 需要说明的是, 当 N不大于数据总条数且 N+h大于数据总条数吋, 说明此吋, 发送方还未发送的数据条少于 h个, 则发送剩余未发送的数据条。  [0092] It should be noted that, when N is not greater than the total number of data and N+h is greater than the total number of data, indicating that the sender has not sent more than h data strips, then the remaining unsent is sent. Data strip.
[0093] 步骤 S205: 接收方接收从第 N个数据条起的 h个加入序号的数据条。 [0093] Step S205: The receiver receives the data strips of the h join sequence numbers from the Nth data strip.
[0094] 具体地接收方接收发送方通过蓝牙发送的从第 N个数据条起的 h个加入序号的 数据条, 放入缓存中。 例如接收方接收发送方通过蓝牙发送的第 1个数据条、 第[0094] Specifically, the receiving party receives the data strips of the h joining sequence numbers from the Nth data strip sent by the sender through the Bluetooth, and puts them into the cache. For example, the receiver receives the first data strip sent by the sender via Bluetooth,
2个数据条、 第 3个数据条、 第 4个数据条。 2 data strips, 3rd data strip, 4th data strip.
[0095] 步骤 S206: 判断接收方接收的从第 N个数据条起的 h个加入序号的数据条的顺 序是否正确。 [0095] Step S206: It is judged whether the order of the data strips of the h join sequence numbers received from the Nth data strip received by the receiver is correct.
[0096] 具体地, 接收方判断比对序号的之后是否为接收方接收从第 N个数据条起的 h 个加入序号的数据条中首次接收的加入序号的数据条的序号, 并且判断判断接 收的从第 N个数据条起的 h个加入序号的数据条的顺序与该 h个加入序号的数据条 中的序号是否一致, 当两个判断结果都为 "是"吋, 步骤 S206的判断结果才为"是  [0096] Specifically, the receiving party determines whether the sequence number of the comparison sequence is the number of the data strip of the join sequence number first received by the receiver in the data strip of the h join sequence number from the Nth data strip, and determines the judgment and reception. Whether the order of the h-added data strips from the Nth data strip is consistent with the sequence number of the h-joined data strips, and when both judgment results are "Yes", the judgment result of step S206 Only "is
[0097] 需要说明的是, 当 N=l吋, 即发送方首次发送数据, 此吋接收方没有对比序号 [0097] It should be noted that when N=l吋, that is, the sender sends data for the first time, the receiver does not have a comparison sequence number.
, 此吋, 只判断接收的从第 N个数据条起的 h个加入序号的数据条的顺序与该 h 个加入序号的数据条中的序号是否一致。 例如, 接收方接收的数据条的顺序为 1 Then, it is judged whether the order of the received data strips of the h-joined number from the Nth data strip is consistent with the sequence number of the h-joined data strips. For example, the order of the data strips received by the receiver is 1
0、 20、 30、 40与加入数据条的序号 10、 20、 30、 40、 50、 10、 20 是一致的0, 20, 30, 40 are consistent with the serial numbers 10, 20, 30, 40, 50, 10, 20 of the added data strip.
, 则上述判断结果为"是", 如果接收方接收的数据条的顺序为 10、 30、 20、 40 , 则上述判断结果为"否"。 当上述判断结果为是吋, 储存该 4个数据条, 并将最 后一个即第 4个数据条的序号 40作为对比序号。 [0098] 当 N〉 1吋, 接收方还需要判断比对序号的之后是否为接收方接收从第 N个数据 条起的 h个加入序号的数据条中首次接收的加入序号的数据条的序号。 例如当 N= 5吋, 第 5-9个数据条的序号分别为 50、 10、 20、 30, 如果接收方接收的数据条的 顺序为 50、 10、 20、 30, 则对比序号 40之后为 50, 并且接收方接收的数据条的 顺序 50、 10、 20、 30与加入数据条的序号的顺序一致, 则上述判断结果为"是" , 否则, 上述判断结果为"否"。 Then, the above judgment result is "Yes", and if the order of the data strips received by the receiver is 10, 30, 20, 40, the above judgment result is "No". When the above judgment result is 吋, the four data strips are stored, and the last one, that is, the serial number 40 of the fourth data strip is used as the comparison serial number. [0098] When N>1吋, the receiver further needs to determine whether the sequence number of the join sequence number of the first received sequence number in the data strip of the h join sequence number received from the Nth data strip is received by the receiver. . For example, when N=5吋, the numbers of the 5-9th data strips are 50, 10, 20, 30 respectively. If the order of the data strips received by the receiver is 50, 10, 20, 30, then the comparison number 40 is followed by 50, and the order of the data strips received by the receiver 50, 10, 20, 30 is the same as the order of the sequence numbers of the added data strips, the above judgment result is "Yes", otherwise, the above judgment result is "No".
[0099] 步骤 S207: 接收方储存该 h个加入序号的数据条中的 h个数据条并将第 N+h-1个 数据条的序号作为比对序号。  [0099] Step S207: The receiver stores the h data strips in the data strips of the h join sequence numbers and uses the sequence numbers of the N+h-1 data strips as the comparison sequence numbers.
[0100] 当步骤 S206的判断结果才为"是"吋, 则接收方接收的顺序正确, 接收方储存该 h个加入序号的数据条中的 h个数据条, 并将第 N+h-1个数据条的序号, 即最后一 个接收的加入序号的数据条的序号, 作为比对序号, 并且令 N=N+h。  [0100] When the result of the determination in step S206 is "YES", the order received by the receiver is correct, and the receiver stores the h data strips in the data strips of the h join sequence numbers, and the N+h-1 The serial number of the data strip, that is, the serial number of the last received data strip of the added serial number, as the comparison serial number, and let N=N+h.
[0101] 步骤 S208: 接收方请求发送方发送从第 N个数据条起 h个加入序号的数据条。  [0101] Step S208: The receiver requests the sender to send the data strips of the join sequence number from the Nth data strip.
[0102] 具体地, 步骤 S206的判断结果才为"是", 则接收方接收的顺序正确, N=N+h  [0102] Specifically, the determination result of step S206 is “Yes”, and the order received by the receiver is correct, N=N+h
, 接收方请求发送方继续发送加入序号的数据条; 步骤 S206的判断结果才为"否 ", 则接收方接收的顺序出错, N不变, 接收方请求发送方重新发送从第 N个加 入序号的数据条。  The receiver requests the sender to continue to send the data strip of the join sequence number; if the judgment result of step S206 is "No", the order received by the receiver is wrong, N is unchanged, and the receiver requests the sender to resend the sequence number from the Nth join. Data strip.
[0103] 需要说明的是, 本发明的另一种实施例中: 步骤 S206也可以仅执行 "判断判断 接收的从第 N个数据条起的 h个加入序号的数据条的顺序与从第 N个数据条起的 h 个加入序号的数据条中的序号是否一致"一种判断, 步骤 S207也可以仅执行 "接 收方储存该 h个加入序号的数据条中的 h个数据条"。  [0103] It should be noted that, in another embodiment of the present invention: Step S206 may also only perform "determining the order of determining the received data strips of the h join sequence numbers from the Nth data strip and from the Nth Whether the serial numbers in the h-added data strips from the data strips are consistent "A judgment, step S207 may also only execute "the recipient stores the h data strips in the h-joined data strips".
[0104] 上述发明, 将数据分批发送分批判断接收方接收的从第 N个数据条起的 h个加 入序号的数据条的顺序是否正确, 如果是, 则储存该 h个加入序号的数据条, 请 求发送方发送下一批加入序号的数据条, 否则, 请求发送方重新发送该 h个加入 序号的数据条, 通过该数据传输方法可以保证数据传输的顺序的准确。  [0104] In the above invention, the data is sent in batches to determine whether the order of the h numbered data strips received from the Nth data strip received by the receiver is correct, and if so, the data of the h join sequence numbers is stored. The requesting sender sends the next batch of data strips with the serial number. Otherwise, the requesting sender resends the h data strips with the serial number, and the data transmission method can ensure the accuracy of the data transmission sequence.
[0105] 请参阅图 3, 图 3是本发明一种基于蓝牙的数据传输方法实施方式三的流程图。  Please refer to FIG. 3. FIG. 3 is a flowchart of Embodiment 3 of a Bluetooth-based data transmission method according to the present invention.
该方法可以应用于具有蓝牙模块的智能终端, 该方法包括:  The method can be applied to a smart terminal having a Bluetooth module, the method comprising:
[0106] 步骤 S301: 发送方将需要进行传输的数据段划分成多个数据条。  [0106] Step S301: The sender divides the data segment that needs to be transmitted into multiple data strips.
[0107] 具体地, 可参见图 2所描述的实施例中关于步骤 S201的描述。 [0108] 步骤 S302: 发送方为多个数据条分别加入序号以获得多个加入序号的数据条 [0107] Specifically, the description about step S201 in the embodiment described in FIG. 2 can be referred to. [0108] Step S302: The sender adds a sequence number to each of the plurality of data strips to obtain a plurality of data strips of the added sequence number.
[0109] 具体地, 可参见图 2所描述的实施例中关于步骤 S202的描述。 [0109] Specifically, the description about step S202 in the embodiment described in FIG. 2 can be referred to.
[0110] 步骤 S303: 判断发送方是否有储存的数据信息: N以及第 N条数据的序号。 [0110] Step S303: Determine whether the sender has stored data information: N and the sequence number of the Nth data.
[0111] 具体地, 当发送方具有储存的数据信息吋, 表明, 该数据传输之前传输过, 由 于某些原因而中断, 此吋接收方中已经储存了第 N个数据条之前的数据条, 伹是 并不能判断出从第 N个数据条起的 h个数据条是否储存成功, 假设从第 N个数据 条起的 h个数据条储存成功, 另 = +11 , 发送方向接收方发送从从第 N个数据条 起的 h个数据条。 [0111] Specifically, when the sender has the stored data information, indicating that the data transmission is transmitted before, and is interrupted for some reason, the data strip before the Nth data strip has been stored in the receiver.伹 It is not possible to determine whether the h data strips from the Nth data strip are stored successfully, assuming that the h data strips from the Nth data strip are successfully stored, and another = +11, the sending direction is sent from the receiving side. h data strips from the Nth data strip.
[0112] 步骤 S304判断 N是否大于总条数。 [0112] Step S304 determines whether N is greater than the total number of strips.
[0113] 具体地, 可参见图 2所描述的实施例中关于步骤 S203的描述。  [0113] Specifically, the description about step S203 in the embodiment described in FIG. 2 can be referred to.
[0114] 步骤 S305: 发送方依次发送从第 N个数据起的 h个加入序号的数据条。 [0114] Step S305: The sender sequentially sends h data strips of the join sequence number from the Nth data.
[0115] 具体地, 可参见图 2所描述的实施例中关于步骤 S204的描述。 [0115] Specifically, the description about step S204 in the embodiment described in FIG. 2 can be referred to.
[0116] 步骤 S306: 接收方接收从第 N个数据起的 h个加入序号的数据条。 [0116] Step S306: The receiver receives the data strips of the h joining sequence numbers from the Nth data.
[0117] 具体地, 可参见图 2所描述的实施例中关于步骤 S205的描述。 [0117] Specifically, the description about step S205 in the embodiment described in FIG. 2 can be referred to.
[0118] 步骤 S307: 接收方向发送方发送接收成功指令。 [0118] Step S307: The receiving direction sends a receiving success instruction to the sender.
[0119] 具体地, 当接收方接收数据成功, 即接收方将从第 N个数据起的 h个加入序号 的数据条写入缓存, 接收方向发送方发送接收成功指令, 说明蓝牙连接正常, 发送方可以继续向接受方传输数据。  [0119] Specifically, when the receiving party receives the data successfully, that is, the receiving party writes the h-added data strips from the Nth data into the buffer, and the receiving direction sends a receiving success instruction, indicating that the Bluetooth connection is normal, and the sending The party can continue to transfer data to the recipient.
[0120] 步骤 S308: 发送方判断在第一吋间阈值内是否收到接收成功指令。 [0120] Step S308: The sender determines whether a reception success instruction is received within the first inter-threshold threshold.
[0121] 具体地, 如果发送方在第一吋间阈值内收到接收成功指令, 说明蓝牙连接正常 ; 如果发送方在第一吋间阈值内未收到接收成功指令, 则说明蓝牙连接不稳定 , 请求发送方重新发送从第 N个数据起的 h个加入序号的数据条。 该第一吋间阈 值可以设置为 0.5s、 ls、 2s等, 本发明不作限制。 [0121] Specifically, if the sender receives the reception success instruction within the first inter-threshold threshold, the Bluetooth connection is normal; if the sender does not receive the reception success instruction within the first inter-threshold threshold, the Bluetooth connection is unstable. , requesting the sender to resend the h-added data strips from the Nth data. The first inter-turn threshold may be set to 0.5s, ls, 2s, etc., and the invention is not limited.
[0122] 步骤 S309: 发送方判断在第二吋间阈值内是否收到接收成功指令。 [0122] Step S309: The sender determines whether a reception success instruction is received within the second time threshold.
[0123] 具体地, 如果发送方在第二吋间阈值内收到接收成功指令, 说明蓝牙连接正常 ; 如果发送方在第二吋间阈值内未收到接收成功指令, 则说明蓝牙连接中断。 其中, 第二吋间阈值大于第一吋间阈值, 该第二吋间阈值可以设置为 2s、 3s、 5s 等, 本发明不作限制。 [0123] Specifically, if the sender receives the reception success instruction within the second inter-threshold threshold, the Bluetooth connection is normal; if the sender does not receive the reception success instruction within the second inter-threshold threshold, the Bluetooth connection is interrupted. The second inter-turn threshold is greater than the first inter-threshold threshold, and the second inter-threshold threshold may be set to 2s, 3s, 5s Etc., the invention is not limited.
[0124] 步骤 S310: 发送方储存第 N个加入序号的数据条的数据信息。  [0124] Step S310: The sender stores the data information of the Nth data column of the added sequence number.
[0125] 具体地, 如果发送方在第二吋间阈值内未收到接收成功指令, 则说明蓝牙连接 中断, 此吋发送方储存第 N个加入序号的数据条的数据信息, 该数据信息包括当 前 N值以及第 N个数据条的序号, 并暂停数据传输。  [0125] Specifically, if the sender does not receive the reception success instruction within the second inter-threshold threshold, the Bluetooth connection is interrupted, and the sender stores the data information of the Nth added sequence data strip, where the data information includes The current N value and the sequence number of the Nth data strip, and the data transmission is suspended.
[0126] 步骤 S311: 判断接收方接受的从第 N个数据条起的 h个加入序号的数据条顺序 是否正确。 [0126] Step S311: It is determined whether the order of the data strips of the h joining sequence numbers received from the Nth data strip accepted by the receiver is correct.
[0127] 具体地, 接收方判断比对序号的之后是否为接收方接收的从第 N个数据条起的 h个加入序号的数据条中首次接收的加入序号的数据条的序号, 按照接收顺序依 次判断接收方接收的从第 N个数据条起的 h个加入序号的数据条的序号是否为前 一个接收的加入序号的数据条中的序号之后的序号。 例如, 当 N=5吋, 如果接收 方接收的数据条的顺序为 50、 10、 20、 30, 对比序号 40之后的序号 50与首次接 收的加入序号的数据条的序号 50—致, 并且, 首次接收的数据条是序号 50之后 的序号 10与第 2个接收的数据条的序号 10—致, 依次类推, 第 3个接收的数据条 的序号 20之后的序号 30与第 4个接收的数据条的序号 30—致, 则上述判断结果为 "是", 否则, 上述判断结果为"否"。  [0127] Specifically, the receiving party determines whether the sequence number of the sequence number of the first number of the data sequence of the number of the join number received from the Nth data strip received by the receiver after the comparison sequence number is received, in the order of receiving It is sequentially determined whether the sequence number of the h number-added data strips received from the Nth data strip received by the receiver is the sequence number after the serial number in the data strip of the previous received join sequence number. For example, when N=5吋, if the order of the data strips received by the receiver is 50, 10, 20, 30, the serial number 50 after the comparison number 40 is the same as the sequence number 50 of the data strip of the first received join sequence number, and The data strip received for the first time is the serial number 10 after the serial number 50 and the serial number 10 of the second received data strip, and so on, and the serial number 30 and the fourth received data after the serial number 20 of the third received data strip. If the serial number of the bar is 30, the above judgment result is "Yes", otherwise, the above judgment result is "No".
[0128] 步骤 S312: 接收方储存该 h个加入序号的数据条中的 h个数据条并将将最后一 个接收的数据条的序号作为比对序号。  [0128] Step S312: The receiver stores the h data strips in the h data strips of the join sequence number and uses the sequence number of the last received data strip as the comparison sequence number.
[0129] 具体地, 当步骤 S312的判断结果才为"是"吋, 则接收方接收的顺序正确, 接收 方储存该 h个加入序号的数据条中的 h个数据条, 并将第 Ν+h-l个数据条的序号, 即最后一个接收的加入序号的数据条的序号, 作为比对序号, 并且令 N=N+h。  [0129] Specifically, when the result of the determination in step S312 is “Yes”, the order received by the receiver is correct, and the receiver stores the h data strips in the data strips of the h join sequence numbers, and the third data is The sequence number of the hl data strips, that is, the sequence number of the last received data strip of the added sequence number, as the comparison sequence number, and let N=N+h.
[0130] 步骤 S313: 接收方请求发送方发送从第 N个加入序号的数据条。  [0130] Step S313: The receiver requests the sender to send the data strip from the Nth join sequence number.
[0131] 步骤 S314: 接收方储存正确的数据条以及对比序号。  [0131] Step S314: The receiver stores the correct data strip and the comparison sequence number.
[0132] 具体地, 当步骤 S311的判断结果为 "否"吋, 接收方储存从第 N个数据条起的 h 个加入序号的数据条中正确的数据条并将最后一个正确的数据条的序号作为比 对序号。 比如, 当 N=5吋, 如果接收方接收的数据条的顺序为 50、 20、 10、 30, 则从第 2个接收的数据条的序号 20出错, 接收方储存首次接收的数据条 50, 以及 将最后一个正确的数据条的序号 50以及对比序号。 [0133] 步骤 S315: 接收方请求发送方发送第 N+h-1个加入序号的数据条。 [0132] Specifically, when the result of the determination in step S311 is "NO", the receiver stores the correct data strip in the data strip of the h join sequence numbers from the Nth data strip and the last correct data strip The serial number is used as the comparison serial number. For example, when N=5吋, if the order of the data strips received by the receiver is 50, 20, 10, 30, the serial number 20 of the data strip received from the second one is in error, and the receiver stores the data strip 50 received for the first time. And the serial number 50 of the last correct data strip and the comparison number. [0133] Step S315: The receiver requests the sender to send the data strip of the N+h-1th join sequence number.
[0134] 步骤 S316: 发送方发送 N+h-1个加入序号的数据条。  [0134] Step S316: The sender sends N+h-1 data strips with the added sequence number.
[0135] 步骤 S317: 接收方接收第 N+h-1个数据条加入序号的数据条。  [0135] Step S317: The receiver receives the data strip of the sequence number of the N+h-1 data strips.
[0136] 步骤 S318: 判断接收方接收的第 N+h-1个加入序号的数据条的序号是否为比对 序号的下一个序号。  [0136] Step S318: It is determined whether the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is the next sequence number of the comparison sequence number.
[0137] 步骤 S319: 接收方储存第 N+h-1个数据条以及将第 N+h-1个数据条序号作为比 对序号。  [0137] Step S319: The receiver stores the N+h-1 data strips and the N+h-1 data strip numbers as the comparison sequence numbers.
[0138] 具体地, 如果步骤 S318的判断结果为"是", 则数据传输在第 N+h-1个数据条处 出错, 此吋接收方储存第 N+h-1个数据条, 将第 N+h-1个数据条序号作为比对序 号, 并且另 N=N+h, 请求发送方发送从第 N个数据条起的 h个加入序号的数据条  [0138] Specifically, if the result of the determination in step S318 is YES, the data transmission is in error at the N+h-1th data strip, and the 吋 receiver stores the N+h-1th data strip, N+h-1 data strip numbers are used as alignment numbers, and another N=N+h, requesting the sender to send h join sequence data strips from the Nth data strip
[0139] 上述发明, 通过将数据分批发送并逐个判断接收方接收的从第 N个数据条起的 h个加入序号的数据条的顺序是否正确, 如果接收方接收的从第 N个数据条起的 h 个加入序号的数据条的顺序都正确, 则储存该 h个加入序号的数据条以及将最后 一个接收的数据条的序号作为比对序号, 令^^1 , 请求发送方发送下一批加 入序号的数据条, 否则, 储存正确的数据条以及将最后一个正确的数据条的序 号作为比对序号, 并请求发送方发送第 N+h-1个加入序号的数据条并判断接收的 该第 N+h-1个加入序号的数据条的序号是否正确, 如果是, 则储存该数据条以及 将概述具体的序号作为比对序号, 4N=N+1 , 请求发送方发送下一批加入序号 的数据条, 否则, 令 N=N-1 , 重复请求发送方发送第 N+h-1个加入序号的数据条 并判断。 通过该数据传输方法可以保证数据传输的顺序的准确, 而且, 还可以 实现蓝牙端点续传的功能。 [0139] According to the above invention, the data is sent in batches and judged one by one whether the order of the h-joined data strips received from the Nth data strip received by the receiver is correct, if the receiving party receives the Nth data strip The sequence of the h data columns added with the serial number is correct. The data strips of the h join sequence numbers are stored, and the sequence number of the last received data strip is used as the comparison sequence number, so ^^1, the request sender sends the next The data strip of the serial number is added in batches. Otherwise, the correct data strip is stored and the sequence number of the last correct data strip is used as the comparison sequence number, and the sender is requested to send the data strip of the N+h-1 join sequence number and judge the received data. Whether the sequence number of the data strip of the N+h-1th join sequence number is correct, if yes, the data strip is stored and the specific sequence number is used as the comparison sequence number, 4N=N+1, and the request sender sends the next batch. Add the data strip of the sequence number, otherwise, let N=N-1, repeat the request sender to send the N+h-1 data strip of the join sequence number and judge. Through the data transmission method, the order of data transmission can be ensured accurately, and the function of continuing the transmission of the Bluetooth endpoint can also be realized.
[0140] 需要说明的是, 图 2所描述的实施例中也可以增加端点续传的功能, 同图 3所描 述的实施例类似, 在图 2描述的实施例步骤 S202之后增加步骤 S303 , 在步骤 S205 之后增加步骤 S307、 S308、 S309以及 S310即可实现。  [0140] It should be noted that, in the embodiment described in FIG. 2, the function of the endpoint retransmission can also be added. Similar to the embodiment described in FIG. 3, step S303 is added after the step S202 of the embodiment described in FIG. Step S205 is followed by adding steps S307, S308, S309 and S310.
[0141] 请参见图 4 , 图 4是本发明一种基于蓝牙的数据传输装置一种实施方式的结构示 意图, 该装置 400包括:  Referring to FIG. 4, FIG. 4 is a schematic structural diagram of an embodiment of a Bluetooth-based data transmission apparatus according to the present invention. The apparatus 400 includes:
[0142] 划分单元 401 , 用于将需要进行传输的数据段划分成多个数据条; [0143] 组合单元 402, 用于为多个数据条分别加入序号以获得多个加入序号的数据条 , 其中, 第 N个数据条中加入序号 M, 序号 M用于表示第 N个数据条在包括第 N 个数据条在内的相邻的 k个数据条中的排序; [0142] a dividing unit 401, configured to divide a data segment that needs to be transmitted into multiple data strips; [0143] The combining unit 402 is configured to respectively add a sequence number to the plurality of data strips to obtain a plurality of data strips of the join sequence number, where the number N is added to the Nth data strip, and the sequence number M is used to indicate that the Nth data strip is Sorting among adjacent k data strips including the Nth data strip;
[0144] 第一发送单元 403, 用于将多个加入序号的数据条向接收方发送;  [0144] The first sending unit 403 is configured to send, by using a plurality of data strips of the added sequence number to the receiver;
[0145] 接收单元 404, 用于接收多个加入序号的数据条;  [0145] The receiving unit 404 is configured to receive a plurality of data strips of the added sequence number;
[0146] 第一判断单元 405, 用于判断接收方接收多个加入序号的数据条的顺序与多个 加入序号的数据条中的序号是否一致;  [0146] The first determining unit 405 is configured to determine whether the sequence in which the receiver receives the data strips of the multiple join sequence numbers is consistent with the sequence numbers in the data strips of the multiple join sequence numbers;
[0147] 请求单元 406, 用于当接收方接收多个加入序号的数据条的顺序与多个加入序 号的数据条中的序号不一致吋, 请求发送方将出错的数据段重新发送。 [0147] The requesting unit 406 is configured to: when the receiving party receives the sequence of the data strips of the multiple joining serial numbers and the sequence numbers of the data strips of the multiple joining serial numbers, the requesting sender resends the data segment that is in error.
[0148] 需要说明的是, 划分单元 401、 组合单元 402、 第一发送单元 403位于发送方; 接收单元 404、 第一判断单元 405、 请求单元 406位于接收方。 [0148] It should be noted that the dividing unit 401, the combining unit 402, and the first transmitting unit 403 are located at the transmitting side; the receiving unit 404, the first determining unit 405, and the requesting unit 406 are located at the receiving side.
[0149] 请参见图 5, 图 5是本发明一种基于蓝牙的数据传输装置另一种实施方式的结构 示意图, 该装置 500包括: [0149] Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of another embodiment of a Bluetooth-based data transmission apparatus according to the present invention. The apparatus 500 includes:
[0150] 划分单元 401 , 用于将需要进行传输的数据段划分成多个数据条; [0150] a dividing unit 401, configured to divide a data segment that needs to be transmitted into multiple data strips;
[0151] 组合单元 402, 用于为多个数据条分别加入序号以获得多个加入序号的数据条 [0151] The combining unit 402 is configured to separately add a sequence number to the plurality of data strips to obtain a plurality of data strips of the added sequence number.
, 其中, 第 N个数据条中加入序号 M, 序号 M用于表示第 N个数据条在包括第 N 个数据条在内的相邻的 k个数据条中的排序;  , wherein the number N is added to the Nth data strip, and the sequence number M is used to indicate the order of the Nth data strip in the adjacent k data strips including the Nth data strip;
[0152] 第一发送单元 403, 用于将多个加入序号的数据条向接收方发送; [0152] The first sending unit 403 is configured to send, by using a plurality of data strips of the added sequence number to the receiver;
[0153] 接收单元 404, 用于接收多个加入序号的数据条; [0153] The receiving unit 404 is configured to receive multiple data strips of the added sequence number;
[0154] 第一判断单元 405, 用于判断接收方接收多个加入序号的数据条的顺序与多个 加入序号的数据条中的序号是否一致;  [0154] The first determining unit 405 is configured to determine whether the order in which the receiver receives the data strips of the multiple join sequence numbers is consistent with the sequence numbers in the data strips of the multiple join sequence numbers;
[0155] 请求单元 406, 用于当接收方接收多个加入序号的数据条的顺序与多个加入序 号的数据条中的序号不一致吋, 请求发送方将出错的数据段重新发送。 [0155] The requesting unit 406 is configured to: when the receiving party receives the sequence of the data strips of the plurality of joining serial numbers and the sequence numbers of the data strips of the plurality of joining serial numbers, the requesting party resends the data segment that is in error.
[0156] 可选地, 第一发送单元 403还用于依次发送从第 N个数据条起的 h个加入序号的 数据条, h不大于 k; [0156] Optionally, the first sending unit 403 is further configured to sequentially send h data columns of the join sequence number from the Nth data strip, where h is not greater than k;
[0157] 接收单元 404还用于接收从第 N个数据条起的 h个加入序号的数据条; [0157] The receiving unit 404 is further configured to receive h data strips of the join sequence number from the Nth data strip;
[0158] 第一判断单元 405还用于判断接收方接收从第 N个数据条起的 h个加入序号的数 据条的顺序与从第 N个数据条起的 h个加入序号的数据条中的序号是否一致; [0159] 请求单元 404还用于如果接收方接收从第 N个数据条起的 h个加入序号的数据条 的顺序与从第 N个数据条起的 h个加入序号的数据条中的序号一致, 则接收方储 存从第 N个数据条起的 h个加入序号的数据条中的 h个数据条, 并请求发送方发 送从第 N+h个加入序号的数据条起的 h个加入序号的数据条; [0158] The first determining unit 405 is further configured to determine, in the data strip of the h join sequence numbers from the Nth data strip, that the receiver receives the data strips of the h join sequence numbers from the Nth data strip. Whether the serial numbers are consistent; [0159] The requesting unit 404 is further configured to: if the receiving party receives the data sequences of the h joining serial numbers from the Nth data strip, the sequence of the data strips of the h joining serial numbers from the Nth data strip is consistent , the receiver stores h data strips of the h join sequence data strips from the Nth data strip, and requests the sender to send h join sequence numbers from the N+thth join sequence number data strip. Data strip
[0160] 请求单元 406还用于如果接收方接收从第 N个数据条起的 h个加入序号的数据条 的顺序与从第 N个数据条起的 h个加入序号的数据条中的序号不一致, 则接收方 请求发送方重新发送从第 N个数据条起的 h个加入序号的数据条。  [0160] The requesting unit 406 is further configured to: if the receiving party receives the data sequence of the h joining sequence numbers from the Nth data bar, the sequence of the data sequence of the h joining sequence numbers from the Nth data bar is inconsistent Then, the receiver requests the sender to resend the h-joined data strips from the Nth data strip.
[0161] 可选地, 装置 500还包括: 比对序号单元 407, 用于将最后一个接收的数据条的 序号作为比对序号;  [0161] Optionally, the apparatus 500 further includes: a comparison sequence number unit 407, configured to use a sequence number of the last received data strip as a comparison sequence number;
[0162] 第一判断单元 405还用于判断比对序号的之后是否为接收方接收从第 N个数据 条起的 h个加入序号的数据条中首次接收的加入序号的数据条的序号。  [0162] The first determining unit 405 is further configured to determine, after the comparison sequence number, whether the receiver receives the sequence number of the data sequence of the join sequence number received for the first time in the data strip of the h join sequence numbers from the Nth data strip.
[0163] 可选地, 第一判断单元 405还用于判断比对序号的之后是否为接收方接收从第 N个数据条起的 h个加入序号的数据条中首次接收的加入序号的数据条的序号, 按照接收顺序依次判断从第 N个数据条起的 h个加入序号的数据条的序号是否为 前一个接收的加入序号的数据条的序号之后的序号;  [0163] Optionally, the first determining unit 405 is further configured to determine, after the comparison sequence number, whether the receiving party receives the first received sequence number of the data sequence of the h joining sequence numbers from the Nth data strip. The serial number, in the order of receiving, sequentially determines whether the serial number of the h numbered data strips from the Nth data strip is the serial number after the serial number of the previously received data strip of the added serial number;
[0164] 请求单元 406还包括储存从第 N个数据条起的 h个加入序号的数据条中正确的数 据条并将最后一个正确的数据条的序号作为比对序号, 并请求发送方重新发送 第 Ν+h-l个加入序号的数据条;  [0164] The requesting unit 406 further includes storing the correct data strip in the h joined sequence data strips from the Nth data strip and using the sequence number of the last correct data strip as the comparison sequence number, and requesting the sender to resend Dijon + hl data strips added to the serial number;
[0165] 第一发送单元 403还用于发送第 N+h-1个加入序号的数据条;  [0165] The first sending unit 403 is further configured to send the data strip of the N+h-1th join sequence number;
[0166] 接收单元 404还用于接收第 N+h-1个加入序号的数据条;  [0166] The receiving unit 404 is further configured to receive the data strip of the N+h-1th join sequence number;
[0167] 第一判断单元 405还用于判断接收方接收的第 N+h-1个加入序号的数据条的序号 是否为比对序号之后的序号;  [0167] The first determining unit 405 is further configured to determine whether the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is a sequence number after the comparison sequence number;
[0168] 请求单元 406还用于如果接收方接收的第 N+h-1个加入序号的数据条的序号不 是比对序号之后的序号, 则接收方请求发送方发送第 N+h-2个加入序号的数据条 [0168] The requesting unit 406 is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is not the sequence number after the sequence number, the receiver requests the sender to send the N+h-2 Add a serial number strip
[0169] 比对序号单元 407还用于如果接收方接收的第 N+h-1个加入序号的数据条的序号 为比对序号的之后的序号, 接收方将第 N+h-1个数据条序号作为比对序号; [0170] 请求单元 406还用于如果接收方接收的第 N+h-1个加入序号的数据条的序号为 比对序号之后的序号, 则接收方储存第 Ν+h-l个数据条, 并请求发送方发送从第 N+h个加入序号的数据条起的 h个加入序号的数据条。 [0169] The comparison sequence number unit 407 is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is the sequence number after the comparison sequence number, the receiver will input the N+h-1 data. The sequence number is used as the comparison sequence number; [0170] the request unit 406 is further configured to: if the number of the N+h-1 join sequence data strips received by the receiver is After comparing the serial numbers after the serial number, the receiver stores the Ν+hl data strips, and requests the sender to send the h data strips of the join sequence number from the data strip of the N+thth join sequence number.
[0171] 可选地, 装置 500还包括: [0171] Optionally, the apparatus 500 further includes:
[0172] 第二发送单元 408, 用于向发送方发送接收成功指令;  [0172] The second sending unit 408 is configured to send a receiving success instruction to the sender.
[0173] 第二判断单元 409, 用于判断在第一吋间阈值内是否收到未接收到接收成功指 令, 如果否, 则发送方重新发送从第 N个数据条起的 h个加入序号的数据条; [0174] 第二判断单元还用于判断在第二吋间阈值内是否收到接收成功指令;  [0173] The second determining unit 409 is configured to determine whether the receiving success instruction is not received within the first inter-threshold threshold, and if not, the sending end resends the h joining serial numbers from the Nth data strip. a data strip; [0174] the second determining unit is further configured to determine whether a receiving success instruction is received within the second inter-threshold threshold;
[0175] 储存单元 410, 用于如果发送方在第二吋间阈值内未收到接收成功指令, 则储 存第 N个加入序号的数据条的数据信息, 数据信息包括当前 N值以及第 N个数据 条的序号; [0175] The storage unit 410 is configured to: if the sender does not receive the reception success instruction within the second inter-threshold threshold, store the data information of the Nth join sequence data strip, where the data information includes the current N value and the Nth The serial number of the data strip;
[0176] 第二判断单元 409还用于判断发送方是否有储存的数据信息, 如果是, 则根据 储存信息发送从第 N+h加入序号的数据条起的 h个加入序号的数据条。  [0176] The second determining unit 409 is further configured to determine whether the sender has stored data information, and if yes, send h data sequences of the added sequence number from the data strip of the N+h joining sequence number according to the stored information.
[0177] 需要说明的是, 划分单元 401、 组合单元 402、 第一发送单元 403、 第二判断单 元 409以及储存单元 410位于发送方; 接收单元 404、 第一判断单元 405、 请求单 元 406、 比对序号单元 407以及第二发送单元 408位于接收方。  [0177] It should be noted that the dividing unit 401, the combining unit 402, the first transmitting unit 403, the second determining unit 409, and the storage unit 410 are located at the transmitting side; the receiving unit 404, the first determining unit 405, the request unit 406, and the ratio The sequence number unit 407 and the second transmission unit 408 are located at the receiving side.
[0178] 需要说明的是, 对于前述的各方法实施例, 为了简单描述, 故将其都表述为一 系列的动作组合, 伹是本领域技术人员应该知悉, 本发明并不受所描述的动作 顺序的限制, 因为根据本发明, 某些步骤可以采用其他顺序或者同吋进行。 其 次, 本领域技术人员也应该知悉, 说明书中所描述的实施例均属于优选实施例 , 所涉及的动作和模块并不一定是本发明所必须的。  [0178] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, and those skilled in the art should know that the present invention is not subject to the described actions. The order is limited because certain steps may be performed in other orders or in the same manner in accordance with the present invention. In the following, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0179] 在上述实施例中, 对各个实施例的描述都各有侧重, 某个实施例中没有详述 的部分, 可以参见其他实施例的相关描述。  [0179] In the foregoing embodiments, the descriptions of the various embodiments are different, and the parts that are not detailed in an embodiment may refer to related descriptions of other embodiments.
[0180] 本发明实施例方法中的步骤可以根据实际需要进行顺序调整、 合并和刪减。  [0180] The steps in the method of the embodiment of the present invention may be sequentially adjusted, merged, and deleted according to actual needs.
[0181] 本发明实施例装置中的单元可以根据实际需要进行合并、 划分和刪减。 本领域 的技术人员可以将本说明书中描述的不同实施例以及不同实施例的特征进行结 合或组合。  [0181] The units in the apparatus of the embodiment of the present invention may be combined, divided, and deleted according to actual needs. Those skilled in the art can combine or combine the different embodiments described in the specification and the features of the different embodiments.
[0182] 通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解到本发明可 以用硬件实现, 或固件实现, 或它们的组合方式来实现。 当使用软件实现吋, 可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的一个或多 个指令或代码进行传输。 计算机可读介质包括计算机存储介质和通信介质, 其 中通信介质包括便于从一个地方向另一个地方传送计算机程序的任 1可介质。 存 储介质可以是计算机能够存取的任 1可可用介质。 以此为例伹不限于: 计算机可 读介质可以包括随机存取存储器 (Random Access [0182] From the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented in hardware, firmware implementation, or a combination thereof. When using software to achieve flaws, The above functions may be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium. Computer readable media includes both computer storage media and communication media, including communication media including any medium that facilitates transfer of a computer program from one location to another. The storage medium can be any of the available media that the computer can access. For example, the computer readable medium may include random access memory (Random Access).
Memory, RAM). 只读存储器 (Read-Only Memory, ROM). 电可擦可编程只 读存储器 (Electrically Erasable Programmable Read-Only Memory, EEPROM) 、 只读光盘 (Compact Disc Read-Only Memory, CD-ROM)或其他光盘存储、 磁 盘存储介质或者其他磁存储设备、 或者能够用于携带或存储具有指令或数据结 构形式的期望的程序代码并能够由计算机存取的任 1可其他介质。 此外。 任 1可连 接可以适当的成为计算机可读介质。 例如, 如果软件是使用同轴电缆、 光纤光 缆、 双绞线、 数字用户线 (Digital Subscriber Line, DSL) 或者诸如红外线、 无 线电和微波之类的无线技术从网站、 服务器或者其他远程源传输的, 那么同轴 电缆、 光纤光缆、 双绞线、 DSL或者诸如红外线、 无线和微波之类的无线技术包 括在所属介质的定影中。 如本发明所使用的, 盘 (Disk) 和碟 (disc) 包括压缩 光碟 (CD) 、 激光碟、 光碟、 数字通用光碟 (DVD) 、 软盘和蓝光光碟, 其中 盘通常磁性的复制数据, 而碟则用激光来光学的复制数据。 上面的组合也应当 包括在计算机可读介质的保护范围之内。  Memory, RAM). Read-Only Memory (ROM). Electrically Erasable Programmable Read-Only Memory (EEPROM), CD-ROM (Compact Disc Read-Only Memory, CD- ROM) or other optical disc storage, magnetic storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of an instruction or data structure and that can be accessed by a computer. Also. Any of the connectables may suitably be a computer readable medium. For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, Then coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, wireless and microwave are included in the fixing of the associated medium. As used in the present invention, a disk and a disc include a compact disc (CD), a laser disc, a disc, a digital versatile disc (DVD), a floppy disc, and a Blu-ray disc, wherein the disc is usually magnetically copied, and the disc is The laser is used to optically replicate the data. Combinations of the above should also be included within the scope of the computer readable media.
总之, 以上所述仅为本发明技术方案的较佳实施例而已, 并非用于限定本发 明的保护范围。 凡在本发明的精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。  In summary, the above description is only a preferred embodiment of the technical solution of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
技术问题 technical problem
问题的解决方案 Problem solution
发明的有益效果 Advantageous effects of the invention

Claims

权利要求书 Claim
[权利要求 1] 一种基于蓝牙的数据传输方法, 其特征在于, 包括:  [Claim 1] A Bluetooth-based data transmission method, comprising:
发送方将需要进行传输的数据段划分成多个数据条;  The sender divides the data segment that needs to be transmitted into multiple data strips;
所述发送方为所述多个数据条分别加入序号以获得多个加入序号的数 据条, 其中, 第 N个数据条中加入序号 M, 序号 M用于表示所述第 N 个数据条在包括所述第 N个数据条在内的相邻的 k个数据条中的排序 所述发送方将所述多个加入序号的数据条向接收方发送;  The sender adds a sequence number to the plurality of data strips to obtain a plurality of data strips of the join sequence number, wherein the Nth data strip includes a sequence number M, and the sequence number M is used to indicate that the Nth data strip is included. Sorting among adjacent k data strips including the Nth data strip, the sender sends the data strips of the plurality of join sequence numbers to the receiver;
所述接收方接收所述多个加入序号的数据条, 并判断所述接收方接收 所述多个加入序号的数据条的顺序与所述多个加入序号的数据条中的 序号是否一致;  Receiving, by the receiving party, the data strips of the multiple join sequence numbers, and determining whether the sequence of the data strips of the plurality of join sequence numbers received by the receiver is consistent with the sequence numbers of the data strips of the multiple join sequence numbers;
如果否, 则所述接收方请求所述发送方将出错的数据段重新发送。  If not, the recipient requests the sender to resend the erroneous data segment.
[权利要求 2] 根据权利要求 1所述的方法, 其特征在于, [Claim 2] The method according to claim 1, characterized in that
所述发送方将所述多个加入序号的数据条向接收方发送的方式包括: 所述发送方依次发送从第 N个数据条起的 h个加入序号的数据条, 所 述 h不大于 k;  The manner in which the sender sends the data strips of the multiple join sequence numbers to the receiver includes: the sender sends the data strips of the h join sequence numbers from the Nth data strip in sequence, where the h is not greater than k ;
所述接收方接收所述多个加入序号的数据条, 并判断所述接收方接收 所述多个加入序号的数据条的顺序与所述多个加入序号的数据条中的 序号是否一致具体为: 所述接收方接收所述从第 N个数据条起的 h个 加入序号的数据条, 并判断所述接收方接收所述从第 N个数据条起的 h个加入序号的数据条的顺序与所述从第 N个数据条起的 h个加入序号 的数据条中的序号是否一致;  Receiving, by the receiving party, the data strips of the plurality of joining serial numbers, and determining whether the receiving party receives the data strips of the plurality of joining serial numbers and the sequence numbers of the plurality of joining serial number data strips are consistent : the receiving party receives the data strips of the h joining sequence numbers from the Nth data strip, and determines the order in which the receiving party receives the data strips of the h joining sequence numbers from the Nth data strip Whether the serial numbers in the data strips of the h joined serial numbers from the Nth data strip are consistent;
如果是, 则所述接收方储存所述从第 N个数据条起的 h个加入序号的 数据条中的 h个数据条, 并请求所述发送方发送从第 N+h个加入序号 的数据条起的 h个加入序号的数据条;  If yes, the receiver stores the h data strips of the h join sequence data strips from the Nth data strip, and requests the sender to send data from the N+th join sequence numbers. h data strips added with serial numbers;
如果否, 则所述接收方请求所述发送方重新发送所述从第 N个数据条 起的 h个加入序号的数据条。  If not, the recipient requests the sender to resend the data strips of the h join sequence numbers from the Nth data strip.
[权利要求 3] 根据权利要求 2所述的方法, 其特征在于, 所述接收方储存所述从第 N个数据条起的 h个加入序号的数据条中的 h 个数据条之后还包括: [Claim 3] The method according to claim 2, characterized in that After the receiving party stores the h data strips in the h join sequence data strips from the Nth data strip, the receiver further includes:
所述接收方将最后一个接收的数据条的序号作为比对序号; 所述判断所述接收方接收所述从第 N个数据条起的 h个加入序号的数 据条的顺序与所述从第 N个数据条起的 h个加入序号的数据条中的序 号是否一致还包括:  Receiving, by the receiving party, a sequence number of the last received data strip as a comparison sequence number; determining, in the order of the receiving party, the data strips of the h joining sequence numbers from the Nth data strip Whether the serial numbers in the h-added data strips from the N data strips are consistent also includes:
判断所述比对序号的之后是否为所述接收方接收所述从第 N个数据条 起的 h个加入序号的数据条中首次接收的加入序号的数据条的序号。  Determining whether the sequence number is followed by a sequence number of the data strip of the join sequence number received for the first time in the data strip of the h join sequence numbers received by the receiver from the Nth data strip.
[权利要求 4] 根据权利要求 3所述的方法, 其特征在于, [Claim 4] The method according to claim 3, characterized in that
所述判断所述接收方接收所述从第 N个数据条起的 h个加入序号的数 据条的顺序与所述 h个加入序号的数据条中的序号是否一致还包括: 判断所述比对序号的之后是否为所述接收方接收所述从第 N个数据条 起的 h个加入序号的数据条中首次接收的加入序号的数据条的序号, 按照接收顺序依次判断所述从第 N个数据条起的 h个加入序号的数据 条的序号是否为前一个接收的加入序号的数据条的序号之后的序号; 所述接收方请求所述发送方重新发送所述从第 N个数据条起的 h个加 入序号的数据条还包括:  Determining whether the order in which the receiving party receives the data strips of the h joining sequence numbers from the Nth data strip is consistent with the sequence numbers in the data strips of the h joining sequence numbers further includes: determining the comparison Whether the serial number is followed by the receiving party receiving the serial number of the data column of the joining sequence number received for the first time in the data strip of the h joining numbers from the Nth data strip, and sequentially determining the Nth order according to the receiving order Whether the sequence number of the h number-added data strips from the data strip is the sequence number after the sequence number of the previous received sequence number of the added sequence number; the receiver requests the sender to resend the slave N-th data strip The h data columns added to the serial number also include:
所述接收方储存所述从第 N个数据条起的 h个加入序号的数据条中正 确的数据条并将最后一个正确的数据条的序号作为所述比对序号, 并 请求所述发送方重新发送第 Ν+h-l个加入序号的数据条;  The receiving party stores the correct data strip in the h numbered data strips from the Nth data strip and uses the sequence number of the last correct data strip as the comparison sequence number, and requests the sender Resend the third + hl data strips with the serial number;
所述发送方发送所述第 Ν+h-l个加入序号的数据条; 所述接收方接收所述第 Ν+h-l个加入序号的数据条, 并判断所述接收 方接收的所述第 Ν+h-l个加入序号的数据条的序号是否为所述比对序 号之后的序号, 如果否, 则所述接收方请求所述发送方发送第 N+h-2 个加入序号的数据条, 如果是, 则所述接收方储存所述第 Ν+h-l个数 据条以及将所述第 Ν+h-l个数据条序号作为所述比对序号, 并请求所 述发送方发送所述从第 N+h个加入序号的数据条起的 h个加入序号的 数据条。 Sending, by the sender, the data strip of the first + hl join sequence number; the receiver receiving the data strip of the third + hl join sequence number, and determining the third hl + hl received by the receiver Whether the sequence number of the data column to which the sequence number is added is the sequence number after the comparison sequence number, and if not, the receiver requests the sender to send the data strip of the N+h-2th join sequence number, and if yes, The receiving party stores the Ν+hl data strips and the Ν+hl data strip numbers as the comparison sequence numbers, and requests the sender to send the slave N+h join sequences The data strips of the h are added to the data strip of the serial number.
[权利要求 5] 根据权利要求 2-4任一权利要求所述的方法, 其特征在于, 所述接收 方接收所述从第 N个数据条起的 h个加入序号的数据条之后还包括: 所述接收方向所述发送方发送接收成功指令; [Claim 5] The method according to any one of claims 2-4, wherein, after receiving the data strips of the h join sequence numbers from the Nth data strip, the receiving party further includes: Sending, by the sending direction, the sending success instruction;
所述发送方判断在第一吋间阈值内是否收到所述接收成功指令, 如果 否, 则所述发送方重新发送所述从第 N个数据条起的 h个加入序号的 数据条;  Determining, by the sender, whether the receiving success instruction is received within the first inter-threshold threshold, and if not, the sender resending the h-added data strips from the Nth data strip;
所述发送方判断在第二吋间阈值内是否收到所述接收成功指令, 如果 否, 则储存所述第 N个加入序号的数据条的数据信息, 所述数据信息 包括当前 N值以及第 N个数据条的序号;  Determining, by the sender, whether the receiving success instruction is received within the second inter-threshold threshold, and if not, storing the data information of the Nth joining sequence data strip, where the data information includes a current N value and a The serial number of the N data strips;
所述发送方分批发送所述加入序号的数据条, 每批依次发送 h个加入 序号的数据条之前还包括:  The sender sends the data strips of the added serial number in batches, and each batch sends h data strips with the serial number sequentially before the batch includes:
所述发送方判断所述发送方是否有储存的所述数据信息, 如果是, 则 根据所述储存信息发送以第 N+h为首的 h个加入序号的数据条。  The sender determines whether the sender has the stored data information, and if so, sends the h-joined data strips starting with the N+h according to the stored information.
[权利要求 6] —种基于蓝牙的数据传输装置, 其特征在于, 包括: [Claim 6] A Bluetooth-based data transmission device, comprising:
划分单元, 用于将需要进行传输的数据段划分成多个数据条; 组合单元, 用于为所述多个数据条分别加入序号以获得多个加入序号 的数据条, 其中, 第 N个数据条中加入序号 M, 序号 M用于表示所述 第 N个数据条在包括所述第 N个数据条在内的相邻的 k个数据条中的排 序;  a dividing unit, configured to divide a data segment that needs to be transmitted into a plurality of data strips; a combining unit, configured to add a sequence number to the plurality of data strips respectively to obtain a plurality of data strips with a join sequence number, wherein, the Nth data The sequence number M is added to the bar, and the sequence number M is used to indicate the order of the Nth data strip in the adjacent k data strips including the Nth data strip;
第一发送单元, 用于将所述多个加入序号的数据条向接收方发送; 接收单元, 用于接收所述多个加入序号的数据条; 第一判断单元, 用于判断所述接收方接收所述多个加入序号的数据条 的顺序与所述多个加入序号的数据条中的序号是否一致;  a first sending unit, configured to send the data strips of the multiple join sequence numbers to the receiver, a receiving unit, configured to receive the data strips of the multiple join sequence numbers, and a first determining unit, configured to determine the receiver Whether the sequence of receiving the plurality of data columns of the added sequence number is consistent with the sequence number of the plurality of data columns of the added sequence number;
请求单元, 用于当所述接收方接收所述多个加入序号的数据条的顺序 与所述多个加入序号的数据条中的序号不一致吋, 请求所述发送方将 出错的数据段重新发送。  a requesting unit, configured to: when the receiving party receives the data sequence of the plurality of joining serial numbers, and the sequence number of the plurality of joining serial numbers is inconsistent, requesting the sender to resend the data segment that is in error .
[权利要求 7] 根据权利要求 6所述的装置, 其特征在于, [Clave 7] The apparatus according to claim 6, wherein
所述第一发送单元还用于依次发送从第 N个数据条起的 h个加入序号 的数据条, 所述 h不大于 k; The first sending unit is further configured to sequentially send h join sequence numbers from the Nth data strip. Data strip, the h is not greater than k;
所述接收单元还用于接收所述从第 N个数据条起的 h个加入序号的数 据条;  The receiving unit is further configured to receive the data strips of the h join sequence numbers from the Nth data strip;
所述第一判断单元还用于判断所述接收方接收所述从第 N个数据条起 的 h个加入序号的数据条的顺序与所述从第 N个数据条起的 h个加入序 号的数据条中的序号是否一致;  The first determining unit is further configured to determine, in the order in which the receiving party receives the data strips of the h joining serial numbers from the Nth data strip, and the h joining serial numbers from the Nth data strip. Whether the serial numbers in the data strip are consistent;
所述请求单元还用于如果所述接收方接收所述从第 N个数据条起的 h 个加入序号的数据条的顺序与所述从第 N个数据条起的 h个加入序号 的数据条中的序号一致, 则所述接收方储存所述从第 N个数据条起的 h个加入序号的数据条中的 h个数据条, 并请求所述发送方发送从第 N +h个加入序号的数据条起的 h个加入序号的数据条; 所述请求单元还用于如果所述接收方接收所述从第 N个数据条起的 h 个加入序号的数据条的顺序与所述从第 N个数据条起的 h个加入序号 的数据条中的序号不一致, 则所述接收方请求所述发送方重新发送所 述从第 N个数据条起的 h个加入序号的数据条。  The requesting unit is further configured to: if the receiving party receives the sequence of the h joining sequence data strips from the Nth data strip and the h joining sequence number strips from the Nth data strip If the serial numbers are the same, the receiver stores the h data strips of the h join sequence data strips from the Nth data strip, and requests the sender to send the join number from the N+thth join sequence. a data strip of the join sequence number from the data strip; the request unit is further configured to: if the receiver receives the sequence of the h join sequence data strips from the Nth data strip If the sequence numbers of the h numbered data strips from the N data strips are inconsistent, the receiver requests the sender to resend the data strips of the h join sequence numbers from the Nth data strip.
[权利要求 8] 根据权利要求 7所述的装置, 其特征在于, [Claim 8] The apparatus according to claim 7, wherein
所述装置还包括: 比对序号单元, 用于将最后一个接收的数据条的序 号作为比对序号;  The device further includes: a comparison serial number unit, configured to use a serial number of the last received data strip as a comparison serial number;
所述第一判断单元还用于判断所述比对序号的之后是否为所述接收方 接收所述从第 N个数据条起的 h个加入序号的数据条中首次接收的加 入序号的数据条的序号。  The first determining unit is further configured to determine, after the comparison sequence number, whether the receiving party receives the first received sequence number of the data sequence of the h joining sequence numbers from the Nth data strip. Serial number.
[权利要求 9] 根据权利要求 8所述的装置, 其特征在于, [Claim 9] The apparatus according to claim 8, wherein
所述第一判断单元还用于判断所述比对序号的之后是否为所述接收方 接收所述从第 N个数据条起的 h个加入序号的数据条中首次接收的加 入序号的数据条的序号, 按照接收顺序依次判断所述从第 N个数据条 起的 h个加入序号的数据条的序号是否为前一个接收的加入序号的数 据条的序号之后的序号;  The first determining unit is further configured to determine, after the comparison sequence number, whether the receiving party receives the first received sequence number of the data sequence of the h joining sequence numbers from the Nth data strip. The serial number of the data strips of the h joining serial numbers from the Nth data strip is sequentially determined according to the receiving sequence, and is the serial number after the serial number of the data strip of the previous received joining serial number;
所述请求单元还包括储存所述从第 N个数据条起的 h个加入序号的数 据条中正确的数据条并将最后一个正确的数据条的序号作为所述比对 序号, 并请求所述发送方重新发送第 Ν+h-l个加入序号的数据条; 所述第一发送单元还用于发送所述第 Ν+h-l个加入序号的数据条; 所述接收单元还用于接收所述第 Ν+h-l个加入序号的数据条; 所述第一判断单元还用于判断所述接收方接收的所述第 N+h-1个加入 序号的数据条的序号是否为所述比对序号之后的序号; The requesting unit further includes storing the number of the h joining serial numbers from the Nth data strip According to the correct data strip in the strip, the sequence number of the last correct data strip is used as the comparison sequence number, and the sender is requested to resend the data strip of the third + hl join sequence number; the first sending unit further a data strip for transmitting the Ν+hl join sequence number; the receiving unit is further configured to receive the data strip of the Ν+hl join sequence number; the first determining unit is further configured to determine the receiving Whether the sequence number of the data strip of the N+h-1th join sequence number received by the party is the sequence number after the comparison sequence number;
所述请求单元还用于如果所述接收方接收的第 N+h-1个加入序号的数 据条的序号不是所述比对序号之后的序号, 则所述接收方请求所述发 送方发送第 N+h-2个加入序号的数据条;  The requesting unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is not the sequence number after the comparison sequence number, the receiver requests the sender to send the first N+h-2 data strips with serial numbers added;
所述比对序号单元还用于如果所述接收方接收的第 N+h-1个加入序号 的数据条的序号为所述比对序号的之后的序号, 所述接收方将所述第 N+h-1个数据条序号作为所述比对序号;  The comparison sequence number unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is the sequence number after the comparison sequence number, the receiver will use the Nth +h-1 strip numbers are used as the comparison sequence number;
所述请求单元还用于如果所述接收方接收的第 N+h-1个加入序号的数 据条的序号为所述比对序号之后的序号, 则所述接收方储存所述第 N +h-l个数据条, 并请求所述发送方发送所述从第 N+h个加入序号的数 据条起的 h个加入序号的数据条。  The requesting unit is further configured to: if the sequence number of the data strip of the N+h-1th join sequence number received by the receiver is a sequence number after the comparison sequence number, the receiver stores the N+hl Data strips, and requesting the sender to send the data strips of the h join sequence numbers from the data strip of the N+thth join sequence number.
[权利要求 10] 根据权利要求 7-9任一权利要求所述的装置, 其特征在于, [Claim 10] The device according to any of claims 7-9, characterized in that
所述装置还包括:  The device also includes:
第二发送单元, 用于向所述发送方发送接收成功指令;  a second sending unit, configured to send a receiving success instruction to the sender;
第二判断单元, 用于判断在第一吋间阈值内是否收到所述未接收到所 述接收成功指令, 如果否, 则所述发送方重新发送所述从第 N个数据 条起的 h个加入序号的数据条;  a second determining unit, configured to determine whether the receiving success instruction is not received within the first inter-threshold threshold, and if not, the sending end resends the h from the Nth data strip Data strips with serial numbers added;
所述第二判断单元还用于判断在第二吋间阈值内是否收到所述接收成 功指令;  The second determining unit is further configured to determine whether the receiving success instruction is received within the second inter-threshold threshold;
储存单元, 用于如果所述发送方在第二吋间阈值内未收到所述接收成 功指令, 则储存所述第 N个加入序号的数据条的数据信息, 所述数据 信息包括当前 N值以及第 N个数据条的序号;  a storage unit, configured to: if the sender does not receive the receiving success instruction within the second inter-threshold threshold, storing data information of the Nth join sequence data strip, where the data information includes a current N value And the serial number of the Nth data strip;
所述第二判断单元还用于判断所述发送方是否有储存的所述数据信息 , 如果是, 则根据所述储存信息发送从第 N+h加入序号的数据条起的 h个加入序号的数据条。 The second determining unit is further configured to determine whether the sender has the stored data information And if yes, sending h data sequences of the added sequence number from the data strip of the N+h join sequence number according to the stored information.
PCT/CN2015/092997 2015-10-27 2015-10-27 Bluetooth-based data transmission method and device WO2017070855A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201580002059.7A CN105900347B (en) 2015-10-27 2015-10-27 A kind of data transmission method and device based on bluetooth
PCT/CN2015/092997 WO2017070855A1 (en) 2015-10-27 2015-10-27 Bluetooth-based data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/092997 WO2017070855A1 (en) 2015-10-27 2015-10-27 Bluetooth-based data transmission method and device

Publications (1)

Publication Number Publication Date
WO2017070855A1 true WO2017070855A1 (en) 2017-05-04

Family

ID=57002571

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/092997 WO2017070855A1 (en) 2015-10-27 2015-10-27 Bluetooth-based data transmission method and device

Country Status (2)

Country Link
CN (1) CN105900347B (en)
WO (1) WO2017070855A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112055314A (en) * 2019-06-28 2020-12-08 合肥炬芯智能科技有限公司 Bluetooth broadcast communication method, system and master device and slave device thereof

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107734002B (en) * 2017-09-25 2020-07-17 西安法士特汽车传动有限公司 Bluetooth data receiving device and method thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100107029A1 (en) * 2008-10-29 2010-04-29 Sony Corporation Wireless communication apparatus and wireless communication method
CN102035859A (en) * 2009-09-28 2011-04-27 北大方正集团有限公司 Method, system and device for displaying upload progress

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1871804B (en) * 2003-08-21 2010-09-01 高通股份有限公司 Outer coding methods for broadcast/multicast content and related apparatus
JP4733689B2 (en) * 2005-03-09 2011-07-27 富士通株式会社 Communication system and transmission method
CN101001135A (en) * 2006-01-11 2007-07-18 上海原动力通信科技有限公司 Method of raising transmission reliablity of IP head compression data pack
CN102238206A (en) * 2010-04-23 2011-11-09 英业达集团(天津)电子技术有限公司 Image file packet retransmission method
CN101883047B (en) * 2010-06-25 2012-05-30 黄宏程 Data concurrency transmission method of multi-network interface device
CN102546784B (en) * 2011-12-29 2014-03-26 深圳市迈进科技有限公司 Method for conducting batch upgrading for device firmware based on controller area network (CAN) bus
CN102805887B (en) * 2012-04-11 2013-12-25 郑攀 Wireless communication system for coating type insulin pumps
CN104661172A (en) * 2015-01-26 2015-05-27 武汉健坤科技有限公司 Extended data transmission method and extended data transmission system based on Bluetooth low power consumption
CN104899065A (en) * 2015-06-11 2015-09-09 武汉虹信通信技术有限责任公司 Method and system for batch online recovery and software online upgrading

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100107029A1 (en) * 2008-10-29 2010-04-29 Sony Corporation Wireless communication apparatus and wireless communication method
CN102035859A (en) * 2009-09-28 2011-04-27 北大方正集团有限公司 Method, system and device for displaying upload progress

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112055314A (en) * 2019-06-28 2020-12-08 合肥炬芯智能科技有限公司 Bluetooth broadcast communication method, system and master device and slave device thereof

Also Published As

Publication number Publication date
CN105900347A (en) 2016-08-24
CN105900347B (en) 2018-06-12

Similar Documents

Publication Publication Date Title
WO2017088572A1 (en) Data processing method, device, and system
CN108989103B (en) Device upgrading method, debugger, network device and network system
CN109634912B (en) Data migration method and system
US20170357497A1 (en) Method for updating a firmware file of an input/output module
EP3291086A1 (en) Method and device for downloading software version, and storage medium
WO2019037458A1 (en) Communication method and apparatus
CN104866290A (en) Method and device for data transmission
CN109067513A (en) A kind of half-duplex operation method, apparatus and system
WO2015176468A1 (en) Method and apparatus for recovering system software of intelligent terminal
JPWO2019087295A1 (en) Update system, update device and device to be updated
WO2017070855A1 (en) Bluetooth-based data transmission method and device
CN110602338B (en) Audio processing method, device, system, storage medium and equipment
WO2014180414A1 (en) Transmission method and device based on management data input/output multi-source agreements
US8412844B2 (en) Validating download success
JP6331429B2 (en) Vehicle system, vehicle apparatus and mobile terminal compatible information acquisition method, program, and recording medium
CN115242783B (en) Transmission method, transmission apparatus, electronic device, and medium
US10514850B2 (en) Information processing system, server device, Information processing method, and computer program product
CN110968334B (en) Application resource updating method, resource package manufacturing method, device, medium and equipment
CN107665123B (en) Firmware updating method
CN111949215B (en) Partition changing method and device of FC-SAN network
CN105099854A (en) Message delivering method and system
WO2017016279A1 (en) Terminal configuration management method and apparatus
CN112825036A (en) Program updating method and device, electronic equipment and storage medium
CN116849724B (en) Communication method, device, equipment and storage medium based on surgical robot
CN113810228B (en) Message queue channel resetting method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15906921

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15906921

Country of ref document: EP

Kind code of ref document: A1