CN110719573B - Information transmission method and device, terminal equipment and storage medium - Google Patents

Information transmission method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN110719573B
CN110719573B CN201910960707.XA CN201910960707A CN110719573B CN 110719573 B CN110719573 B CN 110719573B CN 201910960707 A CN201910960707 A CN 201910960707A CN 110719573 B CN110719573 B CN 110719573B
Authority
CN
China
Prior art keywords
information
message
ble broadcast
transmitted
ble
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.)
Active
Application number
CN201910960707.XA
Other languages
Chinese (zh)
Other versions
CN110719573A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910960707.XA priority Critical patent/CN110719573B/en
Publication of CN110719573A publication Critical patent/CN110719573A/en
Application granted granted Critical
Publication of CN110719573B publication Critical patent/CN110719573B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/18Information format or content conversion, e.g. adaptation by the network of the transmitted or received information for the purpose of wireless delivery to users or terminals
    • 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

Abstract

The invention discloses an information transmission method, an information transmission device, terminal equipment and a storage medium, wherein the method comprises the following steps: after the transmitting end acquires the information to be transmitted, the information to be transmitted is encoded into a BLE broadcast message in a preset format; and the sending end broadcasts the BLE broadcast message outwards, so that the receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcast message. According to the embodiment of the invention, the BLE broadcast is applied to near field message transmission, and particularly the BLE broadcast is applied to a character transmission scene with small data volume, so that the message transmission does not depend on network connection any more, the real-time performance and flexibility of the message transmission scene are improved, the dependence on the environment is reduced, and the timely and effective transmission of the near field message is realized.

Description

