[go: up one dir, main page]

CN115038116A - Data transmission method, device, electronic equipment, storage medium and product - Google Patents

Data transmission method, device, electronic equipment, storage medium and product Download PDF

Info

Publication number
CN115038116A
CN115038116A CN202210709304.XA CN202210709304A CN115038116A CN 115038116 A CN115038116 A CN 115038116A CN 202210709304 A CN202210709304 A CN 202210709304A CN 115038116 A CN115038116 A CN 115038116A
Authority
CN
China
Prior art keywords
data
message queue
sent
terminal
data transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210709304.XA
Other languages
Chinese (zh)
Other versions
CN115038116B (en
Inventor
喻明亮
林羽帆
刘辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Midea Group Co Ltd
GD Midea Air Conditioning Equipment Co Ltd
Original Assignee
Midea Group Co Ltd
GD Midea Air Conditioning Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Midea Group Co Ltd, GD Midea Air Conditioning Equipment Co Ltd filed Critical Midea Group Co Ltd
Priority to CN202210709304.XA priority Critical patent/CN115038116B/en
Publication of CN115038116A publication Critical patent/CN115038116A/en
Application granted granted Critical
Publication of CN115038116B publication Critical patent/CN115038116B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

本发明涉及通信技术领域,提供一种数据传输方法、装置、电子设备、存储介质和产品。方法包括:基于第二消息队列的空闲位信息和从第一消息队列,中确定第一数据;发送所述第一数据给第二终端,将已发送的所述第一数据存入所述第二消息队列中;其中,所述第一消息队列用于存放待发送的数据,所述第二消息队列用于存放已发送的数据。本发明通过在蓝牙协议栈中增加两个消息队列,能够实现不需等待第二终端的应答即可发送剩下的数据。结合这两个消息队列,本发明可以实现两个蓝牙BLE设备的高速数据传输。

Figure 202210709304

The present invention relates to the field of communication technology, and provides a data transmission method, device, electronic device, storage medium and product. The method includes: determining first data from the first message queue based on idle bit information of the second message queue; sending the first data to a second terminal, and storing the sent first data in the first message queue two message queues; wherein, the first message queue is used for storing data to be sent, and the second message queue is used for storing sent data. By adding two message queues in the Bluetooth protocol stack, the present invention can realize that the remaining data can be sent without waiting for the response of the second terminal. Combining the two message queues, the present invention can realize high-speed data transmission of two Bluetooth BLE devices.

Figure 202210709304

Description

数据传输方法、装置、电子设备、存储介质和产品Data transmission method, apparatus, electronic device, storage medium and product

技术领域technical field

本发明涉及通信技术领域,尤其涉及数据传输方法、装置、电子设备、存储介质和产品。The present invention relates to the field of communication technologies, and in particular, to a data transmission method, apparatus, electronic device, storage medium and product.

背景技术Background technique

随着蓝牙低功耗(Bluetooth Low Energy,BLE)技术的不断更新和发展,蓝牙BLE通讯方式可以为收发双方提供可靠的无线通讯。传统的收发模式下,发送方需要等待接收方反馈的应答帧后才能继续传输,这种方式使得蓝牙BLE传输速度慢。对于数据量大并且对传输速度有着较高要求的应用,现有的数据传输速度慢显现的更加明显。With the continuous updating and development of Bluetooth Low Energy (Bluetooth Low Energy, BLE) technology, the Bluetooth BLE communication method can provide reliable wireless communication for both the sender and the receiver. In the traditional transceiver mode, the sender needs to wait for the response frame fed back by the receiver before continuing to transmit, which makes the Bluetooth BLE transmission slow. For applications with a large amount of data and high requirements for transmission speed, the existing slow data transmission speed is more obvious.

发明内容SUMMARY OF THE INVENTION

本发明旨在至少解决相关技术中存在的技术问题之一。为此,本发明提出一种数据传输方法,实现发送方在不需等待接收方的应答即可发送数据,最大限度的提升两个设备的蓝牙射频带宽使用率,进而提升蓝牙数据传输的速率。The present invention aims to solve at least one of the technical problems existing in the related art. To this end, the present invention proposes a data transmission method, which enables the sender to send data without waiting for the receiver's response, maximizes the Bluetooth radio frequency bandwidth usage rate of the two devices, and further increases the rate of Bluetooth data transmission.

本发明还提出一种数据传输装置。The invention also provides a data transmission device.

本发明还提出一种电子设备。The present invention also provides an electronic device.

本发明还提出一种非暂态计算机可读存储介质。The present invention also provides a non-transitory computer-readable storage medium.

本发明还提出一种计算机程序产品。The invention also provides a computer program product.

根据本发明第一方面实施例的数据传输方法,包括:The data transmission method according to the embodiment of the first aspect of the present invention includes:

基于第二消息队列的空闲位信息从第一消息队列中确定第一数据;determining the first data from the first message queue based on the idle bit information of the second message queue;

发送所述第一数据给第二终端,将已发送的所述第一数据存入所述第二消息队列中;sending the first data to the second terminal, and storing the sent first data in the second message queue;

其中,所述第一消息队列用于存放待发送的数据,所述第二消息队列用于存放已发送的数据。The first message queue is used for storing data to be sent, and the second message queue is used for storing sent data.

根据本发明实施例的数据传输方法,第一终端通过第一消息队列的数据和第二消息队列的空闲位确定了第一数据,第一消息队列存放了调度过程中想要发送的数据帧,第二消息队列存放了已经发送但是还未确认是否发送的数据帧,因此只要监测这两个消息队列的情况,就能第一终端是否具备充足条件向外发送数据。由于本方法不需要等待接收方的应答,因此可以最大程度上提升数据传输的速度,实现两个蓝牙BLE设备的数据传输。According to the data transmission method of the embodiment of the present invention, the first terminal determines the first data according to the data of the first message queue and the free bits of the second message queue, and the first message queue stores the data frame to be sent in the scheduling process, The second message queue stores data frames that have been sent but not yet confirmed whether to send or not. Therefore, as long as the conditions of the two message queues are monitored, it can be determined whether the first terminal has sufficient conditions to send data to the outside. Since this method does not need to wait for the receiver's response, the speed of data transmission can be improved to the greatest extent, and the data transmission of two Bluetooth BLE devices can be realized.

根据本发明的一个实施例,所述基于第二消息队列的空闲位信息从第一消息队列中确定第一数据,包括:According to an embodiment of the present invention, the determining of the first data from the first message queue based on idle bit information of the second message queue includes:

确定所述第二消息队列中存在空闲位,将所述第一消息队列中的所有数据作为所述第一数据。It is determined that there are free bits in the second message queue, and all data in the first message queue is used as the first data.

根据本发明的一个实施例,所述将已发送的所述第一数据存入所述第二消息队列中,包括:According to an embodiment of the present invention, storing the sent first data in the second message queue includes:

将所述已发送的所述第一数据按照发送顺序依次存入所述第二消息队列的空闲位中。The sent first data is sequentially stored in the idle bits of the second message queue according to the sending sequence.

根据本发明的一个实施例,所述方法还包括:According to an embodiment of the present invention, the method further includes:

接收所述第二终端发送的第二数据,其中,所述第二数据包括所述已发送的第一数据的确收信息;receiving second data sent by the second terminal, wherein the second data includes acknowledgment information of the sent first data;

基于所述第二消息队列的数据与所述第二数据的比对结果,确定所述第一消息队列的数据或所述第二消息队列的空闲位。Based on the comparison result of the data of the second message queue and the second data, the data of the first message queue or the free bits of the second message queue are determined.

根据本发明的一个实施例,所述基于所述第二消息队列的数据与所述第二数据的比对结果,确定所述第一消息队列的数据或所述第二消息队列的空闲位,包括:According to an embodiment of the present invention, the data of the first message queue or the idle bit of the second message queue is determined based on the comparison result between the data of the second message queue and the second data, include:

基于所述第二消息队列中的数据与所述第二数据的比对一致结果,确定所述第二消息队列的空闲位;determining the idle bits of the second message queue based on the consistent result of the comparison between the data in the second message queue and the second data;

基于所述第二消息队列中的数据与所述第二数据的比对不一致结果,确定所述第一消息队列中的数据。The data in the first message queue is determined based on the inconsistency result of the comparison between the data in the second message queue and the second data.

根据本发明的一个实施例,所述基于所述第二消息队列中的数据与所述第二数据的比对一致结果,确定所述第二消息队列的空闲位;基于所述第二消息队列中的数据与所述第二数据的比对不一致结果,确定所述第一消息队列中的数据,包括:According to an embodiment of the present invention, the free bits of the second message queue are determined based on a consistent result of the comparison between the data in the second message queue and the second data; based on the second message queue The data in the message queue is inconsistent with the result of the comparison of the second data, and the data in the first message queue is determined, including:

基于所述第二消息队列中与所述第二数据比对一致的数据帧,从所述第二消息队列中删除所述比对一致的数据帧,确定更新的所述第二消息队列的空闲位;Based on the data frames in the second message queue that are consistent with the second data, the data frames that are consistent with the comparison are deleted from the second message queue, and the updated idleness of the second message queue is determined. bit;

基于所述第二消息队列中与所述第二数据与比对不一致的数据帧,将所述比对不一致的数据帧存入所述第一消息队列中,确定更新的所述第一消息队列中的数据。Based on the data frames in the second message queue that are inconsistent with the second data and the comparison, the data frames with the inconsistent comparison are stored in the first message queue, and the updated first message queue is determined data in .

根据本发明第二方面实施例的数据传输装置,包括:The data transmission device according to the embodiment of the second aspect of the present invention includes:

第一发送模块,用于基于第二消息队列的空闲位信息从第一消息队列中确定第一数据a first sending module, configured to determine the first data from the first message queue based on the idle bit information of the second message queue

还用于发送所述第一数据给第二终端,将已发送的所述第一数据存入所述第二消息队列中;is also used to send the first data to a second terminal, and store the sent first data in the second message queue;

其中,所述第一消息队列用于存放待发送的数据,所述第二消息队列用于存放已发送的数据。The first message queue is used for storing data to be sent, and the second message queue is used for storing sent data.

根据本发明实施例的数据传输装置,第一终端通过第一发送模块的第一消息队列的数据和第二消息队列的空闲位确定了待发送的第一数据,由于第一消息队列存放了调度过程中想要发送的数据帧,第二消息队列存放了已经发送但是还未确认是否发送的数据帧,因此只要监测这两个消息队列的情况,就能第一终端是否具备充足条件向外发送数据。由于本装置不需要等待接收方的应答,因此可以最大程度上提升数据传输的速度,实现两个蓝牙BLE设备的数据传输。According to the data transmission device of the embodiment of the present invention, the first terminal determines the first data to be sent by using the data of the first message queue of the first sending module and the free bits of the second message queue, because the first message queue stores the schedule The second message queue stores the data frames that you want to send during the process, and the second message queue stores the data frames that have been sent but have not yet been confirmed. Therefore, as long as the conditions of these two message queues are monitored, you can check whether the first terminal has sufficient conditions to send out. data. Since the device does not need to wait for the receiver's response, it can maximize the speed of data transmission and realize data transmission between two Bluetooth BLE devices.

根据本发明第三方面实施例的电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述数据传输方法的步骤。An electronic device according to an embodiment of the third aspect of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above data transmission method when the processor executes the program .

根据本发明第四方面实施例的非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述数据传输方法的步骤。A non-transitory computer-readable storage medium according to an embodiment of the fourth aspect of the present invention stores a computer program thereon, and when the computer program is executed by a processor, implements the steps of the above-mentioned data transmission method.

根据本发明第五方面实施例的计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现上述数据传输方法的步骤。A computer program product according to an embodiment of the fifth aspect of the present invention includes a computer program that implements the steps of the above data transmission method when the computer program is executed by a processor.

本发明实施例中的上述一个或多个技术方案,至少具有如下技术效果之一:本发明实施例中,第一终端通过写入命令的方式发送数据,因此,接收方通过句柄值通知的方式对发送方进行应答;通过对发送方的数据帧的批量应答的方式,使得发送方不需因等待对端设备(接收方)的应答帧即而阻塞任务,使得发送方可发送剩下的数据帧。最大限度的提升两个设备的蓝牙射频带宽使用率,进而提升蓝牙可靠性数据传输的速率。The above-mentioned one or more technical solutions in the embodiment of the present invention have at least one of the following technical effects: In the embodiment of the present invention, the first terminal sends data by means of a write command, therefore, the receiver is notified by a handle value Reply to the sender; by replying to the sender's data frames in batches, the sender does not need to wait for the response frame of the peer device (receiver) to block the task, so that the sender can send the remaining data frame. Maximize the Bluetooth RF bandwidth usage of the two devices, thereby increasing the rate of Bluetooth reliable data transmission.

进一步的,本发明实施例通过确定所述第二消息队列中包括空闲位,能够保证当前有未发完的数据帧且第二消息列表有空位可以将未发完的数据帧存入其中进行后续的确认,保证了传输的有效性。Further, in the embodiment of the present invention, by determining that the second message queue includes idle bits, it can be ensured that there are currently unsent data frames and that there are idle bits in the second message list, and the unsent data frames can be stored therein for subsequent follow-up. Confirmation to ensure the validity of the transmission.

更进一步的,本发明实施例通过比较第二数据中确收信息与第二消息队列的的序号,可以获得发出的第一数据是否被第二终端接收到,据此可以调整第一消息队列的数据或第二消息队列空闲位,避免消息的重复发送或漏发。Further, in this embodiment of the present invention, by comparing the acknowledgment information in the second data with the sequence number of the second message queue, it can be obtained whether the sent first data is received by the second terminal, and accordingly, the information of the first message queue can be adjusted. Data or second message queue free bits to avoid repeated or missed messages.

本发明的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the present invention will be set forth, in part, from the following description, and in part will be apparent from the following description, or may be learned by practice of the invention.

附图说明Description of drawings

为了更清楚地说明本发明实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the following briefly introduces the accompanying drawings required for the description of the embodiments or related technologies. Obviously, the accompanying drawings in the following description are only the For some embodiments of the invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1是本发明实施例提供的数据传输方法流程示意图之一;1 is one of the schematic flowcharts of a data transmission method provided by an embodiment of the present invention;

图2是本发明实施例提供的数据传输方法流程示意图之二;FIG. 2 is the second schematic flowchart of a data transmission method provided by an embodiment of the present invention;

图3是本发明实施例提供的蓝牙数据传输方法流程示意图;3 is a schematic flowchart of a Bluetooth data transmission method provided by an embodiment of the present invention;

图4是本发明实施例提供的一种数据传输装置的结构示意图之一;4 is one of the schematic structural diagrams of a data transmission apparatus provided by an embodiment of the present invention;

图5是本发明实施例提供的一种数据传输装置的结构示意图之二;5 is a second schematic structural diagram of a data transmission apparatus provided by an embodiment of the present invention;

图6是本发明实施例提供的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请实施例的至少一个实施例或示例中。此外,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structures, materials, or features are included in at least one example or example of the embodiments of the present application. Furthermore, the terms "first", "second", and "third" are used for descriptive purposes only and should not be construed to indicate or imply relative importance. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.

下面结合附图和实施例对本申请的实施方式作进一步详细描述。以下实施例用于说明本申请,但不能用来限制本申请的范围。The embodiments of the present application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate the application, but not to limit the scope of the application.

图1示例了本发明实施例提供的数据传输方法的流程示意图,该方法应用于第一终端侧执行数据传输任务,该方法至少包括以下步骤:1 illustrates a schematic flowchart of a data transmission method provided by an embodiment of the present invention. The method is applied to a first terminal side to perform a data transmission task, and the method at least includes the following steps:

步骤101、基于第二消息队列的空闲位信息从第一消息队列中确定第一数据。Step 101: Determine the first data from the first message queue based on the idle bit information of the second message queue.

步骤102、发送第一数据给第二终端,将已发送的第一数据存入第二消息队列中;Step 102, sending the first data to the second terminal, and storing the sent first data in the second message queue;

其中,第一消息队列用于存放待发送的数据,第二消息队列用于存放已发送的数据。The first message queue is used to store data to be sent, and the second message queue is used to store sent data.

针对步骤101和步骤102,需要说明的是,第一终端和第二终端可以为用户的终端,或者还,包括但不限于手机、平板电脑、pc端、车载终端以及家用智能电器等带有蓝牙设备的终端。本发明实施例中蓝牙为低功耗蓝牙,第一消息队列和第二消息队列存在于低功耗蓝牙的蓝牙协议栈之中,蓝牙协议栈包括主机host,控制层controller,以及基于此向上提供的应用层。主机中包括ATT层(Attribute protocol),ATT层用来定义用户命令及命令操作的数据,比如读取某个数据或者写某个数据。第一消息队列对应待发送消息队列,第二消息队列对应待确认消息队列,第一数据包括多个数据帧。For step 101 and step 102, it should be noted that the first terminal and the second terminal may be user terminals, or may also include but are not limited to mobile phones, tablet computers, PC terminals, vehicle terminals, and household smart appliances with Bluetooth device's terminal. In the embodiment of the present invention, the Bluetooth is low-power bluetooth, the first message queue and the second message queue exist in the low-power bluetooth bluetooth protocol stack, and the bluetooth protocol stack includes a host host, a control layer controller, and based on this application layer. The host includes an ATT layer (Attribute protocol). The ATT layer is used to define user commands and data for command operations, such as reading certain data or writing certain data. The first message queue corresponds to the queue of messages to be sent, the second message queue corresponds to the queue of messages to be confirmed, and the first data includes a plurality of data frames.

第一终端执行本发明实施例提供的数据传输过程如下:首先,在发送数据之前,第一终端的应用层会先通过调用ATT层协议栈接口把需要发送的数据添加第一消息队列。然后第一终端会根据当前调度下第一消息队列的和第二消息队列的信息确定需要发送的第一数据。最终第一终端将第一数据发送给第二终端。第一终端通过使用写入命令ATT_WRITE_CMD发送数据。The first terminal performs the data transmission process provided by the embodiment of the present invention as follows: First, before sending data, the application layer of the first terminal first adds the data to be sent to the first message queue by calling the ATT layer protocol stack interface. Then, the first terminal will determine the first data to be sent according to the information of the first message queue and the second message queue under the current scheduling. Finally, the first terminal sends the first data to the second terminal. The first terminal sends data by using the write command ATT_WRITE_CMD.

需要说明的是,ATT_WRITE_CMD与写入请求ATT_WRITE_REQ的不同之处是ATT_WRITE_REQ需要阻塞等待接收方的应答在能继续发送,ATT_WRITE_CMD没有接收方的应答,不需要等待接收方的应答,因此在牺牲了一定可靠性的基础上,实现数据传输速度更快。It should be noted that the difference between ATT_WRITE_CMD and the write request ATT_WRITE_REQ is that ATT_WRITE_REQ needs to block and wait for the receiver's response to continue to send. ATT_WRITE_CMD has no receiver's response and does not need to wait for the receiver's response. On the basis of nature, the data transmission speed is faster.

根据本发明实施例提供的数据传输方法,通过在蓝牙协议栈增加两个消息队列,使得发送方第一终端能够不用通过接收方第二终端的确认信息进行数据传输,同时由于第一数据包括多个数据帧,因此,第一终端可以持续发出多帧数据,改变了以往单帧传输的固有模式。另外,第一终端不需要等待发出数据应答就可以继续发送数据,大大提升了传输的速率。According to the data transmission method provided by the embodiment of the present invention, by adding two message queues to the Bluetooth protocol stack, the first terminal of the sender can perform data transmission without using the confirmation information of the second terminal of the receiver. Therefore, the first terminal can continuously send out multiple frames of data, which changes the inherent mode of single-frame transmission in the past. In addition, the first terminal can continue to send data without waiting for a data response, which greatly improves the transmission rate.

可以理解的是,基于第二消息队列的空闲位信息从第一消息队列中确定第一数据,包括:It can be understood that determining the first data from the first message queue based on the free bit information of the second message queue includes:

确定第二消息队列中存在空闲位,将第一消息队列中的所有数据作为第一数据。It is determined that there are free bits in the second message queue, and all data in the first message queue is used as the first data.

需要说明的是,第一终端的应用层中有数据发送时,需要先判断第一消息队列是否为满,若队列已满,则阻塞应用层任务,否则将应用层数据添加到第一消息队列中准备与第二消息队列对比后进一步进行发送。同时,还需要判断第二消息队列是否为满,若为满则说明此时没有空闲位进行数据确认,完全无法保证传输数据的可靠性,因此通过确定第二消息队列是否存在空闲位,能够支持下一步的数据发送。It should be noted that when data is sent in the application layer of the first terminal, it is necessary to first determine whether the first message queue is full. If the queue is full, block the application layer task, otherwise add the application layer data to the first message queue. The middle is ready to be sent further after being compared with the second message queue. At the same time, it is also necessary to judge whether the second message queue is full. If it is full, it means that there are no free bits for data confirmation at this time, and the reliability of the transmitted data cannot be guaranteed at all. Therefore, by determining whether there are free bits in the second message queue, it is possible to support The next data transmission.

另外,针对第一消息队列的信息进行判断包括两步,首先需要判断第一消息队列是否为空,若为空说明当前无数据可发,不需要执行发送任务,此时可以向第一消息队列中导入新的数据用于发送。因此,在向第一消息队列导入发送数据之前,还需要判断第一消息队列是否为满,若为满则表明不需要应用层导入新的数据进行发送。In addition, judging the information of the first message queue includes two steps. First, it is necessary to determine whether the first message queue is empty. If it is empty, it means that there is currently no data to send, and no sending task needs to be performed. At this time, the first message queue can be sent to the first message queue. Import new data for sending. Therefore, before importing and sending data to the first message queue, it is also necessary to judge whether the first message queue is full. If it is full, it indicates that the application layer does not need to import new data for sending.

针对第二消息队列的信息进行判断时,由于第二消息队列存储的是已发送待确认的数据帧,需要考虑第二消息队列中是否有空余的位置留给当前待发送的数据帧,因此第二消息队列需要不为满,存在第二消息队列的数据帧可以用于确认比对,保障了数据传输的可靠性。When judging the information of the second message queue, since the second message queue stores the data frames that have been sent to be confirmed, it is necessary to consider whether there is any free space in the second message queue for the current data frames to be sent. The second message queue does not need to be full, and the data frames in the second message queue can be used for confirmation and comparison, which ensures the reliability of data transmission.

具体的,第一终端的应用层的数据传输data_tran_task任务包括数据发送人物以及蓝牙协议栈调度任务。其中,执行数据发送任务时,在有数据发送前,第一终端需要先判断待发送消息队列是否是满,若待发送消息队列已满,则阻塞应用层数据传输任务,否则将应用层数据添加到待发送消息队列中。Specifically, the data transmission data_tran_task task of the application layer of the first terminal includes a data sending person and a Bluetooth protocol stack scheduling task. Among them, when performing a data sending task, before data is sent, the first terminal needs to first determine whether the message queue to be sent is full, and if the message queue to be sent is full, the application layer data transmission task is blocked, otherwise the application layer data is added to the queue of messages to be sent.

执行蓝牙协议栈任务调度时,读取第一消息队列是否为空,为空则退出行蓝牙协议栈任务调度;不为空则读取第二消息队列是否满;若为满,则退出此次行蓝牙协议栈任务调度。否则,在此次调度中依次将第一消息队列中的数据帧取出并对数据帧进行编号后得到第一数据,通过ATT_WRITE_CMD的方式发送给对端设备;并将发送的第一数据的数据帧拷贝进第二消息队列中,直到第二消息队列满或者第一消息队列空。每次蓝牙协议栈调度对应一个连接间隔。When executing the task scheduling of the Bluetooth protocol stack, read whether the first message queue is empty, if it is empty, exit the task scheduling of the Bluetooth protocol stack; if it is not empty, read whether the second message queue is full; if it is full, exit this time. Execute the task scheduling of the Bluetooth protocol stack. Otherwise, in this scheduling, the data frames in the first message queue are sequentially taken out and the data frames are numbered to obtain the first data, and sent to the peer device by means of ATT_WRITE_CMD; and the data frame of the first data sent Copy into the second message queue until the second message queue is full or the first message queue is empty. Each Bluetooth protocol stack scheduling corresponds to a connection interval.

另外,需要说明的是,如果第二消息队列满但是第一消息队列还未空时,由于第二消息队列对应的待确认消息优先级高,因此只要第二消息队列满,就会停止进行数据拷贝。若第一消息列表可发送的数据帧为8时,第一终端对第一数据的编号规则可以为,设定00000000分别第一数据对应的八个数据帧,00000001为第一帧,00000010为第二帧,00000100为第三帧,00001000为第四帧,00010000为第五帧,00100000为第六帧,01000000为第七帧,10000000为第八帧。此外,编号规则也可以遵照其它方式,只要保证每个数据帧对应的序号固定即可。In addition, it should be noted that if the second message queue is full but the first message queue is not yet empty, since the message to be confirmed corresponding to the second message queue has a high priority, as long as the second message queue is full, data processing will be stopped. copy. If the number of data frames that can be sent in the first message list is 8, the numbering rule for the first data by the first terminal may be as follows: 00000000 is set to eight data frames corresponding to the first data, 00000001 is the first frame, and 00000010 is the first data frame. Two frames, 00000100 is the third frame, 00001000 is the fourth frame, 00010000 is the fifth frame, 00100000 is the sixth frame, 01000000 is the seventh frame, and 10000000 is the eighth frame. In addition, the numbering rules may also follow other methods, as long as the sequence number corresponding to each data frame is guaranteed to be fixed.

等待蓝牙协议栈调度结束后,在data_tran_task任务中,若应用层仍有数据发送则继续添加到第一消息队列中,没有则蓝牙协议栈调度任务结束。After waiting for the scheduling of the Bluetooth protocol stack, in the data_tran_task task, if there is still data to be sent at the application layer, it will continue to be added to the first message queue, otherwise, the Bluetooth protocol stack scheduling task ends.

可以理解的是,将已发送的第一数据存入第二消息队列中,包括:It can be understood that storing the sent first data in the second message queue includes:

将已发送的第一数据按照发送顺序依次存入第二消息队列的空闲位中。The sent first data is sequentially stored in the idle bits of the second message queue according to the sending sequence.

需要说明的是,第二消息队列的空闲位的数量与第一数据发送的数量不一定一致,因此需要按照发送的顺序依次将第一数据存入第二消息队列的空闲位中。若第二消息队列已满,则会阻碍第一消息队列的发送任务。It should be noted that the number of free bits of the second message queue is not necessarily the same as the number of first data to be sent, so the first data needs to be sequentially stored in the free bits of the second message queue according to the order of sending. If the second message queue is full, the sending task of the first message queue will be blocked.

可以理解的是,将已发送的第一数据存入第二消息队列中,还包括:It can be understood that storing the sent first data in the second message queue also includes:

将已发送的第一数据通过任意次序存入第二消息队列的空闲位中。The sent first data is stored in the free bits of the second message queue in any order.

需要说明的是,由于第一数据是第一终端经过编号后发送的,每一帧都有自己的序号作为标志,因此,第一数据也可以不按照发送顺序,按照其他任意次序直接存入消息队列中。It should be noted that, since the first data is sent by the first terminal after being numbered, and each frame has its own serial number as a mark, therefore, the first data can also be directly stored in the message in any other order, not in the order of transmission. in the queue.

可以理解的是,方法还包括:Understandably, the method also includes:

接收第二终端发送的第二数据,其中,第二数据包括已发送的第一数据的确收信息。Second data sent by the second terminal is received, wherein the second data includes acknowledgment information of the sent first data.

基于第二消息队列中的数据与第二数据的比对结果,确定第一消息队列中的数据或第二消息队列的空闲位。Based on the comparison result between the data in the second message queue and the second data, determine the data in the first message queue or the free bits of the second message queue.

需要说明的是,虽然第一终端接收第二终端发送的第二数据,但是由于第二数据是以ATT_HANDLE_VALUE_NTF的方式发送给第一终端的,因此第一终端并不需要对第二数据进行回复。在本发明实施例中,第一终端可以结合第二终端的反馈的确收信息进行比对,从而对自身构建的第一消息列表和第二消息列表进行更新,已达到蓝牙数据传输的可靠性要求。第二数据所包括的第一数据的确收信息用于确认第一数据中每个数据帧是否收到的,因此第二数据包含的所有数据帧的确收信息,收到的数据帧对应的序号为1,未收到的数据帧对应的序号为0。It should be noted that although the first terminal receives the second data sent by the second terminal, since the second data is sent to the first terminal in the form of ATT_HANDLE_VALUE_NTF, the first terminal does not need to reply to the second data. In this embodiment of the present invention, the first terminal can compare the receipt information fed back by the second terminal, so as to update the first message list and the second message list constructed by itself, which has reached the reliability requirement of Bluetooth data transmission . The acknowledgment information of the first data included in the second data is used to confirm whether each data frame in the first data has been received. Therefore, the acknowledgment information of all the data frames included in the second data, the sequence numbers corresponding to the received data frames are 1. The sequence number corresponding to the unreceived data frame is 0.

可以理解的是,基于第一消息队列和第二消息队列确定第一数据,之前还包括:It can be understood that determining the first data based on the first message queue and the second message queue further includes:

基于第一终端与第二终端的单帧最大容量和连接参数,确定发送和接收数据的连接间隔。The connection interval for sending and receiving data is determined based on the single-frame maximum capacity and connection parameters of the first terminal and the second terminal.

需要说明的是,第一终端(发送方)与第二终端(接收方)建立好BLE无线链路后,需要先进行单帧最大容量mtu值交换以及连接参数更新。连接参数一般根据蓝牙规范来进行更新,更新前的状态通过第一终端发起连接来决定。其中,连接参数作用是在两个蓝牙设备建立链接后,需要以协商的连接参数为间隔交换心跳包,用来维持蓝牙的链接。同时在蓝牙规范中,由于BLE设备是低功耗设备,因此BLE在交换心跳包后,若无数据发送请求,射频模块会关闭,用来节省功耗的流失,等待下一次连接间隔的到来才会重新唤醒射频模块。mtu值协商是为了确定当前确定最大单帧容量,尽量保证第一数据确定发送后能够把缓存区数据发完。It should be noted that, after the first terminal (sender) and the second terminal (receiver) establish a BLE wireless link, it is necessary to first exchange the maximum capacity mtu value of a single frame and update the connection parameters. The connection parameters are generally updated according to the Bluetooth specification, and the state before the update is determined by initiating a connection by the first terminal. The function of the connection parameter is that after the two Bluetooth devices establish a link, heartbeat packets need to be exchanged at intervals of the negotiated connection parameter to maintain the Bluetooth link. At the same time, in the Bluetooth specification, since the BLE device is a low-power device, after the BLE exchange heartbeat packets, if there is no data transmission request, the radio frequency module will be turned off to save the loss of power consumption and wait for the next connection interval. The RF module will wake up again. The purpose of mtu value negotiation is to determine the currently determined maximum single frame capacity, and try to ensure that the buffer area data can be sent completely after the first data is determined to be sent.

具体的,在本实施例中连接参数可以选用50ms,根据实际应用中数据传输以及设备的功耗,还可以选用48.75ms或30ms。在连接参数为50ms的条件下,第一消息队列可以设置的最大经验值为8。Specifically, in this embodiment, the connection parameter can be selected as 50ms, and according to the data transmission and the power consumption of the device in practical applications, 48.75ms or 30ms can also be selected. Under the condition that the connection parameter is 50ms, the maximum empirical value that can be set for the first message queue is 8.

可以理解的是,基于第二数据和第二消息队列的比对结果,确定第一消息队列中的数据和第二消息队列的空闲位,包括:It can be understood that, based on the comparison result between the second data and the second message queue, determining the data in the first message queue and the free bits of the second message queue, including:

基于第二消息队列中的数据与第二数据的比对一致结果,确定第二消息队列的空闲位。Based on the consistent result of the comparison between the data in the second message queue and the second data, the idle bits of the second message queue are determined.

基于第二消息队列中的数据与第二数据的比对不一致结果,确定第一消息队列中的数据。The data in the first message queue is determined based on the inconsistency result of the comparison between the data in the second message queue and the second data.

需要说明的是,在本发明实施例中,第二数据与第二消息队列是通过位或操作进行比对,比对结果用来表示第二终端已经收到了第一终端发送的数据帧。比如,第二终端收到了第一终端的第1、2、3、5、7、8号数据帧,第二数据包含的确收信息为11010111,该值会在下一次连接间隔发送给第一终端。It should be noted that, in this embodiment of the present invention, the second data is compared with the second message queue through a bit OR operation, and the comparison result is used to indicate that the second terminal has received the data frame sent by the first terminal. For example, the second terminal receives data frames No. 1, 2, 3, 5, 7, and 8 of the first terminal, and the confirmation information contained in the second data is 11010111, which will be sent to the first terminal in the next connection interval.

具体的,基于第二消息队列中的数据与第二数据的比对一致结果,确定第二消息队列的空闲位;基于第二消息队列中的数据与第二数据的比对不一致结果,确定第一消息队列中的数据,包括:Specifically, based on the consistent result of the comparison between the data in the second message queue and the second data, determine the free bits of the second message queue; based on the inconsistent result of the comparison between the data in the second message queue and the second data, determine the first Data in a message queue, including:

基于第二消息队列中与第二数据比对一致的数据帧,从第二消息队列中删除比对一致的数据帧,确定更新的第二消息队列的空闲位。Based on the data frames in the second message queue that are consistent with the second data, the data frames that are consistent with the comparison are deleted from the second message queue, and the updated idle bits of the second message queue are determined.

基于第二消息队列中与第二数据与比对不一致的数据帧,将比对不一致的数据帧存入第一消息队列中,确定更新的第一消息队列中的数据。Based on the data frames in the second message queue that are inconsistent with the second data and the comparison, the data frames that are inconsistent with the comparison are stored in the first message queue, and the updated data in the first message queue is determined.

需要说明的是,第二数据中的数据帧与第二消息队列比对一致表明第二终端已经收到,说明已经确认,故可以从第二消息列表中删除,留出的空位可以留给新的发送数据。第二数据中的数据帧与第二消息队列比对不一致表明第二终端还未收到该数据帧,因此需要将该数据帧拷贝进第一消息队列中进行重发。It should be noted that the consistency between the data frame in the second data and the second message queue indicates that the second terminal has received it, indicating that it has been confirmed, so it can be deleted from the second message list, and the space left can be reserved for new send data. The inconsistent comparison between the data frame in the second data and the second message queue indicates that the second terminal has not received the data frame, so the data frame needs to be copied into the first message queue for retransmission.

图2示例了本发明实施例提供的数据传输方法的流程示意图,该方法应用于第二终端侧执行数据传输任务,该方法至少包括以下步骤:2 illustrates a schematic flowchart of a data transmission method provided by an embodiment of the present invention. The method is applied to a second terminal side to perform a data transmission task, and the method at least includes the following steps:

步骤201、接收第一终端发送的第一数据,其中,第一数据基于第二消息队列的空闲位信息从第一消息队列中确定,第一消息队列用于存放待发送的数据,第二消息队列用于存放已发送的数据。Step 201: Receive the first data sent by the first terminal, wherein the first data is determined from the first message queue based on the free bit information of the second message queue, the first message queue is used to store the data to be sent, and the second message queue is used to store the data to be sent. Queues are used to store sent data.

需要说明的是,第二终端执行本发明实施例提供的数据传输过程如下:第二终端根据接收第一终端发送的第一数据,并通过解调获得第一数据包含的数据帧。并根据获得的数据帧,第二终端可以生成确收信息,确收信息中示意了第一数据帧每一个数据帧是否收到。It should be noted that, the second terminal performs the data transmission process provided by the embodiment of the present invention as follows: the second terminal obtains the data frame included in the first data through demodulation according to receiving the first data sent by the first terminal. And according to the obtained data frame, the second terminal may generate acknowledgment information, where the acknowledgment information indicates whether each data frame of the first data frame is received.

根据本发明实施例的数据传输方法,第二终端接收到了第一终端发送的第一数据,由于第一数据通过第一终端的第一消息队列和第二消息队列确定,只与第一终端所处条件有关,因此,第二终端无需向第一终端反馈信息以限制第一终端的发送。由于本方法不需要等待接收方的应答,因此可以最大程度上提升数据传输的速度,实现两个蓝牙BLE设备的数据传输。According to the data transmission method of the embodiment of the present invention, the second terminal receives the first data sent by the first terminal. Since the first data is determined by the first message queue and the second message queue of the first terminal, it is only communicated with the first terminal. Therefore, the second terminal does not need to feed back information to the first terminal to restrict the transmission of the first terminal. Since this method does not need to wait for the receiver's response, the speed of data transmission can be improved to the greatest extent, and the data transmission of two Bluetooth BLE devices can be realized.

可以理解的是,第一数据基于第一终端的第一消息队列和第二消息队列确定,包括:第一数据基于第一终端的非空第一消息队列和非满第二消息队列确定。It can be understood that the first data is determined based on the first message queue and the second message queue of the first terminal, including: the first data is determined based on the non-empty first message queue and the non-full second message queue of the first terminal.

可以理解的是,方法还包括:Understandably, the method also includes:

发送第二数据至第二终端,其中,第二数据包括第一数据的确收信息;sending second data to the second terminal, wherein the second data includes acknowledgement information of the first data;

其中,第二数据用于与第二消息队列的数据进行比对,确认第一消息队列的数据和第二消息队列的空闲位。The second data is used to compare with the data of the second message queue to confirm the data of the first message queue and the free bits of the second message queue.

具体的,第二终端通过使用句柄值通知ATT_HANDLE_VALUE_NTF向第一终端发送第二数据,本发明实施例通过第一终端的ATT_WRITE_CMD传输和第二终端的ATT_HANDLE_VALUE_NTF传输相结合的方式实现两个蓝牙BLE设备可靠性数据传输。Specifically, the second terminal uses the handle value to notify ATT_HANDLE_VALUE_NTF to send the second data to the first terminal. In this embodiment of the present invention, the two Bluetooth BLE devices are reliable by combining the ATT_WRITE_CMD transmission of the first terminal and the ATT_HANDLE_VALUE_NTF transmission of the second terminal. Sexual data transfer.

需要说明的是,ATT_HANDLE_VALUE_NTF与句柄值指示ATT_HANDLE_VALUE_IND的不同之处是,ATT_HANDLE_VALUE_IND需要第一终端回复,如果回复超时,蓝牙连接会对断开。ATT_HANDLE_VALUE_NTF由第二终端主动发起,可以在任何时候发出且不需要第一终端的回复,第二终端采用ATT_HANDLE_VALUE_NTF发信是出于对蓝牙传输速度最高的要求。It should be noted that the difference between ATT_HANDLE_VALUE_NTF and the handle value indicating ATT_HANDLE_VALUE_IND is that ATT_HANDLE_VALUE_IND requires the first terminal to reply. If the reply times out, the Bluetooth connection will be disconnected. ATT_HANDLE_VALUE_NTF is actively initiated by the second terminal, and can be sent at any time without a reply from the first terminal. The second terminal uses ATT_HANDLE_VALUE_NTF to send a letter because of the highest requirement for Bluetooth transmission speed.

需要说明的是,第二终端在收到第一数据包括的数据帧后,会用变量进行“位或操作”,标志着第二终端已经收到了第一终端的数据帧,最终得到第二数据。It should be noted that, after receiving the data frame included in the first data, the second terminal will perform a "bit OR operation" with the variable, indicating that the second terminal has received the data frame of the first terminal, and finally obtains the second data .

具体的,由于第一数据发送前会在进行编号,因此,第二设备收到的数据帧比如00000001、00000010、00000100、00010000、01000000和10000000,第二终端执行位或后的得到的结果是:11010111,则该值即为当前次连接间隔的确收信息,会在下次连接间隔时发送给第一终端。Specifically, since the numbering will be performed before the first data is sent, the data frames received by the second device such as 00000001, 00000010, 00000100, 00010000, 01000000, and 10000000, and the result obtained by the second terminal after performing bit-OR is: 11010111, then this value is the confirmation information of the current connection interval, which will be sent to the first terminal at the next connection interval.

智能家电设备使用蓝牙BLE技术进行可靠性数据传输时,一般会采用在协议层ATT_WRITE_REQ写数据的方式来保证数据的可靠性。因为基于最新的蓝牙规范5.3版本中,ATT_WRITE_REQ写数据方式需要等待对端设备ATT_WRITE_RSP应答后,才能继续发送下一帧数据,若没有接收到ATT_WRITE_RSP应答,需要进行重发。因此保证了数据的可靠性传输,传统的蓝牙数据传输过程中需要经过以下几个步骤:When smart home appliances use Bluetooth BLE technology for reliable data transmission, they generally use the method of writing data at the protocol layer ATT_WRITE_REQ to ensure the reliability of the data. Because based on the latest Bluetooth specification version 5.3, the ATT_WRITE_REQ write data method needs to wait for the ATT_WRITE_RSP response from the peer device before continuing to send the next frame of data. If the ATT_WRITE_RSP response is not received, it needs to be retransmitted. Therefore, the reliable transmission of data is ensured. The traditional Bluetooth data transmission process needs to go through the following steps:

步骤1、发送端的ATT层将调用协议栈接口待发送的数据传递给蓝牙controller层。Step 1. The ATT layer of the sender transmits the data to be sent by calling the protocol stack interface to the Bluetooth controller layer.

步骤2、发送端蓝牙controller层将在使用无线链路建立的连接间隔参数进行跳频,并在空闲状态下将数据帧通过信号调制发送出去。Step 2: The Bluetooth controller layer of the transmitting end performs frequency hopping using the connection interval parameter established by the wireless link, and transmits the data frame through signal modulation in an idle state.

步骤3、接收端通过信号解调拿到发送端的数据帧后,将数据送至接收端的ATT层。Step 3: After the receiving end obtains the data frame of the transmitting end through signal demodulation, the data is sent to the ATT layer of the receiving end.

步骤4、接收端的ATT层对数据帧做出ATT_WRITE_RSP应答帧并传递给接收端蓝牙controller层。Step 4. The ATT layer of the receiving end makes an ATT_WRITE_RSP response frame to the data frame and transmits it to the Bluetooth controller layer of the receiving end.

步骤5、接收端蓝牙controller层将在使用无线链路建立的连接间隔参数进行跳频,并在空闲状态下将数据帧通过信号调制发送出去。Step 5: The Bluetooth controller layer of the receiving end performs frequency hopping using the connection interval parameter established by the wireless link, and transmits the data frame through signal modulation in an idle state.

步骤6、发送端通过信号解调拿到接收端的ATT_WRITE_RSP应答帧后,将数据送至发送端ATT层。Step 6: After the sender obtains the ATT_WRITE_RSP response frame of the receiver through signal demodulation, the data is sent to the ATT layer of the sender.

至此1次数据传输完毕,同时可以算出1次数据传输时间最少需要占用两个连接间隔。实际上对于两个设备的蓝牙数据发送占用的射频带宽时间最大为2.12ms(理论计算值),但连接间隔一般设置为50ms(常见使用值),因此两个设备间的射频带宽大多数时间均在等待,对射频的利用率为(2.12+2.12)/(50+50)=4.24%,利用率较低。同时BLE拥有低功耗,信道跳频的特性,因此在BLE中使用确认机制通信,较长的时间会使RF射频资源处于空闲状态,限制BLE的通信速率。So far, one data transmission is completed, and at the same time, it can be calculated that one data transmission time requires at least two connection intervals. In fact, the maximum radio frequency bandwidth time occupied by the Bluetooth data transmission of two devices is 2.12ms (theoretical calculation value), but the connection interval is generally set to 50ms (commonly used value), so the radio frequency bandwidth between the two devices is the same most of the time. While waiting, the utilization rate of the radio frequency is (2.12+2.12)/(50+50)=4.24%, and the utilization rate is relatively low. At the same time, BLE has the characteristics of low power consumption and channel frequency hopping. Therefore, the confirmation mechanism is used in BLE to communicate, and the RF radio frequency resources will be idle for a long time, which limits the communication rate of BLE.

可以理解的是,参照图3,本发明实施例提供的蓝牙数据传输方法流程,包括如下步骤:It can be understood that, referring to FIG. 3 , the flow of the Bluetooth data transmission method provided by the embodiment of the present invention includes the following steps:

步骤31、发送方与接收方蓝牙连接,建立好BLE无线链路后,先进行mtu值交换以及连接参数更新,其中连接参数为50ms。Step 31: The sender and the receiver are connected via Bluetooth. After the BLE wireless link is established, the mtu value is exchanged and the connection parameter is updated, wherein the connection parameter is 50ms.

步骤32、发送方的应用层data_tran_task任务中有数据发送时,需要先判断“待发送消息队列”是否是满,若队列已满,则阻塞应用层任务,否则将应用层数据添加到“待发送消息队列”中。Step 32. When there is data to be sent in the application layer data_tran_task task of the sender, it is necessary to first determine whether the "message queue to be sent" is full. message queue".

步骤33、在蓝牙协议栈任务调度中,读取“待发送消息队列”是否为空,为空说明当前无需要发送的数据,则退出调度。Step 33: In the task scheduling of the Bluetooth protocol stack, read whether the "message queue to be sent" is empty. If it is empty, it means that there is currently no data to be sent, and the scheduling is exited.

不为空则读取“待确认消息队列”是否满;若为满,则说明之前还存在未确认的数据帧,没有空位可以存储当前待发送数据,退出此次调度;If it is not empty, read whether the "to-be-confirmed message queue" is full; if it is full, it means that there are unconfirmed data frames before, and there is no space to store the current data to be sent, and exit this scheduling;

否则,在此次调度中依次将“待发送消息队列”取出并对数据进行编号后,通过ATT_WRITE_CMD的方式发送给对端设备,并将对应的数据拷贝进“待确认消息队列”中,直到“待确认消息队列”满或者“待发送消息队列”空。Otherwise, in this scheduling, after taking out the "message queue to be sent" and numbering the data, send it to the peer device through ATT_WRITE_CMD, and copy the corresponding data into the "message queue to be confirmed" until " The message queue to be acknowledged is full or the message queue to be sent is empty.

步骤34、接收方通过无线的解调可以接收到发送方的数据,解析数据包的编号字节信息依次进行“位或”操作,在下次蓝牙调度时,通过ATT_HANDLE_VALUE_NTF方式应答给发送方。Step 34: The receiver can receive the data of the sender through wireless demodulation, parse the serial number byte information of the data packet and perform a "bit OR" operation in turn, and reply to the sender by ATT_HANDLE_VALUE_NTF in the next Bluetooth scheduling.

步骤35、等待蓝牙协议栈调度结束后,在data_tran_task任务中,若有数据发送则继续添加到“待发送消息队列”中,没有则阻塞数据发送任务;Step 35. After waiting for the scheduling of the Bluetooth protocol stack, in the data_tran_task task, if there is data to be sent, continue to add it to the "message queue to be sent", otherwise, block the data sending task;

步骤36、在蓝牙协议栈任务中,读取“待发送消息队列”是否为空,为空则退出调度;不为空则读取“待确认消息队列”是否满;若为满,则退出此次调度;否则继续按照步骤33发送数据。Step 36. In the Bluetooth protocol stack task, read whether the "message queue to be sent" is empty, if it is empty, exit the scheduling; if it is not empty, read whether the "message queue to be confirmed" is full; if it is full, exit this secondary scheduling; otherwise, continue to send data according to step 33.

设备A通过解调接收到设备B的应答帧;通过解析应答帧接收序号字节信息与“待确认消息队列”的序号比较,相同序号则将该数据帧从“待确认消息队列”中移除,不相同则将数据帧用后进先出LIFO的方式拷贝到“待发送消息队列”中等待下一次蓝牙协议栈调度到来。Device A receives the response frame from device B through demodulation; by parsing the response frame, the received sequence number byte information is compared with the sequence number of the "to-be-confirmed message queue", and if the same sequence number is the same, the data frame is removed from the "to-be-confirmed message queue" , if it is not the same, copy the data frame to the "message queue to be sent" in a LIFO manner and wait for the next Bluetooth protocol stack scheduling.

步骤37、后续应用层的需要发送数据帧发送,按照步骤32~37的方法执行。Step 37: The subsequent application layer needs to send a data frame to send, which is performed according to the methods of steps 32 to 37.

本发明实施例的蓝牙数据传输方法,第一终端(发送方)通过ATT_WRITE_CMD方式发送数据,第二终端(接收方)通过ATT_HANDLE_VALUE_NTF方式对发送方进行应答,由于接收方通过对发送方的数据帧的批量应答的方式,使得发送方不需因等待接收方的应答即而阻塞任务,使得发送方可发送剩下的数据帧。最大限度的提升两个设备的蓝牙射频带宽使用率,进而提升蓝牙可靠性数据传输的速率。In the Bluetooth data transmission method according to the embodiment of the present invention, the first terminal (sender) sends data through ATT_WRITE_CMD, and the second terminal (receiver) responds to the sender through ATT_HANDLE_VALUE_NTF. The method of batch response allows the sender not to block the task due to waiting for the receiver's response, so that the sender can send the remaining data frames. Maximize the Bluetooth RF bandwidth usage of the two devices, thereby increasing the rate of Bluetooth reliable data transmission.

下面对本发明提供的数据传输装置进行描述,下文描述的数据传输装置与上文描述的第一终端侧的数据传输方法可相互对应参照。如图4所示,本发明实施例还公开了一种数据传输装置,包括:The data transmission apparatus provided by the present invention is described below, and the data transmission apparatus described below and the data transmission method on the first terminal side described above can be referred to each other correspondingly. As shown in FIG. 4 , an embodiment of the present invention further discloses a data transmission device, including:

第一发送模块401,用于基于第一消息队列和第二消息队列确定待发送的第一数据,发送待发送的第一数据给第二终端,将已发送的第一数据存入第二消息队列中;The first sending module 401 is configured to determine the first data to be sent based on the first message queue and the second message queue, send the first data to be sent to the second terminal, and store the sent first data in the second message in the queue;

其中,第一消息队列用于存放待发送的第一数据,第二消息队列用于存放已发送的第一数据。The first message queue is used to store the first data to be sent, and the second message queue is used to store the sent first data.

根据本发明实施例的数据传输装置,第一终端通过第一发送模块的第一消息队列和第二消息队列确定了待发送的第一数据,由于第一消息队列存放了调度过程中想要发送的数据帧,第二消息队列存放了已经发送但是还未确认是否发送的数据帧,因此只要监测这两个消息队列的情况,就能第一终端是否具备充足条件向外发送数据。由于本装置不需要等待接收方的应答,因此可以最大程度上提升数据传输的速度,实现两个蓝牙BLE设备的数据传输。According to the data transmission device of the embodiment of the present invention, the first terminal determines the first data to be sent through the first message queue and the second message queue of the first sending module, because the first message queue stores the data to be sent in the scheduling process. The second message queue stores the data frames that have been sent but have not yet been confirmed to be sent. Therefore, as long as the conditions of the two message queues are monitored, it can be determined whether the first terminal has sufficient conditions to send data to the outside world. Since the device does not need to wait for the receiver's response, it can maximize the speed of data transmission and realize data transmission between two Bluetooth BLE devices.

可以理解的是,基于第二消息队列的空闲位信息从第一消息队列中确定第一数据,包括:It can be understood that determining the first data from the first message queue based on the free bit information of the second message queue includes:

确定第二消息队列中存在空闲位,将第一消息队列中的所有数据作为所述第一数据。It is determined that there are free bits in the second message queue, and all data in the first message queue is used as the first data.

需要说明的是,即需要确定第一消息队列非空且第二消息队列非满后,确定第一数据。It should be noted that the first data needs to be determined after it is determined that the first message queue is not empty and the second message queue is not full.

可以理解的是,将已发送的所述第一数据存入所述第二消息队列中,包括:It can be understood that storing the sent first data in the second message queue includes:

将已发送的所述第一数据按照发送顺序依次存入所述第二消息队列的空闲位中。The sent first data is sequentially stored in the idle bits of the second message queue according to the sending sequence.

可以理解的是,装置还包括:It can be understood that the device also includes:

第一接收模块402,用于接收第二终端发送的第二数据,其中,第二数据包括已发送的第一数据的确收信息;a first receiving module 402, configured to receive second data sent by a second terminal, wherein the second data includes acknowledgement information of the sent first data;

还用于基于第二数据和第二消息队列的比对结果,确认第一消息队列和第二消息队列。It is also used for confirming the first message queue and the second message queue based on the comparison result between the second data and the second message queue.

可以理解的是,第一接收模块402中基于第二数据和第二消息队列的比对结果,确认第一消息队列和第二消息队列,包括:It can be understood that the first receiving module 402 confirms the first message queue and the second message queue based on the comparison result between the second data and the second message queue, including:

基于第二数据与第二消息队列比对一致的数据帧,确定第二消息队列;Determine the second message queue based on the data frame in which the second data is consistent with the second message queue;

基于第二数据与第二消息队列比对不一致的数据帧,确定第一消息队列。The first message queue is determined based on the data frames in which the second data is inconsistent with the second message queue.

下面对本发明提供的数据传输装置进行描述,下文描述的数据传输装置与上文描述的第二终端侧的数据传输方法可相互对应参照。如图5所示,本发明实施例还公开了一种数据传输装置,包括:The data transmission apparatus provided by the present invention is described below, and the data transmission apparatus described below and the data transmission method on the second terminal side described above can be referred to each other correspondingly. As shown in FIG. 5 , an embodiment of the present invention further discloses a data transmission device, including:

第二接收模块501,用于接收第一终端发送的第一数据;The second receiving module 501 is configured to receive the first data sent by the first terminal;

其中,第一数据基于第一终端的第一消息队列和第二消息队列确定,第一消息队列用于存放待发送的第一数据,第二消息队列用于存放已发送的第一数据。The first data is determined based on the first message queue and the second message queue of the first terminal. The first message queue is used to store the first data to be sent, and the second message queue is used to store the sent first data.

根据本发明实施例的数据传输装置,第二终端通过第二接收模块接收到了第一终端发送的第一数据,由于第一数据通过第一终端的第一消息队列和第二消息队列确定,只与第一终端本身条件有关,因此,第二终端无需向第一终端反馈信息以限制第一终端的发送。由于本装置不需要等待接收方的应答,因此可以最大程度上提升数据传输的速度,实现两个蓝牙BLE设备的数据传输。According to the data transmission device of the embodiment of the present invention, the second terminal receives the first data sent by the first terminal through the second receiving module. Since the first data is determined through the first message queue and the second message queue of the first terminal, only It is related to the condition of the first terminal itself, therefore, the second terminal does not need to feed back information to the first terminal to restrict the transmission of the first terminal. Since the device does not need to wait for the receiver's response, it can maximize the speed of data transmission and realize data transmission between two Bluetooth BLE devices.

可以理解的是,第一数据基于第一终端的第一消息队列和第二消息队列确定,包括:It can be understood that the first data is determined based on the first message queue and the second message queue of the first terminal, including:

第一数据基于第一终端的非空第一消息队列和非满第二消息队列确定。The first data is determined based on the non-empty first message queue and the non-full second message queue of the first terminal.

可以理解的是,装置还包括:It can be understood that the device also includes:

第二发送模块502,用于发送第二数据至第二终端,其中,第二数据包括第一数据的确收信息;The second sending module 502 is configured to send second data to the second terminal, wherein the second data includes confirmation information of the first data;

其中,第二数据用于与第二消息队列的比对,确认第一消息队列和第二消息队列。The second data is used for comparison with the second message queue to confirm the first message queue and the second message queue.

图6示例了一种电子设备的实体结构示意图,如图6所示,该电子设备可以包括:处理器(processor)610、通信接口(Communications Interface)620、存储器(memory)630和通信总线640,其中,处理器610,通信接口620,存储器630通过通信总线640完成相互间的通信。处理器610可以调用存储器630中的逻辑指令,以执行如下方法:FIG. 6 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 6 , the electronic device may include: a processor (processor) 610, a communication interface (Communications Interface) 620, a memory (memory) 630 and a communication bus 640, The processor 610 , the communication interface 620 , and the memory 630 communicate with each other through the communication bus 640 . The processor 610 may invoke logic instructions in the memory 630 to perform the following methods:

基于第二消息队列的空闲位信息从第一消息队列中确定第一数据;determining the first data from the first message queue based on the idle bit information of the second message queue;

发送第一数据给第二终端,将已发送的第一数据存入第二消息队列中;sending the first data to the second terminal, and storing the sent first data in the second message queue;

其中,第一消息队列用于存放待发送的数据,第二消息队列用于存放已发送的数据。The first message queue is used to store data to be sent, and the second message queue is used to store sent data.

本发明实施例的电子设备,实现了发送方通过ATT_WRITE_CMD方式发送数据,接收方通过ATT_HANDLE_VALUE_NTF方式对发送方进行应答,由于接收方通过对发送方的数据帧的批量应答的方式,使得发送方不需因等待接收方的应答即而阻塞任务,使得发送方可发送剩下的数据帧。最大限度的提升两个终端的蓝牙射频带宽使用率,进而提升蓝牙可靠性数据传输的速率。The electronic device of the embodiment of the present invention realizes that the sender sends data through the ATT_WRITE_CMD method, and the receiver responds to the sender through the ATT_HANDLE_VALUE_NTF method. Since the receiver responds to the sender's data frames in batches, the sender does not need to The task is blocked waiting for the receiver's response, allowing the sender to send the remaining data frames. Maximize the Bluetooth radio frequency bandwidth usage of the two terminals, thereby improving the rate of Bluetooth reliable data transmission.

此外,上述的存储器630中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the memory 630 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence, or the part that contributes to the related technology or the part of the technical solution. The computer software product is stored in a storage medium, including several The instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .

另一方面,本发明实施例公开一种计算机程序产品,计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,计算机程序包括程序指令,当程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的方法,例如包括:On the other hand, an embodiment of the present invention discloses a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can Executing the methods provided by the above method embodiments, for example, includes:

基于第二消息队列的空闲位信息从第一消息队列中确定第一数据;determining the first data from the first message queue based on the idle bit information of the second message queue;

发送第一数据给第二终端,将已发送的第一数据存入第二消息队列中;sending the first data to the second terminal, and storing the sent first data in the second message queue;

其中,第一消息队列用于存放待发送的数据,第二消息队列用于存放已发送的数据。The first message queue is used to store data to be sent, and the second message queue is used to store sent data.

本发明实施例的计算机程序产品,实现了发送方通过ATT_WRITE_CMD方式发送数据,接收方通过ATT_HANDLE_VALUE_NTF方式对发送方进行应答,由于接收方通过对发送方的数据帧的批量应答的方式,使得发送方不需因等待接收方的应答即而阻塞任务,使得发送方可发送剩下的数据帧。最大限度的提升两个终端的蓝牙射频带宽使用率,进而提升蓝牙可靠性数据传输的速率。The computer program product of the embodiment of the present invention realizes that the sender sends data through the ATT_WRITE_CMD method, and the receiver responds to the sender through the ATT_HANDLE_VALUE_NTF method. Because the receiver responds to the sender's data frames in batches, the sender does not The task needs to be blocked waiting for the receiver's response, so that the sender can send the remaining data frames. Maximize the Bluetooth radio frequency bandwidth usage of the two terminals, thereby improving the rate of Bluetooth reliable data transmission.

又一方面,本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的传输方法,例如包括:In yet another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored, and the computer program is implemented by a processor to execute the transmission method provided by the above embodiments, for example, including :

基于第二消息队列的空闲位信息从第一消息队列中确定第一数据;determining the first data from the first message queue based on the idle bit information of the second message queue;

发送第一数据给第二终端,将已发送的第一数据存入第二消息队列中;sending the first data to the second terminal, and storing the sent first data in the second message queue;

其中,第一消息队列用于存放待发送的数据,第二消息队列用于存放已发送的数据。The first message queue is used to store data to be sent, and the second message queue is used to store sent data.

本发明实施例的非暂态计算机可读存储介质,实现了发送方通过ATT_WRITE_CMD方式发送数据,接收方通过ATT_HANDLE_VALUE_NTF方式对发送方进行应答,由于接收方通过对发送方的数据帧的批量应答的方式,使得发送方不需因等待接收方的应答即而阻塞任务,使得发送方可发送剩下的数据帧。最大限度的提升两个终端的蓝牙射频带宽使用率,进而提升蓝牙可靠性数据传输的速率。The non-transitory computer-readable storage medium of the embodiment of the present invention realizes that the sender sends data in the ATT_WRITE_CMD mode, and the receiver responds to the sender in the ATT_HANDLE_VALUE_NTF mode, because the receiver responds to the sender's data frames in batches. , so that the sender does not need to wait for the receiver's response to block the task, so that the sender can send the remaining data frames. Maximize the Bluetooth radio frequency bandwidth usage of the two terminals, thereby improving the rate of Bluetooth reliable data transmission.

以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place , or distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence, or the parts that make contributions to related technologies, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic disks , optical disc, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods of various embodiments or portions of embodiments.

最后应说明的是,以上实施方式仅用于说明本发明,而非对本发明的限制。尽管参照实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,对本发明的技术方案进行各种组合、修改或者等同替换,都不脱离本发明技术方案的精神和范围,均应涵盖在本发明的中。Finally, it should be noted that the above embodiments are only used to illustrate the present invention, but not to limit the present invention. Although the present invention has been described in detail with reference to the embodiments, those of ordinary skill in the art should understand that various combinations, modifications or equivalent replacements to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and should cover in the present invention.

Claims (10)

1.一种数据传输方法,其特征在于,包括:1. a data transmission method, is characterized in that, comprises: 基于第二消息队列的空闲位信息从第一消息队列中确定第一数据;determining the first data from the first message queue based on the idle bit information of the second message queue; 发送所述第一数据给第二终端,将已发送的所述第一数据存入所述第二消息队列中;sending the first data to the second terminal, and storing the sent first data in the second message queue; 其中,所述第一消息队列用于存放待发送的数据,所述第二消息队列用于存放已发送的数据。The first message queue is used for storing data to be sent, and the second message queue is used for storing sent data. 2.根据权利要求1所述的数据传输方法,其特征在于,所述基于第二消息队列的空闲位信息从第一消息队列中确定第一数据,包括:2. The data transmission method according to claim 1, wherein the determining the first data from the first message queue based on idle bit information of the second message queue comprises: 确定所述第二消息队列中存在空闲位,将所述第一消息队列中的所有数据作为所述第一数据。It is determined that there are free bits in the second message queue, and all data in the first message queue is used as the first data. 3.根据权利要求2所述的数据传输方法,其特征在于,所述将已发送的所述第一数据存入所述第二消息队列中,包括:3. The data transmission method according to claim 2, wherein the storing the sent first data in the second message queue comprises: 将所述已发送的所述第一数据按照发送顺序依次存入所述第二消息队列的空闲位中。The sent first data is sequentially stored in the idle bits of the second message queue according to the sending sequence. 4.根据权利要求1至3任一所述的数据传输方法,其特征在于,所述方法还包括:4. The data transmission method according to any one of claims 1 to 3, wherein the method further comprises: 接收所述第二终端发送的第二数据,其中,所述第二数据包括所述已发送的第一数据的确收信息;receiving second data sent by the second terminal, wherein the second data includes acknowledgment information of the sent first data; 基于所述第二消息队列的数据与所述第二数据的比对结果,确定所述第一消息队列的数据或所述第二消息队列的空闲位。Based on the comparison result of the data of the second message queue and the second data, the data of the first message queue or the free bits of the second message queue are determined. 5.根据权利要求4所述的数据传输方法,其特征在于,所述基于所述第二消息队列的数据与所述第二数据的比对结果,确定所述第一消息队列的数据或所述第二消息队列的空闲位,包括:5 . The data transmission method according to claim 4 , wherein the data of the first message queue or the data of the first message queue is determined based on the comparison result between the data of the second message queue and the second data. 6 . The idle bits of the second message queue include: 基于所述第二消息队列中的数据与所述第二数据的比对一致结果,确定所述第二消息队列的空闲位;determining the idle bits of the second message queue based on the consistent result of the comparison between the data in the second message queue and the second data; 基于所述第二消息队列中的数据与所述第二数据的比对不一致结果,确定所述第一消息队列的数据。The data of the first message queue is determined based on the inconsistency result of the comparison between the data in the second message queue and the second data. 6.根据权利要求5所述的数据传输方法,其特征在于,所述基于所述第二消息队列中的数据与所述第二数据的比对一致结果,确定所述第二消息队列的空闲位;基于所述第二消息队列中的数据与所述第二数据的比对不一致结果,确定所述第一消息队列的数据,包括:6 . The data transmission method according to claim 5 , wherein, the idleness of the second message queue is determined based on a consistent result of the comparison between the data in the second message queue and the second data. 7 . bit; determining the data of the first message queue based on the inconsistency result of the comparison between the data in the second message queue and the second data, including: 基于所述第二消息队列中与所述第二数据比对一致的数据帧,从所述第二消息队列中删除所述比对一致的数据帧,确定更新的所述第二消息队列的空闲位;Based on the data frames in the second message queue that are consistent with the second data, the data frames that are consistent with the comparison are deleted from the second message queue, and the updated idleness of the second message queue is determined. bit; 基于所述第二消息队列中与所述第二数据比对不一致的数据帧,将所述比对不一致的数据帧存入所述第一消息队列中,确定更新的所述第一消息队列中的数据。Based on the data frames in the second message queue that are inconsistent with the second data, store the inconsistent data frames in the first message queue, and determine the updated first message queue. The data. 7.一种数据传输装置,其特征在于,包括:7. A data transmission device, comprising: 第一发送模块,用于基于第二消息队列的空闲位信息从第一消息队列中确定第一数据a first sending module, configured to determine the first data from the first message queue based on the idle bit information of the second message queue 还用于发送所述第一数据给第二终端,将已发送的所述第一数据存入所述第二消息队列中;is also used to send the first data to a second terminal, and store the sent first data in the second message queue; 其中,所述第一消息队列用于存放待发送的数据,所述第二消息队列用于存放已发送的数据。The first message queue is used for storing data to be sent, and the second message queue is used for storing sent data. 8.一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至7任一项所述数据传输方法。8. An electronic device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements any one of claims 1 to 7 when the processor executes the program The data transmission method described in item. 9.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现如权利要求1至7任一项所述数据传输方法。9 . A non-transitory computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 7 is implemented. 10.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述数据传输方法。10. A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 7 is implemented.
CN202210709304.XA 2022-06-21 2022-06-21 Data transmission method, device, electronic device, storage medium and product Active CN115038116B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210709304.XA CN115038116B (en) 2022-06-21 2022-06-21 Data transmission method, device, electronic device, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210709304.XA CN115038116B (en) 2022-06-21 2022-06-21 Data transmission method, device, electronic device, storage medium and product

Publications (2)

Publication Number Publication Date
CN115038116A true CN115038116A (en) 2022-09-09
CN115038116B CN115038116B (en) 2025-07-04

Family

ID=83126359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210709304.XA Active CN115038116B (en) 2022-06-21 2022-06-21 Data transmission method, device, electronic device, storage medium and product

Country Status (1)

Country Link
CN (1) CN115038116B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050217A1 (en) * 2003-08-26 2005-03-03 Yosuke Tamura Wireless LAN apparatus
CN113076281A (en) * 2021-03-30 2021-07-06 山东英信计算机技术有限公司 Method, system, equipment and medium for communication of Ceph kernel client
CN114363370A (en) * 2021-12-29 2022-04-15 中汽创智科技有限公司 Vehicle-mounted equipment communication method, device and system and vehicle

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050217A1 (en) * 2003-08-26 2005-03-03 Yosuke Tamura Wireless LAN apparatus
CN113076281A (en) * 2021-03-30 2021-07-06 山东英信计算机技术有限公司 Method, system, equipment and medium for communication of Ceph kernel client
CN114363370A (en) * 2021-12-29 2022-04-15 中汽创智科技有限公司 Vehicle-mounted equipment communication method, device and system and vehicle

Also Published As

Publication number Publication date
CN115038116B (en) 2025-07-04

Similar Documents

Publication Publication Date Title
EP3720019B1 (en) Internet of things data transmission method, device and system
JP5301533B2 (en) How to optimize near-field links
US8964631B2 (en) Communication apparatus, control method for communication apparatus, and storage medium
US20200104195A1 (en) Methods and apparatus for correcting out-of-order data transactions between processors
CN110808948B (en) Remote procedure call method, device and system
CN117241407A (en) A communication method and device
CN115119540A (en) Communication method and communication device under multi-connection
JP2009278259A (en) Wireless communication device
CN109756464B (en) Communication method, server and client
EP3911089A1 (en) Transmission processing method and device, and apparatus and storage medium
EP3490293B1 (en) Data receiving method, data sending method, receiving device and system
TWI764458B (en) Bluetooth-based data transmission method and data reception method, communicating apparatus and computer storage medium
WO2024088147A1 (en) Communication method and apparatus
EP2922365A1 (en) Packet transmission method, system, and station
CN114765897A (en) Communication method and device
CN115038120A (en) Data transmission method, apparatus, electronic device, storage medium and program product
CN115038115A (en) Data transmission method, apparatus, electronic device, storage medium and product
CN115001541B (en) Data transmission method, device, electronic equipment, storage medium and product
CN115038116A (en) Data transmission method, device, electronic equipment, storage medium and product
CN115065966B (en) Terminal and communication method
CN114205307B (en) Data packet transmission method, RLC entity and storage medium
CN114556872B (en) Wireless communication method, device, electronic equipment and storage medium
CN109688085B (en) Transmission control protocol proxy method, storage medium and server
CN114285529A (en) Data transmission method, device, equipment and medium
WO2025185648A1 (en) Data transmission method between devices, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant