Transmitting method, receiving method, communication device and computer readable storage medium
By distinguishing data types in the ble mesh network and adopting different broadcast packet types (traditional broadcast and extended broadcast), the ble mesh network's inefficiency problem in big data transmission scenarios is solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN202510052181.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-05-06
AI Technical Summary
The ble mesh network is limited by the speed problem in the big data transmission scenario and has low communication efficiency.
By packaging small data into ble traditional broadcast packets and packaging big data into ble extended broadcast packets, different broadcast methods are used for transmission. Specifically, if the target data is the first data type, it is packaged as a ble traditional broadcast packet for broadcasting; if it is a second data type, it is packaged as a ble extended broadcast packet for broadcasting, and the data length of the second data type is greater than the first data type.
It improves the effective data volume of a single packet, improves the transmission efficiency of effective data, and reduces the overhead of protocol data, and is compatible with traditional broadcast scenarios with small data.
Smart Images

Figure CN119946561A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a method for sending and receiving BLE mesh broadcast data, a communication device, and a computer-readable storage medium. Background Art
[0002] Bluetooth Low Energy (BLE) is a wireless communication technology specification designed to provide data transmission capabilities over short distances while maintaining very low power consumption.
[0003] Bluetooth low energy mesh (BLE mesh) is a communication protocol based on the BLE protocol. It allows a large number of BLE devices to form a mesh network, enabling interconnection and collaborative control between devices within a sufficiently large physical coverage area, thereby meeting communication needs in multi-device scenarios.
[0004] For large data transmission scenarios, the BLE mesh network is limited by the rate problem and the communication efficiency is low. Summary of the invention
[0005] The embodiments of the present disclosure provide a method for sending and receiving BLE Mesh broadcast data, a communication device, and a computer-readable storage medium.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for sending BLE Mesh broadcast data, including:
[0007] Get target data;
[0008] determining the type of the target data;
[0009] If the target data is of the first data type, the target data is packaged into a BLE traditional broadcast packet and broadcasted in a BLE traditional broadcast mode; if the target data is of the second data type, the target data is packaged into a BLE extended broadcast packet and broadcasted in a BLE extended broadcast mode;
[0010] The data length of the second data type is greater than the data length of the first data type.
[0011] In a second aspect, an embodiment of the present disclosure provides a method for receiving BLE Mesh broadcast data, including:
[0012] Receive broadcast packets;
[0013] Determining the data type of the target data in the broadcast packet;
[0014] If the target data is of the first data type, the target data is applied based on the BLE traditional broadcast mode; if the target data is of the second data type, the target data is applied based on the BLE extended broadcast mode;
[0015] The data length of the second data type is greater than the data length of the first data type.
[0016] In a third aspect, an embodiment of the present disclosure provides a communication device, including:
[0017] an acquisition unit configured to acquire target data;
[0018] a determining unit, configured to determine the type of the target data;
[0019] The broadcast unit is configured to package the target data into a BLE traditional broadcast packet and broadcast it in a BLE traditional broadcast mode if the target data is a first data type; and to package the target data into a BLE extended broadcast packet and broadcast it in a BLE extended broadcast mode if the target data is a second data type; wherein the data length of the second data type is greater than the data length of the first data type.
[0020] In a fourth aspect, an embodiment of the present disclosure provides another communication device, including:
[0021] a receiving unit configured to receive a broadcast packet;
[0022] a determining unit configured to determine a data type of the target data in the broadcast packet;
[0023] The protocol unit is configured to apply the target data based on the traditional broadcast mode of BLE if the target data is a first data type; and to apply the target data based on the extended broadcast mode of BLE if the target data is a second data type; wherein the data length of the second data type is greater than the data length of the first data type.
[0024] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including:
[0025] Memory for storing computer programs;
[0026] A processor is used to execute a computer program stored on the memory to implement a method for sending BleMesh broadcast data as in the first aspect, and / or to implement a method for receiving BleMesh broadcast data as in the second aspect.
[0027] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program on a memory, and when the computer program is executed by at least one processor, the method for sending BLE mesh broadcast data as in the first aspect is implemented, and / or the method for receiving BLE mesh broadcast data as in the second aspect is implemented.
[0028] The disclosed embodiments provide a method for sending and receiving BLE mesh broadcast data, a communication device and a computer-readable storage medium. By packaging and broadcasting small data (first data type) with BLE traditional broadcast and packaging and broadcasting large data (second data type) with BLE extended broadcast, the effective data amount of a single packet can be increased when broadcasting large data, thereby improving the transmission efficiency of effective data, while also reducing protocol data overhead and being compatible with traditional broadcast scenarios of small data. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of data overhead of a standard BLE mesh protocol layer provided in an embodiment of the present disclosure;
[0030] Figure 2 A flowchart of a method for sending BLE Mesh broadcast data provided by an embodiment of the present disclosure;
[0031] Figure 3 A schematic diagram of the structure and packet sending timing of a BLE traditional broadcast packet provided in an embodiment of the present disclosure;
[0032] Figure 4 A schematic diagram of the structure and timing of packet transmission of a BLE extended broadcast packet provided in an embodiment of the present disclosure;
[0033] Figure 5 A detailed structure of a BLE extended broadcast packet and a schematic diagram of the packet sending timing provided in an embodiment of the present disclosure;
[0034] Figure 6 A detailed flowchart of a method for sending BLE Mesh broadcast data provided by an embodiment of the present disclosure;
[0035] Figure 7 A flowchart of a method for receiving BLE mesh broadcast data provided by an embodiment of the present disclosure;
[0036] Figure 8 A detailed flowchart of a method for receiving BLE mesh broadcast data provided by an embodiment of the present disclosure;
[0037] Fig. 9 A schematic diagram of a communication device provided in an embodiment of the present disclosure Figure 1 ;
[0038] Fig.10 A schematic diagram of a communication device provided in an embodiment of the present disclosure Figure 2 ;
[0039] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. It is understood that the specific embodiments described herein are only used to explain the relevant disclosure, rather than to limit the disclosure. It should also be noted that, for the convenience of description, only the parts related to the relevant disclosure are shown in the drawings.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing the embodiments of the present disclosure and are not intended to limit the present disclosure.
[0042] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0043] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present disclosure are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present disclosure described here can be implemented in an order other than that illustrated or described here.
[0044] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described first. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0045] Bluetooth Low Energy (ble);
[0046] Bluetooth low energy mesh (ble mesh);
[0047] Over the Air (OTA);
[0048] byte(byte, B);
[0049] bit (bit, b);
[0050] Microsecond (μs);
[0051] Milliseconds (ms);
[0052] Seconds(s);
[0053] Application layer;
[0054] Model layer (Model layer);
[0055] Foundation Model layer;
[0056] Access layer;
[0057] Upper transport layer;
[0058] Lower transport layer;
[0059] Network layer;
[0060] Bearer layer;
[0061] Controller;
[0062] BLE legacy broadcast (ble legacy broadcast);
[0063] Payload
[0064] Protocol Data Unit (PDU);
[0065] Operation code (Operate code, opcode, op code);
[0066] Transport Messages Integrity Check (TransMIC); Application Key Flag (AKF);
[0067] Application Key Identifier (AID);
[0068] IV index;
[0069] Network Identifier (NID);
[0070] Network Control (CTL);
[0071] Time to Live (TTL);
[0072] Sequence Number (SEQ);
[0073] Source Address (SRC);
[0074] Destination Address (DST)
[0075] Message Integrity Check for Network (NetMIC); Cyclic Redundancy Check (CRC);
[0076] Megabits per second (Mbps);
[0077] Extended Header Length
[0078] Advertising Mode (AdvMode)
[0079] Broadcasting data information (Adv Data Info, ADI).
[0080] The protocol layers of the standard BLE mesh can include, from the upper layer to the lower layer, the application layer, the model layer, the access layer, the upper transport layer, the lower transport layer, the network layer and the bearer layer.
[0081] Among them, the application layer is responsible for defining the specific needs of users and how to use the functions provided by the model layer to meet their needs; the model layer is responsible for designing standardized or customized models according to the user's usage scenarios, and how to interact with these models; the access layer is responsible for defining the data format of the application layer, and how to encode and decode the data; the upper transport layer is responsible for defining the data packet format in the mesh network, and defines how to encrypt and decrypt application messages and verify their integrity; the lower transport layer is responsible for defining the data packet format in the mesh network, and how to segment, reassemble, confirm, and retransmit data packets; the network layer is responsible for defining the node addresses in the mesh network, and how to route and forward data packets in the network; the bearer layer defines how mesh nodes transmit network messages; among them, there can also be a basic model layer between the model layer and the access layer, which is responsible for defining the status, messages, and models used to configure and manage the mesh network, and how to operate these elements. The basic model layer can be included in the model layer.
[0082] After being packaged layer by layer in each protocol layer, the valid broadcast data is further added with corresponding fields in the controller (Cobbler) and broadcast at the corresponding BLE broadcast timing.
[0083] Figure 1 A schematic diagram of the structure and overhead of each layer of a standard BLE mesh protocol provided in an embodiment of the present disclosure, wherein the model layer, application layer, etc. are not shown. Figure 1 It is the protocol layer overhead corresponding to the traditional broadcast of BLE. Figure 1 As shown in the figure, from bottom to top in terms of protocol layers, the data (single packet) overhead of each layer of the standard BLE mesh protocol is as follows:
[0084] Assume that the broadcast data packet (recorded as BLE legacy broadcast data, or BLE traditional broadcast data) is a non-directional broadcast packet adv_ind, and its payload includes: the broadcast party address AdvA and the effective broadcast data AdvData, where the broadcast party address AdvA occupies 6B, and the effective broadcast data AdvData is obtained after being packaged layer by layer by the protocol layer, occupying 0 to 31B, with a maximum of 31B. Therefore, the maximum overhead of the payload of the broadcast data packet adv_ind is 37B.
[0085] The header overhead of the BLE mesh bearer layer is 2B, of which the broadcast data type (type) occupies 1B, the data length (length) occupies 1B, and the valid data is the network layer PDU, which occupies 14B to 29B, and the maximum valid data is 29B. Therefore, the maximum overhead of the BLE mesh bearer layer is 31B.
[0086] The header overhead of the BLE mesh network layer is 9B, including: IV index occupies 1 bit (bit, b, 1B = 8b), NID occupies 7b, CTL occupies 1b, TTL occupies 7B, SEQ occupies 3B, SRC occupies 2B, DSC occupies 2B; the tail overhead is NetMIC, which occupies 4B or 8B; the valid data is the transport layer PDU (specifically the lower transport layer PDU), which occupies 1B to 16B, and the maximum valid data is 16B. Therefore, assuming that the tail overhead is 4B, the maximum overhead of the BLE mesh network layer is 29B.
[0087] The header overhead of the transport layer under BLE mesh is 1B, of which SEG occupies 1B, AKF occupies 1B, and AID occupies 6B. The SEG field indicates whether the transport layer PDU is a fragmented message. SEG = 0 means unfragmented, and SEG = 1 means fragmented. The valid data is the upper transport layer PDU, which occupies 5B to 15B, and the maximum valid data is 15B. Therefore, the maximum overhead of the transport layer under BLE mesh is 16B.
[0088] The tail overhead of the transport layer on ble mesh is TransMIC, which occupies 4B or 8B. Its valid data is the access layer data. The maximum valid data of a single packet is 11B. If the access layer data is larger than 11B, it will be sub-packetized.
[0089] The data of the BLE mesh access layer consists of an op code (variable length 1 to 3B) and application layer data. Since the op code of the access layer is variable and the application layer data is not much different from the access layer, for the convenience of statistics and comparison, the embodiment of the present disclosure can use the access layer data as the application layer data.
[0090] In the data transmission process of the BLE mesh network, the data structure depends on the definition of the model layer, the sending and receiving packets are limited by the BLE broadcast timing, and the data size is limited by the size of the broadcast data packet, which makes the application scenarios of the BLE mesh network limited to network data transmission of small data volumes. For scenarios such as OTA and special requirements of manufacturers for large data transmission, the BLE mesh network is limited by the rate problem and the communication efficiency is low.
[0091] Based on this, the disclosed embodiment provides a method for sending BLE mesh broadcast data, including: obtaining target data; determining the type of target data; if the target data is a first data type, packaging the target data into a BLE traditional broadcast packet, and broadcasting it in a BLE traditional broadcast mode; if the target data is a second data type, packaging the target data into a BLE extended broadcast packet, and broadcasting it in a BLE extended broadcast mode; wherein the data length of the second data type is greater than the data length of the first data type. In this way, by packaging and broadcasting small data (first data type) in BLE traditional broadcast, and packaging and broadcasting large data (second data type) in BLE extended broadcast, when broadcasting large data, the effective data amount of a single packet can be increased, thereby improving the transmission efficiency of effective data, while also reducing protocol data overhead and being compatible with traditional broadcast scenarios of small data.
[0092] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0093] In one embodiment of the present disclosure, see Figure 2 , which shows a flow chart of a method for sending BLE Mesh broadcast data provided by an embodiment of the present disclosure. Figure 2 As shown, the method for sending the BLE mesh broadcast data includes:
[0094] S201: Acquire target data.
[0095] It should be noted that the target data is information that needs to be broadcast, which can be sent by the application layer and determined according to the actual application scenario.
[0096] It should also be noted that the solution provided by the embodiment of the present disclosure is applied to BLE Mesh, and this solution can be executed by the BLE device of any node in BLE Mesh.
[0097] S202: Determine the type of target data.
[0098] It should be noted that the target data type can be divided into a first data type and a second data type, wherein the first data type corresponds to smaller data and the second data type corresponds to larger data, that is, the data length of the second data type is greater than the data length of the first data type.
[0099] In some embodiments, determining the type of target data may include:
[0100] If the application scenario corresponding to the target data is a preset scenario, the type of the target data is determined to be the second data type; otherwise, the type of the target data is determined to be the first data type.
[0101] It should be noted that the disclosed embodiments can determine the type of target data based on the application scenario. For some special application scenarios, the data volume is often large. Therefore, these special application scenarios can be set as preset scenarios. If the current target data is the target data of the preset scenario, it is determined as the second data type. If it is not the target data of the preset scenario, it is determined as the first data type.
[0102] For example, the preset scenarios include but are not limited to at least one of the following: file transfer, OTA upgrade, and the like.
[0103] In some embodiments, determining the type of target data includes:
[0104] If the data length of the target data is greater than or equal to a preset threshold, the type of the target data is determined to be the second data type; otherwise, the type of the target data is determined to be the first data type.
[0105] It should be noted that the embodiment of the present disclosure may also set a preset threshold value, which is a critical value for measuring whether the target data is big data. The data length of the target data is compared with the preset threshold value, and the type of the target data is determined according to the comparison result.
[0106] For example, assuming that the preset threshold is a bytes and the data length of the target data is b bytes, if b≥a, it means that the target data is big data, which is the first data type; if b<a, it means that the target data is small data, which is the second data type.
[0107] S203: If the target data is of the first data type, the target data is packaged into a BLE traditional broadcast packet and broadcasted in a BLE traditional broadcast mode; if the target data is of the second data type, the target data is packaged into a BLE extended broadcast packet and broadcasted in a BLE extended broadcast mode.
[0108] It should be noted that BLE traditional broadcast, also known as standard BLE broadcast and BLE legacy broadcast, is a standard way of packaging and sending BLE broadcast packets, and BLE extended broadcast is an extended way of packaging and sending BLE broadcast packets, which are introduced separately below.
[0109] In BLE Mesh, both BLE traditional broadcast packets and BLE extended broadcast packets are recorded as air interface data packets.
[0110] Figure 3 The standard BLE mesh protocol air interface data model obtained by packaging the target data based on BLE traditional broadcast is shown. It includes the payload format of the air interface data packet, the format of the air interface data packet, the air interface timing, and the broadcast events sent by the controller. Figure 3As shown, a BLE mesh application data packet will send multiple broadcast events adv_evt (usually 3 times) in the BLE controller, and a broadcast event adv_evt will send a broadcast data packet adv_ind (i.e., air interface data packet, specifically BLE traditional broadcast packet here) in each of the three broadcast channels (channels 37, 38, and 39, called the main channel). Specifically, the BLE traditional broadcast packet adv_ind is sent once in channels 37, 38, and 39, and the frame interval I_TFS between two adjacent frames is usually 150μs.
[0111] The time interval between two adjacent broadcast events adv_evt is the sum of the broadcast interval adv_intval and the broadcast delay advDelay: adv_intval+advDelay. The range of the broadcast interval adv_intval is between 20ms and 10485.759375s. In BLE mesh, the minimum broadcast interval adv_intval, i.e., 20ms, is generally used; the broadcast delay advDelay is a random number between 0 and 10ms (actually a pseudo-random number). For the convenience of statistics and calculation, the embodiment of this disclosure adopts its average value of 5ms.
[0112] like Figure 3 As shown, the payload of the BLE traditional advertising packet adv_ind includes the AdvA field and the AdvData field, that is, Figure 1 The AdvA field is used to store the broadcaster's device address (i.e., the broadcaster address), which can be public or random, and its data length is 6B (or 6 octets); the AdvData field is used to store the broadcast data from the broadcaster host, i.e., the effective broadcast data AdvData, and its data length is 0 to 31B.
[0113] Thus, for a BLE traditional advertising packet adv_ind:
[0114] The maximum length of a single air interface packet is: 376b = preamble 8b + air interface access address (AccessAddress, AA) 32b + header 16b + maximum payload 37B + cyclic redundancy check (CRC) 24b; assuming that the transmission rate of BLE is 1Mbps, that is, it takes 1μs to transmit 1b, so the transmission time of a single air interface packet is 376μs.
[0115] BLE mesh layer (BLE mesh layer includes Figure 1 as well as Figure 1The data overhead of each layer (each protocol layer in the relevant description) is: 4B+1B+13B+2B=20B, of which 4B is the header overhead of the upper transport layer, 1B is the header overhead of the lower transport layer, 13B is the header overhead and tail overhead of the network layer, and 2B is the header overhead of the bearer layer.
[0116] Combination Figure 1 And related descriptions, in BLE traditional broadcast, the maximum valid data of a single packet is 11B (ie, application layer data / access layer data). If it is larger than 11B, it will be sub-packeted. Therefore, the maximum application layer data length of a single BLE traditional broadcast packet adv_ind is 11B.
[0117] In this way, the maximum effective data rate of a single BLE traditional advertising packet adv_ind is: 11B / 25ms / 3=440B / s / 3=146B / s.
[0118] This data transmission rate is sufficient for small data application scenarios, but when facing big data application scenarios, there will be a problem of low communication efficiency. Therefore, the embodiment of the present disclosure uses this BLE traditional broadcast to send packets for the first data type of small data.
[0119] like Figure 3 As shown in the figure, the BLE mesh rate of BLE traditional broadcast is mainly limited by the size of BLE traditional broadcast packets and the data overhead of the BLE mesh protocol. If the single packet data length can be increased, it can not only increase the effective data volume of a single packet, but also increase the transmission rate of single packet effective data, and also reduce the protocol data overhead caused by application layer data packetization, thereby improving the overall BLE mesh data transmission rate. BLE extended broadcast single packet supports a maximum payload of 255B, so BLE extended broadcast can be used to improve air interface utilization, thereby improving transmission efficiency in big data application scenarios.
[0120] Figure 4 The BLE mesh extended broadcast air interface data model is shown by packaging the target data based on the BLE extended broadcast. Figure 3 The air interface data packet format shown is consistent, but its maximum payload length is 255B, so that more valid data can be carried.
[0121] like Figure 4As shown, the ble extended broadcast packet includes a first broadcast packet adv_ext_ind and a second broadcast packet aux_adv_ind, wherein the first broadcast packet adv_ext_ind does not carry valid broadcast data AdvData, etc., and only carries relevant information such as the channel, sending time point timing, etc. of the second broadcast packet aux_adv_ind, and the second broadcast packet aux_adv_ind carries valid broadcast data AdvData.
[0122] Like BLE traditional broadcast, in BLE extended broadcast, the first broadcast packet adv_ext_ind is also sent on three main channels (channels 37, 38 and 39, or broadcast channels), carrying information such as the sending time and channel of the second broadcast packet aux_adv_ind. The second broadcast packet aux_adv_ind is then sent on an available random data channel (one of channels 0 to 36, called an auxiliary channel or data channel), carrying valid broadcast data.
[0123] More specifically, the disclosed embodiment designs the data structure of the air interface data packet of the BLE extended broadcast, the air interface timing of the BLE extended broadcast and the air interface data structure used by the BLE mesh as shown in FIG. Figure 5 In order to maximize the use of network channels, to maximize the amount of valid data and minimize the amount of invalid data, the first broadcast packet adv_ext_ind + the second broadcast packet aux_adv_ind is used as the BLE Mesh big data data transmission air interface, and its data structure is precisely designed.
[0124] like Figure 4 or Figure 5 As shown, the frame interval I_TFS of the first broadcast packet adv_ext_ind sent on three channels can still be 150μs, the broadcast event adv_evt interval is the same as the BLE traditional broadcast, and the frame interval T_MAFS between the sending time of the second broadcast packet aux_adv_ind and the last sending time of the first broadcast packet adv_ext_ind can be greater than or equal to 300μs.
[0125] like Figure 5 As shown, the payload of the first broadcast packet adv_ext_ind only has an extension header without valid broadcast data AdvData (nor the broadcaster address AdvA). The extension header of the first broadcast packet adv_ext_ind is recorded as the first extension header. The first extension header includes: the extension header length ( Figure 5 The example value is 6), broadcast mode AdvMode ( Figure 5The example value is 00`b), the large data flag (Flags) occupies 1B, the broadcast data information (ADI) occupies 2B, and the channel pointer Aux_Ptr occupies 3B. The channel pointer Aux_Ptr is used to indicate the channel information of the second broadcast packet aux_adv_ind.
[0126] That is, the first broadcast packet includes: a preamble, an access address, a header, a first extension header, and a cyclic redundancy check; the first extension header includes: an extension header width, a broadcast mode, a large data mark, and a channel pointer;
[0127] The second broadcast packet includes: a preamble, an access address, a header, a second extended header, a broadcaster address, valid broadcast data, and a cyclic redundancy check; the second extended header includes: an extended header width, a broadcast mode, a large data tag, and broadcast data information.
[0128] The payload of the second broadcast packet aux_adv_ind is composed of an extension header and valid broadcast data AdvData, and also includes a broadcaster address AdvA. The extension header of the second broadcast packet aux_adv_ind is recorded as a second extension header. The second extension header includes: extension header length ( Figure 5 The example value in is 7), broadcast mode AdvMode ( Figure 5 The example value in is 00`b), the large data flag (Flags) occupies 1B, the broadcast data information (ADI) occupies 2B, of which the broadcast party address AdvA (Address) occupies 6B, which can also be included in the second extension header. For the payload of the second broadcast packet aux_adv_ind, the second extension header occupies 4B, the broadcast party address AdvA occupies 6B, and the effective broadcast data AdvData occupies 245B, of which the protocol overhead is 20B. Finally, the maximum effective data of a single packet of the ble extended broadcast packet is 255-10-20=225B.
[0129] In this way, the maximum air interface length of a single packet of the second broadcast packet aux_adv_ind is: 2120b = preamble 8b + air interface access address (AA) 32b + header 16b + maximum payload 255B + cyclic redundancy check (CRC) 24b; assuming that the transmission rate of BLE is 1Mbps, the air interface transmission time of a single packet of the BLE extended broadcast packet is 2120μs.
[0130] The data overhead of each protocol layer of the Mesh layer is 20B (the same as the traditional broadcast of BLE);
[0131] After the expansion, the maximum valid data of a single BLE extended broadcast packet is: 225B (if it is larger than 225B, it will be divided into packets);
[0132] The maximum effective data rate of a single BLE extended advertising packet is: 225B / 25ms / 3=9000B / s / 3=3000B / s, which is 20 times higher than the traditional BLE advertising packet).
[0133] Based on the above description and Figures 3 to 5 In the disclosed embodiment, the target data is packaged into a BLE traditional broadcast packet adv_ind and broadcasted in a BLE traditional broadcast mode, including: packaging the target data according to the BLE traditional broadcast rule to obtain at least one BLE traditional broadcast packet adv_ind; sending the BLE traditional broadcast packet on N main channels respectively, where N is a positive integer, and the BLE traditional broadcast packet contains valid broadcast data;
[0134] The target data is packaged into a ble extended broadcast packet and broadcasted in a ble extended broadcast mode, including: the target data is packaged according to the ble extended broadcast rule to obtain at least one group of ble extended broadcast packets, the ble extended broadcast packet includes a first broadcast packet adv_ext_ind and a corresponding second broadcast packet aux_adv_ind, the first broadcast packet adv_ext_ind carries information of an auxiliary channel, the first broadcast packet adv_ext_ind does not include valid broadcast data AdvData, and the second broadcast packet aux_adv_ind includes valid broadcast data AdvData; after the first broadcast packet adv_ext_ind is sent on N main channels respectively, the second broadcast packet aux_adv_ind is sent on the auxiliary channel.
[0135] It should be noted that whether it is BLE traditional broadcast or BLE extended broadcast, the packaging process (or encapsulation process) at the BLE mesh layer is similar, as mentioned above. Figure 1 Taking the relevant description as an example, the protocol layers of the BLE Mesh layer include: application layer, model layer, access layer, transport layer (including upper transport layer and lower transport layer), network layer and bearer layer.
[0136] The data packaging process is briefly described as follows: the application layer sends the target data, the model layer determines its data type and assigns the corresponding model to be a traditional broadcast model or an extended broadcast model. If it is the second data type, a large data tag (Flags, or ext_flag) is added to it. Since the large data tag is added, there is a Flags field in the air interface format of the first broadcast packet adv_ext_ind and the second broadcast packet aux_adv_ind, and they are sent to the access layer after corresponding processing; the access layer adds an op code to the application layer data packet and sends it to the transport layer; the transport layer determines whether there is a large data tag in the access layer data. If there is a large data tag, it means that it is the first data type, and it is packetized according to the extended BLE rules, that is, if it is greater than the second threshold, it is packetized, and if it is not greater than the second threshold, it is sent as a single packet. For the current extended BLE broadcast, the second threshold is 22 5B, if there is no big data mark, it is packetized according to the traditional broadcast rules, that is, if it is greater than the first threshold, it is packetized, and if it is not greater than the first threshold, a single packet is sent. For the current ble traditional broadcast, the first threshold is 11B, and it is sent to the network layer after corresponding processing; the network layer processes the transport layer PDU accordingly and sends it to the bearer layer; the bearer layer determines whether there is a big data mark in the network layer PDU. If so, it means that it is the second data type. After corresponding processing, valid broadcast data AdvData is obtained, and the valid broadcast data AdvData is put into the ble extended broadcast queue, which is processed by the ble controller and sent; if there is no big data mark, it means that it is the first data type. After corresponding processing, valid broadcast data AdvData is obtained, and the valid broadcast data AdvData is put into the ble traditional broadcast queue, which is processed by the ble controller and sent.
[0137] For ble traditional broadcast, the maximum length of the obtained effective broadcast data AdvData is 31B, and for ble extended broadcast, the maximum length of the obtained effective broadcast data AdvData is 245B. That is, the maximum length of the effective broadcast data contained in the second broadcast packet aux_adv_ind is greater than the maximum length of the effective broadcast data contained in the ble traditional broadcast packet adv_ind, thereby effectively increasing the amount of effective data carried by a single packet and improving the data transmission speed in the big data scenario.
[0138] It should also be noted that in the BLE traditional broadcast queue, the BLE controller follows Figure 3 In the manner shown, effective broadcast data AdvData is encapsulated to obtain a BLE traditional broadcast packet adv_ind and then broadcast, usually N=3, that is, the BLE traditional broadcast packet adv_ind is sent on three main channels 37, 38 and 39 respectively.
[0139] In the BLE extended broadcast queue, the BLE controller follows Figure 5As shown, the effective broadcast data AdvData is encapsulated to obtain a ble extended broadcast packet and then broadcast. The ble extended broadcast packet includes a first broadcast packet adv_ext_ind and a second broadcast packet aux_adv_ind. Usually N=3, that is, the first broadcast packet adv_ext_ind is sent on three main channels 37, 38 and 39 respectively, and the second broadcast packet aux_adv_ind is subsequently sent on an available auxiliary channel (the auxiliary channel is one of channels 0 to 36).
[0140] It can be seen that in the embodiment of the present disclosure, when the target data is of the second data type, the method further includes: adding a big data tag to the target data;
[0141] The target data is packaged layer by layer via at least one protocol layer and a controller. In the process of at least one protocol layer packaging the target data layer by layer, the protocol layer determines the type of the target data based on whether a large data tag exists.
[0142] Wherein, determining the type of the target data and adding a big data tag to the target data includes: the model layer determines the type of the target data, and if the target data is of the second data type, adding a big data tag to the target data;
[0143] The traditional broadcast rule of BLE at least includes: sub-packaging the target data greater than the first threshold, and the extended broadcast rule of BLE at least includes: sub-packaging the target data greater than the second threshold, and the second threshold is greater than the first threshold; in the process of packaging the target data layer by layer at at least one protocol layer, the transport layer determines the type of the target data based on whether there is a large data tag, and sub-packaging the target data based on the broadcast rules corresponding to the corresponding data type; the bearer layer determines the type of the target data based on whether there is a large data tag, and puts the obtained valid broadcast data into the traditional broadcast queue of BLE or the extended broadcast queue of BLE based on the corresponding data type;
[0144] In the BLE broadcast queue, the controller encapsulates the valid broadcast data into a BLE traditional broadcast packet and sends it;
[0145] In the BLE extended advertising queue, the controller encapsulates the valid advertising data into a BLE extended advertising packet and sends it.
[0146] It should be noted that in the disclosed embodiment, the model layer determines the data type of the target data, and assigns a BLE model to the target data of the first data type, and adds a large data tag to the target data of the second data type and assigns a BLE extension model to process them separately. Among them, the BLE extension model can be a vendor model customized by the manufacturer. The transport layer packets the data according to 11B or 225B based on whether there is a large data tag. Since it is possible to packetize, at least one BLE traditional broadcast packet or at least one group of BLE extension broadcast packets will be obtained. The bearer layer sends the valid broadcast data to different broadcast queues based on whether there is a large data tag; the controller packages and broadcasts the valid broadcast data of different broadcast queues according to their respective rules.
[0147] Further, based on the above embodiments, see Figure 6 , which shows a detailed flow chart of a method for sending blemesh broadcast data provided by an embodiment of the present disclosure. Figure 6 As shown, the detailed process includes:
[0148] First, the application layer sends a packet, that is, sends the target data;
[0149] Then, the model layer determines whether to use big data packet sending; if it is the second data type, big data packet sending is used (that is, using BLE extended broadcast), the extended big data transmission model is used, and a big data tag is added to the target data (that is, the aforementioned Flags, or recorded as ext_flag); if it is the first data type, big data packet sending is not used (that is, using BLE traditional broadcast), and the standard BLE mesh model is used without adding big data tags.
[0150] Here, the model layer can customize the vendor model (vendor model is the manufacturer's customized model) for application layer data processing. The standard BLE mesh (that is, BLE traditional broadcast) data is not changed or specially processed. The big data is sent by the vendor model and marked with ext_flag.
[0151] The access layer then performs the corresponding processing ( Figure 6 not shown);
[0152] Then, the transport layer (including the upper transport layer and the lower transport layer) performs packet subpacketing and other corresponding processing based on the big data mark ext_flag; determines whether ext_flag exists. If ext_flag exists, it is subpacketized if it is greater than 225B, otherwise it is sent as a single packet; if ext_flag does not exist, it is subpacketized if it is greater than 11B, otherwise it is sent as a single packet.
[0153] Then, the network layer performs the corresponding processing;
[0154] Then, the bearer layer performs corresponding processing and sends the data packet according to BLE traditional broadcast or BLE extended broadcast based on ext_flag; determines whether ext_flag exists. If ext_flag exists, the processed data packet (valid broadcast data) is placed in BLE extended broadcast queue and sent by BLE controller; if ext_flag does not exist, the processed data packet (valid broadcast data) is placed in BLE traditional broadcast queue and sent by BLE controller.
[0155] Finally, the BLE controller encapsulates and sends the valid broadcast data according to BLE traditional broadcast or BLE extended broadcast.
[0156] In view of the above solutions, the inventors have measured and compared the data transmission performance of only using BLE traditional broadcast and the solution provided by the embodiment of the present disclosure (i.e. before and after expansion). The comparison is mainly based on the theory and practice of the maximum effective data of a single packet and the transmission rate. In the solution provided by the embodiment of the present disclosure, the effective data of a single packet of BLE mesh and the data transmission rate are significantly improved.
[0157] The relevant theoretical data are shown in Table 1, and the measured rate data are shown in Table 2. Among them, the standard protocol corresponds to the solution using only BLE traditional broadcast, and the extended solution corresponds to the solution using BLE extended broadcast provided by the embodiment of the present disclosure.
[0158] Table 1 Comparison of theoretical data
[0159]
[0160] Table 2 Comparison of measured rates (in kB / s)
[0161]
[0162] Combining Table 1 and Table 2, it can be seen that after the transformation, the proportion of effective data in a single packet increased from 29.7% to 88.2%, an increase of nearly 3 times. Under the same network load, the effective data transmission rate is higher; the application data rate in a complex environment increased from 0.1kB / s to 1.83kB / s, an increase of 18 times; the application data rate in a clean environment increased from 0.14kB / s to 2.75kB / s, an increase of 19 times.
[0163] In summary, the disclosed embodiment provides a method for sending Ble Mesh broadcast data, aiming to improve the data transmission rate of the Ble Mesh network, and is mainly used in the data transmission application scenario of the Ble Mesh network, to solve the problems of low data transmission rate and low efficiency of the Ble Mesh data, and to propose a method for increasing the effective data volume of a single packet, which can not only improve the transmission rate of effective data, but also reduce the protocol data overhead caused by application layer data packetization. This solution is based on the standard Ble Mesh protocol (i.e., Ble traditional broadcast), and expands the standard Ble Mesh protocol, supports large data transmission, and is also compatible with the standard Ble Mesh protocol.
[0164] In another embodiment of the present disclosure, a method for receiving BLE mesh broadcast data is also provided, such as Figure 7 As shown, the method may include:
[0165] S701: Receive a broadcast packet.
[0166] It should be noted that the method for receiving BLE mesh broadcast data corresponds to the method for sending BLE mesh broadcast data, and the processing levels of the two are opposite.
[0167] The broadcast packet received here may be the aforementioned BLE traditional broadcast packet or the aforementioned BLE extended broadcast packet, or it may be an invalid broadcast packet. The invalid broadcast packet is directly discarded without subsequent processing.
[0168] S702: Determine the data type of the target data in the broadcast packet.
[0169] Here, the data type can be determined based on whether there is a large data tag in the BLE broadcast packet, or the data type can be determined by judging the application scenario / length of the target data.
[0170] S703: If the target data is of the first data type, the target data is applied based on the traditional broadcast mode of BLE; if the target data is of the second data type, the target data is applied based on the extended broadcast mode of BLE.
[0171] The data length of the second data type is greater than the data length of the first data type.
[0172] On this basis, see Figure 8 , which shows a detailed flow chart of a method for receiving BLE Mesh broadcast data provided by an embodiment of the present disclosure. Figure 8 As shown, the detailed process includes:
[0173] First, the controller receives the broadcast packet and performs corresponding processing;
[0174] Then, the bearer layer determines whether it is a mesh packet. If so, it executes the subsequent steps. If not, it directly discards the broadcast packet and ends the process.
[0175] It should be noted that here, the support of the extended bearer layer for BLE extended scanning is required so that BLE mesh can receive BLE extended broadcast data.
[0176] Then, the network layer and transport layer perform corresponding processing in turn.
[0177] Finally, the access layer sends the data packet to the corresponding model for processing according to the OP code of the received data packet, such as the standard BLE mesh model or the customized vendor model. After the model processes the data, it sends the data to the application.
[0178] It should be noted that the previous embodiment is a method for sending Ble Mesh broadcast data, and this embodiment is a method for receiving Ble Mesh broadcast data. The Ble devices in Ble Mesh can be used as both broadcasters and receivers. Based on this solution, the amount of broadcast data can be effectively increased and the data transmission efficiency of Ble Mesh can be improved.
[0179] In another embodiment of the present disclosure, see Fig. 9 , which shows a schematic diagram of the structure of a communication device 90 provided in an embodiment of the present disclosure. Fig. 9 As shown, the communication device 90 includes:
[0180] An acquisition unit 901 is configured to acquire target data;
[0181] A determination unit 902, configured to determine the type of target data;
[0182] The broadcast unit 903 is configured to package the target data into a BLE traditional broadcast packet and broadcast it in a BLE traditional broadcast mode if the target data is a first data type; if the target data is a second data type, package the target data into a BLE extended broadcast packet and broadcast it in a BLE extended broadcast mode; wherein the data length of the second data type is greater than the data length of the first data type.
[0183] In some embodiments, the determination unit 902 is configured to determine that the target data is the second data type if the application scenario corresponding to the target data is a preset scenario; otherwise, determine that the target data is the first data type.
[0184] In some embodiments, the preset scenario includes at least one of the following: file transfer, over-the-air download OTA upgrade.
[0185] In some embodiments, the determination unit 902 is configured to determine that the target data is the second data type if the data length of the target data is greater than or equal to a preset threshold; otherwise, determine that the target data is the first data type.
[0186] In some embodiments, the broadcast unit 903 is configured to package the target data according to the BLE traditional broadcast rules to obtain at least one BLE traditional broadcast packet; send the BLE traditional broadcast packet on N main channels respectively, where N is a positive integer, and the BLE traditional broadcast packet contains valid broadcast data.
[0187] In some embodiments, the broadcast unit 903 is configured to package the target data according to the BLE extended broadcast rule to obtain at least one group of BLE extended broadcast packets, the BLE extended broadcast packet includes a first broadcast packet and a corresponding second broadcast packet, the first broadcast packet carries information of the auxiliary channel, the first broadcast packet does not contain valid broadcast data, and the second broadcast packet contains valid broadcast data; after sending the first broadcast packet on N main channels respectively, the second broadcast packet is sent on the auxiliary channel;
[0188] The maximum length of the valid broadcast data included in the second broadcast packet is greater than the maximum length of the valid broadcast data included in the BLE traditional broadcast packet.
[0189] In some embodiments, the determining unit 902 is further configured to add a big data tag to the target data;
[0190] The target data is packaged layer by layer via the mesh layer and the controller. The mesh layer includes at least one protocol layer. In the process of packaging the target data layer by layer at least one protocol layer, the protocol layer determines the type of the target data based on whether there is a big data tag in the target data.
[0191] It should be noted that, in the embodiment of the present disclosure, the acquisition unit 901 may be an application layer, the determination unit 902 may specifically be a model layer, and the broadcast unit 903 may be a mesh layer + controller. That is, in fact, the broadcast unit 903 may include the acquisition unit 901 and the determination unit 902.
[0192] In some embodiments, at least one protocol layer includes at least a model layer, a transport layer, and a bearer layer; wherein the model layer is used to determine the type of the target data, and when the target data is of the second data type, a big data tag is added to the target data;
[0193] The traditional broadcast rule of BLE at least includes: sub-packaging the target data greater than the first threshold, and the extended broadcast rule of BLE at least includes: sub-packaging the target data greater than the second threshold, and the second threshold is greater than the first threshold;
[0194] In the process of packaging the target data layer by layer at at least one protocol layer, the transport layer is used to determine the type of the target data based on whether the big data tag exists in the target data, and to sub-pack the target data based on the broadcast rules corresponding to the corresponding data types; the bearer layer is used to determine the type of the target data based on whether the big data tag exists in the target data, and to put the obtained valid broadcast data into the BLE traditional broadcast queue or the BLE extended broadcast queue based on the corresponding data type;
[0195] In the BLE traditional broadcast queue, the controller is used to encapsulate the valid broadcast data into a BLE traditional broadcast packet and send it;
[0196] In the BLE extended advertising queue, the controller is used to encapsulate the valid advertising data into a BLE extended advertising packet and send it.
[0197] In some embodiments, the first broadcast packet includes: a preamble, an access address, a header, a first extended header, and a cyclic redundancy check; the first extended header includes: an extended header width, a broadcast mode, a large data mark, and a channel pointer; the second broadcast packet includes: a preamble, an access address, a header, a second extended header, a broadcaster address, valid broadcast data, and a cyclic redundancy check; the second extended header includes: an extended header width, a broadcast mode, a large data mark, and broadcast data information.
[0198] The present disclosure also provides another communication device 100, such as Fig.10 As shown, the communication device 100 may include:
[0199] The receiving unit 1001 is configured to receive a broadcast packet;
[0200] A determination unit 1002 determines the data type of the target data in the broadcast packet;
[0201] The protocol unit 1003 is configured to apply the target data based on the BLE traditional broadcast mode if the target data is the first data type; and to apply the target data based on the BLE extended broadcast mode if the target data is the second data type;
[0202] The data length of the second data type is greater than the data length of the first data type.
[0203] It should be noted that the receiving unit 1001 may be a controller, the judging unit 1002 may be an access layer, and the protocol unit 103 may include a model layer and an application layer; at the same time, the remaining protocol layers may also be regarded as components of the protocol unit 103.
[0204] visible, Fig.10 The communication device 100 shown and the aforementioned Fig. 9The communication device 90 shown may actually be the same device, but is divided into different units based on performing different functions in different working processes.
[0205] It can be understood that in this embodiment, a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.
[0206] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0207] Therefore, this embodiment provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by at least one processor, it implements the steps of the method for sending BLE Mesh broadcast data described in any one of the aforementioned embodiments, and / or the steps of the method for receiving BLE Mesh broadcast data.
[0208] This embodiment also provides a computer program product, which includes a computer program. When the computer program is executed by at least one processor, it implements the steps of the method for sending BLE mesh broadcast data described in any one of the aforementioned embodiments, and / or the steps of the method for receiving BLE mesh broadcast data.
[0209] Based on the above-mentioned communication device 90, communication device 100, computer-readable storage medium and computer program product, see Fig.11 , which shows a schematic diagram of the composition structure of an electronic device provided by an embodiment of the present disclosure. Fig.11As shown, the electronic device 110 may include: a communication interface 1101, a memory 1102 and a processor 1103; each component is coupled together via a bus system 1104. It is understood that the bus system 1104 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.11 Various buses are labeled as bus system 1104. Among them, the communication interface 1101 is used for receiving and sending signals in the process of sending and receiving information between other external network elements;
[0210] A memory 1102, used for storing a computer program that can be run on the processor 1103;
[0211] Processor 1103 is used to execute the method for sending BLE Mesh broadcast data and / or the method for receiving BLE Mesh broadcast data described in any of the aforementioned embodiments when running the computer program.
[0212] It should be noted that the electronic device can be a BLE device in BLE mesh.
[0213] It can be understood that the memory 1102 in the embodiment of the present disclosure can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can 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 can 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 RAM (SRAM), dynamic RAM (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 1102 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] The processor 1103 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1103. The above processor 1103 may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1102, and the processor 1103 reads the information in the memory 1102 and completes the steps of the above method in combination with its hardware.
[0215] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present disclosure, or a combination thereof.
[0216] For software implementation, the techniques described herein can be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0217] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the protection scope of the present disclosure.
[0218] It should be noted that in the present disclosure, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0219] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.
[0220] The methods disclosed in several method embodiments provided in the present disclosure can be arbitrarily combined without conflict to obtain new method embodiments.
[0221] The features disclosed in several product embodiments provided in the present disclosure can be arbitrarily combined without conflict to obtain new product embodiments.
[0222] The features disclosed in several method or device embodiments provided in the present disclosure may be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0223] The above description is only a specific implementation mode of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure.
Claims
1. A method for sending BLE mesh broadcast data, characterized in that: The method comprises: Get target data; determining the type of the target data; If the target data is of the first data type, the target data is packaged into a BLE traditional broadcast packet and broadcasted in a BLE traditional broadcast mode; if the target data is of the second data type, the target data is packaged into a BLE extended broadcast packet and broadcasted in a BLE extended broadcast mode; The data length of the second data type is greater than the data length of the first data type.
2. The method according to claim 1, characterized in that: The determining the type of the target data includes: If the application scenario corresponding to the target data is a preset scenario, the type of the target data is determined to be the second data type; otherwise, the type of the target data is determined to be the first data type.
3. The method according to claim 2, characterized in that The preset scenario includes at least one of the following: file transfer and over-the-air download OTA upgrade.
4. The method according to claim 1, characterized in that The determining the type of the target data includes: If the data length of the target data is greater than or equal to a preset threshold, the type of the target data is determined to be the second data type; otherwise, the type of the target data is determined to be the first data type.
5. The method according to claim 1, characterized in that The packaging of the target data into a BLE traditional broadcast packet and broadcasting in a BLE traditional broadcast mode includes: packaging the target data according to BLE traditional broadcast rules to obtain at least one BLE traditional broadcast packet; sending the BLE traditional broadcast packet on N main channels respectively, where N is a positive integer, and the BLE traditional broadcast packet contains valid broadcast data; The packaging of the target data into a BLE extended broadcast packet and broadcasting in a BLE extended broadcast mode includes: packaging the target data according to a BLE extended broadcast rule to obtain at least one group of BLE extended broadcast packets, wherein the BLE extended broadcast packet includes a first broadcast packet and a corresponding second broadcast packet, wherein the first broadcast packet carries information of an auxiliary channel, the first broadcast packet does not contain valid broadcast data, and the second broadcast packet contains valid broadcast data; after the first broadcast packet is respectively sent on the N main channels, the second broadcast packet is sent on the auxiliary channel; The maximum length of the valid broadcast data included in the second broadcast packet is greater than the maximum length of the valid broadcast data included in the BLE traditional broadcast packet.
6. The method according to claim 5, characterized in that In the case where the target data is the second data type, the method further includes: adding a big data tag to the target data; The target data is packaged layer by layer via at least one protocol layer and a controller. In the process of the at least one protocol layer packaging the target data layer by layer, the protocol layer determines the type of the target data based on whether the large data tag exists.
7. The method according to claim 6, characterized in that The at least one protocol layer includes at least a model layer, a transport layer and a bearer layer; Wherein, determining the type of the target data and adding a big data tag to the target data comprises: the model layer determines the type of the target data, and when the target data is of the second data type, adding a big data tag to the target data; The BLE traditional broadcast rule at least includes: sub-packaging the target data greater than a first threshold, and the BLE extended broadcast rule at least includes: sub-packaging the target data greater than a second threshold, the second threshold being greater than the first threshold; in the process of packaging the target data layer by layer at at least one protocol layer, the transport layer determines the type of the target data based on whether the large data tag exists, and sub-packaging the target data based on the broadcast rule corresponding to the corresponding data type; the bearer layer determines the type of the target data based on whether the large data tag exists, and puts the obtained valid broadcast data into the BLE traditional broadcast queue or the BLE extended broadcast queue based on the corresponding data type; In the BLE traditional broadcast queue, the controller encapsulates the valid broadcast data into the BLE traditional broadcast packet and sends it; In the BLE extended broadcast queue, the controller encapsulates the valid broadcast data into the BLE extended broadcast packet and sends it.
8. The method according to claim 6 or 7, characterized in that: The first broadcast packet includes: a preamble, an access address, a header, a first extension header, and a cyclic redundancy check; the first extension header includes: an extension header width, a broadcast mode, the large data tag, and a channel pointer; The second broadcast packet includes: a preamble, an access address, a header, a second extended header, a broadcaster address, the valid broadcast data, and a cyclic redundancy check; the second extended header includes: an extended header width, a broadcast mode, the large data tag, and broadcast data information.
9. A method for receiving BLE mesh broadcast data, characterized in that: The method comprises: Receive broadcast packets; Determining the data type of the target data in the broadcast packet; If the target data is of the first data type, the target data is applied based on the BLE traditional broadcast mode; if the target data is of the second data type, the target data is applied based on the BLE extended broadcast mode; The data length of the second data type is greater than the data length of the first data type.
10. A communication device, characterized in that: include: an acquisition unit configured to acquire target data; a determining unit, configured to determine the type of the target data; The broadcast unit is configured to package the target data into a BLE traditional broadcast packet and broadcast it in a BLE traditional broadcast mode if the target data is a first data type; and to package the target data into a BLE extended broadcast packet and broadcast it in a BLE extended broadcast mode if the target data is a second data type; wherein the data length of the second data type is greater than the data length of the first data type.
11. A communication device, characterized in that: include: a receiving unit configured to receive a broadcast packet; a determining unit configured to determine a data type of the target data in the broadcast packet; The protocol unit is configured to apply the target data based on the traditional broadcast mode of BLE if the target data is a first data type; and to apply the target data based on the extended broadcast mode of BLE if the target data is a second data type; wherein the data length of the second data type is greater than the data length of the first data type.
12. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, used to execute a computer program stored on the memory to implement the method for sending BLE mesh broadcast data as described in any one of claims 1 to 8, and / or to implement the method for receiving BLE mesh broadcast data as described in claim 9.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program on a memory, and when the computer program is executed by at least one processor, it implements the method for sending BLE mesh broadcast data as described in any one of claims 1 to 8, and / or, implements the method for receiving BLE mesh broadcast data as described in claim 9.