Information transmission method and device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of production control technologies, and in particular, to an information transmission method and apparatus, a terminal device, and a storage medium.
Background
At present, there are two main schemes for transmitting text between devices: one scheme is to transmit characters through short messages; another solution is to transmit text over a network. For the first scheme, the mobile phone number of the message receiver needs to be known, the real-time performance is poor, and the cost is high; with the second solution, both the transmitting party and the receiving party are required to establish a stable network connection with the server, so the flexibility is poor. Moreover, both of the above two schemes lack perception of the user location, and in many scenarios, the near field message needs to be pushed in time, which cannot be satisfied by the above two schemes.
Disclosure of Invention
The invention mainly aims to provide an information transmission method, an information transmission device, terminal equipment and a storage medium, and aims to realize timely and effective transmission of near-field messages and improve the flexibility of message pushing.
In order to achieve the above object, the present invention provides an information transmission method, including:
after obtaining information to be transmitted, a transmitting end encodes the information to be transmitted into a BLE broadcast message in a preset format, wherein the BLE broadcast message at least comprises: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted;
and the sending end broadcasts the BLE broadcast message outwards, so that a receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcast message.
Optionally, the identification code is a random identification code, and the step of encoding, by the sending end, the information to be transmitted into a BLE broadcast message in a preset format after the sending end obtains the information to be transmitted includes:
the sending end generates a random identification code after obtaining the information to be transmitted, and the random identification code is used for identifying the information to be transmitted;
converting the information to be transmitted into a code sequence with a preset coding format;
dividing the information to be transmitted converted into the code sequence to obtain a message byte sequence after the information to be transmitted is divided;
configuring a sequence bit for each message byte sequence;
filling the random identification code, the sequence bits and the corresponding message byte sequences into a BLE broadcast data structure to obtain a group of BLE broadcast messages, wherein each message byte sequence and sequence bit corresponds to one BLE broadcast message, and the sequence bits include: the total number of BLE broadcast messages of the BLE broadcast group corresponding to the information to be transmitted and the serial number of the current BLE broadcast message in the BLE broadcast group.
Optionally, the BLE broadcast message is a BLE Beacon broadcast message, and the BLE broadcast data structure further includes: basic attribute information padding bits, the basic attribute information including: beacon type, length, tool id, fixed head.
Optionally, one BLE Beacon broadcast message has 31 bytes, wherein the basic attribute information occupies the first 6 bytes, and the remaining 25 bytes configure the random identifier, the sequence bits, and the corresponding message byte sequence in sequence.
Optionally, the sequence bits are one byte, where the first 4 bits are the total number of BLE broadcast messages in a BLE broadcast group corresponding to the information to be transmitted, and the last 4 bits are sequence numbers of the current BLE broadcast message in the BLE broadcast group to which the current BLE broadcast message belongs.
In addition, an embodiment of the present invention further provides an information transmission method, including:
after receiving a BLE broadcast message, a receiving end obtains an identification code from the BLE broadcast message;
and the receiving end decodes the BLE broadcast message based on the identification code to obtain the message content of the external broadcast of the transmitting end.
Optionally, the identification code is a random identification code, and the step of the receiving end decoding the BLE broadcast message based on the identification code to obtain the message content broadcasted by the transmitting end to the outside includes:
the receiving end obtains a group of associated BLE broadcast messages according to the random identification code;
analyzing each BLE broadcast message in the group of BLE broadcast messages to obtain a sequence bit and a corresponding message byte sequence in each BLE broadcast message;
sequencing the message byte sequence in each BLE broadcast message according to the sequence bit in each BLE broadcast message;
splicing the message byte sequences in the sequenced BLE broadcast messages according to the sequence to obtain spliced message byte sequences;
and decoding the spliced message byte sequence according to a preset decoding format, and restoring to obtain the message content broadcasted by the sending end.
In addition, an embodiment of the present invention further provides an information transmission apparatus, where the information transmission apparatus includes:
the encoding module is configured to encode the information to be transmitted into a BLE broadcast message in a preset format after the information to be transmitted is acquired, where the BLE broadcast message at least includes: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted;
the broadcasting module is used for broadcasting the BLE broadcasting message outwards so that a receiving end can decode the BLE broadcasting message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcasting message;
alternatively, the information transmission apparatus includes:
the receiving module is used for obtaining an identification code from a BLE broadcast message after the BLE broadcast message is received;
and the decoding module is used for decoding the BLE broadcast message based on the identification code to obtain the message content of the external broadcast of the sending end.
In addition, an embodiment of the present invention further provides a terminal device, where the terminal device includes a memory, a processor, and an information transmission program that is stored in the memory and is executable on the processor, and the information transmission program implements the steps of the information transmission method described above when executed by the processor.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where an information transmission program is stored, and when the information transmission program is executed by a processor, the information transmission program implements the steps of the information transmission method described above.
According to the information transmission method, the information transmission device, the terminal device and the storage medium provided by the embodiment of the invention, after the sending end obtains the information to be transmitted, the information to be transmitted is coded into a BLE broadcast message with a preset format, wherein the BLE broadcast message at least comprises the following components: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted; and the sending end broadcasts the BLE broadcast message outwards, so that a receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcast message. According to the embodiment of the invention, the BLE broadcast is applied to near field message transmission, and particularly the BLE broadcast is applied to a character transmission scene with small data volume, so that the message transmission does not depend on network connection any more, the real-time performance and flexibility of the message transmission scene are improved, the dependence on the environment is reduced, and the timely and effective transmission of the near field message is realized. The scheme can be widely applied to environments with dense people flow and poor network conditions, such as shopping malls and stores, and provides real-time and on-site customized message pushing (for example, a user enters a shopping mall and can receive real-time discount information of the shopping mall).
Drawings
Fig. 1 is a functional block diagram of a terminal to which an information transmission apparatus of the present invention belongs;
FIG. 2 is a flowchart illustrating an exemplary embodiment of an information transmission method according to the present invention;
figure 3 is a diagram illustrating a BLE Beacon broadcast message format in an embodiment of the present invention;
fig. 4 is a schematic interface diagram of the sending end sending BLE broadcast message in this embodiment;
figure 5 is a schematic interface diagram of the receiving end receiving BLE broadcast message in this embodiment;
fig. 6 is a flowchart illustrating an information transmission method according to another exemplary embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: after obtaining information to be transmitted, a transmitting end encodes the information to be transmitted into a BLE broadcast message in a preset format, wherein the BLE broadcast message at least comprises: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted; and the sending end broadcasts the BLE broadcast message outwards, so that a receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcast message. According to the embodiment of the invention, the BLE broadcast is applied to near field message transmission, and particularly the BLE broadcast is applied to a character transmission scene with small data volume, so that the message transmission does not depend on network connection any more, the real-time performance and flexibility of the message transmission scene are improved, the dependence on the environment is reduced, and the timely and effective transmission of the near field message is realized. The scheme can be widely applied to environments with dense people flow and poor network conditions, such as shopping malls and stores, and provides real-time and on-site customized message pushing (for example, a user enters a shopping mall and can receive real-time discount information of the shopping mall).
The technical terms related to the embodiment of the invention comprise:
BLE (Bluetooth Low Energy), is a personal area network technology designed and sold by the Bluetooth alliance. Compare traditional classic bluetooth, the advantage of bluetooth low energy lies in: maximized standby time, fast connection, and low peak transmit/receive power consumption, thereby allowing bluetooth low energy to significantly reduce power consumption and cost while maintaining equivalent communication range.
Specifically, the bluetooth module type of the mobile terminal may include: classic Bluetooth (BT) and Bluetooth Low Energy (BLE), wherein:
classic Bluetooth (BT): the module supporting the bluetooth protocol below 4.0 is generally used for transmission with a relatively large data volume, such as: higher data volume transmissions such as voice, music, etc.
Bluetooth Low Energy (BLE): the Bluetooth module is a module supporting the Bluetooth protocol of 4.0 or higher, is also called a BLE module, has the biggest characteristic of reducing the cost and the power consumption, and is applied to products with higher real-time requirements.
The scheme of the embodiment of the invention mainly utilizes the low-power-consumption Bluetooth broadcast to realize the pushing of the near-field text message so as to improve the flexibility and timeliness of message transmission.
BLE Beacon (Bluetooth low energy Beacon) is a broadcast protocol based on Bluetooth low energy protocol.
In consideration of the fact that in the related art, text transmission is performed between devices, there are two main schemes: one scheme is to transmit characters through short messages; another solution is to transmit text over a network. For the first scheme, the mobile phone number of the message receiver needs to be known, the real-time performance is poor, and the cost is high; with the second solution, both the transmitting party and the receiving party are required to establish a stable network connection with the server, so the flexibility is poor. Moreover, both of the above two schemes lack perception of the user location, and in many scenarios, the near field message needs to be pushed in time, which cannot be satisfied by the above two schemes.
Therefore, the embodiment of the invention provides a solution, which can realize the timely and effective transmission of the near field message and improve the flexibility of message pushing.
Specifically, referring to fig. 1, fig. 1 is a functional module diagram of a terminal to which the information transmission device of the present invention belongs. The terminal can be a mobile terminal with a Bluetooth communication function, such as a mobile phone, a tablet personal computer and the like, and can realize the broadcast of messages or the reception of broadcast messages, and the information transmission device can be borne on the terminal in a hardware or software mode. Therefore, the terminal can be a bluetooth message broadcasting end and can also be a bluetooth message receiving end.
In this embodiment, the terminal to which the information transmission apparatus belongs at least includes an output module 110, a first processor 120, a first memory 130 and a first communication module 140.
The first memory 130 stores a first operating system and an information transmission program, wherein for a sender of a broadcast message, information to be transmitted (i.e., information to be broadcast) acquired by the sender and a BLE broadcast message encoded by the information to be broadcast in a preset format may be stored in the first memory 130. For a receiver receiving the broadcast message, the BLE broadcast message received by the receiver may be stored in the first memory 130.
The output module 110 may be a display screen, a speaker, etc., and the display screen is used for displaying terminal-related information. The first communication module 140 may include a WIFI module, a mobile communication module, a bluetooth module, and the like, and communicates with an external terminal device or a server through the first communication module 140.
As an embodiment, wherein the information transfer program in the first memory 130 is executed by the processor, the following steps are implemented:
after obtaining information to be transmitted, a transmitting end encodes the information to be transmitted into a BLE broadcast message in a preset format, wherein the BLE broadcast message at least comprises: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted;
and the sending end broadcasts the BLE broadcast message outwards, so that a receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcast message.
Further, the information transfer program in the first memory 130 when executed by the processor further implements the steps of:
the sending end generates a random identification code after obtaining the information to be transmitted, and the random identification code is used for identifying the information to be transmitted;
converting the information to be transmitted into a code sequence with a preset coding format;
dividing the information to be transmitted converted into the code sequence to obtain a message byte sequence after the information to be transmitted is divided;
configuring a sequence bit for each message byte sequence;
filling the random identification code, the sequence bits and the corresponding message byte sequences into a BLE broadcast data structure to obtain a group of BLE broadcast messages, wherein each message byte sequence and sequence bit corresponds to one BLE broadcast message, and the sequence bits include: the total number of BLE broadcast messages of the BLE broadcast group corresponding to the information to be transmitted and the serial number of the current BLE broadcast message in the BLE broadcast group.
As an embodiment, wherein the information transfer program in the first memory 130 is executed by the processor, the following steps are implemented:
after receiving a BLE broadcast message, a receiving end obtains an identification code from the BLE broadcast message;
and the receiving end decodes the BLE broadcast message based on the identification code to obtain the message content of the external broadcast of the transmitting end.
Further, the information transfer program in the first memory 130 when executed by the processor further implements the steps of:
the receiving end obtains a group of associated BLE broadcast messages according to the random identification code;
analyzing each BLE broadcast message in the group of BLE broadcast messages to obtain a sequence bit and a corresponding message byte sequence in each BLE broadcast message;
sequencing the message byte sequence in each BLE broadcast message according to the sequence bit in each BLE broadcast message;
splicing the message byte sequences in the sequenced BLE broadcast messages according to the sequence to obtain spliced message byte sequences;
and decoding the spliced message byte sequence according to a preset decoding format, and restoring to obtain the message content broadcasted by the sending end.
According to the scheme, after the sending end acquires the information to be transmitted, the information to be transmitted is encoded into the BLE broadcast message in the preset format, and the BLE broadcast message at least comprises: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted; and the sending end broadcasts the BLE broadcast message outwards, so that a receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcast message. According to the embodiment of the invention, the BLE broadcast is applied to near field message transmission, and particularly the BLE broadcast is applied to a character transmission scene with small data volume, so that the message transmission does not depend on network connection any more, the real-time performance and flexibility of the message transmission scene are improved, the dependence on the environment is reduced, and the timely and effective transmission of the near field message is realized. The scheme can be widely applied to environments with dense people flow and poor network conditions, such as shopping malls and stores, and provides real-time and on-site customized message pushing (for example, a user enters a shopping mall and can receive real-time discount information of the shopping mall).
Based on the above terminal architecture but not limited to the above terminal architecture, embodiments of the method of the present invention are provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating an exemplary embodiment of an information transmission method according to the present invention. This embodiment is applied to a transmitting end that transmits a BLE broadcast message. In this embodiment, the information transmission method includes:
step S101, after acquiring information to be transmitted, a transmitting end encodes the information to be transmitted into a BLE broadcast message with a preset format, wherein the BLE broadcast message at least comprises: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted;
in the scheme of this embodiment, BLE broadcasting is mainly used to implement timely and effective push of a near field message, an execution subject of the method may be a mobile terminal or an independent BLE broadcasting transmitting device, or may be an information transmission device borne on the mobile terminal, which is exemplified by the mobile terminal in this embodiment. In this embodiment, the mobile terminal may be a mobile electronic device such as a mobile phone and a tablet computer.
In this embodiment, the mobile terminal has a bluetooth function, and the mobile terminal can perform bluetooth broadcast through the bluetooth function, and bluetooth broadcast information can be received by an external terminal.
Therefore, the Bluetooth broadcasting characteristic of the mobile terminal can be utilized to realize timely and effective transmission of the near field information.
The bluetooth function of the mobile terminal may be conventional standard Bluetooth (BT) technology, or may be BLE bluetooth, that is, bluetooth low energy; the present embodiment is exemplified by BLE bluetooth.
The method for the sending end to obtain the information to be transmitted may be that an operator on the sending end side copies the information to the sending end, or the information may be sent to the sending end through an external device, which is not limited in this embodiment.
After the transmitting end obtains the information to be transmitted, the information to be transmitted is coded into the BLE broadcast message in the preset format according to the data structure characteristics of the BLE broadcast message.
Wherein the BLE broadcast message may include: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted;
the content of the information to be transmitted may be set by the sending end, for example, the content may be corresponding scene information, for example: corresponding to introduction information of scenic spots or exhibits, public area position information, visiting route push information and the like.
The identification code for identifying the information to be transmitted is set in this embodiment in consideration of: the content of the information to be transmitted may be many, and one BLE broadcast message cannot bear the text information to be broadcast at one time, but a plurality of BLE broadcast messages are needed to complete the broadcast of the complete scene information at one time.
In addition, when information is sent, the information to be transmitted is divided into a plurality of different parts, and the different parts are filled in a plurality of BLE broadcast messages to be sent outwards respectively, wherein the plurality of BLE broadcast messages all carry the identification code, so that after the receiving end receives the BLE broadcast messages, the whole piece of original scene broadcast information is restored through the identification code.
In particular, the identification code may be a random identification code. Taking a random identification code as an example, after the sending end obtains the information to be transmitted, a specific implementation scheme for encoding the information to be transmitted into a BLE broadcast message in a preset format is as follows:
firstly, after acquiring information to be transmitted, the sending end generates a random identification code for identifying the information to be transmitted;
then, converting the information to be transmitted into a code sequence with a preset coding format;
then, dividing the information to be transmitted converted into the code sequence to obtain a message byte sequence after the information to be transmitted is divided;
then, configuring a sequence bit for each message byte sequence; filling the random identification code, the sequence bits and the corresponding message byte sequences into a BLE broadcast data structure to obtain a group of BLE broadcast messages, wherein each message byte sequence and sequence bit corresponds to one BLE broadcast message, and the sequence bits include: the total number of BLE broadcast messages of the BLE broadcast group corresponding to the information to be transmitted and the serial number of the current BLE broadcast message in the BLE broadcast group.
Taking BLE broadcast message as BLE Beacon broadcast message as an example, the BLE broadcast data structure further includes: basic attribute information padding bits, the basic attribute information including: beacon type, tool id, length, fixed head, etc.
Specifically, as shown in fig. 3, one BLE Beacon broadcast message has 31 bytes, wherein the basic attribute information occupies the first 6 bytes, and the remaining 25 bytes are sequentially configured with a random identifier, a sequence bit, and a corresponding message byte sequence.
That is, of 31 bytes of a bluetooth Beacon, 6 bytes (including Beacon type, length, tool id, fixed header, etc.) are removed from the prefix, and the remaining 25 bytes are used to carry text information to be transmitted (including the id (i.e., random id) of the message, the total number of beacons in the Beacon group into which the message is divided, the sequence number of the Beacon group to which the current Beacon belongs, and the byte sequence into which the text message is divided).
As shown in fig. 3, the random identification code occupies 5 bytes, and is dynamically and randomly generated by the sending end, and is used for identifying different text messages;
the sequence bits are 1 byte, wherein the first 4 bits are the total number of BLE broadcast messages of a BLE broadcast group corresponding to the information to be transmitted, and the last 4 bits are the sequence numbers of the current BLE broadcast messages in the BLE broadcast group to which the current BLE broadcast messages belong.
For example:
the order bit is 0x31, indicating that there are 3 pieces of Beacon in the set of Beacon, wherein this piece is currently the 1 st piece of the 3 pieces; the order bit is 0x55, indicating that there are 5 beacons in the set, where this is currently the 5 th of the 5.
A 19 byte pad message byte sequence is reserved.
Therefore, corresponding data are filled through the Bluetooth Beacon data structure, and a complete Bluetooth Beacon broadcast message is formed.
Fig. 4 shows an interface of the transmitting end for transmitting a BLE broadcast message, where fig. 4 is a schematic interface diagram of the transmitting end for transmitting a BLE broadcast message in this embodiment.
To send a piece of content as "hello! Welcome to Shanghai! Hello, Welcome to Shanghai! "is an example.
On the transmitting side: a random identification code of 5 bytes length is generated for identifying the piece of text information.
The transmitting end converts the information into UTF-8 encoding, resulting in a total of 58 bytes. Since each Beacon carries a position of 19 bytes for the byte sequence of the message, the message needs to be divided into 4 beacons to be sent.
The transmitting end simultaneously transmits 4 Beacon, the first 11 bytes of the Beacon have the same content, the 12 th bytes (sequence bits) are respectively 0x41, 0x42, 0x43 and 0x44, and then the message byte sequence is respectively filled with 19 bytes, 19 bytes and 1 byte in sequence.
Step S102, the sending end broadcasts the BLE broadcast message outwards, so that after the receiving end receives the BLE broadcast message, the receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted.
And after the transmitting end completes the coding of the BLE broadcast message, the BLE broadcast message is broadcasted to the outside.
And at the receiving end, after the receiving end receives the BLE broadcast message, the receiving end distinguishes different message groups according to the identification codes. And when detecting that all the pieces of a group of Beacons are received and cached, sequencing the pieces of Beacons according to the sequence bits of the Beacons. Then, splicing the sequenced message byte sequences of each Beacon in sequence, and then decoding according to UTF-8, thus restoring the corresponding message content.
An interface for the receiving end to receive the BLE broadcast message may be shown in fig. 5, where fig. 5 is a schematic diagram of an interface for the receiving end to receive the BLE broadcast message in this embodiment.
Specifically, taking an identification code as a random identification code as an example, a specific implementation scheme for the receiving end to obtain the message content of the sending end external broadcast by decoding the BLE broadcast message based on the identification code may be as follows:
firstly, the receiving end obtains a group of associated BLE broadcast messages according to the random identification code;
then, analyzing each BLE broadcast message in the group of BLE broadcast messages to obtain a sequence bit and a corresponding message byte sequence in each BLE broadcast message;
then, sequencing the message byte sequence in each BLE broadcast message according to the sequence bit in each BLE broadcast message;
then, splicing the message byte sequences in the sequenced BLE broadcast messages according to the sequence to obtain a spliced message byte sequence;
and finally, decoding the spliced message byte sequence according to a preset decoding format, and restoring to obtain the message content broadcasted by the sending end.
According to the scheme, after the sending end acquires the information to be transmitted, the information to be transmitted is encoded into the BLE broadcast message in the preset format, and the BLE broadcast message at least comprises: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted; and the sending end broadcasts the BLE broadcast message outwards, so that a receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcast message. According to the embodiment of the invention, the BLE broadcast is applied to near field message transmission, and particularly the BLE broadcast is applied to a character transmission scene with small data volume, so that the message transmission does not depend on network connection any more, the real-time performance and flexibility of the message transmission scene are improved, the dependence on the environment is reduced, and the timely and effective transmission of the near field message is realized. The scheme can be widely applied to environments with dense people flow and poor network conditions, such as shopping malls and stores, and provides real-time and on-site customized message pushing (for example, a user enters a shopping mall and can receive real-time discount information of the shopping mall).
Referring to fig. 6, fig. 6 is a flowchart illustrating an information transmission method according to another exemplary embodiment of the present invention. This embodiment is applied to a receiving end that transmits a BLE broadcast message. In this embodiment, the information transmission method includes:
step S201, after receiving a BLE broadcast message, a receiving end obtains an identification code from the BLE broadcast message;
specifically, on the receiving end side, after the user starts the bluetooth Beacon scanning of the terminal, when the user enters a signal transmission range of a certain bluetooth Beacon transmitting device (transmitting end), a BLE broadcast message broadcasted by the bluetooth Beacon transmitting device under the current scene can be received.
Wherein the BLE broadcast message comprises: the method includes that a sending end broadcasts content of information and an identification code for identifying the broadcast information, and further, according to a data structure of a BLE broadcast message, the BLE broadcast message may further include: beacon type, implement id, length, fixed head, sequence position, etc.
And after receiving the BLE broadcast message, the receiving end acquires the identification code from the BLE broadcast message. The identification code may be a random identification code randomly generated by the sending end.
Step S202, the receiving end decodes the BLE broadcast message based on the identification code to obtain the message content of the sending end broadcasting outwards.
Specifically, after receiving the BLE broadcast message, the receiving end obtains an identification code from the BLE broadcast message, and decodes the BLE broadcast message based on the identification code to obtain the message content of the external broadcast of the transmitting end.
For the bluetooth Beacon broadcast data structure, as shown in fig. 3, one BLE Beacon broadcast message has 31 bytes, wherein the basic attribute information (including Beacon type, tool id, length, fixed header, etc.) occupies the first 6 bytes, and the remaining 25 bytes sequentially configure the random identifier (i.e., the information identifier), the sequence bits, and the corresponding message byte sequence of the BLE Beacon broadcast message.
That is, in 31 bytes of one bluetooth Beacon,
the 6 bytes (including Beacon type, length, machine id, fixed header, etc.) of the prefix are removed, and the remaining 25 bytes are used for carrying text information to be transmitted (including the identification code (i.e. random identification code) of the message, the total number of Beacon groups into which the message is divided, the serial number of the Beacon group to which the current Beacon belongs, and the byte sequence after the text message is divided).
As shown in fig. 3, the random identification code occupies 5 bytes, and is dynamically and randomly generated by the sending end, and is used for identifying different text messages;
the sequence bits are 1 byte, wherein the first 4 bits are the total number of BLE broadcast messages of a BLE broadcast group corresponding to the information to be transmitted, and the last 4 bits are the sequence numbers of the current BLE broadcast messages in the BLE broadcast group to which the current BLE broadcast messages belong.
A 19 byte pad message byte sequence is reserved.
Therefore, corresponding data are filled through the Bluetooth Beacon data structure, and a complete Bluetooth Beacon broadcast message is formed.
For example:
the order bit is 0x31, indicating that there are 3 pieces of Beacon in the set of Beacon, wherein this piece is currently the 1 st piece of the 3 pieces; the order bit is 0x55, indicating that there are 5 beacons in the set, where this is currently the 5 th of the 5.
To send a piece of content as "hello! Welcome to Shanghai! Hello, Welcome to Shanghai! "is an example.
On the transmitting side: a random identification code of 5 bytes length is generated for identifying the piece of text information.
The transmitting end converts the information into UTF-8 encoding, resulting in a total of 58 bytes. Since each Beacon carries a position of 19 bytes for the byte sequence of the message, the message needs to be divided into 4 beacons to be sent.
The transmitting end simultaneously transmits 4 Beacon, the first 11 bytes of the Beacon have the same content, the 12 th bytes (sequence bits) are respectively 0x41, 0x42, 0x43 and 0x44, and then the message byte sequence is respectively filled with 19 bytes, 19 bytes and 1 byte in sequence.
And at the receiving end, after the receiving end receives the BLE broadcast message, the receiving end distinguishes different message groups according to the identification codes. And when detecting that all the pieces of a group of Beacons are received and cached, sequencing the pieces of Beacons according to the sequence bits of the Beacons. Then, splicing the sequenced message byte sequences of each Beacon in sequence, and then decoding according to UTF-8, thus restoring the corresponding message content.
Specifically, taking an identification code as a random identification code as an example, a specific implementation scheme for the receiving end to obtain the message content of the sending end external broadcast by decoding the BLE broadcast message based on the identification code may be as follows:
firstly, the receiving end obtains a group of associated BLE broadcast messages according to the random identification code;
then, analyzing each BLE broadcast message in the group of BLE broadcast messages to obtain a sequence bit and a corresponding message byte sequence in each BLE broadcast message;
then, sequencing the message byte sequence in each BLE broadcast message according to the sequence bit in each BLE broadcast message;
then, splicing the message byte sequences in the sequenced BLE broadcast messages according to the sequence to obtain a spliced message byte sequence;
and finally, decoding the spliced message byte sequence according to a preset decoding format, and restoring to obtain the message content broadcasted by the sending end.
According to the scheme, after receiving the BLE broadcast message, the receiving end obtains the identification code from the BLE broadcast message; and the receiving end decodes the BLE broadcast message based on the identification code to obtain the message content of the external broadcast of the transmitting end. According to the embodiment of the invention, the BLE broadcast is applied to near field message transmission, and particularly the BLE broadcast is applied to a character transmission scene with small data volume, so that the message transmission does not depend on network connection any more, the real-time performance and flexibility of the message transmission scene are improved, the dependence on the environment is reduced, and the timely and effective transmission of the near field message is realized. The scheme can be widely applied to environments with dense people flow and poor network conditions, such as shopping malls and stores, and provides real-time and on-site customized message pushing (for example, a user enters a shopping mall and can receive real-time discount information of the shopping mall).
In addition, an embodiment of the present invention further provides an information transmission apparatus, where the information transmission apparatus includes:
the encoding module is configured to encode the information to be transmitted into a BLE broadcast message in a preset format after the information to be transmitted is acquired, where the BLE broadcast message at least includes: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted;
the broadcasting module is used for broadcasting the BLE broadcasting message outwards so that a receiving end can decode the BLE broadcasting message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcasting message;
alternatively, the information transmission apparatus includes:
the receiving module is used for obtaining an identification code from a BLE broadcast message after the BLE broadcast message is received;
and the decoding module is used for decoding the BLE broadcast message based on the identification code to obtain the message content of the external broadcast of the sending end.
The information transmission device of the embodiment can be carried on the terminal in a form of hardware or software. The terminal can be a Bluetooth message broadcasting terminal and/or a Bluetooth message receiving terminal. For the functions and the implementation principle of the information transmission device of this embodiment, please refer to the above embodiments, which are not described herein again.
In addition, an embodiment of the present invention further provides a terminal device, where the terminal device includes a memory, a processor, and an information transmission program that is stored in the memory and is executable on the processor, and when the information transmission program is executed by the processor, the steps of the information transmission method according to the embodiment shown in fig. 2 are implemented.
Since the information transmission program is executed by the processor, all technical solutions of all the foregoing embodiments are adopted, so that at least all the beneficial effects brought by all the technical solutions of all the foregoing embodiments are achieved, and details are not repeated herein.
In addition, an embodiment of the present invention further provides a terminal device, where the terminal device includes a memory, a processor, and an information transmission program that is stored in the memory and is executable on the processor, and when the information transmission program is executed by the processor, the steps of the information transmission method according to the embodiment shown in fig. 6 are implemented.
Since the information transmission program is executed by the processor, all technical solutions of all the foregoing embodiments are adopted, so that at least all the beneficial effects brought by all the technical solutions of all the foregoing embodiments are achieved, and details are not repeated herein.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where an information transmission program is stored, and when the information transmission program is executed by a processor, the steps of the information transmission method according to the above embodiment are implemented.
Since the information transmission program is executed by the processor, all technical solutions of all the foregoing embodiments are adopted, so that at least all the beneficial effects brought by all the technical solutions of all the foregoing embodiments are achieved, and details are not repeated herein.
Compared with the prior art, according to the information transmission method, the information transmission device, the terminal device and the storage medium provided by the embodiment of the invention, after the sending end obtains the information to be transmitted, the information to be transmitted is encoded into a BLE broadcast message with a preset format, wherein the BLE broadcast message at least comprises: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted; and the sending end broadcasts the BLE broadcast message outwards, so that a receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcast message. According to the embodiment of the invention, the BLE broadcast is applied to near field message transmission, and particularly the BLE broadcast is applied to a character transmission scene with small data volume, so that the message transmission does not depend on network connection any more, the real-time performance and flexibility of the message transmission scene are improved, the dependence on the environment is reduced, and the timely and effective transmission of the near field message is realized. The scheme can be widely applied to environments with dense people flow and poor network conditions, such as shopping malls and stores, and provides real-time and on-site customized message pushing (for example, a user enters a shopping mall and can receive real-time discount information of the shopping mall).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, a controlled terminal, or a network device) to execute the method of each embodiment of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. An information transmission method, comprising:
after obtaining information to be transmitted, a transmitting end encodes the information to be transmitted into a BLE broadcast message in a preset format, wherein the BLE broadcast message at least comprises: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted; information to be transmitted in the BLE broadcast message is divided into a plurality of message byte sequences;
the sending end broadcasts the BLE broadcast message outwards, so that after the receiving end receives the BLE broadcast message, the receiving end decodes the BLE broadcast message based on the identification code to obtain the content of the information to be transmitted;
the identification code is a random identification code, and the step of encoding the information to be transmitted into a BLE broadcast message with a preset format after the transmitting end acquires the information to be transmitted comprises the following steps:
the sending end generates a random identification code after obtaining the information to be transmitted, and the random identification code is used for identifying the information to be transmitted;
converting the information to be transmitted into a code sequence with a preset coding format; wherein the preset encoding format is a UTF-8 encoding format;
dividing the information to be transmitted converted into the code sequence to obtain a message byte sequence after the information to be transmitted is divided;
configuring a sequence bit for each message byte sequence;
filling the random identification code, the sequence bits and the corresponding message byte sequences into a BLE broadcast data structure to obtain a group of BLE broadcast messages, wherein each message byte sequence and sequence bit corresponds to one BLE broadcast message, and the sequence bits include: the total number of BLE broadcast messages of a BLE broadcast group corresponding to the information to be transmitted and the serial number of the current BLE broadcast message in the BLE broadcast group; the BLE broadcast message is a BLE Beacon broadcast message, and the BLE broadcast data structure further comprises: basic attribute information padding bits, the basic attribute information including: beacon type, length, tool id, fixed head.
2. The information transmission method according to claim 1, wherein one BLE Beacon broadcast message has 31 bytes, wherein the basic attribute information occupies the first 6 bytes, and the remaining 25 bytes configure the random identity, sequence bits and corresponding message byte sequence in turn.
3. The information transmission method according to claim 2, wherein the sequential bits are one byte, where the first 4 bits are a total number of BLE broadcast messages in a BLE broadcast group corresponding to the information to be transmitted, and the last 4 bits are a sequence number of a current BLE broadcast message in the BLE broadcast group to which the current BLE broadcast message belongs.
4. An information transmission method, comprising:
after receiving a BLE broadcast message, a receiving end obtains an identification code from the BLE broadcast message, wherein information to be transmitted in the BLE broadcast message is divided into a plurality of message byte sequences;
the receiving end decodes the BLE broadcast message based on the identification code to obtain the message content of the sending end broadcasting outwards; the BLE broadcast message is broadcast by a sending end after the sending end acquires the information to be transmitted and codes the information into the BLE broadcast message with a preset format; the BLE broadcast message includes at least: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted; information to be transmitted in the BLE broadcast message is divided into a plurality of message byte sequences; the identification code is a random identification code, and the step of encoding the information to be transmitted into a BLE broadcast message with a preset format after the transmitting end acquires the information to be transmitted comprises the following steps: the sending end generates a random identification code after obtaining the information to be transmitted, and the random identification code is used for identifying the information to be transmitted; converting the information to be transmitted into a code sequence with a preset coding format; wherein the preset encoding format is a UTF-8 encoding format; dividing the information to be transmitted converted into the code sequence to obtain a message byte sequence after the information to be transmitted is divided; configuring a sequence bit for each message byte sequence; filling the random identification code, the sequence bits and the corresponding message byte sequences into a BLE broadcast data structure to obtain a group of BLE broadcast messages, wherein each message byte sequence and sequence bit corresponds to one BLE broadcast message, and the sequence bits include: the total number of BLE broadcast messages of a BLE broadcast group corresponding to the information to be transmitted and the serial number of the current BLE broadcast message in the BLE broadcast group; the BLE broadcast message is a BLE Beacon broadcast message, and the BLE broadcast data structure further comprises: basic attribute information padding bits, the basic attribute information including: beacon type, length, tool id, fixed head.
5. The information transmission method according to claim 4, wherein the identification code is a random identification code, and the step of the receiving end decoding the BLE broadcast message based on the identification code to obtain the message content broadcasted outside by the transmitting end comprises:
the receiving end obtains a group of associated BLE broadcast messages according to the random identification code;
analyzing each BLE broadcast message in the group of BLE broadcast messages to obtain a sequence bit and a corresponding message byte sequence in each BLE broadcast message;
sequencing the message byte sequence in each BLE broadcast message according to the sequence bit in each BLE broadcast message;
splicing the message byte sequences in the sequenced BLE broadcast messages according to the sequence to obtain spliced message byte sequences;
and decoding the spliced message byte sequence according to a preset decoding format, and restoring to obtain the message content broadcasted by the sending end.
6. An information transmission apparatus, characterized in that the information transmission apparatus comprises:
the encoding module is configured to encode the information to be transmitted into a BLE broadcast message in a preset format after the information to be transmitted is acquired, where the BLE broadcast message at least includes: the content of the information to be transmitted and an identification code used for identifying the information to be transmitted; the encoding module is further configured to generate a random identification code for identifying the information to be transmitted after the transmitting end acquires the information to be transmitted; converting the information to be transmitted into a code sequence with a preset coding format; wherein the preset encoding format is a UTF-8 encoding format; dividing the information to be transmitted converted into the code sequence to obtain a message byte sequence after the information to be transmitted is divided; configuring a sequence bit for each message byte sequence; filling the random identification code, the sequence bits and the corresponding message byte sequences into a BLE broadcast data structure to obtain a group of BLE broadcast messages, wherein each message byte sequence and sequence bit corresponds to one BLE broadcast message, and the sequence bits include: the total number of BLE broadcast messages of a BLE broadcast group corresponding to the information to be transmitted and the serial number of the current BLE broadcast message in the BLE broadcast group; the BLE broadcast message is a BLE Beacon broadcast message, and the BLE broadcast data structure further comprises: basic attribute information padding bits, the basic attribute information including: one or more of beacon type, length, tool id and fixed head;
the broadcasting module is used for broadcasting the BLE broadcasting message outwards so that a receiving end can decode the BLE broadcasting message based on the identification code to obtain the content of the information to be transmitted after receiving the BLE broadcasting message;
alternatively, the information transmission apparatus includes:
the receiving module is used for obtaining an identification code from a BLE broadcast message after the BLE broadcast message is received;
and the decoding module is used for decoding the BLE broadcast message based on the identification code to obtain the message content of the external broadcast of the sending end.
7. A terminal device, characterized in that the terminal device comprises a memory, a processor and an information transmission program stored on the memory and executable on the processor, the information transmission program, when executed by the processor, implementing the steps of the information transmission method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that an information transmission program is stored thereon, which when executed by a processor implements the steps of the information transmission method according to any one of claims 1 to 5.
CN201910960707.XA 2019-10-09 2019-10-09 Information transmission method and device, terminal equipment and storage medium Active CN110719573B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910960707.XA CN110719573B (en) 2019-10-09 2019-10-09 Information transmission method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910960707.XA CN110719573B (en) 2019-10-09 2019-10-09 Information transmission method and device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110719573A CN110719573A (en) 2020-01-21
CN110719573B true CN110719573B (en) 2022-03-01

Family

ID=69211355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910960707.XA Active CN110719573B (en) 2019-10-09 2019-10-09 Information transmission method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110719573B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125725B (en) * 2020-08-31 2022-10-11 Oppo广东移动通信有限公司 Broadcast message sending method, broadcast message receiving method, broadcast message sending device, broadcast message receiving device, and storage medium
CN113347578B (en) * 2021-05-17 2022-06-21 广州安凯微电子股份有限公司 Audio data transmission method, device and system, storage medium and earphone

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660308A (en) * 2015-01-26 2015-05-27 武汉健坤科技有限公司 File transfer method and file transfer system based on Bluetooth low power consumption technology
CN106303982A (en) * 2016-08-23 2017-01-04 北京小米移动软件有限公司 Data broadcasting method and device
CN106686526B (en) * 2016-12-16 2020-10-30 美的智慧家居科技有限公司 Method and device for acquiring routing information of electric appliance
CN109831746B (en) * 2018-11-27 2020-09-01 阿里巴巴集团控股有限公司 Method and device for data transmission based on Bluetooth broadcast and Bluetooth equipment
CN109561395A (en) * 2018-12-07 2019-04-02 青岛海信电器股份有限公司 A kind of blue-tooth transmission method and device

Also Published As

Publication number Publication date
CN110719573A (en) 2020-01-21

