Data transmission method, device, terminal and storage medium
Through the mechanism of aggregating data frames and target response frames, the problem of waste of waiting time in Bluetooth data transmission is solved, data throughput and efficiency are improved, and transmission reliability and anti-interference ability are enhanced.
Patent Information
- Application Number
- CN202110931659.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-13
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2041-08-13
AI Technical Summary
In the existing Bluetooth data transmission technology, a fixed cycle needs to be separated from each transmission data frame, resulting in a waste of waiting time, which limits the throughput and speed of Bluetooth transmission and reduces the efficiency of data transmission.
By aggregating data frames, multiple target data segments are combined for transmission and retransmission based on the feedback target response frame, avoiding the wasted waiting time each time a single data segment is transmitted.
It improves the data throughput and efficiency of Bluetooth transmission, enhances the reliability and anti-interference ability of data transmission.
Smart Images

Figure CN113645600B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a data transmission method, device, terminal and storage medium. Background Art
[0002] The current encoding and decoding processing method for Bluetooth is that the encoding end adds frame header and frame tail check bits to the frame with short data volume, encodes it, and then transmits it once. The decoding end then decodes and checks each received data frame with short data volume, and sends the corresponding response frame to the encoding end based on each check result. The encoding end determines whether each data frame should be retransmitted based on each response frame.
[0003] In the related art, a fixed period is required between each transmission of data frames, and each data frame will wait for the end of the transmission period after being sent. The above encoding and decoding method will cause a waste of waiting time, thereby limiting the throughput of Bluetooth transmission, and further making the Bluetooth data transmission bandwidth smaller, the speed slower, and the data transmission efficiency lower. Summary of the invention
[0004] The embodiment of the present application provides a data transmission method, device, terminal and storage medium. The technical solution is as follows:
[0005] On the one hand, an embodiment of the present application provides a data transmission method, which is performed by a data sending device, and the method includes:
[0006] Sending an aggregated data frame to a data receiving device via Bluetooth; the aggregated data frame includes at least two target data segments;
[0007] receiving a target response frame fed back by the data receiving device via Bluetooth; the target response frame is used to feed back transmission conditions corresponding to each of the at least two target data segments;
[0008] Based on the target response frame, the target data segment whose transmission status is transmission failure is retransmitted via Bluetooth.
[0009] On the one hand, an embodiment of the present application provides a data transmission method, which is performed by a data receiving device, and the method includes:
[0010] Receiving an aggregated data frame sent by a data sending device via Bluetooth; the aggregated data frame includes at least two target data segments;
[0011] Based on the aggregated data frame, a target response frame is generated; the target response frame is used to feedback the transmission status corresponding to each of the at least two target data segments;
[0012] Sending the target response frame to the data sending device via Bluetooth;
[0013] In response to the target response frame feeding back that there is the target data segment with transmission failure, receiving the target data segment retransmitted by the data sending device via Bluetooth.
[0014] On the other hand, an embodiment of the present application provides a data transmission device, which is used in a data sending device, and includes:
[0015] A data sending module, used to send an aggregated data frame to a data receiving device via Bluetooth; the aggregated data frame includes at least two target data segments;
[0016] A response receiving module, used for receiving a target response frame fed back by the data receiving device via Bluetooth; the target response frame is used for feeding back the transmission status of each of the at least two target data segments;
[0017] The data retransmission module is used to retransmit the target data segment whose transmission status is transmission failure through Bluetooth based on the target response frame.
[0018] In a possible implementation, the data retransmission module includes:
[0019] An information acquisition submodule, used for acquiring bitmap information corresponding to the target response frame; the bitmap information includes first information; the first information is used for indicating that the transmission status of the corresponding target data segment is a transmission failure;
[0020] A data retransmission submodule is used to resend the target data segment corresponding to the first information to the data receiving device via Bluetooth based on the bitmap information.
[0021] In a possible implementation, the bitmap information also includes second information; the second information is used to indicate that the transmission status of the corresponding target data segment is successful.
[0022] In a possible implementation manner, the device further includes:
[0023] A target data acquisition module, used for acquiring the at least two target data segments arriving within a specified time before sending the aggregated data frame to the data receiving device via Bluetooth;
[0024] The aggregate data generation module is used to aggregate and encode the at least two target data segments to generate the aggregate data frame.
[0025] In a possible implementation manner, the device further includes:
[0026] A set acquisition module, used for acquiring a set of data to be sent before the at least two target data segments arrive within a specified time; the set of data to be sent includes data buffered by the data sending device in a data transmission cycle and to be sent via Bluetooth;
[0027] A first data determination module, configured to determine at least two first data segments based on the data set to be sent; the first data segment is a data segment of a specified data length in the data set to be sent;
[0028] The target data acquisition module comprises:
[0029] The target acquisition submodule is used to add corresponding verification identifiers to at least two of the first data segments respectively to obtain the at least two target data segments.
[0030] In a possible implementation, the verification identifier includes a timestamp identifier and a verification code identifier;
[0031] The target acquisition submodule includes:
[0032] A second data acquisition unit, configured to add the timestamp identifiers corresponding to the at least two first data segments, to obtain second data segments corresponding to the at least two first data segments;
[0033] The target data acquisition unit is used to add corresponding check code identifiers to at least two of the second data segments, so as to obtain the at least two target data segments corresponding to the at least two of the second data segments.
[0034] In a possible implementation, the aggregate data generating module includes:
[0035] A sorting submodule, used for sorting the at least two target data segments according to the timestamp identifiers corresponding to each of them, to obtain a target data set;
[0036] The encoding generation submodule is used to encode the target data set to generate the aggregated data frame.
[0037] On the other hand, an embodiment of the present application provides a data transmission device, which is used in a data receiving device, and includes:
[0038] A data receiving module, used to receive an aggregated data frame sent by a data sending device via Bluetooth; the aggregated data frame includes at least two target data segments;
[0039] A response generation module, used to generate a target response frame based on the aggregated data frame; the target response frame is used to feedback the transmission status of each of the at least two target data segments;
[0040] A response sending module, used to send the target response frame to the data sending device via Bluetooth;
[0041] The retransmission receiving module is used for receiving the target data segment retransmitted by the data sending device via Bluetooth in response to the target response frame feedback indicating that the target data segment has failed to be transmitted.
[0042] In a possible implementation, the response generating module includes:
[0043] A decoding submodule, used to decode the aggregated data frame to obtain the at least two target data segments in the aggregated data frame and their corresponding check identifiers;
[0044] A check submodule, configured to perform a check based on the check identifiers corresponding to the at least two target data segments, to obtain a check result corresponding to the at least two target data segments;
[0045] The response generation submodule is used to generate the target response frame based on the verification result.
[0046] On the other hand, an embodiment of the present application provides a terminal, which includes a processor and a memory; the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the data transmission method as described in the above aspects.
[0047] On the other hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer program is stored. The computer program is loaded and executed by a processor to implement the data transmission method as described in the above aspects.
[0048] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the data transmission method provided in various optional implementations of the above aspects.
[0049] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0050] In an embodiment of the present application, a data sending device combines multiple target data segments in the form of aggregated data frames via Bluetooth and sends them to a data receiving device, and receives a target response frame as feedback, thereby determining the transmission status corresponding to each target data segment in the aggregated data frame, and retransmitting the target data segment that failed to transmit, so that the data receiving device obtains complete data. Through the above method, multiple target data segments can be sent during a data transmission, and the transmission status corresponding to each target data segment can be fed back at the same time, avoiding the waste of waiting time caused by the transmission cycle each time a single data segment is transmitted, thereby improving the data throughput of Bluetooth transmission, and further improving the efficiency of Bluetooth data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;
[0052] Figure 2 is a flow chart of a data transmission method provided by another exemplary embodiment of the present application;
[0053] Figure 3 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;
[0054] Figure 4 yes Figure 3 A schematic diagram of generating an aggregated data frame involved in the illustrated embodiment;
[0055] Figure 5 yes Figure 3 A schematic diagram of generating a target response frame involved in the illustrated embodiment;
[0056] Figure 6 yes Figure 3 A framework diagram of a Bluetooth encoding and decoding method involved in the illustrated embodiment;
[0057] Figure 7 is a structural block diagram of a data transmission device provided by an exemplary embodiment of the present application;
[0058] Figure 8 is a structural block diagram of a data transmission device provided by an exemplary embodiment of the present application;
[0059] Fig. 9 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0061] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0062] In the field of communication, data transmission can be performed by establishing a physical connection between a data transmitter and a data receiver through Bluetooth, and data transmission can be performed based on the data transmission and reception mechanism of Bluetooth. In the related art, the encoding and decoding scheme for the transmitted data when data is transmitted through Bluetooth is encoded and decoded at the baseband layer of Bluetooth. During encoding, only a data frame with a short amount of data is transmitted each time by adding a check bit at the head and tail of the frame, and then the received single data frame is checked at the Bluetooth baseband layer of the data receiving end to determine whether the data frame needs to be retransmitted. In this way, Bluetooth transmission is performed in the time domain with a time slot as a cycle. After each data frame is sent, it will wait for the end of the transmission cycle before the next transmission. At present, the above-mentioned encoding and decoding method will cause a waste of this waiting time, thereby limiting the throughput of Bluetooth transmission, and using a small transmission bandwidth of Bluetooth when transmitting data, resulting in a slow transmission speed. At the same time, since the above-mentioned encoding and decoding method only adds a check at the end of the frame for the check, if any bit in the entire frame has a transmission error, the entire data frame will be retransmitted. This results in low data transmission efficiency and insufficient reliability of transmission in an interference environment.
[0063] In order to solve the above technical problems, the present application provides a data transmission method, which is applied to the process of data transmission of a terminal with Bluetooth function. The terminal for data transmission and reception can be a smart Bluetooth headset, a smart phone, a tablet computer, an e-book reader, a personal portable computer, a desktop computer, etc. The method provided in the embodiment of the present application can combine data by means of aggregated data frames and send them to the receiving end. In the application scenario of user big data transmission / reception, the transmission gap time between each short data frame can be saved, thereby improving the transmission throughput, and improving the transmission bandwidth while the occupied spectrum resources remain unchanged. In addition, the target data segment that failed to be transmitted in the aggregated data frame is determined based on the target response frame returned by the receiving end, so that the target data segment that failed to be transmitted can be resent to the receiving end. This segment-by-segment retransmission mechanism can avoid the jamming problem caused by packet loss during the transmission process in the scenario where there is interference in the user's electromagnetic environment. The reliability of Bluetooth connection and transmission is improved, and the anti-interference ability of Bluetooth data transmission is improved.
[0064] Figure 1A flowchart of a data transmission method provided by an exemplary embodiment of the present application is shown. The data transmission method can be executed by a data sending device, for example, the data sending device can be a terminal with a Bluetooth function, and the data transmission method includes the following steps:
[0065] Step 101: Send an aggregated data frame to a data receiving device via Bluetooth; the aggregated data frame includes at least two target data segments.
[0066] The target data segment may be audio data (Advanced Audio Distribution Profile, A2DP), file data (Object Push Profile, OPP), etc.
[0067] In a possible implementation, the data corresponding to the target data segment is data collected by a specified application.
[0068] For example, the data corresponding to the target data segment may be user data collected by the background of a specified application.
[0069] In a possible implementation, the data sending device sends the aggregated data frame to the data receiving device through a radio frequency link and an antenna, and the antenna in the data receiving device receives the data.
[0070] Step 102, receiving a target response frame fed back by the data receiving device via Bluetooth; the target response frame is used to feed back transmission conditions corresponding to at least two target data segments.
[0071] In a possible implementation, the transmission status is at least one of successful transmission or failed transmission of the corresponding target data segment.
[0072] Step 103: Based on the target response frame, the target data segment with transmission failure is retransmitted via Bluetooth.
[0073] In a possible implementation, when the data sending device determines the transmission status corresponding to each target data segment in the aggregated data frame, the aggregated data frame determined to have failed in transmission is resent to the data receiving device via Bluetooth.
[0074] To summarize, in the scheme shown in the embodiment of the present application, the data sending device combines multiple target data segments in the form of aggregated data frames via Bluetooth and sends them to the data receiving device, and receives feedback target response frames, thereby determining the transmission status corresponding to each target data segment in the aggregated data frame, and retransmitting the target data segment that failed to transmit, so that the data receiving device obtains complete data. Through the above method, multiple target data segments can be sent during one data transmission, and the transmission status corresponding to each target data segment can be fed back at the same time, avoiding the waste of waiting time caused by the transmission cycle each time a single data segment is transmitted, thereby improving the data throughput of Bluetooth transmission, and further improving the efficiency of Bluetooth data transmission.
[0075] Figure 2 A flowchart of a data transmission method provided by an exemplary embodiment of the present application is shown. The data transmission method can be executed by a data receiving device, for example, the data receiving device can be a terminal with a Bluetooth function, and the data transmission method includes the following steps:
[0076] Step 201: receiving an aggregated data frame sent by a data sending device via Bluetooth; the aggregated data frame includes at least two target data segments.
[0077] In an embodiment of the present application, a data receiving device obtains an aggregated data frame sent by a data sending device via Bluetooth, where the aggregated data frame includes at least two target data segments.
[0078] Step 202: Generate a target response frame based on the aggregated data frame; the target response frame is used to feedback the transmission status corresponding to at least two target data segments.
[0079] In a possible implementation manner, the data receiving device decodes and verifies the received aggregated data frame to generate a target response frame.
[0080] Step 203: Send the target response frame to the data sending device via Bluetooth.
[0081] In the embodiment of the present application, the data receiving device sends the target response frame generated after verifying the aggregated data frame to the data sending device through the radio frequency link and the antenna, and the target response frame is received by the antenna of the data sending device.
[0082] Step 204 : In response to the target response frame feedback indicating that there is a target data segment whose transmission has failed, receiving the target data segment retransmitted by the data sending device via Bluetooth.
[0083] To summarize, in the scheme shown in the embodiment of the present application, the data sending device combines multiple target data segments in the form of aggregated data frames via Bluetooth and sends them to the data receiving device, and receives feedback target response frames, thereby determining the transmission status corresponding to each target data segment in the aggregated data frame, and retransmitting the target data segment that failed to transmit, so that the data receiving device obtains complete data. Through the above method, multiple target data segments can be sent during one data transmission, and the transmission status corresponding to each target data segment can be fed back at the same time, avoiding the waste of waiting time caused by the transmission cycle each time a single data segment is transmitted, thereby improving the data throughput of Bluetooth transmission, and further improving the efficiency of Bluetooth data transmission.
[0084] Figure 3 A flowchart of a data transmission method provided by an exemplary embodiment of the present application is shown. The data transmission method can be interactively executed by a data sending device and a data receiving device. For example, the data sending device and the data receiving device can be terminals with Bluetooth function. The data transmission method includes the following steps:
[0085] Step 301: A data sending device obtains a data set to be sent.
[0086] In the embodiment of the present application, during the process of data transmission via Bluetooth, there is a data transmission cycle, that is, an aggregated data frame is transmitted once every data transmission cycle.
[0087] The data set to be sent includes data buffered by the data sending device in a data transmission cycle and to be sent via Bluetooth.
[0088] In a possible implementation, after the data sending device sends the aggregated data frame to the data receiving device, the data sending device sends the aggregated data frame to the data receiving device again after a data transmission period in the time domain.
[0089] In one data transmission cycle in the time domain, data that needs to be sent via Bluetooth and is received during this period of time can be obtained.
[0090] Exemplarily, if the data transmission cycle is a, Bluetooth data caching starts when the time domain is 0, and the time domain a is the time node for the first data transmission. At this time node, the data sending device obtains the data set A to be sent, which is the data that needs to be transmitted by Bluetooth received in the time period from 0 to a. At time node a, the data set A to be sent is processed and sent to the data receiving device. At the same time, the data sending device starts to obtain the next round of data set B to be sent at time node a. The data set B to be sent is the data that needs to be transmitted by Bluetooth received in the time period from a to 2a. At time node 2a, the data set B to be sent is processed and sent to the data receiving device. Similarly, the data sending device starts to obtain the next round of data set C to be sent at time node 2a, and so on.
[0091] In a possible implementation, the data set to be sent includes each acquired data segment to be sent.
[0092] The data lengths corresponding to the data segments to be sent may be different.
[0093] Exemplarily, the data cached in the data transmission cycle that needs to be sent via Bluetooth includes data segment a, data segment b, data segment c, and data segment d. The data length corresponding to data segment a is 5 bits, the data length corresponding to data segment b is 2 bits, the data length corresponding to data segment c is 3 bits, and the data length corresponding to data segment d is 6 bits. Then the data set to be sent is [data segment a, data segment b, data segment c, data segment d], where each data segment has its own corresponding data length.
[0094] Step 302: The data sending device determines at least two first data segments based on a data set to be sent.
[0095] In the embodiment of the present application, the data sending device determines at least two first data segments by dividing the data set to be sent.
[0096] The first data segment may be a data segment of a specified data length in a data set to be sent.
[0097] In a possible implementation, based on the number of data segments to be sent, the data set to be sent is equally divided to determine at least two first data segments.
[0098] Exemplarily, the data set to be sent [data segment a, data segment b, data segment c, data segment d] is equally divided. Since the data length corresponding to data segment a is 5 bits, the data length corresponding to data segment b is 2 bits, the data length corresponding to data segment c is 3 bits, and the data length corresponding to data segment d is 6 bits, and the number of data segments in the data set to be sent is 4, the total data length in the data set to be sent is divided by the number of data segments to be sent, and it is determined that the data set to be sent can be equally divided into 4 first data segments, and the data length corresponding to each first data segment is 4 bits.
[0099] In another possible implementation, a fixed data length is preset, and the data set to be sent is divided into first data segments of fixed data length.
[0100] Exemplarily, if the preset fixed data length is 2 bits, the data set to be sent [data segment a, data segment b, data segment c, data segment d] is divided. Since the data length corresponding to data segment a is 5 bits, the data length corresponding to data segment b is 2 bits, the data length corresponding to data segment c is 3 bits, and the data length corresponding to data segment d is 6 bits, the data to be sent can be divided into 8 first data segments with a data length of 2 bits each.
[0101] In another possible implementation, the data set to be sent is divided into a preset fixed number of first data segments.
[0102] Exemplarily, if the fixed number of pre-set first data segments is 4, the data set to be sent [data segment a, data segment b, data segment c, data segment d] is divided. Since the data length corresponding to data segment a is 5 bits, the data length corresponding to data segment b is 2 bits, the data length corresponding to data segment c is 3 bits, and the data length corresponding to data segment d is 6 bits, the data to be sent can be divided into 4 first data segments with a data length of 4 bits each.
[0103] Step 303: The data sending device adds corresponding check marks to at least two first data segments respectively to obtain at least two target data segments.
[0104] In the embodiment of the present application, the data sending device adds corresponding verification marks to the at least two first data segments obtained by segmentation, and obtains at least two target data segments arriving within a specified time. The specified time can be a data transmission cycle or a preset fixed time.
[0105] In a possible implementation manner, the verification identifier includes a timestamp identifier and a verification code identifier.
[0106] Among them, the data sending device adds corresponding timestamp identifiers to at least two first data segments to obtain second data segments corresponding to the at least two first data segments; then, adds corresponding check code identifiers to at least two second data segments to obtain at least two target data segments corresponding to the at least two second data segments.
[0107] The timestamp identifier may be a timestamp corresponding to the start of the first data segment in the data transmission cycle, or a timestamp of the first data segment in the data transmission cycle when it is cached. The timestamp identifier is used to indicate the order in which each first data segment cache becomes data to be transmitted.
[0108] After obtaining the timestamp identifiers corresponding to the respective first data segments, the timestamp identifiers corresponding to the respective first data segments are added to the corresponding first data segments, so as to generate second data segments corresponding to the timestamp identifiers added to the respective first data segments.
[0109] In a possible implementation manner, the check code identifier is a redundant check code added to the second data segment.
[0110] The redundant check code may be a parity check code, a Hamming check code, a cyclic redundancy check code, etc. The redundant check code may be added to the tail of the second data segment to generate a target data segment, and may be used to detect errors in the target data segment.
[0111] Step 304: The data sending device aggregates and encodes at least two target data segments to generate an aggregated data frame.
[0112] In the embodiment of the present application, the data sending device arranges and aggregates the target data segments, and encodes and generates corresponding aggregate data frames.
[0113] In a possible implementation, at least two target data segments are sorted according to their corresponding timestamp identifiers to obtain a target data set; the target data set is encoded to generate an aggregated data frame.
[0114] For example, Figure 4 Schematic diagram of generating an aggregate data frame according to an embodiment of the present application. The aggregate data frame generation process can be performed in a Bluetooth encoding module, such as Figure 4 As shown, the Bluetooth encoding module exists in the Bluetooth module of the data sending device. When the data is transmitted to the Bluetooth encoding module, the encoding module starts and begins encoding. The workflow of the Bluetooth encoding module includes the following steps:
[0115] S41, the data transmission period of each data transmission by the Bluetooth encoding module is time T, and the encoding module caches all the data to be sent within time T to form an aggregate data packet, which can be the data set to be sent in the above embodiment.
[0116] S42, the Bluetooth encoding module divides the cached data to be sent into N equal parts, and it can be calculated that the data length corresponding to each data segment is B. The encoding module inserts the corresponding timestamp after each data segment based on the corresponding incoming order of each data segment.
[0117] S43, the Bluetooth encoding module adds a redundant check code to the end of each data segment after the timestamp is inserted. The redundant check code can be any one of the parity check, Hamming check and cyclic redundancy check, and then completes the encoding of each data segment.
[0118] S44, the Bluetooth encoding module sorts the encoded data segments according to the time stamp sequence to form an aggregate data frame 401. The structure of the generated aggregate data frame 401 is as follows: Figure 4 shown.
[0119] S45, transmitting the generated aggregated data frame 401 through the Bluetooth sending module.
[0120] Step 305: The data sending device sends an aggregated data frame to the data receiving device.
[0121] In the embodiment of the present application, the data sending device sends the aggregated data frame to the data receiving device through the Bluetooth transmission module in the Bluetooth baseband.
[0122] Step 306: The data receiving device receives the aggregated data frame sent by the data sending device via Bluetooth.
[0123] The aggregated data frame may include at least two target data segments, and the target data segments may be data segments to be transmitted via Bluetooth within a specified time.
[0124] Exemplarily, the user data to be transmitted by the data sending device is collected by the application, sent to the Bluetooth protocol stack through the corresponding Bluetooth profile, and sent to the Bluetooth baseband and link control layer through the HCI (Host Controller Interface). The above embodiment can be encoded and decoded in the Bluetooth baseband and link control layer.
[0125] In a possible implementation manner, the data sending device may determine whether to use an aggregate data frame and the capacity of the aggregate data frame according to the type or source of the data to be transmitted.
[0126] For example, when based on the type or source of the data to be transmitted, it can be determined that the data to be transmitted has a high throughput and high reliability data transmission requirement, it can be determined to use an aggregated data frame for transmission. According to the degree of demand for high throughput and high reliability data transmission of the data to be transmitted, the capacity of the aggregated data frame can be determined, that is, when the demand is high, the larger the capacity of the aggregated data frame is, the larger the amount of data contained in the aggregated data frame is.
[0127] Step 307: The data receiving device generates a target response frame based on the aggregated data frame.
[0128] In the embodiment of the present application, after receiving the aggregated data frame, the data receiving device decodes and verifies the aggregated data frame in the Bluetooth decoding module to generate a corresponding target response frame.
[0129] The target response frame may be used to feedback the transmission status of at least two target data segments.
[0130] In one possible implementation, the aggregated data frame is decoded to obtain at least two target data segments in the aggregated data frame and their respective corresponding verification identifiers; verification is performed based on the verification identifiers corresponding to the at least two target data segments to obtain verification results corresponding to the at least two target data segments; and a target response frame is generated based on the verification results.
[0131] For example, Figure 5 Schematic diagram of target response frame generation involved in the embodiment of the present application. The target response frame generation process can be performed in the Bluetooth decoding module, such as Figure 5 As shown, the Bluetooth decoding module exists in the Bluetooth module of the data receiving device. When the Bluetooth receiving module of the data receiving device receives the aggregated data frame transmitted in the air, it demodulates the aggregated data frame and transmits it to the Bluetooth decoding module, and then the Bluetooth decoding module starts to work. The workflow of the Bluetooth decoding module includes the following steps:
[0132] S51, the data receiving device communicates with the data sending module through the Bluetooth receiving module and receives an aggregated data frame.
[0133] S52, the Bluetooth decoding module verifies each target data segment in the aggregated data frame in the order of timestamps.
[0134] The aggregate data frame 501 is verified in sequence according to the order of the timestamps to obtain the verification results of each target data segment. The verification result corresponding to the target data segment 1 is a correct verification, the verification result corresponding to the target data segment 2 is a verification error, and the verification result corresponding to the target data segment N is a correct verification. Based on the verification results corresponding to each target data segment, the bitmap information 502 corresponding to the aggregate data frame 501 can be determined, wherein the bitmap information 502 can include first information for indicating that the verification result is a verification error and second information for indicating that the verification result is a correct verification. The first information can be marked as 0, and the second information can be marked as 1.
[0135] S53, based on the verification results corresponding to all the target data segments in the aggregated data frame, calculate and obtain the bitmap information bitmap corresponding to the aggregated data frame.
[0136] The bitmap information bitmap can be an N-bit value, each bit corresponding to a target data segment in the aggregate data frame. If the check result of the j-th target data segment is a correct check, then the value of the j-th bit in the bitmap information bitmap is set to 1; if the check result of the k-th target data segment is a check error, then the value of the k-th bit in the bitmap information bitmap is set to 0.
[0137] S54, the Bluetooth decoding module transmits the calculated bitmap information bitmap as a target response frame to the Bluetooth sending module of the Bluetooth receiving device, which is transmitted as a target response frame.
[0138] S55, sending the generated target response frame to the Bluetooth sending device through the transmitting module.
[0139] Step 308: The data receiving device sends the target response frame to the data sending device via Bluetooth.
[0140] In the embodiment of the present application, the data receiving device sends the calculated and generated target response frame to the data sending device through the Bluetooth transmitting module, and the data sending device can receive the target response frame through the Bluetooth receiving module.
[0141] Step 309: The data sending device retransmits the target data segment whose transmission status is transmission failure via Bluetooth based on the target response frame.
[0142] In an embodiment of the present application, after receiving the target response frame, the data sending device parses the target response frame to obtain the transmission status corresponding to each target data segment. If there is a transmission failure among the transmission status corresponding to each target data segment obtained, the target data segment with failed transmission is obtained, the corresponding target data segment is re-obtained from the cached data, and the corresponding target data segment is re-sent to the data receiving device.
[0143] In a possible implementation manner, bitmap information corresponding to the target response frame is obtained; based on the bitmap information, the target data segment corresponding to the first information is resent to the data receiving device.
[0144] Among them, the bitmap information may include first information; the first information is used to indicate that the transmission status of the corresponding target data segment is a transmission failure; the bitmap information may also include second information; the second information can be used to indicate that the transmission status of the corresponding target data segment is a transmission success.
[0145] During the transmission of aggregated data frames, interference or other factors may cause transmission errors in some data segments of the aggregated data frames. By checking the bitmap information, the data with transmission errors can be determined without retransmitting the entire aggregated data frame, which greatly improves the efficiency of data transmission.
[0146] Exemplarily, after receiving the target response frame, the data sending device checks each flag bit that is 0 in the bitmap information bitmap, reads the data segments corresponding to each flag bit in the cache through the Bluetooth encoding module, and retransmits the data segments corresponding to each flag bit.
[0147] In one possible implementation, in response to the data sending device receiving a target response frame, each target data segment indicating a transmission failure in the target response frame is resent to the data receiving device, or each target data segment indicating a transmission failure in the target response frame is added with verification information and aggregated and encoded to generate a retransmitted data frame, which is then sent to the data receiving device.
[0148] In a possible implementation, in response to the data sending device receiving the target response frame, each target data segment indicating a transmission failure in the target response frame is sent to the data receiving device together with the data buffered in the next data transmission cycle.
[0149] Step 310: The data receiving device receives the target data segment retransmitted by the data sending device.
[0150] In a possible implementation, in response to a target response frame feeding back that there is a target data segment whose transmission has failed, the target data segment retransmitted by the data sending device via Bluetooth is received.
[0151] If the target response frame feedback shows that there is no target data segment that failed to be transmitted, the data sending device does not need to retransmit the data and can wait for the next data transmission cycle to continue transmitting the Bluetooth data buffered in the next cycle.
[0152] For example, Figure 6is a framework diagram of a Bluetooth encoding and decoding method involved in an embodiment of the present application, such as Figure 6 As shown, the Bluetooth encoding and decoding method involves a data sending device 610 and a data receiving device 620. The data sending device 610 and the data receiving device 620 both include Bluetooth data with transmission, a Bluetooth transmitting module and a Bluetooth receiving module. The data sending device 610 also includes a Bluetooth encoding module, and the data receiving device 620 also includes a Bluetooth decoding module. Since the above embodiment does not use the short-period high-frequency encoding transmission method in traditional Bluetooth, it aggregates and generates a large-capacity aggregated data frame for one-time transmission by caching data within a certain transmission period T. The data transmission efficiency and throughput are significantly improved. At the same time, since the data segments in the aggregated data frame are sorted by using timestamps, redundant check codes are added after each data segment, and a mechanism for retransmitting segment by segment through bitmap information bitmap is established, the data segments with transmission errors can be identified and the data can be retransmitted efficiently. The data transmission reliability and anti-interference ability are improved.
[0153] In a possible implementation manner, the data receiving device replaces the target data segment that failed to be transmitted in the aggregated data frame with the received retransmitted target data segment to obtain the target data frame.
[0154] To summarize, in the scheme shown in the embodiment of the present application, the data sending device combines multiple target data segments in the form of aggregated data frames via Bluetooth and sends them to the data receiving device, and receives feedback target response frames, thereby determining the transmission status corresponding to each target data segment in the aggregated data frame, and retransmitting the target data segment that failed to transmit, so that the data receiving device obtains complete data. Through the above method, multiple target data segments can be sent during one data transmission, and the transmission status corresponding to each target data segment can be fed back at the same time, avoiding the waste of waiting time caused by the transmission cycle each time a single data segment is transmitted, thereby improving the data throughput of Bluetooth transmission, and further improving the efficiency of Bluetooth data transmission.
[0155] Figure 7 The structural block diagram of a data transmission device provided by an exemplary embodiment of the present application is shown. The data transmission device is used in a data sending device, and the data transmission device includes:
[0156] The data sending module 710 is used to send an aggregated data frame to a data receiving device via Bluetooth; the aggregated data frame includes at least two target data segments;
[0157] The response receiving module 720 is used to receive a target response frame fed back by the data receiving device via Bluetooth; the target response frame is used to feed back the transmission status of each of the at least two target data segments;
[0158] The data retransmission module 730 is used to retransmit the target data segment whose transmission status is transmission failure through Bluetooth based on the target response frame.
[0159] In a possible implementation, the data retransmission module 730 includes:
[0160] An information acquisition submodule, used for acquiring bitmap information corresponding to the target response frame; the bitmap information includes first information; the first information is used for indicating that the transmission status of the corresponding target data segment is a transmission failure;
[0161] A data retransmission submodule is used to resend the target data segment corresponding to the first information to the data receiving device via Bluetooth based on the bitmap information.
[0162] In a possible implementation, the bitmap information also includes second information; the second information is used to indicate that the transmission status of the corresponding target data segment is successful.
[0163] In a possible implementation manner, the device further includes:
[0164] A target data acquisition module, used for acquiring the at least two target data segments arriving within a specified time before sending the aggregated data frame to the data receiving device via Bluetooth;
[0165] The aggregate data generation module is used to aggregate and encode the at least two target data segments to generate the aggregate data frame.
[0166] In a possible implementation manner, the device further includes:
[0167] A set acquisition module, used for acquiring a set of data to be sent before the at least two target data segments arrive within a specified time; the set of data to be sent includes data buffered by the data sending device in a data transmission cycle and to be sent via Bluetooth;
[0168] A first data determination module, configured to determine at least two first data segments based on the data set to be sent; the first data segment is a data segment of a specified data length in the data set to be sent;
[0169] The target data acquisition module comprises:
[0170] The target acquisition submodule is used to add corresponding verification identifiers to at least two of the first data segments respectively to obtain the at least two target data segments.
[0171] In a possible implementation, the verification identifier includes a timestamp identifier and a verification code identifier;
[0172] The target acquisition submodule includes:
[0173] A second data acquisition unit, configured to add the timestamp identifiers corresponding to the at least two first data segments, to obtain second data segments corresponding to the at least two first data segments;
[0174] The target data acquisition unit is used to add corresponding check code identifiers to at least two of the second data segments, so as to obtain the at least two target data segments corresponding to the at least two of the second data segments.
[0175] In a possible implementation, the aggregate data generating module includes:
[0176] A sorting submodule, used for sorting the at least two target data segments according to the timestamp identifiers corresponding to each of them, to obtain a target data set;
[0177] The encoding generation submodule is used to encode the target data set to generate the aggregated data frame.
[0178] To summarize, in the scheme shown in the embodiment of the present application, the data sending device combines multiple target data segments in the form of aggregated data frames via Bluetooth and sends them to the data receiving device, and receives feedback target response frames, thereby determining the transmission status corresponding to each target data segment in the aggregated data frame, and retransmitting the target data segment that failed to transmit, so that the data receiving device obtains complete data. Through the above method, multiple target data segments can be sent during one data transmission, and the transmission status corresponding to each target data segment can be fed back at the same time, avoiding the waste of waiting time caused by the transmission cycle each time a single data segment is transmitted, thereby improving the data throughput of Bluetooth transmission, and further improving the efficiency of Bluetooth data transmission.
[0179] Figure 8 FIG. 1 is a block diagram of a data transmission device provided by an exemplary embodiment of the present application. The data transmission device is used in a data receiving device, and the data transmission device includes:
[0180] The data receiving module 810 is used to receive an aggregated data frame sent by a data sending device via Bluetooth; the aggregated data frame includes at least two target data segments;
[0181] A response generation module 820 is used to generate a target response frame based on the aggregated data frame; the target response frame is used to feedback the transmission status of each of the at least two target data segments;
[0182] A response sending module 830, configured to send the target response frame to the data sending device;
[0183] The retransmission receiving module 840 is configured to receive the target data segment retransmitted by the data sending device in response to the target response frame feedback indicating that the target data segment has failed to be transmitted.
[0184] In a possible implementation, the response generation module 820 includes:
[0185] A decoding submodule, used to decode the aggregated data frame to obtain the at least two target data segments in the aggregated data frame and their corresponding check identifiers;
[0186] A check submodule, configured to perform a check based on the check identifiers corresponding to the at least two target data segments, to obtain a check result corresponding to the at least two target data segments;
[0187] The response generation submodule is used to generate the target response frame based on the verification result.
[0188] To summarize, in the scheme shown in the embodiment of the present application, the data sending device combines multiple target data segments in the form of aggregated data frames via Bluetooth and sends them to the data receiving device, and receives feedback target response frames, thereby determining the transmission status corresponding to each target data segment in the aggregated data frame, and retransmitting the target data segment that failed to transmit, so that the data receiving device obtains complete data. Through the above method, multiple target data segments can be sent during one data transmission, and the transmission status corresponding to each target data segment can be fed back at the same time, avoiding the waste of waiting time caused by the transmission cycle each time a single data segment is transmitted, thereby improving the data throughput of Bluetooth transmission, and further improving the efficiency of Bluetooth data transmission.
[0189] Fig. 9 9 is a block diagram of a computer device 900 according to an exemplary embodiment. The computer device 900 may be a terminal involved in the above embodiment, that is, a data sending device, a data receiving device, such as a smart phone, a tablet computer or a desktop computer. The computer device 900 may also be called a target user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0190] Typically, the computer device 900 includes a processor 901 and a memory 902 .
[0191] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0192] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction, which is used to be executed by the processor 901 to implement the method provided in the method embodiment of the present application.
[0193] In some embodiments, the computer device 900 may also optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907, a positioning assembly 908 and a power supply 909.
[0194] The radio frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0195] In some embodiments, the computer device 900 further includes one or more sensors 910 , including but not limited to: an acceleration sensor 911 , a gyroscope sensor 912 , a pressure sensor 913 , a fingerprint sensor 914 , an optical sensor 915 , and a proximity sensor 916 .
[0196] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the computer device 900, and the computer device 900 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.
[0197] An embodiment of the present application further provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the data transmission method described in the above embodiments.
[0198] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the data transmission method provided in various optional implementations of the above aspects.
[0199] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0200] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: The method is performed by a data sending device, and the method includes: Acquire a data set to be sent; the data set to be sent includes data cached by the data sending device in a data transmission cycle and to be sent via Bluetooth; Dividing the data set to be sent into at least two first data segments of a preset fixed number; Adding respective corresponding timestamp identifiers to at least two of the first data segments to obtain respective second data segments corresponding to the at least two first data segments; the timestamp identifiers are used to indicate the order in which the first data segments are cached as data to be transmitted; Adding corresponding check code identifiers to at least two of the second data segments, respectively, to obtain at least two target data segments; Sort the at least two target data segments according to the timestamp identifiers corresponding to each of them to obtain a target data set; Aggregate-encode the target data set to generate an aggregate data frame; Sending the aggregated data frame to a data receiving device via Bluetooth; the aggregated data frame includes the at least two target data segments; receiving a target response frame fed back by the data receiving device through the Bluetooth mode; the target response frame is used to feed back the transmission status of the at least two target data segments; the target response frame is verified by the data receiving device based on the verification identifiers corresponding to the at least two target data segments, in the order of the timestamp identifiers, to obtain the verification results corresponding to the at least two target data segments, and is generated based on the verification results; Based on the target response frame, the target data segment whose transmission condition is transmission failure is retransmitted through the Bluetooth mode.
2. The method according to claim 1, characterized in that The retransmitting the target data segment whose transmission condition is transmission failure by Bluetooth based on the target response frame includes: Obtaining bitmap information corresponding to the target response frame; the bitmap information includes first information; the first information is used to indicate that the transmission status of the corresponding target data segment is a transmission failure; Based on the bitmap information, the target data segment corresponding to the first information is resent to the data receiving device via Bluetooth.
3. The method according to claim 2, characterized in that The bitmap information also includes second information; the second information is used to indicate that the transmission status of the corresponding target data segment is successful.
4. A data transmission method, characterized in that: The method is performed by a data receiving device, and includes: Receiving an aggregated data frame sent by a data sending device via Bluetooth; the aggregated data frame includes at least two target data segments; the aggregated data frame is obtained by the data sending device obtaining a data set to be sent, dividing the data set to be sent into at least two first data segments of a preset fixed number, adding respective corresponding timestamp identifiers to at least two first data segments to obtain respective corresponding second data segments of at least two first data segments, adding respective corresponding check code identifiers to at least two second data segments to obtain at least two target data segments, sorting the at least two target data segments according to the respective corresponding timestamp identifiers to obtain a target data set, and performing aggregate coding on the target data set; the timestamp identifier is used to indicate the order in which each of the first data segments is cached as data to be transmitted; the data set to be sent includes data cached by the data sending device in a data transmission cycle and to be sent via Bluetooth; Decoding the aggregated data frame to obtain the at least two target data segments in the aggregated data frame, timestamp identifiers corresponding to the at least two target data segments, and check identifiers corresponding to the at least two target data segments; Based on the verification identifiers corresponding to the at least two target data segments, verification is performed in sequence according to the order of the timestamp identifiers to obtain verification results corresponding to the at least two target data segments; Based on the verification result, a target response frame is generated; the target response frame is used to feedback the transmission status corresponding to each of the at least two target data segments; Sending the target response frame to the data sending device via Bluetooth; In response to the target response frame feeding back that there is the target data segment with transmission failure, receiving the target data segment retransmitted by the data sending device via Bluetooth.
5. A data transmission device, characterized in that: The device is used in a data sending device, and comprises: A set acquisition module, used to acquire a data set to be sent; the data set to be sent includes data cached by the data sending device in a data transmission cycle and to be sent via Bluetooth; A first data determination module, configured to divide the data set to be sent into at least two first data segments of a preset fixed number; A target acquisition submodule, used to add corresponding verification identifiers to at least two of the first data segments respectively, to obtain at least two target data segments; An aggregate data generation module, configured to aggregate and encode the at least two target data segments to generate an aggregate data frame; A data sending module, used for sending the aggregated data frame to a data receiving device via Bluetooth; the aggregated data frame includes the at least two target data segments; A response receiving module, used for receiving a target response frame fed back by the data receiving device via the Bluetooth mode; the target response frame is used for feeding back the transmission status corresponding to each of the at least two target data segments; A data retransmission module, configured to retransmit the target data segment whose transmission condition is transmission failure through the Bluetooth mode based on the target response frame; The verification mark includes a timestamp mark and a verification code mark; the target acquisition submodule includes: A second data acquisition unit, configured to add the timestamp identifiers corresponding to the at least two first data segments, to obtain second data segments corresponding to the at least two first data segments; a target data acquisition unit, configured to add respective corresponding check code identifiers to at least two of the second data segments, so as to obtain the at least two target data segments; The aggregate data generation module includes: A sorting submodule, used for sorting the at least two target data segments according to the timestamp identifiers corresponding to each of them, to obtain a target data set; The encoding generation submodule is used to encode the target data set to generate the aggregated data frame.
6. A data transmission device, characterized in that: The device is used in a data receiving device, and comprises: A data receiving module, used for receiving an aggregated data frame sent by a data sending device via Bluetooth; the aggregated data frame includes at least two target data segments; the aggregated data frame is obtained by the data sending device obtaining a data set to be sent, dividing the data set to be sent into at least two first data segments of a preset fixed number, adding respective corresponding timestamp identifiers to at least two first data segments to obtain respective corresponding second data segments of at least two first data segments, adding respective corresponding check code identifiers to at least two second data segments to obtain at least two target data segments, sorting the at least two target data segments according to the respective corresponding timestamp identifiers to obtain a target data set, and performing aggregate coding on the target data set; the timestamp identifier is used to indicate the order in which each of the first data segments is cached as data to be transmitted; the data set to be sent includes data cached by the data sending device in a data transmission cycle and to be sent via Bluetooth; A response generation module, used to generate a target response frame based on the aggregated data frame; the target response frame is used to feedback the transmission status of each of the at least two target data segments; A response sending module, used to send the target response frame to the data sending device via Bluetooth; a retransmission receiving module, configured to receive the target data segment retransmitted by the data sending device via Bluetooth in response to the target response frame feedback that there is a target data segment with transmission failure; Wherein, the response generation module includes: a decoding submodule, configured to decode the aggregated data frame to obtain the at least two target data segments in the aggregated data frame, timestamp identifiers corresponding to the at least two target data segments, and check identifiers corresponding to the at least two target data segments; A check submodule, configured to perform checks in sequence according to the order of the timestamp identifiers based on the check identifiers corresponding to the at least two target data segments, to obtain check results corresponding to the at least two target data segments; The response generation submodule is used to generate the target response frame based on the verification result.
7. A terminal, characterized in that: The terminal includes a processor and a memory; the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the data transmission method as described in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the computer program is loaded and executed by a processor to implement the data transmission method according to any one of claims 1 to 4.
9. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; a processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the data transmission method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method for multi-packet communication between two devices
CN112737739A
Wireless communication device and wireless communication method
US20180084406A1