CN112822664A - Data communication method and device in smart home environment - Google Patents

Data communication method and device in smart home environment Download PDF

Info

Publication number
CN112822664A
CN112822664A CN201911122811.8A CN201911122811A CN112822664A CN 112822664 A CN112822664 A CN 112822664A CN 201911122811 A CN201911122811 A CN 201911122811A CN 112822664 A CN112822664 A CN 112822664A
Authority
CN
China
Prior art keywords
data
sending
interface
sending interface
communication
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.)
Pending
Application number
CN201911122811.8A
Other languages
Chinese (zh)
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.)
Hangzhou Joyoung Household Electrical Appliances Co Ltd
Original Assignee
Hangzhou Joyoung Household Electrical Appliances 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 Hangzhou Joyoung Household Electrical Appliances Co Ltd filed Critical Hangzhou Joyoung Household Electrical Appliances Co Ltd
Priority to CN201911122811.8A priority Critical patent/CN112822664A/en
Publication of CN112822664A publication Critical patent/CN112822664A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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/0205Traffic management, e.g. flow control or congestion control at the air interface
    • 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/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
    • H04W28/065Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information using assembly or disassembly of packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast

Landscapes

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

Abstract

The embodiment of the invention discloses a data communication method and a device in an intelligent home environment, equipment in the intelligent home environment performs Bluetooth low energy consumption BLE data transmission when performing data communication through Bluetooth, the method is applied to a data sending equipment end, and the method comprises the following steps: after Bluetooth connection is established with a data receiving end, packaging data to be sent through a self-defined communication data format; selecting a corresponding interface from the provided first sending interface and the second sending interface according to the interface selection instruction to transmit the packed data; the first sending interface has overtime resending and sending state reporting mechanisms; the second sending interface does not have a timeout retransmission and sending state reporting mechanism; the protocol description in the communication data format is provided with a selection identification bit of the first sending interface and the second sending interface. According to the scheme of the embodiment, the large data communication is realized, the reliable transmission of data is ensured, and the data transmission efficiency and the data transmission rate are improved.

Description

Data communication method and device in smart home environment
Technical Field
The embodiment of the invention relates to an intelligent household equipment communication technology, in particular to a data communication method and device in an intelligent household environment.
Background
In the field of internet of things, the BLE (bluetooth low energy) of bluetooth 4.0 has been increasingly widely used due to advantages such as low power consumption, strong real-time performance, mobile phone integration, free frequency band (2.4GHZ) and the like. However, the bluetooth 4.0BLE has a certain limitation on the length of a data transmission frame, each frame of data cannot be greater than 20 bytes, and meanwhile, problems of disconnection, data loss, data non-verification and the like occur in the communication process, so the BLE communication is unreliable transmission.
In practical applications, the data transmitted between devices is often larger than 20 bytes, and at the same time, not only reliable data transmission between devices but also higher-speed communication needs to be realized.
There is a related scheme (CN105657646A) that realizes the transmission of more than 20 bytes of data. The data is unpacked and divided into a plurality of small packets, and each packet is less than or equal to 20 bytes. However, this scheme must wait for ack to send the next packet every time a packet of data is transmitted, which ensures reliable transmission of data and communication of large data, but greatly reduces transmission efficiency and transmission rate.
Disclosure of Invention
The embodiment of the invention provides a data communication method and device in an intelligent home environment, which can realize big data communication, ensure reliable data transmission and improve data transmission efficiency and transmission rate.
In order to achieve the object of the embodiment of the present invention, an embodiment of the present invention provides a data communication method in an intelligent home environment, where a device in the intelligent home environment performs bluetooth low energy BLE data transmission when performing data communication through bluetooth, and the method is applied to a data transmitting device, and the method may include:
after Bluetooth connection is established with a data receiving end, packaging data to be sent through a self-defined communication data format;
selecting a corresponding interface from the provided first sending interface and the second sending interface according to the interface selection instruction to transmit the packed data;
the first sending interface is provided with a timeout retransmission and sending state reporting mechanism; the second sending interface does not have a timeout retransmission and sending state reporting mechanism; and the protocol description in the communication data format is provided with a selection identification bit of the first sending interface and the second sending interface, and the selection identification bit is used for determining to select the first sending interface or the second sending interface.
In an exemplary embodiment of the present invention, the communication data format may include: packet header, data length, protocol description, instruction sequence number, total packet number, packet sequence number, valid data, checksum, version number, reserved bits, and instruction reply enable bits.
In an exemplary embodiment of the present invention, when the first transmission interface is selected, the selection identification bit is set to a first flag; and when the second sending interface is selected, the selection identification bit is set as a second mark.
In an exemplary embodiment of the present invention, before the packing the data to be transmitted in the customized communication data format, the method may further include:
judging whether the data to be sent needs to be subjected to subpackage processing according to the length of the data to be sent;
if the data needs to be subjected to sub-packaging processing, sub-packaging the data to be sent, and entering a packaging processing program after the sub-packaging;
if the sub-packaging processing is not needed, the packaging processing program is directly entered.
In an exemplary embodiment of the present invention, the method may further include: when the first sending interface is selected for data transmission, after the packed data is transmitted, timing is started, and a data receiving device end is waited to return a response ACK when the data packet is successfully received; and if the ACK is not received after the time-out, retransmitting the data.
In an exemplary embodiment of the present invention, the retransmitting data may include: retransmitting the data a plurality of times; the method may further comprise: if the ACK is not received after the data is retransmitted for multiple times within the specified retransmission times, reporting to an application layer for failure processing, and if the ACK is received within the specified retransmission times, determining that the data is successfully transmitted; and/or the presence of a gas in the gas,
if the transmitted data packet is packetized before being transmitted, the step of waiting for the data receiving device to return an acknowledgement ACK when the data packet is successfully received comprises the following steps: waiting for the ACK after sending each sub-packet or waiting for the ACK after sending all sub-packets.
In an exemplary embodiment of the present invention, the method may further include:
determining whether to establish Bluetooth connection with the equipment of the broadcast information or not through the monitored broadcast information so as to perform data transmission on the equipment through Bluetooth; and/or the presence of a gas in the gas,
and if the Bluetooth connection is disconnected in the communication process, emptying the cache data which is not sent yet, and restoring the relevant parameters to the initial state.
In order to achieve the object of the embodiment of the present invention, an embodiment of the present invention further provides a data communication method in an intelligent home environment, where equipment in the intelligent home environment performs bluetooth low energy BLE data transmission when performing data communication through bluetooth, and the method is applied to a data receiving equipment end, and the method may include:
after Bluetooth connection is established with a data sending end, determining that the adopted data sending interface is a first sending interface or a second sending interface through a protocol description in a self-defined communication data format, and determining whether data to be sent is packetized or not before data sending through the total packet number in the self-defined communication data format; the first sending interface is provided with a timeout retransmission and sending state reporting mechanism; the second sending interface does not have a timeout retransmission and sending state reporting mechanism; a protocol description in the communication data format is provided with a selection identification bit of the first sending interface and the second sending interface, and the selection identification bit is used for determining to select the first sending interface or the second sending interface;
when the adopted data sending interface is determined to be the first sending interface, returning a response ACK to the data sending equipment end; and when determining that the data to be transmitted is packetized before data transmission, performing packet splicing processing on the received data packets.
In an exemplary embodiment of the present invention, the method may further include:
broadcasting broadcast information containing self information outwards, so that other equipment except the self can determine whether to establish Bluetooth connection with the self according to the broadcast information, and perform data transmission with the other equipment through Bluetooth; and/or the presence of a gas in the gas,
if the Bluetooth connection is disconnected in the communication process, emptying incompletely received data and completely receiving unprocessed data, and restoring the related parameters to the initial state.
In order to achieve the purpose of the embodiment of the present invention, an embodiment of the present invention further provides a data communication device in an intelligent home environment, which may include a processor and a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, the data communication device performs bluetooth low energy BLE data transmission when performing data communication through bluetooth, and when the instructions are executed by the processor, the BLE data communication method in the intelligent home environment is implemented.
The embodiment of the invention comprises the following steps: the method includes that when equipment in the smart home environment performs data communication through Bluetooth, Bluetooth low energy consumption BLE data transmission is performed, the method is applied to a data sending equipment end, and the method can include: after Bluetooth connection is established with a data receiving end, packaging data to be sent through a self-defined communication data format; selecting a corresponding interface from the provided first sending interface and the second sending interface according to the interface selection instruction to transmit the packed data; the first sending interface is provided with a timeout retransmission and sending state reporting mechanism; the second sending interface does not have a timeout retransmission and sending state reporting mechanism; and the protocol description in the communication data format is provided with a selection identification bit of the first sending interface and the second sending interface, and the selection identification bit is used for determining to select the first sending interface or the second sending interface. According to the scheme of the embodiment, the large data communication is realized, the reliable transmission of data is ensured, and the data transmission efficiency and the data transmission rate are improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a flowchart of a data communication method applied to an intelligent home environment of a data sending device side according to an embodiment of the present invention;
FIG. 2 is a communication diagram of device A and device B according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a process of performing big data communication by the device a and the device B based on a customized communication data format according to the embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative reliable sending interface and an alternative unreliable sending interface according to an embodiment of the present invention;
fig. 5 is a schematic communication diagram when a device a sends data to a device B through an unreliable interface according to an embodiment of the present invention;
fig. 6 is a schematic diagram illustrating a method for sending data from a device a to a device B through a reliable interface according to an embodiment of the present invention;
fig. 7 is a communication diagram illustrating successful data transmission when a device a transmits data to a device B through a reliable interface according to an embodiment of the present invention;
fig. 8 is a schematic communication diagram illustrating success after data is retransmitted once when a device a transmits data to a device B through a reliable interface according to an embodiment of the present invention;
fig. 9 is a communication diagram illustrating a data transmission failure when the device a transmits data to the device B through the reliable interface according to an embodiment of the present invention;
fig. 10 is a flowchart of a data communication method applied to an intelligent home environment of a data receiving device side according to an embodiment of the present invention;
fig. 11 is a block diagram of a data communication device in an intelligent home environment according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Example one
An embodiment of the present invention provides a data communication method in an intelligent home environment, where devices in the intelligent home environment perform Bluetooth Low Energy (BLE) data transmission when performing data communication through bluetooth, and the method is applied to a data transmitting device, where as shown in fig. 1, the method may include S101 to S102:
s101, after Bluetooth connection is established with a data receiving end, packaging data to be sent through a self-defined communication data format;
s102, selecting a corresponding interface from the provided first sending interface and the second sending interface according to an interface selection instruction to transmit the packed data;
the first sending interface is provided with a timeout retransmission and sending state reporting mechanism; the second sending interface does not have a timeout retransmission and sending state reporting mechanism; and the protocol description in the communication data format is provided with a selection identification bit of the first sending interface and the second sending interface, and the selection identification bit is used for determining to select the first sending interface or the second sending interface.
In an exemplary embodiment of the present invention, the method may further include: and determining whether to establish Bluetooth connection with the equipment of the broadcast information or not by monitoring the broadcast information so as to perform data transmission on the equipment through Bluetooth.
In an exemplary embodiment of the present invention, the data sending device end may be any device in an intelligent home environment, the data sending device end may serve as a master, and a device a (which may serve as a master) is taken as a data sending device, and a device B (which may serve as a slave) is taken as a data receiving device for example.
In an exemplary embodiment of the present invention, as shown in fig. 2, device a acts as a Master (e.g., they may be App or devices with Master function), and may actively listen to broadcast information scanned from slave devices. The device B as a Slave (Slave) may actively broadcast its own information (media access control MAC, name, server universally unique identifier Service UUID, etc.). After starting broadcast, the device B broadcasts information outwards, and after monitoring the broadcast information of the device B, the device A judges whether the device is a connectable device according to the broadcast information content, and if the device is judged to be a connectable device, the device A initiates a connection request. The two devices (device a and device B) are now connected and can communicate with each other to transfer data.
In an exemplary embodiment of the present invention, the communication data format may include: packet header, data length, protocol description, instruction sequence number, total packet number, packet sequence number, valid data, checksum, version number, reserved bits, and instruction reply enable bits.
In an exemplary embodiment of the present invention, a big data communication process of device a and device B based on a custom communication data format may be as shown in fig. 3.
In an exemplary embodiment of the present invention, the data format of device a and device B in big data communication through BLE is implemented by the following custom format:
Figure BDA0002275900640000071
in an exemplary embodiment of the present invention, the total length from the packet header to the checksum is ≦ 20 bytes.
In an exemplary embodiment of the present invention, the packet header: the starting position of each sub-packet.
Data length: all bytes long from the "protocol description" field to "valid data".
Protocol description: three parts of Ver, Res and EnAck can be contained. Ver represents the current protocol format version, and the data needs to be analyzed aiming at different versions when being received and analyzed; res is a reserved bit; EnAck is an instruction reply enable bit, e.g., when 0, it means that the instruction does not need to be replied to, and when 1, the instruction needs to be replied to.
Instruction sequence number: different instructions are distinguished, and all sub-packets of the same instruction have the same instruction sequence number (data needing to be sent by an application layer is taken as one instruction).
Total number of packets: total number of command packets.
Packet number: the sequence number of each packet is instructed, the transmitting end starts from "1", and the receiving end is "0" when replying to the Ack.
Valid data: partial data of data to be transmitted (partial data when there is packetization, and total data when there is no packetization).
Checking: and (3) checking all data from the packet header to the last byte of the effective data, wherein the specific checking method is not limited, the receiving party and the transmitting party are well defined, and whether the data is correct or not needs to be checked before the packet is received.
In an exemplary embodiment of the present invention, before the packing the data to be transmitted in the customized communication data format, the method may further include:
judging whether the data to be sent needs to be subjected to subpackage processing according to the length of the data to be sent;
if the data needs to be subjected to sub-packaging processing, sub-packaging the data to be sent, and entering a packaging processing program after the sub-packaging;
if the sub-packaging processing is not needed, the packaging processing program is directly entered.
In an exemplary embodiment of the present invention, for large data, for example, data larger than 20 bytes, a packet of the large data may be divided into a plurality of small packets in the form of packetization and transmitted separately. If the data is small, for example, the data is less than or equal to 20 bytes, the data can be directly packed and sent, and the packetization processing may not be performed.
In an exemplary embodiment of the present invention, the protocol description may be provided with a selection flag of the first sending interface and the second sending interface;
when the first sending interface is selected, the selection identification bit is set as a first mark; and when the second sending interface is selected, the selection identification bit is set as a second mark.
In the exemplary embodiment of the present invention, as shown in fig. 4, an "intermediate communication layer" of a device may provide two interfaces, namely, a first interface and a second interface, for data transmission, that is, a reliable (Ack required) transmission interface and an unreliable (Ack not required) transmission interface, respectively, and the device may select an appropriate interface to transmit data according to different requirements. If the device needs to know whether the current data is successfully transmitted (the receiving end has received and replied to the Ack), the reliable transmission interface (namely, the first transmission interface) is selected, and if the device does not care about the current data transmission result, the unreliable transmission interface (namely, the second transmission interface) is selected.
In the exemplary embodiment of the present invention, the unreliable sending interface only performs packetization (if necessary), and encapsulation on the data to be sent by the application layer, and then sends the data after packetization, and does not pay attention to the sending result. The EnAck bits in the "protocol description" of each packet may all be 0 when sent using the unreliable interface. For example, the following steps are carried out: assuming that the connection interval is 30ms, and 6 packets of data can be transmitted at most per interval (the number of packets transmitted per connection interval is limited by the connection interval time and the performance of the lower computer), when the device a transmits data to the device B through the unreliable interface, and the data is transmitted in three packets, the data flow may be as shown in fig. 5.
In an exemplary embodiment of the invention, the reliable sending interface will not only packetize (if necessary) and encapsulate the data, but also wait for the receiver to reply.
In an exemplary embodiment of the present invention, the method may further include: when the first sending interface is selected for data transmission, after the packed data is transmitted, timing is started, and a data receiving device end is waited to return a response ACK when the data packet is successfully received; and if the ACK is not received after the time-out, retransmitting the data.
In an exemplary embodiment of the present invention, the retransmitting data may include: retransmitting the data a plurality of times; the method may further comprise: if the ACK is not received after the data is retransmitted for multiple times within the specified retransmission times, reporting to an application layer for failure processing, and if the ACK is received within the specified retransmission times, determining that the data is successfully transmitted; and/or the presence of a gas in the gas,
if the transmitted data packet is packetized before being transmitted, the step of waiting for the data receiving device to return an acknowledgement ACK when the data packet is successfully received comprises the following steps: waiting for the ACK after sending each sub-packet or waiting for the ACK after sending all sub-packets.
In an exemplary embodiment of the present invention, as shown in fig. 6, the working principle of the reliable transmission interface may be as follows: judging whether the data needs to be subjected to sub-packaging according to the length of the data to be sent, if the data needs to be subjected to sub-packaging, performing sub-packaging processing on the data to be sent according to a custom data format by a data sending end, if the data does not need to be subjected to sub-packaging, only grouping the data according to the custom data format, then starting a timer after the data is sent to count whether the data is sent overtime or not, waiting for one-time reply Ack of a data receiving end, if the Ack replied by the data receiving end is not received after the data is overtime, retransmitting the data for multiple times, and keeping the data content of each sub-package unchanged. If not receiving the Ack replied by the data receiving end after repeated retransmission, reporting to the application layer of the sending end for failure processing, and if receiving the reply of the data receiving end within the specified retransmission times, successfully sending. The reliable sending interface can wait for one reply when sending data every time, and does not need to reply an Ack for each packet of data, thereby ensuring the sending efficiency while ensuring the reliable sending.
In an exemplary embodiment of the invention, the EnAck bits in the "protocol description" of each packet may all be 1 when sent using a reliable interface. For example, the following steps are carried out: assuming that the connection interval is 30ms, and 6 packets of data can be transmitted at most in each interval, at this time, the device a transmits data to the device B through the reliable interface, the data is divided into three packets for transmission, and each retransmission time is 500ms for retransmission (the number of retransmissions can be set according to actual situations), the data flow chart is divided into the following cases:
1. one-time transmission success
As shown in fig. 7, device a sends three packets of data, and opens 500ms timeout at the same time, device B has collected all the data packets, and replies to device a at the next connection interval, and closes 500ms timeout after device a receives the reply from device B, which indicates that the data is successfully sent.
2. Success after one retransmission
As shown in fig. 8, device a sends three packets of data and starts a timeout of 500ms, and device B does not reply to Ack because it only receives 1 and 3 packets and does not receive all packets. Device a does not receive the reply from device B, will resend all packetized data after 500ms timeout, and open 500ms timeout again. When the device B finishes all the sub-packets, the device B replies to the device A at the next connection interval, and the device A is closed for 500ms after receiving the reply of the device B and is overtime, and the data transmission is successful.
3. Failure of data transmission
As shown in fig. 9, device a sends three packets of data and starts a timeout of 500ms, and device B does not reply to Ack because it only receives 1 and 3 packets and does not receive all packets. Device a does not receive the reply from device B, will resend all packetized data after 500ms timeout, and open 500ms timeout again. At this point, device B still does not receive all the packetized data, and therefore does not reply with an Ack. After the timeout of 500ms again, the device a determines that the data transmission has failed since the number of retransmissions has reached the preset total number.
In the exemplary embodiment of the present invention, in the scheme described above, the receiving end of the reliable transmission interface only needs to reply to all the packets once, which not only ensures reliable transmission of data, but also alleviates the packet processing logic at both ends of transmission and reception. In other embodiments, the data receiving end may also reply to each packetized data correspondingly, which has the following advantages: the sending end only needs to send data which is not received by the receiving end, the quantity of the sent data is reduced as much as possible under the condition of complex communication environment, and the success rate can be ensured. However, when there are many data packets, the whole communication process consumes more connection interval time, which reduces the overall efficiency, and the logic processing at the transmitting and receiving ends is also slightly complicated, which is not suitable for some platforms with less resources.
In an exemplary embodiment of the present invention, the method may further include: and if the Bluetooth connection is disconnected in the communication process, emptying the cache data which is not sent yet, and restoring the relevant parameters to the initial state.
In the exemplary embodiment of the present invention, if the device encounters disconnection during communication, the device empties the buffered data that has not been sent yet, the incompletely received data, and the completely unprocessed data, and meanwhile, the relevant parameters of the data sending end and the data receiving end may both be restored to the initial state.
In the exemplary embodiment of the invention, the scheme of the embodiment of the invention is based on the transmission modes of notify and write without response, the data is unpacked and transmitted by the user-defined data format, and meanwhile, a reliable and unreliable transmission interface is provided, so that a data transmitting end can conveniently select a proper interface to transmit the data according to different occasions. Even if the interface which reliably sends the data only needs to wait for the Ack of the receiving end once after sending out all the packet data, the overall data sending time is reduced. Based on the user-defined data format and the two sending interfaces, the limitation on the data length during data transmission between the devices through Bluetooth 4.0BLE can be solved, and reliable data transmission and communication rate can be guaranteed.
Example two
An embodiment of the present invention further provides a data communication method in an intelligent home environment, where a device in the intelligent home environment performs bluetooth low energy BLE data transmission when performing data communication through bluetooth, and the method is applied to a data receiving device, as shown in fig. 10, the method may include S201 to S202:
s201, after Bluetooth connection is established with a data sending end, when BLE data transmission is carried out through Bluetooth 4.0, whether the adopted data sending interface is a first sending interface or a second sending interface is determined through a protocol description in a self-defined communication data format, and whether data to be sent is packetized or not before data sending is carried out is determined through the total packet number in the self-defined communication data format; the first sending interface is provided with a timeout retransmission and sending state reporting mechanism; the second sending interface does not have a timeout retransmission and sending state reporting mechanism; and the protocol description in the communication data format is provided with a selection identification bit of the first sending interface and the second sending interface, and the selection identification bit is used for determining to select the first sending interface or the second sending interface.
S202, when the adopted data sending interface is determined to be the first sending interface, returning a response ACK to the data sending equipment end; and when determining that the data to be transmitted is packetized before data transmission, performing packet splicing processing on the received data packets.
In an exemplary embodiment of the present invention, the method may further include:
broadcasting the broadcast information containing the self information outwards, so that other devices except the self can determine whether to establish Bluetooth connection with the self according to the broadcast information, and carry out data transmission with the other devices through Bluetooth.
In an exemplary embodiment of the present invention, the data receiving device end may be any device in an intelligent home environment, and the data sending device end may be a slave, for example, in the first embodiment, a device a (which may be a master) may be taken as a data sending device, and a device B (which may be a slave) may be taken as a data receiving device.
In the exemplary embodiment of the present invention, any embodiment in the first embodiment is applicable to the second embodiment, and details are not repeated here.
In an exemplary embodiment of the present invention, the method may further include: if the Bluetooth connection is disconnected in the communication process, emptying incompletely received data and completely receiving unprocessed data, and restoring the related parameters to the initial state.
In the exemplary embodiment of the present invention, if the device encounters disconnection during communication, the device empties the buffered data that has not been sent yet, the incompletely received data, and the completely unprocessed data, and meanwhile, the relevant parameters of the data sending end and the data receiving end may both be restored to the initial state.
EXAMPLE III
An embodiment of the present invention further provides a data communication device 1 in an intelligent home environment, as shown in fig. 11, which may include a processor 11 and a computer-readable storage medium 12, where instructions are stored in the computer-readable storage medium 12, and when the data communication device 1 performs data communication through bluetooth, bluetooth low energy BLE data transmission is performed, and when the instructions are executed by the processor, the data communication method in the intelligent home environment is implemented.
In the exemplary embodiment of the present invention, any embodiment of the first embodiment and the second embodiment is applicable to the third embodiment, and details are not repeated here.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.

Claims (10)

1. A data communication method in an intelligent home environment is characterized in that Bluetooth Low Energy (BLE) data transmission is carried out when equipment in the intelligent home environment carries out data communication through Bluetooth, the method is applied to a data sending equipment end, and the method comprises the following steps:
after Bluetooth connection is established with a data receiving end, packaging data to be sent through a self-defined communication data format;
selecting a corresponding interface from the provided first sending interface and the second sending interface according to the interface selection instruction to transmit the packed data;
the first sending interface is provided with a timeout retransmission and sending state reporting mechanism; the second sending interface does not have a timeout retransmission and sending state reporting mechanism; and the protocol description in the communication data format is provided with a selection identification bit of the first sending interface and the second sending interface, and the selection identification bit is used for determining to select the first sending interface or the second sending interface.
2. The data communication method in the smart home environment according to claim 1, wherein the communication data format includes: packet header, data length, protocol description, instruction sequence number, total packet number, packet sequence number, valid data, checksum, version number, reserved bits, and instruction reply enable bits.
3. The data communication method in the smart home environment according to claim 1, wherein when the first transmission interface is selected, the selection flag is set to a first flag; and when the second sending interface is selected, the selection identification bit is set as a second mark.
4. The data communication method in the smart home environment according to claim 2, wherein before the data to be transmitted is packed in the customized communication data format, the method further comprises:
judging whether the data to be sent needs to be subjected to subpackage processing according to the length of the data to be sent;
if the data needs to be subjected to sub-packaging processing, sub-packaging the data to be sent, and entering a packaging processing program after the sub-packaging;
if the sub-packaging processing is not needed, the packaging processing program is directly entered.
5. The data communication method in the smart home environment according to claim 2, further comprising: when the first sending interface is selected for data transmission, after the packed data is transmitted, timing is started, and a data receiving device end is waited to return a response ACK when the data packet is successfully received; and if the ACK is not received after the time-out, retransmitting the data.
6. The data communication method in the smart home environment according to claim 5, wherein the retransmitting data includes: retransmitting the data a plurality of times; the method further comprises the following steps: if the ACK is not received after the data is retransmitted for multiple times within the specified retransmission times, reporting to an application layer for failure processing, and if the ACK is received within the specified retransmission times, determining that the data is successfully transmitted; and/or the presence of a gas in the gas,
if the transmitted data packet is packetized before being transmitted, the step of waiting for the data receiving device to return an acknowledgement ACK when the data packet is successfully received comprises the following steps: waiting for the ACK after sending each sub-packet or waiting for the ACK after sending all sub-packets.
7. The data communication method in the smart home environment according to claim 1, further comprising:
determining whether to establish Bluetooth connection with the equipment of the broadcast information or not through the monitored broadcast information so as to perform data transmission on the equipment through Bluetooth; and/or the presence of a gas in the gas,
and if the Bluetooth connection is disconnected in the communication process, emptying the cache data which is not sent yet, and restoring the relevant parameters to the initial state.
8. A data communication method in an intelligent home environment is characterized in that Bluetooth Low Energy (BLE) data transmission is carried out when equipment in the intelligent home environment carries out data communication through Bluetooth, the method is applied to a data receiving equipment end, and the method comprises the following steps:
after Bluetooth connection is established with a data sending end, determining that the adopted data sending interface is a first sending interface or a second sending interface through a protocol description in a self-defined communication data format, and determining whether data to be sent is packetized or not before data sending through the total packet number in the self-defined communication data format; the first sending interface is provided with a timeout retransmission and sending state reporting mechanism; the second sending interface does not have a timeout retransmission and sending state reporting mechanism; a protocol description in the communication data format is provided with a selection identification bit of the first sending interface and the second sending interface, and the selection identification bit is used for determining to select the first sending interface or the second sending interface;
when the adopted data sending interface is determined to be the first sending interface, returning a response ACK to the data sending equipment end; and when determining that the data to be transmitted is packetized before data transmission, performing packet splicing processing on the received data packets.
9. The data communication method in the smart home environment according to claim 8, further comprising:
broadcasting broadcast information containing self information outwards, so that other equipment except the self can determine whether to establish Bluetooth connection with the self according to the broadcast information, and perform data transmission with the other equipment through Bluetooth; and/or the presence of a gas in the gas,
if the Bluetooth connection is disconnected in the communication process, emptying incompletely received data and completely receiving unprocessed data, and restoring the related parameters to the initial state.
10. A data communication device in an intelligent home environment, comprising a processor and a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the data communication device performs data communication through bluetooth, the data communication device performs Bluetooth Low Energy (BLE) data transmission, and when the instructions are executed by the processor, the data communication device performs the data communication method in the intelligent home environment according to any one of claims 1 to 7, or the data communication device performs the data communication method in the intelligent home environment according to any one of claims 8 to 9.
CN201911122811.8A 2019-11-16 2019-11-16 Data communication method and device in smart home environment Pending CN112822664A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911122811.8A CN112822664A (en) 2019-11-16 2019-11-16 Data communication method and device in smart home environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911122811.8A CN112822664A (en) 2019-11-16 2019-11-16 Data communication method and device in smart home environment