Similar Documents

Publication Publication Date Title
EP1323263B1 (en) Portable device interaction with beacons
KR100442941B1 (en) Broadcast message transmission circuit and transmitting Method thereof
CN101360278A (en) Method, apparatus and system for instant message receiving and transmitting
CN1964330A (en) System and method for providing multimedia electronic mail service in a portable terminal
CN102118719B (en) Mobile intelligent information service system, adaptation converting device and method
CN110719573B (en) Information transmission method and device, terminal equipment and storage medium
CN104183250A (en) Method and system for synchronizing function of music player of intelligent device and Bluetooth headset
CN110621055A (en) Network distribution method, device, terminal, equipment, storage medium and system
JP2008219482A (en) Information distribution system in radio packet communication system, information distribution method and information distribution device
CN110769382B (en) Message pushing method and device, terminal equipment and storage medium
CN105049327A (en) Touch vibration instant messaging method and system
CN101193337A (en) MMS coding device
CN102882950A (en) Method for transmitting information between different sets of equipment based on double-tone multi-frequency technology
CN101971649A (en) Method and device for providing a service
CN101895832B (en) Method and device for configuring access point name and application message and mobile terminals
WO2013182079A1 (en) Short message transcoding method and device
CN102802197A (en) Method and device for transmitting application data
CN102264044A (en) Video short message sending method, apparatus thereof and system thereof
CN103516775A (en) Method and system for achieving fast synchronization among equipment
CN107005817B (en) Terminal device, network device and group communication method
CN101083811A (en) Method, equipment and system for realizing scene mode sharing
CN112118610B (en) Network distribution method and system for wireless intelligent equipment
KR100956793B1 (en) Method and Server for Transforming Message Format for Interworking between Different Message Standards
WO2012130002A1 (en) Multimedia message sending and receiving methods and devices
CN104468479A (en) Terminal communication method, device and system, and terminal

Legal Events

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