CN113810063A - Data transmission method in wifi and Bluetooth system sharing radio frequency - Google Patents
Data transmission method in wifi and Bluetooth system sharing radio frequency Download PDFInfo
- Publication number
- CN113810063A CN113810063A CN202110954388.9A CN202110954388A CN113810063A CN 113810063 A CN113810063 A CN 113810063A CN 202110954388 A CN202110954388 A CN 202110954388A CN 113810063 A CN113810063 A CN 113810063A
- Authority
- CN
- China
- Prior art keywords
- data
- wifi
- bluetooth
- data packet
- sent
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 230000005540 biological transmission Effects 0.000 title claims abstract description 24
- 238000004891 communication Methods 0.000 claims abstract description 17
- 238000010586 diagram Methods 0.000 description 2
- 230000009977 dual effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011010 flushing procedure Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000001681 protective effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B1/00—Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
- H04B1/005—Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission adapting radio receivers, transmitters andtransceivers for operation on two or more bands, i.e. frequency ranges
- H04B1/0067—Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission adapting radio receivers, transmitters andtransceivers for operation on two or more bands, i.e. frequency ranges with one or more circuit blocks in common for different bands
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B1/00—Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
- H04B1/02—Transmitters
- H04B1/04—Circuits
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W88/00—Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
- H04W88/02—Terminal devices
- H04W88/06—Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a data transmission method in a wifi and Bluetooth system sharing radio frequency, which comprises a robot and a programming machine; the robot is connected with the programming machine for communication, and the programming machine transmits the corresponding instruction to the robot through wifi or Bluetooth; the steps of transmitting data via radio frequency are as follows: 101) a connection step, 102) a buffer area setting step, 103) an instruction storing step and 104) a sending selection step; the data transmission method in the wifi and Bluetooth system sharing radio frequency is flexible in configuration and capable of effectively solving the conflict situation generated in data transmission.
Description
Technical Field
The invention relates to the technical field of data transmission, in particular to a data transmission method in a wifi and Bluetooth system sharing radio frequency.
Background
At present, in the field of data transmission, particularly in a system with wifi and bluetooth, the simplest way is that each of the two devices has its own radio frequency antenna. The phenomenon is particularly prominent on the learning machine, and because the price of the learning machine is relatively high, a plurality of radio frequency antennas are mostly arranged for solving the problem. In practice, due to considerations of volume, compression cost and the like, it is a trend to adopt a common radio frequency antenna, and how to reduce the communication delay between bluetooth devices and ensure stability, and how to ensure that WiFi data is not lost as much as possible becomes one of important problems to be solved.
Disclosure of Invention
The invention overcomes the defects of the prior art, and provides the data transmission method in the wifi and Bluetooth system sharing the radio frequency, which has flexible configuration and effectively solves the conflict condition generated during data transmission.
The technical scheme of the invention is as follows:
a data transmission method in a wifi and Bluetooth system sharing radio frequency comprises a robot and a programming machine; the robot is connected with the programming machine for communication, and the programming machine transmits the corresponding instruction to the robot through wifi or Bluetooth; the steps of transmitting data via radio frequency are as follows:
101) a connection step: the robot and the programming machine are connected and communicated through wifi and Bluetooth and are combined in the same mesh network; the instruction priority sent through the Bluetooth communication is higher than that sent through the wifi communication;
102) setting a buffer area: setting a first sending buffer area for caching a local data packet to be sent, and providing a second sending buffer area for caching a WiFi data packet to be sent; when the programming machine sends a data packet, the data in the first cache region is preferentially sent, and when the data does not exist in the first cache region, the data in the second cache region is sent again;
103) and an instruction storing step: the programming machine stores instructions to be sent through wifi and Bluetooth into a first cache region according to time sequence;
104) a transmission selection step: when the data of the first buffer area is sent, selecting WiFi sending or Bluetooth sending according to the data type; when the data packet is a Bluetooth sending data packet and the Bluetooth equipment at the receiving end is not on-line, deleting the data packet; and when the data packet is a WiFi data packet and WiFi is not connected, storing the data into a second buffer area.
Further, the Data packet comprises Head, Type, Length, Data, and checksum;
head is a data header, occupies 1 byte, and has a default value of 0 xEC;
the Type is a data Type and occupies 1 byte, default 0xFE represents a wifi data packet, and 0xFC represents a Bluetooth data packet;
length is data Length, and occupies 3 bytes;
data is Data content;
checksum is a check code, occupies 1 byte, and has a data accumulated sum value.
Further, in step 104), when the second buffer is full, deleting a data packet which has not been sent by the second buffer queue head.
Furthermore, the first sending buffer area and the second sending buffer area both adopt a first-in first-out queue mode.
Furthermore, the programming machine also comprises a server, and the programming machine is connected with the server through wifi or Bluetooth for communication;
the robot executes the instructions transmitted by the programming machine;
and backing up the operation process of the programming machine by the background server and analyzing corresponding data.
Compared with the prior art, the invention has the advantages that:
the data transmission method in the wifi and Bluetooth system sharing radio frequency is flexible in configuration and capable of effectively solving the conflict situation generated in data transmission.
The invention can reduce the communication delay between the Bluetooth devices, ensure the stability and ensure that WiFi data are not lost as much as possible. As shown in fig. 2, with the dual buffer areas, the data in the first buffer area is to be transmitted in real time, and the data in the second buffer area can be transmitted with a delay. The Bluetooth data in the first cache region is preferentially ensured to be sent out, and wifi data which can be transmitted in time is effectively executed. And other wifi data can be cached in the second cache region according to the network state and sent when waiting for being idle.
Drawings
FIG. 1 is a schematic flow diagram of the present invention;
FIG. 2 is a diagram of a dual cache area according to the present invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
As shown in fig. 1 to fig. 2, a data transmission method in wifi and bluetooth systems sharing radio frequency is characterized in that: comprises a robot and a programming machine; the robot is connected with the programming machine for communication, and the programming machine transmits the corresponding instruction to the robot through wifi or Bluetooth; the steps of transmitting data via radio frequency are as follows:
101) a connection step: the robot and the programming machine are connected and communicated through wifi and Bluetooth and are combined in the same mesh network; the instruction priority sent through the Bluetooth communication is higher than the instruction priority sent through the wifi communication. That is, in general, instructions sent by bluetooth communication need to be executed first than instructions sent by wifi, and the importance degree is generally higher than that of instructions sent by wifi. Generally, the content sent by wifi is mostly instructions for backup, for example, a server can be further included, and the programming machine is connected and communicated with the server through wifi or bluetooth. The robot executes the instructions transmitted by the programming machine; and backing up the operation process of the programming machine by the background server and analyzing corresponding data. Such information of the programmer connecting to the server is sent by wifi.
102) Setting a buffer area: setting a first sending buffer area for caching a local data packet to be sent, and providing a second sending buffer area for caching a Wifi data packet to be sent; that is, the data packet of the first transmission buffer includes the command transmitted through the bluetooth communication and the command transmitted through the wifi, and the second transmission buffer stores only the command transmitted through the wifi.
When the programming machine sends a data packet, the data in the first cache region is preferentially sent, and when the data does not exist in the first cache region, the data in the second cache region is sent again; the first sending buffer area and the second sending buffer area both adopt a first-in first-out queue mode.
The Data packet format is shown in table 1, and includes Head, Type, Length, Data, and checksum.
Head is a data header, occupies 1 byte, and has a default value of 0 xEC;
the Type is a data Type and occupies 1 byte, default 0xFE represents a wifi data packet, and 0xFC represents a Bluetooth data packet;
length is data Length, and occupies 3 bytes;
data is Data content;
checksum is a check code, occupies 1 byte, and has a data accumulated sum value.
1 |
1 |
3 | n octets | 1 octets | |
Head | Type | Length | Data | checksum |
TABLE 1
1 |
1 |
3 | n octets | 1 octets | |
0xEC | 0xFE | n | ……… | checksum |
TABLE 2
1 |
1 |
3 | n octets | 1 octets | |
0xEC | 0xFC | n | ……… | checksum |
TABLE 3
The above tables 2 and 3 are wifi data packet examples and bluetooth data packet examples, respectively.
103) And an instruction storing step: the programming machine stores instructions to be sent through wifi and Bluetooth into a first cache region according to time sequence; that is, the corresponding instructions issued at the first time are stored in the first buffer and executed in a first-in first-out manner.
Taking a buffer capable of storing 200 data packets as an example, a first-in first-out queue is adopted, the position of the sequence number 1 is the head of the sending buffer, and the data packet to be sent currently is taken out from the head of the queue for sending; the position of the sequence 200 is the tail of the transmission buffer, and if a new data packet is to be transmitted, the new data packet is put into the tail of the transmission buffer to be transmitted. The tail of the queue depends on how many data packets are waiting to be sent in the current sending buffer, and if only 3 data packets are waiting to be sent currently, the tail of the queue is the sequence number 4, that is, a new data packet is placed at the position of the sequence number 4.
104) A transmission selection step: when the data of the first buffer area is sent, selecting WiFi sending or Bluetooth sending according to the data type; when the data packet is a Bluetooth sending data packet and the Bluetooth equipment at the receiving end is not on-line, deleting the data packet; when the data packet is a WiFi data packet WiFi, the data is stored in the second buffer area, or if the WiFi data packet transmission occupies more than a predetermined time value, the data is directly stored in the second buffer area (it needs to be pointed out that when the WiFi data packet of the second buffer area is executed, as long as the first buffer area has no instruction, the predetermined time value may not be set, and the WiFi data packet transmission is completed). Avoiding the buffer being full after a long time of occupation would mean that the local data packet of the programming machine itself can only be jammed to the end of the queue (for example, to the position of the sequence number 200), which would greatly delay the sending time of the data packet and seriously affect the user experience.
When the second cache area is full, deleting a data packet which is not sent by the head of the second cache area, and storing a new wifi incomplete instruction in the tail of the second cache area at the vacated position.
In a specific design, the first cache region and the second cache region both set a call cache region base class, which includes a read method bufferRead (), a write method bufferWrite (), an empty method bufferReset (), and a return storage size method bufferFill (), and the following specific definitions are provided:
the reading method buffer () is used for reading data in the buffer area, positioning the data through a pointer variable, storing the read data and obtaining the data length.
The write method buffer write () is used to write data into the buffer and record the data length.
The flushing method bufferReset () is used to flush the data in the buffer.
The postback store size method bufferFill () is used to obtain the size of the stored data in the buffer.
And a judgment method wifi _ ble _ send _ task () is needed to be additionally arranged for the first cache region and the second cache region, and is used for reading data in the first cache region, judging the data type and processing the data according to the current network state. If the current data type needs to be sent through WiFi, whether the WiFi is kept connected or not is judged, if yes, data are sent, and if the WiFi is not connected, the data are stored in a second buffer area. Before storing in the second buffer area, firstly judging whether there is any residual space, if it is full, removing data, then storing new data in the second buffer area.
In conclusion, the scheme can reduce the communication delay between the Bluetooth devices, ensure the stability and ensure that WiFi data are not lost as much as possible. After the double buffer areas are adopted, the data of the first buffer area is transmitted in real time, and the data of the second buffer area can be transmitted in a delayed mode. The Bluetooth data in the first cache region is preferentially ensured to be sent out, and wifi data which can be transmitted in time is effectively executed. And other wifi data can be cached in the second cache region according to the network state and sent when waiting for being idle. The problem that in a WiFi and Bluetooth system sharing a radio frequency antenna, one party is disconnected due to the fact that the WiFi and the Bluetooth simultaneously send data and the radio frequency antenna is preempted is effectively solved.
The foregoing is only a preferred embodiment of the present invention, and the details thereof are not described in detail and can be implemented by conventional techniques. Naturally, it should be noted that, for a person skilled in the art, several modifications and refinements can be made without departing from the inventive concept, and these modifications and refinements should also be considered as within the protective scope of the present invention.
Claims (5)
1. A data transmission method in a wifi and Bluetooth system sharing radio frequency is characterized in that: comprises a robot and a programming machine; the robot is connected with the programming machine for communication, and the programming machine transmits the corresponding instruction to the robot through wifi or Bluetooth; the steps of transmitting data via radio frequency are as follows:
101) a connection step: the robot and the programming machine are connected and communicated through wifi and Bluetooth and are combined in the same mesh network; the instruction priority sent through the Bluetooth communication is higher than that sent through the wifi communication;
102) setting a buffer area: setting a first sending buffer area for caching a local data packet to be sent, and providing a second sending buffer area for caching a WiFi data packet to be sent; when the programming machine sends a data packet, the data in the first cache region is preferentially sent, and when the data does not exist in the first cache region, the data in the second cache region is sent again;
103) and an instruction storing step: the programming machine stores instructions to be sent through wifi and Bluetooth into a first cache region according to time sequence;
104) a transmission selection step: when the data of the first buffer area is sent, selecting WiFi sending or Bluetooth sending according to the data type; when the data packet is a Bluetooth sending data packet and the Bluetooth equipment at the receiving end is not on-line, deleting the data packet; and when the data packet is a WiFi data packet and WiFi is not connected, storing the data into a second buffer area.
2. The method for sending data in wifi and bluetooth systems sharing radio frequency according to claim 1, wherein: the Data packet comprises Head, Type, Length, Data and checksum;
head is a data header, occupies 1 byte, and has a default value of 0 xEC;
the Type is a data Type and occupies 1 byte, default 0xFE represents a wifi data packet, and 0xFC represents a Bluetooth data packet;
length is data Length, and occupies 3 bytes;
data is Data content;
checksum is a check code, occupies 1 byte, and has a data accumulated sum value.
3. The method for sending data in wifi and bluetooth systems sharing radio frequency according to claim 1, wherein: and 104) deleting a data packet which is not sent by the queue head of the second buffer area when the second buffer area is full.
4. The method for sending data in wifi and bluetooth systems sharing radio frequency according to claim 1, wherein: the first sending buffer area and the second sending buffer area both adopt a first-in first-out queue mode.
5. The method for sending data in wifi and bluetooth systems sharing radio frequency according to claim 1, wherein: the programming machine is connected with the server for communication through wifi or Bluetooth;
the robot executes the instructions transmitted by the programming machine;
and backing up the operation process of the programming machine by the background server and analyzing corresponding data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110954388.9A CN113810063A (en) | 2021-08-19 | 2021-08-19 | Data transmission method in wifi and Bluetooth system sharing radio frequency |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110954388.9A CN113810063A (en) | 2021-08-19 | 2021-08-19 | Data transmission method in wifi and Bluetooth system sharing radio frequency |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113810063A true CN113810063A (en) | 2021-12-17 |
Family
ID=78941513
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110954388.9A Pending CN113810063A (en) | 2021-08-19 | 2021-08-19 | Data transmission method in wifi and Bluetooth system sharing radio frequency |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113810063A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105659682A (en) * | 2013-10-23 | 2016-06-08 | 高通股份有限公司 | Apparatus and methods of bluetooth and wireless local area network coexistence |
US9763244B1 (en) * | 2015-06-18 | 2017-09-12 | Amazon Technologies, Inc. | Adaptive data frame aggregation |
CN107729221A (en) * | 2017-09-29 | 2018-02-23 | 科立讯通信股份有限公司 | Cross-thread message monitoring method, device, computer equipment and storage medium |
CN111294289A (en) * | 2020-03-26 | 2020-06-16 | 上海有个机器人有限公司 | Multi-link switching robot communication method and system |
CN111669733A (en) * | 2019-03-06 | 2020-09-15 | 乐鑫信息科技(上海)股份有限公司 | Method for transmitting data packet at node in Bluetooth Mesh network |
-
2021
- 2021-08-19 CN CN202110954388.9A patent/CN113810063A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105659682A (en) * | 2013-10-23 | 2016-06-08 | 高通股份有限公司 | Apparatus and methods of bluetooth and wireless local area network coexistence |
US9763244B1 (en) * | 2015-06-18 | 2017-09-12 | Amazon Technologies, Inc. | Adaptive data frame aggregation |
CN107729221A (en) * | 2017-09-29 | 2018-02-23 | 科立讯通信股份有限公司 | Cross-thread message monitoring method, device, computer equipment and storage medium |
CN111669733A (en) * | 2019-03-06 | 2020-09-15 | 乐鑫信息科技(上海)股份有限公司 | Method for transmitting data packet at node in Bluetooth Mesh network |
CN111294289A (en) * | 2020-03-26 | 2020-06-16 | 上海有个机器人有限公司 | Multi-link switching robot communication method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107426113B (en) | Message receiving method and network equipment | |
EP2461527A1 (en) | Route switching device and data cashing method thereof | |
US20090016354A1 (en) | Information processing apparatus and information processing system | |
CN101197773B (en) | Packet compressed transmitting and received de-compression method and system based on multilink | |
CN101819561A (en) | File downloading method and system | |
JPH0824320B2 (en) | Method and device for buffer chaining in communication control device | |
US8626963B2 (en) | Packet based data transfer system and method for host-slave interface | |
CN113014510B (en) | Data caching method and device in distributed test of inertial navigation system | |
US20080263171A1 (en) | Peripheral device that DMAS the same data to different locations in a computer | |
JP6929946B2 (en) | Data transmission method, device, transmitting end, receiving end and system | |
US10862809B2 (en) | Modifying carrier packets based on information in tunneled packets | |
CN111538694A (en) | Data caching method for network interface to support multiple links and retransmission | |
US7213245B2 (en) | Software on demand system | |
CN106533976A (en) | Data packet processing method and device | |
CN113810063A (en) | Data transmission method in wifi and Bluetooth system sharing radio frequency | |
CN101621861B (en) | Method and device for processing command with telecommunication intelligent application card | |
CN102299861B (en) | A kind of message flux control method | |
CN108632302B (en) | Information transmission method and device | |
CN116132532A (en) | Message processing method and device and electronic equipment | |
CN115801770A (en) | Large file transmission method based on full-user-state QUIC protocol | |
CN114168517B (en) | Universal asynchronous serial data analysis method and device | |
CN112003767A (en) | Method for sending simulation message | |
CN106407307A (en) | Interaction method and interaction device for node data of distributed database | |
CN103024087B (en) | Support massive store and the system and method for ethernet communication simultaneously | |
WO2020227878A1 (en) | Method for scheduling data in memory, and data scheduling device and system |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20211217 |
|
RJ01 | Rejection of invention patent application after publication |