Publications (1)

Publication Number Publication Date
CN112822664A true CN112822664A (en) 2021-05-18

Family

ID=75851946

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911122811.8A Pending CN112822664A (en) 2019-11-16 2019-11-16 Data communication method and device in smart home environment

Country Status (1)

Country Link
CN (1) CN112822664A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101022612A (en) * 2006-02-16 2007-08-22 杭州波导软件有限公司 Mobile terminal user information data duplicate method
CN101841469A (en) * 2010-03-24 2010-09-22 北京创毅视讯科技有限公司 Data transmitting method, system and device in Internet of things
CN103825905A (en) * 2014-03-10 2014-05-28 云中致用(广州)信息科技有限公司 Method and device for multimedia data exchange
US20150334488A1 (en) * 2014-05-14 2015-11-19 Samsung Electronics Co., Ltd. Method and apparatus for communicating audio data
CN105657646A (en) * 2016-01-29 2016-06-08 南京悦控智能科技有限公司 Bluetooth 4.0 based device-to-device big data communication method
CN106571894A (en) * 2016-11-10 2017-04-19 深圳市民德电子科技股份有限公司 Bluetooth information sending and receiving methods
US20170303076A1 (en) * 2016-04-14 2017-10-19 Lg Electronics Inc. Method and apparatus for transmitting or receiving data using bluetooth in wireless communication system
CN107835040A (en) * 2017-11-30 2018-03-23 深圳市文鼎创数据科技有限公司 A kind of method, equipment and the storage medium of the data communication based on bluetooth
CN109495869A (en) * 2018-11-30 2019-03-19 锐迪科微电子科技(上海)有限公司 Bluetooth connecting method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101022612A (en) * 2006-02-16 2007-08-22 杭州波导软件有限公司 Mobile terminal user information data duplicate method
CN101841469A (en) * 2010-03-24 2010-09-22 北京创毅视讯科技有限公司 Data transmitting method, system and device in Internet of things
CN103825905A (en) * 2014-03-10 2014-05-28 云中致用(广州)信息科技有限公司 Method and device for multimedia data exchange
US20150334488A1 (en) * 2014-05-14 2015-11-19 Samsung Electronics Co., Ltd. Method and apparatus for communicating audio data
CN105657646A (en) * 2016-01-29 2016-06-08 南京悦控智能科技有限公司 Bluetooth 4.0 based device-to-device big data communication method
US20170303076A1 (en) * 2016-04-14 2017-10-19 Lg Electronics Inc. Method and apparatus for transmitting or receiving data using bluetooth in wireless communication system
CN106571894A (en) * 2016-11-10 2017-04-19 深圳市民德电子科技股份有限公司 Bluetooth information sending and receiving methods
CN107835040A (en) * 2017-11-30 2018-03-23 深圳市文鼎创数据科技有限公司 A kind of method, equipment and the storage medium of the data communication based on bluetooth
CN109495869A (en) * 2018-11-30 2019-03-19 锐迪科微电子科技(上海)有限公司 Bluetooth connecting method and device

Similar Documents

Publication Publication Date Title
US10986670B2 (en) Random access feedback method, random access processing method, base station and terminal
RU2434337C1 (en) Method for sending status information in mobile communication system and mobile communication system receiver
EP1161822B1 (en) Enhanced wireless-specific interfaces
CN106559739B (en) Lightweight data transmission method suitable for Bluetooth low-power wireless communication system
JP5215413B2 (en) Status report for retransmission protocol
WO2018176226A1 (en) Harq feedback method, apparatus, and system
US7457305B2 (en) Handling of acknowledgement messages in terminal
US20140192822A1 (en) Method for sending status information in mobile telecommunications system and receiver of mobile telecommunications
US10284340B2 (en) Multicast sending apparatus, multicast receiving apparatus, and multicast transmission determining method
US9036524B2 (en) Method and apparatus for sending control signaling
TWI526019B (en) Method and device for processing a packet in a wlan system
CN111629368B (en) Communication method of earphone and charging box, earphone and readable storage medium
CN107959555B (en) Data transmission method, device and storage medium based on LWAAP
US7197313B1 (en) Method for allocating wireless resource in wireless communication system
US20070277073A1 (en) Communication device, communication system, method of operating a communication device and ARQ feedback message
CN101369879B (en) Method and apparatus for requesting data retransmission
KR20210111839A (en) Data retransmission method, apparatus, recording medium and electronic device
US7434133B2 (en) Method of retransmitting data frame and network apparatus using the method
CN100574274C (en) The transmission system of radio link protocol and method
CN103973414A (en) Data transmission method and device
EP1580916B1 (en) System and method for transmitting units of messages in a mobile communication system
CN113302865B (en) Communication method, device and system
KR101018685B1 (en) Apparatus and method for controling automatic repeat request reset in wireless broadbandinternet system
KR20220003609A (en) Transmission method, apparatus and storage medium of hybrid automatic retransmission request feedback
KR20200016982A (en) Method and system for data transmission, and apparatus

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