CN113613289A - Bluetooth data transmission method, system and communication equipment - Google Patents

Bluetooth data transmission method, system and communication equipment Download PDF

Info

Publication number
CN113613289A
CN113613289A CN202110881530.1A CN202110881530A CN113613289A CN 113613289 A CN113613289 A CN 113613289A CN 202110881530 A CN202110881530 A CN 202110881530A CN 113613289 A CN113613289 A CN 113613289A
Authority
CN
China
Prior art keywords
data
difference
compressed
compressed data
bluetooth
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110881530.1A
Other languages
Chinese (zh)
Other versions
CN113613289B (en
Inventor
林泽军
杨衍才
夏中灵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Youmi Industrial Automation Equipment Co ltd
Original Assignee
Yaomi Chongqing Intelligent Technology 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 Yaomi Chongqing Intelligent Technology Co ltd filed Critical Yaomi Chongqing Intelligent Technology Co ltd
Priority to CN202110881530.1A priority Critical patent/CN113613289B/en
Publication of CN113613289A publication Critical patent/CN113613289A/en
Application granted granted Critical
Publication of CN113613289B publication Critical patent/CN113613289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The invention discloses a method, a system and a communication device for transmitting Bluetooth data; the method comprises the steps of obtaining a Bluetooth sensor data packet and forming an unary array; extracting first data from the unary array, using the first data as a compressed data index tag and determining the first data as a comparison data standard, and establishing a compressed data length tag; continuing to extract the next data from the unary array, and calculating the difference between the next data and the comparison data standard; according to the magnitude relation between the difference absolute value and a preset threshold, the compressed data of the next data is formed by the difference sign, the difference reduction multiple and the difference absolute value which are correspondingly processed, the length label of the compressed data is updated, and the comparison data standard is updated according to the difference; and transmitting the compressed data to the next-level communication device until all the data in the unary array are compressed. The invention can improve the data throughput by 50% to the maximum extent, expands the industrial application range of the Bluetooth product and has great promotion effect on improving the performance of the Bluetooth product.

Description

Bluetooth data transmission method, system and communication equipment
Technical Field
The present invention relates to the field of bluetooth communication, and in particular, to a bluetooth data transmission method, system and communication device.
Background
With the rapid development of wireless communication technology, various wireless communication protocols are increasing, and application products based on the wireless communication protocols are also increasing, taking products based on bluetooth communication as examples, such as bluetooth pedometer, bluetooth earphone, bluetooth sound box, bluetooth data collector, etc., have already widely entered people's lives. The application of the existing Bluetooth communication technology is very wide, and the main reason is that the Bluetooth has the advantages of low power consumption, high speed, large coverage area, good stability and the like, and the Bluetooth can be simultaneously connected with a plurality of devices, so that the requirements of users on different devices can be met.
However, compared with the WIFI wireless communication protocol, the transmission speed of bluetooth is relatively low, and the maximum transmission speed of the technology of bluetooth version 4.2 is 2.0Mbps, which is much lower than the WIFI transmission speed; therefore, in some application scenarios with huge data traffic and high transmission speed requirement, the bluetooth communication technology is prone to overload data transmission, data confusion, and even failure to implement the predetermined function.
Based on this, considering that the requirement of the user on the transmission rate is higher and higher, the traditional bluetooth transmission technology cannot meet the actual requirement; how to increase the transmission speed of bluetooth data to increase the throughput of bluetooth data has become a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the foregoing defects in the prior art, an object of the present invention is to provide a bluetooth data transmission method, system and communication device, which are used to improve the transmission efficiency of bluetooth data and enhance the bluetooth data throughput.
In a first aspect of the present invention, the present invention provides a bluetooth data transmission method, including:
s1, acquiring one or more Bluetooth sensor data packets to be transmitted, and forming a unary array;
s2, extracting first data from the unary array, taking the first data as a compressed data index label, and establishing a compressed data length label; and determining the first data as a comparison data standard;
s3, continuing to extract next data from the unary array, and calculating the difference value between the extracted next data and the comparison data standard;
s4, according to the magnitude relation between the difference absolute value and the preset threshold, the difference sign, the difference reduction multiple and the difference absolute value after corresponding processing form the compressed data of the next data, the compressed data length label is updated, and the comparison data standard is updated according to the difference;
and S5, repeatedly executing the steps S3-S4 until all the data in the unary array are compressed, and transmitting the compressed data to the next-level communication device.
In a second aspect of the present invention, the present invention further provides a bluetooth data transmission system, which includes a data acquisition module, a data compression module and a data transmission module integrated in a bluetooth chip;
the data acquisition module is connected with one or more sensors through an SPI (serial peripheral interface); the data acquisition module acquires one or more Bluetooth sensor data packages to be transmitted from one or more sensors and forms an unary array;
the data compression module extracts first data from the unary array, the first data is used as a compressed data index tag, and a compressed data length tag is established; and determining the first data as a comparison data standard; continuing to extract next data from the unary array, and calculating a difference value between the extracted next data and a comparison data standard; according to the magnitude relation between the difference absolute value and a preset threshold, the compressed data of the next data is formed by the difference sign, the difference reduction multiple and the difference absolute value which are correspondingly processed, the length label of the compressed data is updated, and the comparison data standard is updated according to the difference; until all data in the unary array are compressed;
and the data sending module transmits the compressed data to the next-stage communication device.
In a third aspect of the present invention, the present invention also provides a communication device comprising a transceiver, a memory, a processor and a program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program:
s1, acquiring one or more Bluetooth sensor data packets to be transmitted, and forming a unary array;
s2, extracting first data from the unary array, taking the first data as a compressed data index label, and establishing a compressed data length label; and determining the first data as a comparison data standard;
s3, continuing to extract next data from the unary array, and calculating the difference value between the extracted next data and the comparison data standard;
s4, according to the magnitude relation between the difference absolute value and the preset threshold, the difference sign, the difference reduction multiple and the difference absolute value after corresponding processing form the compressed data of the next data, the compressed data length label is updated, and the comparison data standard is updated according to the difference;
and S5, repeatedly executing the steps S3-S4 until all the data in the unary array are compressed, and transmitting the compressed data to the next-level communication device.
In a fourth aspect, the present invention also provides a chip system in a fourth aspect, where the chip system includes a processor, and is configured to support an electronic device to implement the functions recited in the first aspect or any one of the possible implementation manners of the first aspect.
In one possible design, the system-on-chip may further include a memory, which stores program instructions and data necessary for the electronic device. The chip system may be constituted by a chip, or may include a chip and other discrete devices.
For technical effects brought by any one of the possible implementation manners of the second aspect to the fourth aspect, reference may be made to technical effects brought by different possible implementation manners of the first aspect or the first aspect, and details are not described here.
The invention has the beneficial effects that:
the invention can compress data by the difference value between data without changing the prior transmission modeAccording to the method, the compressed data is provided with the sign corresponding to the difference value and the difference value reduction multiple, the compressed data can be ensured not to be distorted basically in the recovery stage, only when the difference value multiple is not 1, the data can be slightly distorted, and the error between the data and the real data is less than 1/(2)4X-2-1), so that the distortion rate caused by the compression process is very small and substantially negligible; the original data is a storage space of N x 4, and the compressed data is a storage space of N x 2, so that the data throughput can be improved by 50% to the maximum, complex calculation is not needed, an algorithm core only needs to compare the data twice, no intermediate data exists, no data cache space needs to be additionally allocated, and the calculation complexity of the compressed algorithm is low, so that the normal performance of other devices is not influenced by only occupying small calculation capacity and less memory. The Bluetooth data transmission method, the Bluetooth data transmission system and the communication equipment can obviously improve the data throughput, expand the industrial application range of products and have great promotion effect on improving the performance of the products.
Drawings
Fig. 1 is a flowchart of a bluetooth data transmission method in one embodiment of the present invention;
FIG. 2 is a diagram illustrating a Bluetooth data compression determination based on a predetermined threshold condition according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a compressed data store in accordance with an embodiment of the present invention;
fig. 4 is a diagram of a bluetooth data transmission system architecture in an embodiment of the present invention;
FIG. 5 is a diagram of a Bluetooth data transmission system architecture in accordance with a preferred embodiment of the present invention;
fig. 6 is a block diagram of a communication device according to an embodiment of the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and examples, wherein the terms "upper", "lower", "left", "right", "inner", "outer", and the like, as used herein, refer to an orientation or positional relationship indicated in the drawings, which is for convenience and simplicity of description, and does not indicate or imply that the referenced devices or components must be in a particular orientation, constructed and operated in a particular manner, and thus should not be construed as limiting the present invention. The terms "first," "second," "third," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
As shown in fig. 1, fig. 1 is a flowchart of a bluetooth data transmission method in an embodiment of the present invention, where the bluetooth data transmission method includes:
101. acquiring one or more Bluetooth sensor data packets to be transmitted, and forming an unary array;
in this embodiment, the bluetooth sensor data packets to be transmitted may be obtained from each sensor, and the bluetooth sensor data packets are obtained through a bluetooth chip, a series of start addresses of the bluetooth sensor data packets are defined, and a unary array is formed according to the corresponding start addresses.
102. Extracting first data from the unary array, taking the first data as a compressed data index tag, and establishing a compressed data length tag; and determining the first data as a comparison data standard;
in this embodiment, the compression algorithm is executed from this step, first data in the unary array needs to be obtained, and a data space is allocated to the first data, where the first data is special and can be used as an index tag of the compressed data, and the value of the index tag is an original data copy of the first data and is not modified, and the index tag is a data header of the compressed data; because no comparative data standard which can be used for data comparison exists at this time, the embodiment does not need to perform additional processing on the first data, and still only needs to copy the first data as it is, that is, the compressed data index tag is used as the initial comparative data standard; the comparison data standard can adjust the relation between the data; this comparative data criterion is also a constant update of this value as the compression process progresses.
In some embodiments, the numeric types of the raw data in the unary array include fractional and integer; and when the original data is in a decimal type, calculating a reshaping parameter value of the original data, and reshaping the original data or the difference value by using the reshaping parameter value.
Generally, the data format, i.e. the value type, is a decimal type, the decimal type data occupies at least 4 bytes in a bluetooth chip or other MCU, and the data length occupied by the compressed data is 2 bytes, i.e. the compressed data length is 1/2 of the original data. Of course, the invention is also applicable to the case of integers, and the ratio of the length of each original datum in the integer data to the length of the compressed data is still 2: 1.
In the step, fractional data is taken as an example, a reshaping parameter value needs to be calculated for each fractional data in the unary array, the integer parameter value is actually a multiple value, and a product obtained by multiplying the original data by the reshaping parameter value is an integer. If the original data is not in a decimal type, the reshaping parameter value can be ignored, namely, reshaping processing on the integer data is not needed; or directly set the reshaping parameter value to 1.
For example, when the data processed by the present invention is decimal data, it is necessary to calculate a reshaping parameter value of the decimal data, for example, for the data 618.76, the reshaping parameter value is 100, and the decimal data 618.76 needs to be multiplied by the reshaping parameter value of 100 to be converted into integer data 61876, which is convenient for the calculation of the subsequent process.
In this embodiment, a compressed data length tag needs to be constructed for the first compressed data index, that is, a length space is allocated for the first compressed data index, assuming that the original data occupies 4 bytes, the size of the length space here may be 2 bytes, and meanwhile, the initial value of the length space is set to 1, and the value of the length space will increase with the update of the compressed data.
103. Continuing to extract next data from the unary array, and calculating a difference value between the extracted next data and a comparison data standard;
acquiring next data in the array, taking the data acquired this time, namely the next data, as a subtracted number, and taking a comparison data standard as the subtracted number, and calculating a difference value between the two; if the original data is fractional, this difference needs to be multiplied by the resulting reshaping parameter value and then forced to be converted to the reshaping value offset. If the original data is not a decimal number, the operation of multiplying by the value of the reshaping parameter, the difference being the value of the reshaping offset, can be omitted.
In this embodiment, after the first data is extracted, since the first data is provided with the compressed data index tag and the compressed data length tag, the first data is equivalent to a data header of the compressed data, and the tag of the data header can facilitate computer/device/user indexing; and after the data head of the compressed data is determined, continuously extracting the second data, calculating a difference value between the second data and the comparison data standard, and performing subsequent processing on the difference value.
Generally, since there may be a plurality of data in the unary array, in addition to the difference between the first data and the second data, the difference between the second data and the subsequent data is calculated, so the difference between the next data and the comparison data standard may refer to the difference between the second data and the comparison data standard corresponding to the first data, or may refer to the difference between the nth data and the N-1 th data comparison standard data, where N ≧ 2.
104. According to the magnitude relation between the difference absolute value and a preset threshold, the compressed data of the next data is formed by the difference sign, the difference reduction multiple and the difference absolute value which are correspondingly processed, the length label of the compressed data is updated, and the comparison data standard is updated according to the difference;
FIG. 2 is a diagram illustrating a Bluetooth data compression determination based on a predetermined threshold condition according to an embodiment of the present invention; as shown in fig. 2, in the embodiment of the present invention, the process of compressing the core of the bluetooth data is completed through the relationship between the absolute value of the difference and the preset threshold, which specifically includes:
401. if the difference absolute value is smaller than the first threshold, the difference sign, the difference reduction multiple and the difference absolute value form compressed data of the next data, the compressed data length label is updated, and the comparison data standard is updated according to the difference;
the sign of the difference at this time is determined according to the positive and negative conditions of the difference, the difference is reduced by a multiple of 1, that is, the difference is not reduced, and the absolute value of the difference is the absolute value corresponding to the difference, for example, if the difference is-2333, the sign of the difference is-1, and the absolute value of the difference is 2333.
402. If the absolute value of the difference is larger than or equal to the first threshold and smaller than the second threshold, the difference is reduced, the reduced difference sign, the reduced difference multiple and the absolute value of the difference form compressed data of the next data, the length label of the compressed data is updated, and the comparison data standard is updated according to the difference.
The sign of the difference at this time is still determined according to the positive and negative conditions of the difference, assuming that the difference is reduced by a factor of 10, that is, the original difference is reduced by a factor of 10, and the absolute value of the difference is the absolute value corresponding to the difference after the difference is reduced by a factor of 10 and shaped, for example, assuming that the original difference is-23333, the sign of the difference is-the difference is reduced by a factor of 10, the reduced difference is shaped, and the finally determined absolute value of the difference is 2333.
The preset threshold includes the above-mentioned first threshold and second threshold, and the first threshold and the second threshold may be calculated as follows:
first threshold value N1Is expressed as N1=24X-2-1;
Second threshold value N2Is expressed as N2=K×N1=K×(24X-2-1);
Wherein, X represents the byte number occupied by each original data in the unary array, namely 8X represents the bit number occupied by the original data, and X/2 represents the byte number occupied by each original data in the unary array, namely 4X represents the bit number occupied by the compressed data; k represents the reduction of the difference by a factor of two.
The specific size of K may be determined by both the transmitter and the receiver, for example, the compression side may set K to 3, the compression side may separately notify the decompression side of K to 3, and when the decompression side knows K to 3, the decompression side may decompress the data by K to 3.
It is understood that the number of bits occupied by the compressed data is the number of bits occupied by the compressed data other than the first data, and the first data is not compressed because there is no other reference standard, so that the first data still occupies X bytes.
The format of the compressed data is represented as a symbol, a multiple and a data difference, namely, the compressed data respectively represents a difference value symbol, a difference value reduction multiple and a difference value absolute value; in the compressed data, the sign corresponding to the difference value occupies 1 bit, and the sign corresponding to the difference value is a positive sign or a negative sign; the 1 st bit is occupied by the reduction multiple of the difference, which indicates that the reduction multiple of the difference is 1 time or K times; the absolute value of the difference occupies the remaining 4X-2 bits; x represents the number of bytes occupied by each original data in the unary array, namely 8X represents the number of bits occupied by the original data.
For example, it is assumed that original data occupies 4 bytes, and compressed data occupies 2 bytes, that is, the compressed data has 8 × 2 bits in total; then the symbol may occupy bit1, a 1 may represent a positive sign, and a 0 may represent a symbol; the multiple may occupy the 2 nd bit, 1 may represent a multiple of 1,0 may represent a multiple of K; the remaining 14 bits are occupied by the data difference value, and therefore the data difference value must have a size of 2 or less1416383(16 is denoted by 0x3FFF, and 11111111111111 is binary).
It can be understood that, in the symbol, the multiple and the data difference, the symbol may occupy the 1 st bit or the 2 nd bit, and the multiple may occupy the 1 st bit or the 2 nd bit; the data difference value generally occupies the remaining number of bits; the meaning represented by the numerical value 1 or 0 can also be set by those skilled in the art according to the actual situation, and the present invention is not limited to this specifically.
For example, space is allocated for the compressed data, and 2 bytes are added to the address based on the last allocation, and the difference is stored in the address. The 2 bytes of storage space are divided into the following 3 parts:
1. the symbol area is 1 bit in length and can only represent a data interval of 0-1;
2. the multiple area is 1 bit in length and can only represent a data interval of 0-1;
3. the difference area is 14 bits in length, can only represent a data interval of 0-16383, and is converted into hexadecimal, namely 0-0 x3 FFF.
The difference needs to be further processed in conjunction with the parameters calculated in the above step before the compressed data is saved. The further division is performed according to whether the difference value is greater than or equal to 0, and if the difference value is greater than or equal to 0, the most significant Bit of the 2 bytes is 0, that is, Bit15 is equal to 0. If the difference is less than 0, the most significant Bit of the 2 bytes is 1, i.e., Bit15 is equal to 1. According to the multiple parameter obtained above, if the multiple parameter is 1, the 14 th Bit of the 2 bytes is 0, i.e. Bit15 is equal to 0. If the multiple parameter is 10, Bit 14 of the 2 bytes is 1, i.e., Bit15 is equal to 1. Bits 0 to 13 of the 2 bytes, i.e., Bit13 to Bit0, store the above calculated difference. At this point, the new difference, i.e., all of the Bit bits in the compressed data, is processed.
In the above embodiment, the compressed data length tag needs to be updated, and the comparison data standard needs to be updated according to the difference, so that 1 needs to be added to the compressed data length tag first, that is, one compressed data is added; the difference is then compensated into the comparison data standard.
For example, in some embodiments, assuming that the absolute difference is less than 16383, the original comparison criterion is 12383, and the difference is-11383, then the updated comparison criterion data is represented as 1000.
In some embodiments, assuming the absolute difference is greater than or equal to 16383 and less than 163830, the original comparison standard data is 12383 and the difference is 163814; then in the previous storing process, the difference value needs to be reduced, and the quotient thereof is 16381.4, and at this time, the reduced difference value needs to be shaped, so the reduced difference value can be represented as 16381; the resulting reshaped quotient 16381 is compensated to the comparison data standard as an increment, which is also signed, the sign being the same as the calculated sign.
Fig. 3 shows a schematic diagram of storing compressed data in an embodiment of the present invention, as shown in fig. 3, assuming that n data are total in original data, and a start address of each data occupies 4 bytes, and therefore, 4n bytes are total from a first data to an nth data, when the n data are compressed by using the processes of steps 102 to 104 in the present invention, the first data are compressed first, so that the first data 401 can be directly copied, and a data length is set for the first data 401; the start address of the compressed first data 401 occupies 4 bytes, and the data length thereof occupies 2 bytes; for the following data, taking the 2 nd data 402 as an example, the start address of the compressed 2 nd data 402 occupies 2 bytes, where the 2 bytes include a symbol 403, a multiple 404 and a data difference 405, which correspond to the difference symbol in the foregoing, and the difference is reduced by a multiple and an absolute value of the difference; similarly, corresponding to the 3 rd data 406, the start address of the compressed 3 rd data 406 also occupies 2 bytes, and the 2 bytes also include a symbol, a multiple, and a data difference, and so on, all data using the 1 st data as a data index can be compressed in the same manner as the 2 nd data and the 3 rd data.
403. If the absolute value of the difference is greater than or equal to the second threshold, the next data is used as a new compressed data index tag, a new compressed data length tag is established, the next data is determined to be a comparison data standard, and the step 103 is returned.
In this step, if the absolute value of the difference is greater than or equal to the second threshold, it is indicated that the shaping value offset corresponding to the difference is already greater than the size that can be stored in the format of the compressed data, and for example, if the compressed data is 2 bytes, the number of bits of the compressed data that can store the data content, that is, the difference between the stored data is 14 bits, and even if the data can be reduced by a factor of 10 at the maximum, the data can still be stored by only 10 × (2) at the maximum14-1) data size 163830; i.e., 0x3FFF 10 (represented in decimal 163830), so that a difference value exceeding 163830 (both positive and negative signs are considered as exceeding) indicates that 2 words have been exceeded and can be represented adequatelyThe range of offset values, so to restart creating a new index starting with the original data, and at the same time, to process the new index in a manner similar to the first data in step 102, a data space is allocated to the data, which is more specific and can be used as a compressed data index tag, the value of which is a copy of the original data of the data without any modification, and the index tag is a header of a new set of compressed data; because a comparison data standard which can be used for new data comparison does not exist at this time, the embodiment does not need to perform additional processing on the data, and still only needs to copy the data as it is, that is, the compressed data index tag is used as an initial comparison data standard; the comparison data standard can adjust the relation between the data; this comparative data criterion is also a constant update of this value as the compression process progresses.
In this embodiment, a compressed data length tag needs to be constructed for the compressed data index, that is, a length space is allocated for the compressed data index, assuming that the original data occupies 4 bytes, the size of the length space here may occupy 2 bytes, and meanwhile, the initial value of the length space is set to 1, and the value of the length space will increase with the update of the compressed data.
105. And (5) repeatedly executing the steps 103-104 until all the data in the unary array are compressed, and transmitting the compressed data to the next-level communication device.
And judging whether the extracted next data is the last data in the unary array, if not, continuing the compression process, repeatedly executing the steps 103-104, and obtaining the next data in the array. If the last data, the compression process is finished, and the compression process is directly exited. And transmitting the compressed data to the next-stage communication device.
The next-level communication Device refers to a next-level communication Device for bluetooth data transmission, and may include, but is not limited to, a memory, a processor, a router, a Mobile phone terminal, a computer, a server, a tablet computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and other devices capable of storing and/or processing bluetooth data, which is not limited in this respect.
Fig. 4 is an architecture diagram of a bluetooth data transmission system in an embodiment of the present invention, and as shown in fig. 4, the bluetooth data transmission system 200 includes a data acquisition module 201, a data compression module 202, and a data transmission module 203 integrated in a bluetooth chip; wherein:
the data acquisition module 201 is configured to:
acquiring one or more Bluetooth sensor data packets to be transmitted, and forming an unary array;
the data compression module 202 is configured to:
extracting first data from the unary array, taking the first data as a compressed data index tag, and establishing a compressed data length tag; and determining the first data as a comparison data standard; continuing to extract next data from the unary array, and calculating a difference value between the extracted next data and a comparison data standard; according to the magnitude relation between the difference absolute value and a preset threshold, the compressed data of the next data is formed by the difference sign, the difference reduction multiple and the difference absolute value which are correspondingly processed, the length label of the compressed data is updated, and the comparison data standard is updated according to the difference; until all data in the unary array are compressed;
the data sending module 203 is configured to:
and transmitting the compressed data to a next-stage communication device.
Fig. 5 is an architecture diagram of a bluetooth data transmission system in a preferred embodiment of the present invention, as shown in fig. 5, the bluetooth data transmission system 210 includes a data acquisition module 211, a data compression module 212, and a data transmission module 213 integrated in a bluetooth chip; wherein:
the data acquisition module 211 is connected with one or more sensors through an SPI interface; the data acquisition module 211 acquires one or more bluetooth sensor data packets to be transmitted from one or more sensors and forms an unary array;
it should be understood that only 2 sensors are shown in fig. 5, and do not represent only 2 sensors in the present application, and those skilled in the art can set the kinds and the number of the corresponding sensors according to the actual situation.
The data compression module 212 extracts first data from the unary array, and establishes a compressed data length tag by using the first data as a compressed data index tag; and determining the first data as a comparison data standard; continuing to extract next data from the unary array, and calculating a difference value between the extracted next data and a comparison data standard; according to the magnitude relation between the difference absolute value and a preset threshold, the compressed data of the next data is formed by the difference sign, the difference reduction multiple and the difference absolute value which are correspondingly processed, the length label of the compressed data is updated, and the comparison data standard is updated according to the difference; until all data in the unary array are compressed;
the data transmission module 213 transmits the compressed data to the next-stage communication device.
It should be noted that, because the contents of information interaction, execution process, and the like between the modules/units of the apparatus are based on the same concept as the method embodiment of the present application, the technical effect brought by the contents is the same as the method embodiment of the present application, and specific contents may refer to the description in the foregoing method embodiment of the present application, and are not described herein again.
Fig. 6 is a structural diagram of a communication device according to an embodiment of the present invention, please refer to fig. 6, which is a schematic structural diagram of a communication device according to an embodiment of the present invention; as shown in fig. 6, the communication device includes a memory 320, a processor 300, a transceiver 310, a bus interface, and a program stored in the memory 320 and executable on the processor 300, wherein the processor 300 is configured to read the program in the memory 320 and execute the following processes:
s1, acquiring one or more Bluetooth sensor data packets to be transmitted, and forming a unary array;
s2, extracting first data from the unary array, taking the first data as a compressed data index label, and establishing a compressed data length label; and determining the first data as a comparison data standard;
s3, continuing to extract next data from the unary array, and calculating the difference value between the extracted next data and the comparison data standard;
s4, according to the magnitude relation between the difference absolute value and the preset threshold, the difference sign, the difference reduction multiple and the difference absolute value after corresponding processing form the compressed data of the next data, the compressed data length label is updated, and the comparison data standard is updated according to the difference;
and S5, repeatedly executing the steps S3-S4 until all the data in the unary array are compressed, and transmitting the compressed data to the next-level communication device.
The memory may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP; the processor 2000 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The memory may also include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a Hard Disk Drive (HDD), or a solid-state drive (SSD).
The memory may also comprise a combination of memories of the kind described above. The memory processor provides instructions and data. The portion of memory may also include non-volatile random access memory (NVRAM). The memory stores an operating system and operating instructions, executable modules or data structures, or subsets thereof, or expanded sets thereof, wherein the operating instructions may include various operating instructions for performing various operations. The operating system may include various system programs for implementing various basic services and for handling hardware-based tasks.
The processor is an operating device for controlling the electronic device, and may also be referred to as a Central Processing Unit (CPU). In a particular application, the various components of the electronic device are coupled together by a bus system that may include a power bus, a control bus, a status signal bus, etc., in addition to a data bus.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
The processor may be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Where in fig. 6, the bus architecture may include any number of interconnected buses and bridges, with various circuits of one or more processors, represented by processor 300, and memory, represented by memory 320, being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface. The transceiver 310 may be a number of elements including a transmitter and a transceiver providing a means for communicating with various other apparatus over a transmission medium. The processor 300 is responsible for managing the bus architecture and general processing, and the memory 320 may store data used by the processor 300 in performing operations.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (8)

1. A method for bluetooth data transmission, the method comprising:
s1, acquiring one or more Bluetooth sensor data packets to be transmitted, and forming a unary array;
s2, extracting first data from the unary array, taking the first data as a compressed data index label, and establishing a compressed data length label; and determining the first data as a comparison data standard;
s3, continuing to extract next data from the unary array, and calculating the difference value between the extracted next data and the comparison data standard;
s4, according to the magnitude relation between the difference absolute value and the preset threshold, the difference sign, the difference reduction multiple and the difference absolute value after corresponding processing form the compressed data of the next data, the compressed data length label is updated, and the comparison data standard is updated according to the difference;
and S5, repeatedly executing the steps S3-S4 until all the data in the unary array are compressed, and transmitting the compressed data to the next-level communication device.
2. The method according to claim 1, wherein the step S4 specifically includes:
s41, if the difference absolute value is smaller than the first threshold, the difference sign, the difference reduction multiple and the difference absolute value form the compressed data of the next data, the compressed data length label is updated, and the comparison data standard is updated according to the difference;
and S42, if the absolute value of the difference is greater than or equal to the first threshold and less than the second threshold, reducing the difference, forming the compressed data of the next data by the reduced difference sign, the reduced difference multiple and the absolute value of the difference, updating the length label of the compressed data, and updating the comparison data standard according to the difference.
3. The bluetooth data transmission method according to claim 2, wherein the step S4 further comprises the step S43:
s43, if the absolute value of the difference is larger than or equal to the second threshold, the next data is used as a new compressed data index label, a new compressed data length label is established, the next data is determined to be a comparison data standard, and the step S3 is returned.
4. A method for Bluetooth data transmission according to claim 2 or 3,
first threshold value N1Is expressed as N1=24X-2-1;
Second threshold value N2Is expressed as N2=K×N1=K×(24X-2-1);
Wherein, X represents the byte number occupied by each original data in the unary array, namely 8X represents the bit number occupied by the original data, and X/2 represents the byte number occupied by each original data in the unary array, namely 4X represents the bit number occupied by the compressed data; k represents the reduction of the difference by a factor of two.
5. The method as claimed in claim 4, wherein in the compressed data, the symbol corresponding to the difference occupies 1 bit, indicating that the symbol corresponding to the difference is a positive or negative sign; the reduction multiple of the difference occupies 1 bit, and represents that the reduction multiple of the difference is 1 time or K times; the absolute value of the difference occupies the remaining 4X-2 bits.
6. The method of claim 1, wherein the numerical type of the raw data in the unary array includes a decimal type and an integer type; and when the original data is in a decimal type, calculating a reshaping parameter value of the original data, and reshaping the original data or the difference value by using the reshaping parameter value.
7. A Bluetooth data transmission system comprises a data acquisition module, a data compression module and a data sending module which are integrated in a Bluetooth chip; it is characterized in that the preparation method is characterized in that,
the data acquisition module is connected with one or more sensors through an SPI (serial peripheral interface); the data acquisition module acquires one or more Bluetooth sensor data packages to be transmitted from one or more sensors and forms an unary array;
the data compression module extracts first data from the unary array, the first data is used as a compressed data index tag, and a compressed data length tag is established; and determining the first data as a comparison data standard; continuing to extract next data from the unary array, and calculating a difference value between the extracted next data and a comparison data standard; according to the magnitude relation between the difference absolute value and a preset threshold, the compressed data of the next data is formed by the difference sign, the difference reduction multiple and the difference absolute value which are correspondingly processed, the length label of the compressed data is updated, and the comparison data standard is updated according to the difference; until all data in the unary array are compressed;
and the data sending module transmits the compressed data to the next-stage communication device.
8. A communication device comprising a transceiver, a memory, a processor, and a program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of:
s1, acquiring one or more Bluetooth sensor data packets to be transmitted, and forming a unary array;
s2, extracting first data from the unary array, taking the first data as a compressed data index label, and establishing a compressed data length label; and determining the first data as a comparison data standard;
s3, continuing to extract next data from the unary array, and calculating the difference value between the extracted next data and the comparison data standard;
s4, according to the magnitude relation between the difference absolute value and the preset threshold, the difference sign, the difference reduction multiple and the difference absolute value after corresponding processing form the compressed data of the next data, the compressed data length label is updated, and the comparison data standard is updated according to the difference;
and S5, repeatedly executing the steps S3-S4 until all the data in the unary array are compressed, and transmitting the compressed data to the next-level communication device.
CN202110881530.1A 2021-08-02 2021-08-02 Bluetooth data transmission method, system and communication equipment Active CN113613289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110881530.1A CN113613289B (en) 2021-08-02 2021-08-02 Bluetooth data transmission method, system and communication equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110881530.1A CN113613289B (en) 2021-08-02 2021-08-02 Bluetooth data transmission method, system and communication equipment

