Data transmission method and apparatus, and communication device
Patent Information
- Application Number
- CN202280096921.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2025-02-18
AI Technical Summary
In Bluetooth transmission, the size of GATT PDU is limited, so the SDU from the application layer cannot be transmitted directly because its size does not match the GATT PDU.
Divide the SDU into one or more segments, and encapsulate each segment into a GATT PDU for transmission through the Bluetooth layer. The second node receives it and reassembles it into the original SDU.
Effective transmission of SDU is achieved. By matching the segmentation and GATT PDU sizes, the problem of transmission mismatch is solved and the data can be transmitted smoothly.
Smart Images

Figure CN119487898A_ABST
Abstract
Description
Data transmission method and device, and communication equipment Technical Field
[0001] The embodiments of the present application relate to the field of mobile communication technology, and specifically to a data transmission method and apparatus, and communication equipment. Background Art
[0002] When transmitting data over Bluetooth, the size of the Generic Attribute (GATT) Package Data Unit (PDU) supported by the Bluetooth layer is limited. In other words, a GATT PDU can only transmit data of a specific size. However, the size of the Service Data Unit (SDU) from the application layer often does not match the size of the GATT PDU, making it impossible to transmit the SDU over Bluetooth.
[0003] Summary of the Invention
[0004] Embodiments of the present application provide a data transmission method and apparatus, a communication device, a chip, a computer-readable storage medium, a computer program product, and a computer program.
[0005] The data transmission method provided in the embodiment of the present application includes:
[0006] The first node divides the SDU into one or more segments;
[0007] The first node sends the one or more segments to a second node.
[0008] The data transmission method provided in the embodiment of the present application includes:
[0009] The second node receives one or more segments sent by the first node;
[0010] The second node reassembles the one or more segments into SDUs.
[0011] The data transmission device provided in an embodiment of the present application is applied to a first node, and the device includes:
[0012] a processing unit, configured to segment the SDU into one or more segments;
[0013] A communication unit is configured to send the one or more segments to the second node.
[0014] The data transmission device provided in an embodiment of the present application is applied to a second node, and the device includes:
[0015] a communication unit, configured to receive one or more segments sent by the first node;
[0016] A processing unit is configured to reassemble the one or more segments into an SDU.
[0017] The communication device provided in an embodiment of the present application includes a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the above-mentioned data transmission method.
[0018] The chip provided in the embodiment of the present application is used to implement the above-mentioned data transmission method.
[0019] Specifically, the chip includes: a processor, which is used to call and run a computer program from a memory, so that a device equipped with the chip executes the above-mentioned data transmission method.
[0020] The computer-readable storage medium provided in an embodiment of the present application is used to store a computer program, which enables a computer to execute the above-mentioned data transmission method.
[0021] The computer program product provided in the embodiment of the present application includes computer program instructions, which enable a computer to execute the above-mentioned data transmission method.
[0022] The computer program provided in the embodiment of the present application, when executed on a computer, enables the computer to execute the above-mentioned data transmission method.
[0023] Through the above technical solution, the first node divides the SDU into one or more segments, and the first node sends the one or more segments to the second node. Since the SDU is divided into one or more segments, the size of the segment can be matched with the size of the GATT PDU, which provides an effective solution for transmitting each segment of the SDU based on Bluetooth. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0025] Figure 1 is a schematic diagram of the framework of a BLE protocol stack;
[0026] Figure 2 is a schematic diagram of a client / server architecture;
[0027] FIG3 is a flow chart of a data transmission method provided in an embodiment of the present application;
[0028] FIG4 is a schematic diagram of a BMTP SDU provided by an embodiment of the present application being decomposed into multiple BMTP segments;
[0029] FIG5 is a schematic diagram of a segmented format provided in an embodiment of the present application;
[0030] FIG6 is a first schematic diagram of a maintenance receiving window provided in an embodiment of the present application;
[0031] FIG7 is a second schematic diagram of a maintenance receiving window provided in an embodiment of the present application;
[0032] FIG8 is a first schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;
[0033] FIG9 is a second schematic diagram of the structure of the data transmission device provided in an embodiment of the present application;
[0034] FIG10 is a schematic structural diagram of a communication device provided in an embodiment of the present application;
[0035] FIG11 is a schematic structural diagram of a chip according to an embodiment of the present application;
[0036] FIG12 is a schematic block diagram of a communication system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will describe the technical solutions in the embodiments of this application in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0038] To facilitate understanding of the technical solutions of the embodiments of the present application, the relevant technologies of the embodiments of the present application are described below. The following relevant technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all fall within the protection scope of the embodiments of the present application.
[0039] Bluetooth technology is a radio technology that supports short-range communication between devices. Bluetooth technology types include Classic Bluetooth (BT), Bluetooth Low Energy (BLE), and Dual-Mode Bluetooth. Classic Bluetooth only supports the functions of Classic Bluetooth and not BLE; BLE only supports BLE and not Classic Bluetooth; and Dual-Mode Bluetooth supports both BLE and Classic Bluetooth. Compared to Classic Bluetooth, BLE is very different, or in other words, they are two different technologies.
[0040] The Bluetooth protocol specifies two layers of protocols: the Bluetooth Core protocol and the Bluetooth Application layer protocol. The Bluetooth Core protocol focuses on describing and specifying the core Bluetooth technology; the Bluetooth Application layer protocol builds on the Bluetooth Core protocol and defines various strategies based on specific application requirements.
[0041] For Bluetooth Low Energy, the framework of its BLE protocol stack is shown in Figure 1. The BLE protocol stack includes the Link Layer (LL), Host Controller Interface (HCI), Generic Access Profile (GAP), Logical Link Control and Adaptation Protocol (L2CAP), Security Manager Protocol (SMP), Attribute Protocol (ATT), and Generic Attribute (GATT). Below the BLE protocol stack is the wireless layer, which includes the physical (PHY) layer; above the BLE protocol stack is the application layer.
[0042] For Bluetooth Low Energy, a client / server (C / S) architecture is used for data interaction. As shown in Figure 2, when a client wants to access certain data, it sends a request (also known as a command or PDU) to the server, and the server returns a response (also known as a command or PDU) to the client. This data interaction architecture is called the C / S architecture.
[0043] The ATT layer's ATT commands, also known as ATT PDUs, include the following four types of ATT commands: read, write, notify, and indicate. These commands can be categorized into two types: If a command requires a response, it will be followed by a request; if a command only requires an ACK and no response, it will not be followed by a request.
[0044] The GATT layer defines services and characteristics. In the client / server architecture, the server provides services, which can be understood as data, and data as attributes. Services and characteristics are the manifestations of data, or in other words, data is ultimately converted into services and characteristics. In the Bluetooth specification, each specific application is composed of multiple services, and each service is composed of multiple characteristics. It should be noted that a characteristic corresponds to one or more attributes. For example, a characteristic contains the following three types of attributes: characteristic declaration entries, characteristic value entries, and characteristic descriptor entries.
[0045] Currently, when transmitting data over Bluetooth, the size of the GATT PDU supported by the Bluetooth layer (specifically, the GATT layer in the BLE protocol stack in Figure 1) is limited. That is, the GATT PDU can only transmit data of a specific size. However, the size of the SDU from the application layer often does not match the size of the GATT PDU, which makes it impossible to transmit the SDU directly over Bluetooth. To this end, the following technical solutions are proposed in the embodiments of the present application.
[0046] To facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The above related technologies can be combined arbitrarily with the technical solutions of the embodiments of the present application as optional solutions, and all of them fall within the scope of protection of the embodiments of the present application. The embodiments of the present application include at least part of the following contents.
[0047] It should be noted that the "first node" in the embodiments of the present application can be understood as a "client," and the "second node" can be understood as a "server." Of course, the "first node" can also be understood as a "server," and the "second node" can also be understood as a "client." Both the first node and the second node can be Bluetooth terminals.
[0048] FIG3 is a flow chart of a data transmission method provided in an embodiment of the present application. As shown in FIG3 , the data transmission method includes the following steps:
[0049] Step 301: A first node divides an SDU into one or more segments; the first node sends the one or more segments to a second node.
[0050] In an embodiment of the present application, the first node has at least a first protocol layer and a second protocol layer, the first protocol layer is located above the second protocol layer, and the second protocol layer is located above the Bluetooth layer; the second protocol layer of the first node divides the SDU from the first protocol layer into one or more segments.
[0051] In some optional embodiments, the Bluetooth layer is a GATT layer. The first protocol layer is an application layer, which may also be called an Application Transmission Protocol (AMTP) layer. The second protocol layer is a protocol layer between the Bluetooth layer and the first protocol layer. The second protocol layer may be, but is not limited to, a BLE Transmission Protocol (BMTP) layer. The technical solution of the embodiments of the present application does not limit the name of the second protocol layer.
[0052] In some optional implementations, the SDU from the first protocol layer may also be referred to as an application layer message, an AMTP PDU, or a BMTP SDU. After receiving the SDU from the first protocol layer, the second protocol layer divides the SDU into one or more segments, which may also be referred to as BMTP segments. It should be noted that the name of the segment may be determined based on the name of the second protocol layer, and the technical solutions of the embodiments of the present application do not limit the name of the segment.
[0053] In some optional embodiments, the first node sequentially assigns a sequence number to each of the one or more segments, such that each of the one or more segments corresponds to a sequence number. For example, the first node segments an SDU into segments 1, 2, and 3, and assigns sequence numbers 0, 1, and 2 to these three segments, respectively. Here, the second protocol layer of the first node sequentially assigns a sequence number to each of the one or more segments.
[0054] In some optional implementations, the second protocol layer of the first node divides the SDU into one or more segments, passes the one or more segments to the Bluetooth layer, and encapsulates the one or more segments into corresponding one or more GATT PDUs and sends them to the second node through the Bluetooth layer.
[0055] Referring to Figure 4, the Bluetooth layer is the GATT layer in the BLE protocol stack shown in Figure 1. Based on the infrastructure shown in Figure 1, the BMTP layer is introduced between the application layer and the GATT layer, and the BMTP layer is used to achieve adaptation between the BMTP SDU of the application layer and the GATT PDU of the GATT layer. Specifically, when the BMTP SDU (i.e., the application layer message) of the application layer needs to be transmitted by the Bluetooth layer (i.e., the GATT layer), since the size of the BMTP SDU of the application layer does not match the size of the GATT PDU of the Bluetooth layer, it is necessary to decompose the BMTP SDU of the application layer into one or more BMTP segments so that the size of the BMTP segment matches the size of the GATT PDU of the Bluetooth layer. In this way, the BMTP segments can be sent through the GATT PDU of the Bluetooth layer. Specifically, the application layer (i.e., the AMTP layer) passes the BMTP SDU (i.e., the application layer message) to the BMTP layer. The BMTP layer divides the BMTP SDU into multiple BMTP segments and passes the multiple BMTP segments to the GATT layer. The GATT layer encapsulates each BMTP segment into a GATT PDU. The GATT PDU includes a GATT header and a GATT payload, and the content of the GATT payload corresponds to the BMTP segment.
[0056] Here, the BMTP SDU from the application layer is split by the BMTP layer into multiple sequential and non-overlapping BMTP segments, each of which is sent as a single GATT PDU. Each BMTP segment is assigned a different sequence number and is sent in sequence.
[0057] In the embodiment of the present application, the segment has a specific format, which can be called a BMTP frame format, and the format is described below.
[0058] In some optional embodiments, the segment includes a header and a payload. Here, the segment can be referred to as a BMTP segment, and correspondingly, the header can be referred to as a BMTP header, and the payload can be referred to as a BMTP payload. The header includes at least one of the following:
[0059] First information, where the first information is used to indicate a priority level of the segment or a priority level of an SDU corresponding to the segment;
[0060] second information, where the second information is used to indicate whether the segment is a handshake message;
[0061] third information, where the third information is used to indicate whether the segment is a starting segment of an SDU;
[0062] Fourth information, the fourth information is used to indicate whether the segment is the end segment of an SDU;
[0063] fifth information, the fifth information being used to indicate whether the segment is a response message;
[0064] sixth information, the sixth information being used to indicate a sequence number of the segment;
[0065] Seventh information, the seventh information is used to indicate the size of the SDU transmitted after the handshake message exchange;
[0066] Eighth information, where the eighth information is used to indicate a sequence number of the segment received by the first node;
[0067] Ninth information, the ninth information is used to indicate the protocol version number;
[0068] Tenth information, the tenth information is used to indicate the size of the segment transmitted after the handshake message exchange;
[0069] The eleventh information is used to indicate the size of the receiving window of the first node.
[0070] It should be noted that the description of "Xth information" in the above description can also be replaced by "Xth field", and X can be one, two, three,..., ten, or eleven.
[0071] In some optional embodiments, the first information occupies 1 bit. The first information is set to a first value (such as 1), indicating a first priority level; the first information is set to a second value (such as 0), indicating a second priority level, and the first priority level is higher than the second priority level. Here, the first priority level may also be referred to as a high priority level, and the second priority level may also be referred to as a low priority level. As an example: for an emergency message, the first information in the header of its corresponding segment is set to a first value (such as 1); for an ordinary message, the first information in the header of its corresponding segment is set to a second value (such as 0). For a segment whose first information is set to a first value (such as 1), the first node needs to end the currently sent segment and give priority to sending this segment.
[0072] In some optional implementations, the second information occupies 1 bit. The second information is set to a first value (such as 1) to indicate that it is a handshake message; the first information is set to a second value (such as 0) to indicate that it is not a handshake message.
[0073] In some optional implementations, the third information occupies 1 bit. The third information is set to a first value (e.g., 1), indicating that it is the start segment of an SDU and also marks the beginning of a new SDU transmission; the first information is set to a second value (e.g., 0), indicating that it is not the start segment of an SDU.
[0074] In some optional implementations, the fourth information occupies 1 bit. The fourth information is set to a first value (such as 1) to indicate that it is the end segment of an SDU; the fourth information is set to a second value (such as 0) to indicate that it is not the end segment of an SDU.
[0075] In some optional implementations, the fifth information occupies 1 bit. Setting the fifth information to a first value (e.g., 1) indicates a response message; setting the fifth information to a second value (e.g., 0) indicates a non-response message. It should be noted that segmented transmission is reliable transmission, and each segment requires a response message.
[0076] In some optional implementations, the sixth information occupies N1 bits, where N1 is, for example, 8. The sixth information is used to indicate the sequence number (or sequence index) of the segment. Here, the sender of the segment increments the sequence number by 1 each time it sends a segment, until the sequence number reaches a maximum (e.g., 255), then wraps around to 0 and starts incrementing again. The first segment has a sequence number of 0.
[0077] In some optional implementations, the seventh information occupies N2 bits, where N2 is, for example, 16. The seventh information is used to indicate the size of the SDU transmitted after the handshake message exchange. For example, the maximum size of the SDU is 64KB.
[0078] In some optional implementations, the eighth information occupies N3 bits, where N3 is, for example, 8. The eighth information is used to indicate a sequence number (or sequence index (SequenceIndex)) of a segment received by the first node.
[0079] In some optional implementations, the ninth information occupies N4 bits, where N4 is, for example, 8. The ninth information is used to indicate a protocol version number that needs to be negotiated.
[0080] In some optional implementations, the tenth information occupies N5 bits, where N5 is, for example, 8. The tenth information is used to indicate the size of the segment transmitted after the handshake message exchange.
[0081] In some optional implementations, the eleventh information occupies N6 bits, where N6 is, for example, 8. The eleventh information is used to indicate the size of the receiving window of the first node. Here, the size of the receiving window may be in units of a segment size of the BMTP layer.
[0082] In some optional embodiments, if the first node has a segment or SDU of the first priority level to be sent, the first node abandons the transmission of the segment or SDU of the second priority level, and / or abandons the management of the segment or SDU of the second priority level that has been sent; the first priority level is higher than the second priority level.
[0083] In some optional implementations, when the header includes the second information and the second information indicates that the segment is a handshake message, the header includes at least one of the ninth information, the tenth information, and the eleventh information.
[0084] Here, during the handshake message interaction process, it is necessary to negotiate at least one of the protocol version number, the size of the transmitted segment, and the size of the receiving window of the first node. Therefore, when the header includes second information and the second information indicates that the segment is a handshake message, the header includes at least one of the ninth information, the tenth information, and the eleventh information.
[0085] In some optional embodiments, the header includes the seventh information when the header includes the sixth information and the sixth information indicates that the sequence number of the segment is the initial sequence number and / or the header includes the third information and the third information indicates that the segment is the starting segment of an SDU.
[0086] Here, for the starting segment of an SDU, the sixth information in the header of the segment indicates that the sequence number of the segment is the initial sequence number (such as 0) and / or the third information included in the header of the segment indicates that the segment is the starting segment of an SDU. The segment needs to indicate the size of the entire SDU to be transmitted, so the header of the segment needs to include the seventh information.
[0087] In some optional implementations, when the header includes the fifth information and the fifth information indicates that the segment is a response message, the header includes the eighth information.
[0088] In some optional embodiments, when the header includes the fourth information and the fourth information indicates that the segment is not the end segment of an SDU, the first node determines that the size of the payload of the segment is equal to the size of the segments supported by the first node minus the size of the header of the segment. In this way, the first node can determine the size of the payload of other segments in an SDU except the end segment in this way. Further, the first node can accumulate the total size of the payload of all segments before the end segment in an SDU. Correspondingly, when the header includes the fourth information and the fourth information indicates that the segment is not the end segment of an SDU, the second node determines that the size of the payload of the segment is equal to the size of the segments supported by the first node minus the size of the header of the segment. In this way, the second node can determine the size of the payload of other segments in an SDU except the end segment in this way. Further, the second node can accumulate the total size of the payload of all segments before the end segment in an SDU.
[0089] In some optional embodiments, when the header includes the fourth information and the fourth information indicates that the segment is the end segment of an SDU, the first node determines that the size of the payload of the segment is equal to the size of the SDU minus the size of the data sent by the first node. Here, the size of the data sent by the first node can be the total size of the payloads of all segments before the end segment in an SDU accumulated by the first node. In this way, the first node can determine the size of the payload of the end segment in an SDU. Correspondingly, when the header includes the fourth information and the fourth information indicates that the segment is the end segment of an SDU, the second node determines that the size of the payload of the segment is equal to the size of the SDU minus the size of the data received by the second node. In this way, the second node can determine the size of the payload of the end segment in an SDU.
[0090] It should be noted that the positions of the above-mentioned information in the packet header of the embodiment of the present application are not limited, and there can be various implementation methods. As an example: Figure 5 shows a segmented format, in which the payload is preceded by a header, and the header includes the following information: P, H, B, E, A, SequenceIndex, Length, AckIndex, Version, SegmentSize, WindowSize, where P corresponds to the first information in the above scheme, H corresponds to the second information in the above scheme, B corresponds to the third information in the above scheme, E corresponds to the fourth information in the above scheme, A corresponds to the fifth information in the above scheme, SequenceIndex corresponds to the sixth information in the above scheme, Length corresponds to the seventh information in the above scheme, AckIndex corresponds to the eighth information in the above scheme, Version corresponds to the ninth information in the above scheme, SegmentSize corresponds to the tenth information in the above scheme, and WindowSize corresponds to the eleventh information in the above scheme.
[0091] In the above scheme, a segment can be understood as a message, which can be a handshake message (that is, the second information in the header of the segment indicates that it is a handshake message), or a data message (that is, the second information in the header of the segment indicates that it is not a handshake message), or a response message (that is, the fifth information in the header of the segment indicates that it is a response message), or a data message + response message (that is, the second information in the header of the segment indicates that it is a response message). The interaction between the first node and the second node must first complete the handshake message interaction (that is, the first node sends a handshake request message to the second node, and the second node returns a handshake response message to the first node). After completing the handshake message interaction, the first node can interact with the second node via data messages and / or response messages. During the interaction between the first node and the second node, the first node uses a write command that does not require a response message to send a message to the server, and the second node uses a notification command to send a message to the first node.
[0092] Here, in the service of the second protocol layer (such as the BMTP layer), at least two characteristics are introduced, which can be recorded as C1 characteristic and C2 characteristic, wherein C1 characteristic is the characteristic for the first node to send a write command without a response message to the second node, and C2 characteristic is the characteristic for the second node to send a notification command to the first node. The first node can send a message by calling the write command without a response message in the same way as accessing the C1 characteristic. The second node can send a message by calling the notification command in the same way as accessing the C2 characteristic. As an example: the write command without a response message can be called a Write without Response command, and the notification command can be called a Notify command.
[0093] Here, the first node and the second node act as a pair of client and server, interacting on a BLE channel. Interactions on different BLE channels need to be kept isolated, that is, no BMTP parameters are shared.
[0094] Based on the above description, it can be understood that the first node sends the one or more segments to the second node using a write command that does not require a response message. Optionally, the first node sends the segments subject to the following restriction: the first node sends the segments of the next SDU after completing the transmission of the segments of the first SDU. In other words, the first node only sends one SDU at a time during data transmission. If other SDUs are being processed while the first SDU is being transmitted, the first node can only send the next SDU after the current SDU is completely transmitted.
[0095] Step 302: The second node receives one or more segments sent by the first node; the second node reassembles the one or more segments into SDUs.
[0096] In an embodiment of the present application, the second node has at least a second protocol layer, the second protocol layer being located above the Bluetooth layer; the second protocol layer of the second node reassembles the one or more segments into SDUs. Here, the second node reassembles the one or more segments into SDUs in a received order.
[0097] In some optional embodiments, if the second node receives a segment or SDU of a first priority level, the second node abandons receiving the segment or SDU of a second priority level, and / or abandons managing the received segment or SDU of a second priority level; the first priority level is higher than the second priority level.
[0098] In some optional embodiments, the second node has at least a first protocol layer and a second protocol layer, the first protocol layer is located above the second protocol layer, and the second protocol layer is located above the Bluetooth layer; the second protocol layer of the second node verifies at least one of the following: whether the size of the received segment is equal to the size of the segment indicated by the tenth information in the starting segment; whether the starting segment corresponding to the ending segment is received; whether the size of the reassembled SDU is equal to the size of the SDU indicated by the seventh information in the starting segment; if the verification result is yes, the second protocol layer of the second node passes the reassembled SDU to the first protocol layer; if the verification result is no, the second node ends the BMTP transmission.
[0099] Here, the first protocol layer on the second node side is a protocol layer equivalent to the first protocol layer on the first node side. Similarly, the second protocol layer on the second node side is a protocol layer equivalent to the second protocol layer on the first node side. The first protocol layer and the second protocol layer on the second node side can be understood with reference to the aforementioned description of the first protocol layer and the second protocol layer on the first node side.
[0100] In the above scheme, after the second protocol layer of the second node receives all the segments of an SDU, the second node will reassemble these segments in the order of reception and submit the reassembled SDU to the first protocol layer. Here, the second protocol layer of the second node can use the following methods to determine whether all the segments of an SDU have been received: whether the size of the received segment is equal to the size of the segment indicated by the tenth information in the starting segment; whether the starting segment corresponding to the ending segment has been received; whether the size of the reassembled SDU is equal to the size of the SDU indicated by the seventh information in the starting segment; if the verification results are all yes, it is determined that all the segments of an SDU have been received; if there is at least one no in the verification results, it is determined that all the segments of an SDU have not been received. In this case, the second node ends the BMTP transmission. Here, a handshake message exchange is required before a BMTP transmission begins. If the current BMTP transmission ends, a handshake message exchange is required before the next BMTP transmission begins.
[0101] In an embodiment of the present application, the second protocol layer (such as the BMTP layer) adopts a reliable transmission method. Therefore, the message sender needs to dynamically adjust the rate at which it sends messages according to the receiver's message receiving capability (i.e., the size of the receiving window). In other words, the message flow control can be performed through the receiving window.
[0102] Specifically, the first node and the second node respectively maintain a local receiving window, the receiving window of the first node is a first receiving window, and the first receiving window is used to store the sequence numbers of the segments received by the first node, and the receiving window of the second node is a second receiving window, and the second receiving window is used to store the sequence numbers of the segments received by the second node.
[0103] For the first node, the first node maintains the first receiving window in the following manner:
[0104] The first node receives the segment sent by the second node, and updates the first receiving window based on the sequence number of the received segment; and / or,
[0105] The first node sends a response message to the second node, and deletes all or some of the sequence numbers in the first receive window, where the response message indicates the sequence numbers of the segments received by the first node. Optionally, the partial sequence numbers are the sequence numbers indicated by the response message, or the partial sequence numbers include the sequence number indicated by the response message and sequence numbers preceding the sequence number.
[0106] Here, the first node receives the segment sent by the second node and updates the first receiving window based on the sequence number of the received segment. Specifically, the first node receives the segment sent by the second node and adds the sequence number of the segment to the first receiving window.
[0107] Here, the first node sends a response message to the second node and deletes all or part of the sequence numbers in the first receiving window. The response message is used to indicate the sequence numbers of the segments received by the first node. Specifically, the first node sends a response message to the second node and deletes all the sequence numbers in the first receiving window (that is, clears the first receiving window); or, the first node sends a response message to the second node and deletes the sequence number indicated by the response message in the first receiving window; or, the first node sends a response message to the second node and deletes the sequence number indicated by the response message in the first receiving window and the sequence number before the sequence number.
[0108] For the second node, the second node maintains the first receiving window in the following manner:
[0109] The second node updates the second receiving window based on the sequence number of the received segment; and / or,
[0110] The second node sends a response message to the first node and deletes all or some of the sequence numbers in the second receive window, where the response message indicates the sequence numbers of the segments received by the second node. Optionally, the partial sequence numbers are the sequence numbers indicated by the response message, or the partial sequence numbers include the sequence number indicated by the response message and sequence numbers preceding the sequence number.
[0111] Here, the second node updates the second receiving window based on the sequence number of the received segment, specifically: the second node adds the sequence number of the received segment to the second receiving window.
[0112] Here, the second node sends a response message to the first node and deletes all or part of the sequence numbers in the second receive window, where the response message is used to indicate the sequence numbers of the segments received by the second node. Specifically, the second node sends a response message to the first node and deletes all the sequence numbers in the second receive window (i.e., clears the second receive window); or, the second node sends a response message to the first node and deletes the sequence number indicated by the response message in the second receive window; or, the second node sends a response message to the first node and deletes the sequence number indicated by the response message in the second receive window and the sequence number before the sequence number. Here, the second node sends the response message to the first node using a notification command.
[0113] As an example: referring to FIG6 , the client is the first node, the server is the second node, and the interaction process between the client and the server is as follows:
[0114] 1. The client sends its first message to the server. This message is a segment + acknowledgment (Segment & ACK) message, which can also be understood as a data message + acknowledgment message. The SequenceIndex and AckIndex carried in this message are 0 and 0, respectively. The SequenceIndex is the sequence number of the segment sent, and the AckIndex is the sequence number of the segment received by the client. After this exchange, the client's receive window remains empty, and the server's receive window is filled with the sequence number of the segment received by the server, which is 0.
[0115] 2. The client sends a second message to the server. This message is a segment (also known as a "Segment") message, which can also be understood as a data message. This message carries a SequenceIndex of 1, which represents the sequence number of the segment sent. After this exchange, the client's receive window remains empty, while the server's receive window is updated with the sequence number of the segment received by the server, which is 1.
[0116] 3. The server sends an ACK message to the client, which carries a SequenceIndex of 1 and an AckIndex of 1. After this interaction, the server's receive window is cleared (or sequence numbers 1 and earlier are deleted), and the client's receive window is filled with the sequence number of the segment received by the client, which is 1.
[0117] 4. The client sends a final message to the server, a Segment + Acknowledgement (Segment & ACK) message. The SequenceIndex and AckIndex carried in this message are 2 and 1, respectively. SequenceIndex is the sequence number of the segment sent, and AckIndex is the sequence number of the segment received by the client. After this interaction, the client's receive window is cleared (or sequence number 1 and earlier are deleted), and the server's receive window is filled with the sequence number of the segment received by the server, which is 2.
[0118] 5. The server sends an ACK message to the client, carrying a SequenceIndex of 2 and an AckIndex of 2. After this exchange, the server's receive window is cleared (or sequence number 2 and earlier are deleted), and the client's receive window is filled with the sequence number of the segment received by the client, which is 2.
[0119] In this embodiment of the present application, when the first information (hereinafter referred to as P) in the header of a segment is set to a first value (e.g., 1), it indicates that the segment is a segment that needs to be sent with priority. If the currently transmitted segment or SDU has not yet been completely sent, its transmission still needs to be abandoned so that a higher-priority segment can be sent. If the transmission of a segment or SDU is interrupted, the sender and receiver need to clear their respective receive windows and abandon the management of sent and received messages.
[0120] Specifically, if the first node has a segment or SDU of the first priority level to be transmitted, the first node abandons transmission of the segment or SDU of the second priority level and / or deletes at least some sequence numbers in the first receive window, where the at least some sequence numbers are sequence numbers of segments of the second priority level; the first priority level is higher than the second priority level. Here, the segment or SDU of the second priority level refers to a segment or SDU that is currently being transmitted but has not yet been completed. If the second node receives a segment or SDU of the first priority level, the first node abandons reception of the segment or SDU of the second priority level and deletes all sequence numbers in the second receive window; the first priority level is higher than the second priority level. Here, the segment or SDU of the second priority level refers to a segment or SDU that is currently being received but has not yet been completed. Correspondingly, if the second node receives a segment or SDU of the first priority level, the second node abandons reception of the segment or SDU of the second priority level and / or deletes at least some sequence numbers in the second receive window, where the at least some sequence numbers are sequence numbers of segments of the second priority level; the first priority level is higher than the second priority level.
[0121] As an example: referring to FIG7 , the client is the first node, the server is the second node, and the interaction process between the client and the server is as follows:
[0122] 1. The client sends the first message to the server. This message is a segment + acknowledgment (denoted as Segment & ACK) message, which can also be understood as a data message + acknowledgment message. The SequenceIndex and AckIndex carried by this message are 0 and 0 respectively, where SequenceIndex is the sequence number of the segment sent this time, and AckIndex is the sequence number of the segment received by the client. In addition, the P carried by this message is 0, indicating that the priority level of this message is the second priority level. After this interaction, the client's receive window remains unchanged and remains empty. The server's receive window is added with the sequence number of the segment received by the server, that is, 0.
[0123] 2. The client sends a second message to the server. This message is a segment (also known as a data message). The SequenceIndex value carried by this message is 1, which represents the sequence number of the segment being sent. Additionally, the P value carried by this message is 0, indicating that this message has the second highest priority. After this exchange, the client's receive window remains empty, while the server's receive window is updated with the sequence number of the segment received by the server, which is 1.
[0124] 3. The client sends the Mth message to the server. This message is a segment + acknowledgment (denoted as Segment & ACK) message. The SequenceIndex and AckIndex carried by this message are 2 and 1, respectively. SequenceIndex is the sequence number of the segment sent this time, and AckIndex is the sequence number of the segment received by the client. In addition, the P carried by this message is 1, indicating that the priority level of this message is the first priority level. After this interaction, the receive windows of the client and server are cleared. Furthermore, the sequence number of the segment received by the server, that is, 2, is added to the receive window of the server.
[0125] 4. The server sends an ACK message to the client, carrying a SequenceIndex of 2 and an AckIndex of 2. After this exchange, the server's receive window is cleared (or sequence numbers 2 and earlier are deleted), and the client's receive window is filled with the sequence number of the segment received by the client, which is 2.
[0126] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all fall within the scope of protection of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will no longer describe the various possible combinations separately. For another example, the various different embodiments of the present application can also be arbitrarily combined, as long as they do not violate the idea of the present application, they should also be regarded as the contents disclosed in the present application. For another example, under the premise of no conflict, the various embodiments and / or the technical features in each embodiment described in the present application can be arbitrarily combined with the prior art, and the technical solution obtained after the combination should also fall within the scope of protection of the present application.
[0127] It should also be understood that in the various method embodiments of the present application, the sequence numbers of the above-mentioned processes do not imply a precedence in the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, in the embodiments of the present application, the terms "downlink," "uplink," and "sidelink" are used to indicate the transmission direction of signals or data, where "downlink" is used to indicate the first direction of transmission of signals or data from a site to a user equipment in a cell, "uplink" is used to indicate the second direction of transmission of signals or data from a user equipment in a cell to a site, and "sidelink" is used to indicate the third direction of transmission of signals or data from user equipment 1 to user equipment 2. For example, "downlink signal" indicates that the transmission direction of the signal is the first direction. In addition, in the embodiments of the present application, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships can exist. Specifically, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0128] FIG8 is a first structural diagram of a data transmission device according to an embodiment of the present application, which is applied to a first node. As shown in FIG8 , the data transmission device includes:
[0129] The processing unit 801 is configured to divide the SDU into one or more segments;
[0130] The communication unit 802 is configured to send the one or more segments to the second node.
[0131] In some optional implementations, the processing unit 801 is further configured to sequentially assign a sequence number to each of the one or more segments.
[0132] In some optional embodiments, the first node has at least a first protocol layer and a second protocol layer, the first protocol layer is located above the second protocol layer, and the second protocol layer is located above the Bluetooth layer;
[0133] The processing unit 801 is configured to segment an SDU from a first protocol layer into one or more segments through a second protocol layer.
[0134] In some optional embodiments, the segment includes a header and a payload, and the header includes at least one of the following:
[0135] First information, where the first information is used to indicate a priority level of the segment or a priority level of an SDU corresponding to the segment;
[0136] second information, where the second information is used to indicate whether the segment is a handshake message;
[0137] third information, where the third information is used to indicate whether the segment is a starting segment of an SDU;
[0138] Fourth information, the fourth information is used to indicate whether the segment is the end segment of an SDU;
[0139] fifth information, the fifth information being used to indicate whether the segment is a response message;
[0140] sixth information, the sixth information being used to indicate a sequence number of the segment;
[0141] Seventh information, the seventh information is used to indicate the size of the SDU transmitted after the handshake message exchange;
[0142] Eighth information, where the eighth information is used to indicate a sequence number of the segment received by the first node;
[0143] Ninth information, the ninth information is used to indicate the protocol version number;
[0144] Tenth information, the tenth information is used to indicate the size of the segment transmitted after the handshake message exchange;
[0145] The eleventh information is used to indicate the size of the receiving window of the first node.
[0146] In some optional embodiments, the processing unit 801 is also used to abandon the transmission of the second priority level segment or SDU if the communication unit has a first priority level segment or SDU to be sent, and / or abandon the management of the second priority level segment or SDU that has been sent; the first priority level is higher than the second priority level.
[0147] In some optional implementations, when the header includes the second information and the second information indicates that the segment is a handshake message, the header includes at least one of the ninth information, the tenth information, and the eleventh information.
[0148] In some optional embodiments, the header includes the seventh information when the header includes the sixth information and the sixth information indicates that the sequence number of the segment is the initial sequence number and / or the header includes the third information and the third information indicates that the segment is the starting segment of an SDU.
[0149] In some optional implementations, when the header includes the fifth information and the fifth information indicates that the segment is a response message, the header includes the eighth information.
[0150] In some optional embodiments, the processing unit 801 is further used to determine that the size of the payload of the segment is equal to the size of the segment supported by the first node minus the size of the header of the segment when the header includes the fourth information and the fourth information indicates that the segment is not the end segment of an SDU.
[0151] In some optional embodiments, the processing unit 801 is further used to determine that the size of the payload of the segment is equal to the size of the SDU minus the size of the data sent by the first node, when the header includes the fourth information and the fourth information indicates that the segment is the end segment of an SDU.
[0152] In some optional implementations, the communication unit 802 is configured to send the one or more segments to the second node using a write command without requiring a response message.
[0153] In some optional implementations, the communication unit 802 sends the segment to meet the following restrictions:
[0154] After sending a segment of an SDU, the communication unit 802 sends a segment of the next SDU.
[0155] In some optional implementations, the receiving window of the first node is a first receiving window, and the first receiving window is used to store sequence numbers of segments received by the first node; the receiving window of the second node is a second receiving window, and the second receiving window is used to store sequence numbers of segments received by the second node;
[0156] The communication unit 802 is further configured to receive the segment sent by the second node; the processing unit 801 is further configured to update the first receiving window based on the sequence number of the received segment; and / or,
[0157] The communication unit 802 is further used to send a response message to the second node; the processing unit 801 is further used to delete all or part of the sequence numbers in the first receiving window, and the response message is used to indicate the sequence numbers of the segments received by the first node.
[0158] In some optional implementations, the partial sequence number is the sequence number indicated by the response message; or, the partial sequence number includes the sequence number indicated by the response message and a sequence number before the sequence number.
[0159] In some optional embodiments, the processing unit 801 is also used to delete at least part of the sequence numbers in the first receiving window if there are segments or SDUs of the first priority level to be sent by the first node, and the at least part of the sequence numbers are sequence numbers of segments of the second priority level; the first priority level is higher than the second priority level.
[0160] Those skilled in the art should understand that the relevant description of the above-mentioned data transmission device in the embodiment of the present application can be understood with reference to the relevant description of the data transmission method in the embodiment of the present application.
[0161] FIG9 is a second schematic diagram of the structure of a data transmission device provided in an embodiment of the present application, which is applied to a second node. As shown in FIG9 , the data transmission device includes:
[0162] The communication unit 901 is configured to receive one or more segments sent by the first node;
[0163] The processing unit 902 is configured to reassemble the one or more segments into an SDU.
[0164] In some optional implementations, each of the one or more segments corresponds to a sequence number.
[0165] In some optional embodiments, the first node has at least a second protocol layer, and the second protocol layer is located above the Bluetooth layer;
[0166] The processing unit 902 is configured to reassemble the one or more segments into SDUs through a second protocol layer.
[0167] In some optional embodiments, the segment includes a header and a payload, and the header includes at least one of the following:
[0168] First information, where the first information is used to indicate a priority level of the segment or a priority level of an SDU corresponding to the segment;
[0169] second information, where the second information is used to indicate whether the segment is a handshake message;
[0170] third information, where the third information is used to indicate whether the segment is a starting segment of an SDU;
[0171] Fourth information, the fourth information is used to indicate whether the segment is the end segment of an SDU;
[0172] fifth information, the fifth information being used to indicate whether the segment is a response message;
[0173] sixth information, the sixth information being used to indicate a sequence number of the segment;
[0174] Seventh information, the seventh information is used to indicate the size of the SDU transmitted after the handshake message exchange;
[0175] Eighth information, where the eighth information is used to indicate a sequence number of the segment received by the first node;
[0176] Ninth information, the ninth information is used to indicate the protocol version number;
[0177] Tenth information, the tenth information is used to indicate the size of the segment transmitted after the handshake message exchange;
[0178] The eleventh information is used to indicate the size of the receiving window of the first node.
[0179] In some optional embodiments, the processing unit 902 is further used to abandon the reception of the segment or SDU of the second priority level if the communication unit receives a segment or SDU of the first priority level, and / or abandon the management of the received segment or SDU of the second priority level; the first priority level is higher than the second priority level.
[0180] In some optional implementations, when the header includes the second information and the second information indicates that the segment is a handshake message, the header includes at least one of the ninth information, the tenth information, and the eleventh information.
[0181] In some optional embodiments, the header includes the seventh information when the header includes the sixth information and the sixth information indicates that the sequence number of the segment is the initial sequence number and / or the header includes the third information and the third information indicates that the segment is the starting segment of an SDU.
[0182] In some optional implementations, when the header includes the fifth information and the fifth information indicates that the segment is a response message, the header includes the eighth information.
[0183] In some optional embodiments, the processing unit 902 is further used to determine that the size of the payload of the segment is equal to the size of the segment supported by the first node minus the size of the header of the segment when the header includes the fourth information and the fourth information indicates that the segment is not the end segment of an SDU.
[0184] In some optional embodiments, the processing unit 902 is further used to determine that the size of the payload of the segment is equal to the size of the SDU minus the size of the data received by the second node, when the header includes the fourth information and the fourth information indicates that the segment is the end segment of an SDU.
[0185] In some optional implementations, the processing unit 902 is configured to reassemble the one or more segments into SDUs in a receiving order.
[0186] In some optional embodiments, the second node has at least a first protocol layer and a second protocol layer, the first protocol layer is located above the second protocol layer, and the second protocol layer is located above the Bluetooth layer;
[0187] The processing unit 902 is also used to verify at least one of the following through the second protocol layer: whether the size of the received segment is equal to the size of the segment indicated by the tenth information in the starting segment; whether the starting segment corresponding to the ending segment is received; whether the size of the reassembled SDU is equal to the size of the SDU indicated by the seventh information in the starting segment; if the verification result is yes, the reassembled SDU is passed to the first protocol layer through the second protocol layer; if the verification result is no, the BMTP transmission is terminated.
[0188] In some optional implementations, the receiving window of the second node is a second receiving window, the second receiving window is used to store sequence numbers of segments received by the second node, and the receiving window of the first node is a first receiving window, the first receiving window is used to store sequence numbers of segments received by the first node;
[0189] The processing unit 902 is further configured to update the second receiving window based on the sequence number of the received segment; and / or,
[0190] The communication unit 901 is also used to send a response message to the first node; the processing unit is used to delete all or part of the sequence numbers in the second receiving window, and the response message is used to indicate the sequence numbers of the segments received by the second node.
[0191] In some optional implementations, the partial sequence number is the sequence number indicated by the response message; or, the partial sequence number includes the sequence number indicated by the response message and a sequence number before the sequence number.
[0192] In some optional embodiments, the processing unit 902 is also used to delete at least part of the sequence numbers in the second receiving window if the communication unit receives a segment or SDU of a first priority level, and the at least part of the sequence numbers are sequence numbers of segments of a second priority level; the first priority level is higher than the second priority level.
[0193] In some optional implementations, the communication unit 901 is configured to send a response message to the first node using a notification command.
[0194] Those skilled in the art should understand that the relevant description of the above-mentioned data transmission device in the embodiment of the present application can be understood with reference to the relevant description of the data transmission method in the embodiment of the present application.
[0195] Figure 10 is a schematic structural diagram of a communication device 1000 provided in an embodiment of the present application. The communication device can be a first node or a second node. The communication device 1000 shown in Figure 10 includes a processor 1010, which can call and execute a computer program from a memory to implement the method in the embodiment of the present application.
[0196] Optionally, as shown in FIG10 , the communication device 1000 may further include a memory 1020. The processor 1010 may call and execute a computer program from the memory 1020 to implement the method in the embodiment of the present application.
[0197] The memory 1020 may be a separate device independent of the processor 1010 , or may be integrated into the processor 1010 .
[0198] Optionally, as shown in FIG10 , the communication device 1000 may further include a transceiver 1030 , and the processor 1010 may control the transceiver 1030 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices.
[0199] The transceiver 1030 may include a transmitter and a receiver. The transceiver 1030 may further include an antenna, and the number of antennas may be one or more.
[0200] Optionally, the communication device 1000 may specifically be the first node of the embodiment of the present application, and the communication device 1000 may implement the corresponding processes implemented by the first node in each method of the embodiment of the present application. For the sake of brevity, they will not be repeated here.
[0201] Optionally, the communication device 1000 may specifically be the second node of the embodiment of the present application, and the communication device 1000 may implement the corresponding processes implemented by the second node in each method of the embodiment of the present application. For the sake of brevity, they will not be repeated here.
[0202] Figure 11 is a schematic structural diagram of a chip according to an embodiment of the present application. The chip 1100 shown in Figure 11 includes a processor 1110, which can call and run a computer program from a memory to implement the method according to the embodiment of the present application.
[0203] Optionally, as shown in FIG11 , the chip 1100 may further include a memory 1120. The processor 1110 may call and execute a computer program from the memory 1120 to implement the method in the embodiment of the present application.
[0204] The memory 1120 may be a separate device independent of the processor 1110 , or may be integrated into the processor 1110 .
[0205] Optionally, the chip 1100 may further include an input interface 1130. The processor 1110 may control the input interface 1130 to communicate with other devices or chips, and specifically, may obtain information or data sent by other devices or chips.
[0206] Optionally, the chip 1100 may further include an output interface 1140. The processor 1110 may control the output interface 1140 to communicate with other devices or chips, and specifically, may output information or data to other devices or chips.
[0207] Optionally, the chip can be applied to the first node in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the first node in each method of the embodiment of the present application. For the sake of brevity, it will not be repeated here.
[0208] Optionally, the chip can be applied to the second node in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the second node in each method of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0209] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0210] FIG12 is a schematic block diagram of a communication system 1200 provided in an embodiment of the present application. As shown in FIG12 , the communication system 1200 includes a first node 1210 and a second node 1220 .
[0211] Among them, the first node 1210 can be used to implement the corresponding functions implemented by the terminal device in the above method, and the second node 1220 can be used to implement the corresponding functions implemented by the first node in the above method. For the sake of brevity, they are not repeated here.
[0212] It should be understood that the processor of the embodiments of the present application may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiment can be completed by hardware integrated logic circuits in the processor or software instructions. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0213] It is understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0214] It should be understood that the above-mentioned memories are exemplary but not restrictive. For example, the memories in the embodiments of the present application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM RAM (DR RAM), etc. In other words, the memories in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0215] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program.
[0216] Optionally, the computer-readable storage medium can be applied to the first node in the embodiment of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the first node in the various methods of the embodiment of the present application. For the sake of brevity, they will not be repeated here.
[0217] Optionally, the computer-readable storage medium can be applied to the second node in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the second node in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0218] An embodiment of the present application also provides a computer program product, including computer program instructions.
[0219] Optionally, the computer program product can be applied to the first node in the embodiment of the present application, and the computer program instructions enable the computer to execute the corresponding processes implemented by the first node in the various methods of the embodiment of the present application. For the sake of brevity, they will not be repeated here.
[0220] Optionally, the computer program product can be applied to the second node in the embodiment of the present application, and the computer program instructions enable the computer to execute the corresponding processes implemented by the second node in the various methods of the embodiment of the present application. For the sake of brevity, they are not repeated here.
[0221] The embodiment of the present application also provides a computer program.
[0222] Optionally, the computer program can be applied to the first node in the embodiments of the present application. When the computer program runs on a computer, the computer executes the corresponding processes implemented by the first node in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0223] Optionally, the computer program can be applied to the second node in the embodiments of the present application. When the computer program runs on a computer, the computer executes the corresponding processes implemented by the second node in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0224] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0225] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0226] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0227] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0228] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0229] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a first node, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0230] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A data transmission method, comprising: The first node divides the service data unit SDU into one or more segments; The first node sends the one or more segments to a second node.
2. The method according to claim 1, wherein The method further comprises: The first node sequentially assigns a sequence number to each of the one or more segments.
3. The method according to claim 1 or 2, wherein: The first node has at least a first protocol layer and a second protocol layer, the first protocol layer is located above the second protocol layer, and the second protocol layer is located above the Bluetooth layer; The first node divides the SDU into one or more segments, including: The second protocol layer of the first node segments the SDU from the first protocol layer into one or more segments.
4. The method according to any one of claims 1 to 3, wherein The segment includes a header and a payload, wherein the header includes at least one of the following: First information, where the first information is used to indicate a priority level of the segment or a priority level of an SDU corresponding to the segment; second information, where the second information is used to indicate whether the segment is a handshake message; third information, where the third information is used to indicate whether the segment is a starting segment of an SDU; Fourth information, the fourth information is used to indicate whether the segment is the end segment of an SDU; fifth information, the fifth information being used to indicate whether the segment is a response message; sixth information, the sixth information being used to indicate a sequence number of the segment; Seventh information, the seventh information is used to indicate the size of the SDU transmitted after the handshake message exchange; Eighth information, where the eighth information is used to indicate a sequence number of the segment received by the first node; Ninth information, the ninth information is used to indicate the protocol version number; Tenth information, the tenth information is used to indicate the size of the segment transmitted after the handshake message exchange; The eleventh information is used to indicate the size of the receiving window of the first node.
5. The method according to claim 4, wherein The method further comprises: If the first node has a segment or SDU of the first priority level to be sent, the first node abandons the transmission of the segment or SDU of the second priority level, and / or abandons the management of the segment or SDU of the second priority level that has been sent; the first priority level is higher than the second priority level.
6. The method according to claim 4 or 5, wherein: In a case where the header includes the second information and the second information indicates that the segment is a handshake message, the header includes at least one of the ninth information, the tenth information, and the eleventh information.
7. The method according to any one of claims 4 to 6, wherein When the header includes the sixth information and the sixth information indicates that the sequence number of the segment is an initial sequence number and / or the header includes the third information and the third information indicates that the segment is a starting segment of an SDU, the header includes the seventh information.
8. The method according to any one of claims 4 to 7, wherein In a case where the header includes the fifth information and the fifth information indicates that the segment is a response message, the header includes the eighth information.
9. The method according to any one of claims 4 to 8, wherein The method further comprises: When the header includes the fourth information and the fourth information indicates that the segment is not the end segment of an SDU, the first node determines that the size of the payload of the segment is equal to the size of the segment supported by the first node minus the size of the header of the segment.
10. The method according to any one of claims 4 to 8, wherein The method further comprises: When the header includes the fourth information and the fourth information indicates that the segment is an end segment of an SDU, the first node determines that the size of the payload of the segment is equal to the size of the SDU minus the size of data sent by the first node.
11. The method according to any one of claims 1 to 10, wherein The first node sending the one or more segments to the second node includes: The first node sends the one or more segments to the second node using a write command without requiring a reply message.
12. The method according to any one of claims 1 to 11, wherein The first node sends the segment to satisfy the following constraints: After sending a segment of an SDU, the first node sends a segment of the next SDU.
13. The method according to any one of claims 1 to 12, wherein The receiving window of the first node is a first receiving window, and the first receiving window is used to store the sequence numbers of the segments received by the first node; the receiving window of the second node is a second receiving window, and the second receiving window is used to store the sequence numbers of the segments received by the second node; The method further comprises: The first node receives the segment sent by the second node, and updates the first receiving window based on the sequence number of the received segment; and / or, The first node sends a response message to the second node and deletes all or part of the sequence numbers in the first receiving window, where the response message is used to indicate the sequence numbers of the segments received by the first node.
14. The method according to claim 13, wherein The partial sequence number is the sequence number indicated by the response message; or, The partial sequence number includes the sequence number indicated by the response message and the sequence number before the sequence number.
15. The method according to claim 13 or 14, wherein: The method further comprises: If the first node has segments or SDUs of the first priority level to be sent, the first node deletes at least some of the sequence numbers in the first receiving window, and the at least some of the sequence numbers are sequence numbers of segments of the second priority level, and the first priority level is higher than the second priority level.
16. A data transmission method, the method comprising: The second node receives one or more segments sent by the first node; The second node reassembles the one or more segments into SDUs.
17. The method according to claim 16, wherein Each of the one or more segments corresponds to a sequence number.
18. The method according to claim 16 or 17, wherein The second node has at least a second protocol layer, and the second protocol layer is located above the Bluetooth layer; The second node reassembling the one or more segments into an SDU, comprising: The second protocol layer of the second node reassembles the one or more segments into SDUs.
19. The method according to any one of claims 16 to 18, wherein The segment includes a header and a payload, wherein the header includes at least one of the following: First information, where the first information is used to indicate a priority level of the segment or a priority level of an SDU corresponding to the segment; second information, where the second information is used to indicate whether the segment is a handshake message; third information, where the third information is used to indicate whether the segment is a starting segment of an SDU; Fourth information, the fourth information is used to indicate whether the segment is the end segment of an SDU; fifth information, the fifth information being used to indicate whether the segment is a response message; sixth information, the sixth information being used to indicate a sequence number of the segment; Seventh information, the seventh information is used to indicate the size of the SDU transmitted after the handshake message exchange; Eighth information, where the eighth information is used to indicate a sequence number of the segment received by the first node; Ninth information, the ninth information is used to indicate the protocol version number; Tenth information, the tenth information is used to indicate the size of the segment transmitted after the handshake message exchange; The eleventh information is used to indicate the size of the receiving window of the first node.
20. The method according to claim 19, wherein The method further comprises: If the second node receives a segment or SDU of the first priority level, the second node abandons receiving the segment or SDU of the second priority level, and / or abandons managing the received segment or SDU of the second priority level; the first priority level is higher than the second priority level.
21. The method according to claim 19 or 20, wherein In a case where the header includes the second information and the second information indicates that the segment is a handshake message, the header includes at least one of the ninth information, the tenth information, and the eleventh information.
22. The method according to any one of claims 19 to 21, wherein When the header includes the sixth information and the sixth information indicates that the sequence number of the segment is an initial sequence number and / or the header includes the third information and the third information indicates that the segment is a starting segment of an SDU, the header includes the seventh information.
23. The method according to any one of claims 19 to 22, wherein In a case where the header includes the fifth information and the fifth information indicates that the segment is a response message, the header includes the eighth information.
24. The method according to any one of claims 19 to 23, wherein The method further comprises: When the header includes the fourth information and the fourth information indicates that the segment is not the end segment of an SDU, the second node determines that the size of the payload of the segment is equal to the size of the segment supported by the first node minus the size of the header of the segment.
25. The method according to any one of claims 19 to 23, wherein The method further comprises: When the header includes the fourth information and the fourth information indicates that the segment is an end segment of an SDU, the second node determines that the size of the payload of the segment is equal to the size of the SDU minus the size of data received by the second node.
26. The method according to any one of claims 16 to 25, wherein The second node reassembling the one or more segments into an SDU, comprising: The second node reassembles the one or more segments into SDUs in a receiving order.
27. The method according to any one of claims 16 to 26, wherein The second node has at least a first protocol layer and a second protocol layer, the first protocol layer is located above the second protocol layer, and the second protocol layer is located above the Bluetooth layer; the method further includes: The second protocol layer of the second node verifies at least one of the following: whether the size of the received segment is equal to the size of the segment indicated by the tenth information in the starting segment; whether the starting segment corresponding to the ending segment is received; and whether the size of the reassembled SDU is equal to the size of the SDU indicated by the seventh information in the starting segment; If the verification result is yes, the second protocol layer of the second node transmits the reassembled SDU to the first protocol layer; If the verification result is negative, the second node ends the BMTP transmission.
28. The method according to any one of claims 16 to 27, wherein The receiving window of the second node is a second receiving window, and the second receiving window is used to store sequence numbers of segments received by the second node. The receiving window of the first node is a first receiving window, and the first receiving window is used to store sequence numbers of segments received by the first node. The method further comprises: The second node updates the second receiving window based on the sequence number of the received segment; and / or, The second node sends a response message to the first node and deletes all or part of the sequence numbers in the second receiving window, where the response message is used to indicate the sequence numbers of the segments received by the second node.
29. The method according to claim 28, wherein The partial sequence number is the sequence number indicated by the response message; or, The partial sequence number includes the sequence number indicated by the response message and the sequence number before the sequence number.
30. The method according to claim 28 or 29, wherein The method further comprises: If the second node receives a segment or SDU of the first priority level, the second node deletes at least some of the sequence numbers in the second receiving window, and the at least some of the sequence numbers are sequence numbers of segments of the second priority level; the first priority level is higher than the second priority level.
31. The method according to any one of claims 28 to 30, wherein The second node sending a response message to the first node includes: The second node sends a response message to the first node using a notification command.
32. A data transmission device, applied to a first node, comprising: a processing unit, configured to segment the SDU into one or more segments; A communication unit is configured to send the one or more segments to the second node.
33. The apparatus according to claim 32, wherein The processing unit is further configured to sequentially assign a sequence number to each of the one or more segments.
34. The apparatus according to claim 32 or 33, wherein: The first node has at least a first protocol layer and a second protocol layer, the first protocol layer is located above the second protocol layer, and the second protocol layer is located above the Bluetooth layer; The processing unit is configured to segment the SDU from the first protocol layer into one or more segments through the second protocol layer.
35. The device according to any one of claims 32 to 34, wherein The segment includes a header and a payload, wherein the header includes at least one of the following: First information, where the first information is used to indicate a priority level of the segment or a priority level of an SDU corresponding to the segment; second information, where the second information is used to indicate whether the segment is a handshake message; third information, where the third information is used to indicate whether the segment is a starting segment of an SDU; Fourth information, the fourth information is used to indicate whether the segment is the end segment of an SDU; fifth information, the fifth information being used to indicate whether the segment is a response message; sixth information, the sixth information being used to indicate a sequence number of the segment; Seventh information, the seventh information is used to indicate the size of the SDU transmitted after the handshake message exchange; Eighth information, where the eighth information is used to indicate a sequence number of the segment received by the first node; Ninth information, the ninth information is used to indicate the protocol version number; Tenth information, the tenth information is used to indicate the size of the segment transmitted after the handshake message exchange; The eleventh information is used to indicate the size of the receiving window of the first node.
36. The apparatus of claim 35, wherein: The processing unit is also used to abandon the transmission of the second priority level segment or SDU if the communication unit has a first priority level segment or SDU to be sent, and / or abandon the management of the second priority level segment or SDU that has been sent; the first priority level is higher than the second priority level.
37. The apparatus according to claim 35 or 36, wherein In a case where the header includes the second information and the second information indicates that the segment is a handshake message, the header includes at least one of the ninth information, the tenth information, and the eleventh information.
38. The device according to any one of claims 35 to 37, wherein When the header includes the sixth information and the sixth information indicates that the sequence number of the segment is an initial sequence number and / or the header includes the third information and the third information indicates that the segment is a starting segment of an SDU, the header includes the seventh information.
39. The device according to any one of claims 35 to 38, wherein In a case where the header includes the fifth information and the fifth information indicates that the segment is a response message, the header includes the eighth information.
40. The device according to any one of claims 35 to 39, wherein The processing unit is also used to determine that the size of the payload of the segment is equal to the size of the segment supported by the first node minus the size of the header of the segment when the header includes the fourth information and the fourth information indicates that the segment is not the end segment of an SDU.
41. The device according to any one of claims 35 to 39, wherein The processing unit is further configured to determine, when the header includes the fourth information and the fourth information indicates that the segment is an end segment of an SDU, that the size of the payload of the segment is equal to the size of the SDU minus the size of the data sent by the first node.
42. The apparatus according to any one of claims 32 to 41, wherein The communication unit is configured to send the one or more segments to the second node using a write command without requiring a response message.
43. The apparatus according to any one of claims 32 to 42, wherein: The communication unit sends the segment to meet the following restrictions: After sending a segment of an SDU, the communication unit sends a segment of the next SDU.
44. The device according to any one of claims 32 to 43, wherein The receiving window of the first node is a first receiving window, and the first receiving window is used to store the sequence numbers of the segments received by the first node; the receiving window of the second node is a second receiving window, and the second receiving window is used to store the sequence numbers of the segments received by the second node; The communication unit is further configured to receive a segment sent by the second node; the processing unit is further configured to update the first receiving window based on a sequence number of the received segment; and / or, The communication unit is further used to send a response message to the second node; the processing unit is further used to delete all or part of the sequence numbers in the first receiving window, and the response message is used to indicate the sequence numbers of the segments received by the first node.
45. The apparatus of claim 44, wherein: The partial sequence number is the sequence number indicated by the response message; or, The partial sequence number includes the sequence number indicated by the response message and the sequence number before the sequence number.
46. The apparatus according to claim 44 or 45, wherein The processing unit is also used to delete at least part of the sequence numbers in the first receiving window if there are segments or SDUs of the first priority level to be sent by the first node, and the at least part of the sequence numbers are sequence numbers of segments of the second priority level; the first priority level is higher than the second priority level.
47. A data transmission device, applied to a second node, comprising: a communication unit, configured to receive one or more segments sent by the first node; A processing unit is configured to reassemble the one or more segments into an SDU.
48. The apparatus of claim 47, wherein Each of the one or more segments corresponds to a sequence number.
49. The apparatus according to claim 47 or 48, wherein The first node has at least a second protocol layer, and the second protocol layer is located above the Bluetooth layer; The processing unit is configured to reassemble the one or more segments into SDUs through a second protocol layer.
50. The apparatus according to any one of claims 47 to 49, wherein The segment includes a header and a payload, wherein the header includes at least one of the following: First information, where the first information is used to indicate a priority level of the segment or a priority level of an SDU corresponding to the segment; second information, where the second information is used to indicate whether the segment is a handshake message; third information, where the third information is used to indicate whether the segment is a starting segment of an SDU; Fourth information, the fourth information is used to indicate whether the segment is the end segment of an SDU; fifth information, the fifth information being used to indicate whether the segment is a response message; sixth information, the sixth information being used to indicate a sequence number of the segment; Seventh information, the seventh information is used to indicate the size of the SDU transmitted after the handshake message exchange; Eighth information, where the eighth information is used to indicate a sequence number of the segment received by the first node; Ninth information, the ninth information is used to indicate the protocol version number; Tenth information, the tenth information is used to indicate the size of the segment transmitted after the handshake message exchange; The eleventh information is used to indicate the size of the receiving window of the first node.
51. The apparatus of claim 50, wherein: The processing unit is also used to abandon the reception of the segment or SDU of the second priority level if the communication unit receives a segment or SDU of the first priority level, and / or abandon the management of the received segment or SDU of the second priority level; the first priority level is higher than the second priority level.
52. The apparatus according to claim 50 or 51, wherein In a case where the header includes the second information and the second information indicates that the segment is a handshake message, the header includes at least one of the ninth information, the tenth information, and the eleventh information.
53. The apparatus according to any one of claims 50 to 52, wherein: When the header includes the sixth information and the sixth information indicates that the sequence number of the segment is an initial sequence number and / or the header includes the third information and the third information indicates that the segment is a starting segment of an SDU, the header includes the seventh information.
54. The apparatus according to any one of claims 50 to 53, wherein In a case where the header includes the fifth information and the fifth information indicates that the segment is a response message, the header includes the eighth information.
55. The apparatus according to any one of claims 50 to 54, wherein The processing unit is also used to determine that the size of the payload of the segment is equal to the size of the segment supported by the first node minus the size of the header of the segment when the header includes the fourth information and the fourth information indicates that the segment is not the end segment of an SDU.
56. The apparatus according to any one of claims 50 to 54, wherein The processing unit is further configured to, when the header includes the fourth information and the fourth information indicates that the segment is an end segment of an SDU, determine that the size of the payload of the segment is equal to the size of the SDU minus the size of the data received by the second node.
57. The apparatus according to any one of claims 47 to 56, wherein The processing unit is configured to reassemble the one or more segments into SDUs according to a receiving order.
58. The apparatus of any one of claims 47 to 57, wherein The second node has at least a first protocol layer and a second protocol layer, the first protocol layer is located above the second protocol layer, and the second protocol layer is located above the Bluetooth layer; The processing unit is further configured to verify, through the second protocol layer, at least one of the following: whether the size of the received segment is equal to the size of the segment indicated by the tenth information in the starting segment; whether the starting segment corresponding to the ending segment is received; and whether the size of the reassembled SDU is equal to the size of the SDU indicated by the seventh information in the starting segment; If the verification result is yes, the reassembled SDU is delivered to the first protocol layer through the second protocol layer; If the verification result is negative, the BMTP transmission ends.
59. The device according to any one of claims 47 to 58, wherein The receiving window of the second node is a second receiving window, and the second receiving window is used to store sequence numbers of segments received by the second node. The receiving window of the first node is a first receiving window, and the first receiving window is used to store sequence numbers of segments received by the first node. The processing unit is further configured to update the second receiving window based on the sequence number of the received segment; and / or, The communication unit is further used to send a response message to the first node; the processing unit is used to delete all or part of the sequence numbers in the second receiving window, and the response message is used to indicate the sequence numbers of the segments received by the second node.
60. The apparatus of claim 59, wherein The partial sequence number is the sequence number indicated by the response message; or, The partial sequence number includes the sequence number indicated by the response message and the sequence number before the sequence number.
61. The apparatus according to claim 59 or 60, wherein The processing unit is also used to delete at least part of the sequence numbers in the second receiving window if the communication unit receives a segment or SDU of the first priority level, and the at least part of the sequence numbers are sequence numbers of the segments of the second priority level; the first priority level is higher than the second priority level.
62. The apparatus according to any one of claims 59 to 61, wherein The communication unit is configured to send a response message to the first node using a notification command.
63. A communication device comprising: A processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 15, or the method according to any one of claims 16 to 31.
64. A chip comprising: A processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes the method according to any one of claims 1 to 15, or the method according to any one of claims 16 to 31.
65. A computer-readable storage medium for storing a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 15, or the method according to any one of claims 16 to 31.
66. A computer program product comprising computer program instructions, the computer program instructions causing a computer to perform the method of any one of claims 1 to 15, or the method of any one of claims 16 to 31.
67. A computer program, the computer program causing a computer to perform the method of any one of claims 1 to 15, or any one of claims 16 to 31.