Publications (2)

Publication Number Publication Date
CN113613289A true CN113613289A (en) 2021-11-05
CN113613289B CN113613289B (en) 2024-03-22

Family

ID=78306488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110881530.1A Active CN113613289B (en) 2021-08-02 2021-08-02 Bluetooth data transmission method, system and communication equipment

Country Status (1)

Country Link
CN (1) CN113613289B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114629502A (en) * 2022-03-21 2022-06-14 和睿沐康(成都)医疗科技有限公司 Method, device, system and medium for compressing, uploading and decompressing sampled data
CN115460163A (en) * 2022-08-18 2022-12-09 深圳市千岩科技有限公司 Data processing method, data processing device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010054131A1 (en) * 1999-01-29 2001-12-20 Alvarez Manuel J. System and method for perfoming scalable embedded parallel data compression
US20100325094A1 (en) * 2009-06-19 2010-12-23 Sybase, Inc. Data Compression For Reducing Storage Requirements in a Database System
US20150309650A1 (en) * 2014-04-24 2015-10-29 Qualcomm Incorporated Efficient lossless compression for peripheral interface data transfer
CN108738006A (en) * 2018-05-31 2018-11-02 出门问问信息科技有限公司 Data transmission method based on bluetooth and device
CN109040047A (en) * 2018-07-25 2018-12-18 中国石油天然气股份有限公司 Indicator diagram data compression and transmission method and device
CN109787638A (en) * 2019-01-10 2019-05-21 杭州幻方科技有限公司 A kind of compression storing data processing unit and method
CN110943797A (en) * 2019-12-18 2020-03-31 北京邮电大学 Data compression method in SDH network
CN111865324A (en) * 2019-11-20 2020-10-30 马上消费金融股份有限公司 Data compression and decompression method, device, system and storage device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010054131A1 (en) * 1999-01-29 2001-12-20 Alvarez Manuel J. System and method for perfoming scalable embedded parallel data compression
US20100325094A1 (en) * 2009-06-19 2010-12-23 Sybase, Inc. Data Compression For Reducing Storage Requirements in a Database System
US20150309650A1 (en) * 2014-04-24 2015-10-29 Qualcomm Incorporated Efficient lossless compression for peripheral interface data transfer
CN108738006A (en) * 2018-05-31 2018-11-02 出门问问信息科技有限公司 Data transmission method based on bluetooth and device
CN109040047A (en) * 2018-07-25 2018-12-18 中国石油天然气股份有限公司 Indicator diagram data compression and transmission method and device
CN109787638A (en) * 2019-01-10 2019-05-21 杭州幻方科技有限公司 A kind of compression storing data processing unit and method
CN111865324A (en) * 2019-11-20 2020-10-30 马上消费金融股份有限公司 Data compression and decompression method, device, system and storage device
CN110943797A (en) * 2019-12-18 2020-03-31 北京邮电大学 Data compression method in SDH network

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114629502A (en) * 2022-03-21 2022-06-14 和睿沐康(成都)医疗科技有限公司 Method, device, system and medium for compressing, uploading and decompressing sampled data
CN114629502B (en) * 2022-03-21 2022-11-22 和睿沐康(成都)医疗科技有限公司 Method, device, system and medium for compressing, uploading and decompressing sampled data
CN115460163A (en) * 2022-08-18 2022-12-09 深圳市千岩科技有限公司 Data processing method, data processing device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113613289B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
CN113613289B (en) Bluetooth data transmission method, system and communication equipment
US10817460B2 (en) RDMA data sending and receiving methods, electronic device, and readable storage medium
CN112003625A (en) Huffman coding method, system and equipment
WO2024098715A1 (en) Video compression method and system for baseboard management control chip, and related components
WO2021101451A1 (en) Method and apparatus for storing data, and computer device and storage medium thereof
EP3295568B1 (en) Improved compressed caching in a virtual memory system
CN115567589B (en) Compression transmission method, device and equipment of JSON data and storage medium
WO2020125527A1 (en) Data compression method, apparatus, computer device and storage medium
CN113630125A (en) Data compression method, data encoding method, data decompression method, data encoding device, data decompression device, electronic equipment and storage medium
CN111966647A (en) Cloud storage method and device for small files, server and storage medium
CN111491169A (en) Digital image compression method, device, equipment and medium
CN113220651B (en) Method, device, terminal equipment and storage medium for compressing operation data
US6871274B2 (en) Instruction code conversion apparatus creating an instruction code including a second code converted from a first code
WO2015021753A1 (en) Data compression method, computer system and device
CN106293542B (en) Method and device for decompressing file
WO2021237510A1 (en) Data decompression method and system, and processor and computer storage medium
WO2021036189A1 (en) Rdma data sending and receiving methods, electronic device and readable storage medium
CN111417920A (en) Data processing method and device
WO2021237513A1 (en) Data compression storage system and method, processor, and computer storage medium
CN116431585A (en) File compression method and device, and file decompression method and device
CN105491544A (en) Short message compression communication method and short message compression communication system
CN112003624A (en) Lossless compression and online decompression method and device for radio monitoring data
WO2021237518A1 (en) Data storage method and apparatus, processor and computer storage medium
CN117093510B (en) Cache high-efficiency indexing method for general purpose of size end
WO2023130801A1 (en) Function-based data sending method and apparatus, device, and data receiving method

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240206

Address after: 401120 No.107 dataguzhong Road, Xiantao street, Yubei District, Chongqing

Applicant after: CHONGQING YOUMI INDUSTRIAL AUTOMATION EQUIPMENT Co.,Ltd.

Country or region after: China

Address before: 400000 No. 107, datagu Middle Road, Xiantao street, Yubei District, Chongqing

Applicant before: Yaomi (Chongqing) Intelligent Technology Co.,Ltd.

Country or region before: China

GR01 Patent grant
GR01 Patent grant