CN113347615B - Bluetooth communication method and device and readable storage medium - Google Patents

Bluetooth communication method and device and readable storage medium Download PDF

Info

Publication number
CN113347615B
CN113347615B CN202110560279.9A CN202110560279A CN113347615B CN 113347615 B CN113347615 B CN 113347615B CN 202110560279 A CN202110560279 A CN 202110560279A CN 113347615 B CN113347615 B CN 113347615B
Authority
CN
China
Prior art keywords
connection
type
operating system
field terminal
function information
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
CN202110560279.9A
Other languages
Chinese (zh)
Other versions
CN113347615A (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.)
Shenzhen Feasycom Technology Co ltd
Original Assignee
Shenzhen Feasycom 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 Shenzhen Feasycom Technology Co ltd filed Critical Shenzhen Feasycom Technology Co ltd
Priority to CN202110560279.9A priority Critical patent/CN113347615B/en
Publication of CN113347615A publication Critical patent/CN113347615A/en
Application granted granted Critical
Publication of CN113347615B publication Critical patent/CN113347615B/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/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • 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
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • 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 relates to a Bluetooth communication method, a Bluetooth communication device and a readable storage medium. The Bluetooth communication method comprises the following steps: s1, registering at least one type of connection channel, wherein the type of the connection channel corresponds to the type of a terminal operating system; s2, establishing Bluetooth connection with the field terminal according to a connection request sent by the field terminal; s3, generating at least one format of function information to be transmitted, wherein the format of the function information to be transmitted corresponds to the type of a terminal operating system; and S4, transmitting the function information to be transmitted in a corresponding format to the field terminal through the connection channel corresponding to the type of the field terminal operating system. In the invention, the function information to be transmitted in the format corresponding to the terminal operating system is generated, so that the function information to be transmitted received by the terminal meets the requirement of the operating system, thereby ensuring the validity of the function information to be transmitted and realizing the effective propagation of the function information to be transmitted.

Description

Bluetooth communication method and device and readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a bluetooth communication method, system, and readable storage medium.
Background
In the field of communications, bluetooth technology is widely used. In daily public places, functional devices provided with bluetooth modules are generally used to realize the propagation of corresponding data. For example, in some usage scenarios, when a user is located in a specific public place, the corresponding function information may be received by turning on a bluetooth function of a terminal (e.g., a mobile phone) and establishing a bluetooth connection with a current function device.
In practical application, the formats of the function information sent outwards by the function device are the same regardless of the operating system of the field terminal, different terminals may correspond to different operating systems, and different operating systems may have different requirements on the formats of the function information, so that the existing mode of sending the function information in the same format outwards cannot ensure effective propagation of the function information.
Disclosure of Invention
The invention aims to solve the technical problem that the validity of function information received by a terminal cannot be ensured in the prior art, and provides a Bluetooth communication method, a Bluetooth communication device and a readable storage medium.
The technical scheme adopted for solving the technical problems is as follows: a bluetooth communication method is constructed, comprising:
S1, registering at least one type of connection channel, wherein the type of the connection channel corresponds to the type of a terminal operating system;
s2, establishing Bluetooth connection with the field terminal according to a connection request sent by the field terminal;
s3, generating at least one format of function information to be transmitted, wherein the format of the function information to be transmitted corresponds to the type of a terminal operating system;
and S4, transmitting the function information to be transmitted in a corresponding format to the field terminal through the connection channel corresponding to the type of the field terminal operating system.
Preferably, the at least one type of connection channel includes an iOS connection channel corresponding to an iOS operating system and/or an Android connection channel corresponding to an Android operating system;
in step S2, an iAP2 bluetooth connection is established with the field terminal according to a connection request sent by the field terminal of the iOS operating system, and/or an SPP bluetooth connection is established with the field terminal according to a connection request sent by the field terminal of the Android operating system.
Preferably, in step S4, it includes:
s4-1, setting at least one type of control signal, wherein the type of the control signal corresponds to the format of the function information to be sent and the type of the connection channel;
S4-2, determining the type of the connecting channel of the function information to be sent according to the type of the current control signal;
s4-3, the function information to be sent is sent to the field terminal through a corresponding type of connection channel.
Preferably, after step S4-2, further comprising:
s4-2-1, judging whether the format of the function information to be sent corresponds to an iOS operating system or not; if yes, executing the step S4-2-2; if not, executing the step S4-3;
s4-2-2, analyzing the function information to be sent, and acquiring format information of the function information to be sent;
s4-2-3, judging whether the format information is consistent with preset format information or not; if yes, executing the step S4-3; if not, executing the step S4-2-4;
s4-2-4, discarding the function information to be sent.
Preferably, in step S2, it includes:
s2-1, broadcasting connection information outwards for searching connection by a field terminal;
s2-2, establishing a bottom Bluetooth connection with the field terminal according to the connection information and a connection request sent by the field terminal through the corresponding connection channel;
s2-3, determining the type of the field terminal operating system according to the connection channel through which the connection request passes;
S2-4, handshake with the field terminal through a communication protocol corresponding to the field terminal operating system type and connecting the field terminal.
Preferably, the function information to be transmitted includes location information.
The invention also constructs a Bluetooth communication device, which comprises a Bluetooth module and a functional module, wherein the Bluetooth module comprises a registration unit, a connection establishment unit and an information sending unit, and the functional module comprises a generation unit;
the registration unit is used for registering at least one type of connection channel, and the type of the connection channel corresponds to the type of the terminal operating system;
the connection establishment unit is used for establishing Bluetooth connection with the field terminal according to a connection request sent by the field terminal;
the generating unit is used for generating at least one format of function information to be sent, and the format of the function information to be sent corresponds to the type of the terminal operating system;
the information sending unit is configured to send the function information to be sent in a corresponding format to the field terminal through the connection channel corresponding to the type of the field terminal operating system.
Preferably, the at least one type of connection channel includes an iOS connection channel corresponding to an iOS operating system and/or an Android connection channel corresponding to an Android operating system;
The connection establishment unit is used for establishing iAP2 Bluetooth connection with the field terminal according to a connection request sent by the field terminal of the iOS operation system and/or establishing SPP Bluetooth connection with the field terminal according to a connection request sent by the field terminal of the Android operation system.
Preferably, the function module further comprises a setting unit, and the information sending unit comprises a second determining unit and a sub sending unit;
the setting unit is used for setting at least one type of control signal, wherein the type of the control signal corresponds to the format of the function information to be sent and the type of the connection channel;
the second determining unit is configured to determine a type of the connection channel of the function information to be sent according to a type of a current control signal;
the sub-sending unit is used for sending the function information to be sent to the field terminal through a corresponding type of connection channel.
The present invention also constructs a readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the bluetooth communication method as described in any of the above.
The Bluetooth communication method, the Bluetooth communication device and the readable storage medium have the following beneficial effects:
In the invention, the function information to be transmitted in the format corresponding to the terminal operating system is generated, so that the function information to be transmitted received by the terminal meets the requirement of the operating system, thereby ensuring the validity of the function information to be transmitted and realizing the effective propagation of the function information to be transmitted.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a flow chart of a first embodiment of the bluetooth communication method according to the present invention;
fig. 2 is a flow chart of a second embodiment of the bluetooth communication method according to the invention;
fig. 3 is a schematic structural view of a first embodiment of the bluetooth communication device according to the present invention;
fig. 4 is a schematic structural diagram of a second embodiment of the bluetooth communication device according to the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic flow chart of a first embodiment of a bluetooth communication method according to the present invention, where the bluetooth communication method of the embodiment may be applied to a functional device provided with a bluetooth module, the functional device includes a bluetooth module and a functional module, and the functional device may be a bluetooth locator. As shown in fig. 1, in the present embodiment, the bluetooth communication method includes the steps of:
s1, registering at least one type of connection channel, wherein the type of the connection channel corresponds to the type of a terminal operating system.
It can be appreciated that the bluetooth module performs self-checking and initialization after the functional device is powered on. The method specifically comprises initializing a Bluetooth controller and a Bluetooth protocol, configuring parameters, performing memory self-checking and checking parameters or a plurality of the parameters so as to ensure the normal use of the functions of the Bluetooth module. When the Bluetooth protocol is initialized, a connection channel is registered so as to ensure that the Bluetooth module is connected with the terminal and communication is smoothly carried out.
Wherein at least one type of connection channel is registered, the type of connection channel corresponding to the type of terminal operating system. For example, if a connection channel is registered and bound with a service class UUID specified by the iAP2 protocol, the connection channel is corresponding to the iOS connection channel; and if one connecting channel is registered and bound with the UUID of the universal SPP service class, the connecting channel is correspondingly an Android connecting channel. It can be appreciated that the service class UUID includes a plurality of kinds, and when the service class UUID is specified by the iAP2 protocol, the service class UUID corresponds to the iOS operating system; when the service class UUID is the generic SPP, the service class UUID may correspond to other operating systems in addition to the Android operating system.
It is understood that the terminal includes, but is not limited to, mobile phones, notebook computers, tablet computers, palm computers, PAD and other electronic devices, and the operating system of the terminal may include, but is not limited to, an Android operating system, an iOS operating system, a Symbian operating system, a Black Berry operating system, a Windows Phone operating system and the like; by registering the connection channel corresponding to the type of the terminal operation system, the subsequent connection and communication with the terminal of the corresponding type are facilitated.
The at least one type of connection channel comprises one type or a plurality of types of connection channels. When the connection channel of one type is included, the connection channel of the iOS corresponding to the iOS or the Android connection channel corresponding to the Android operating system is included; when multiple types of connection channels are included, the connection channels include iOS connection channels corresponding to iOS operating systems and/or Android connection channels corresponding to Android operating systems. It can be understood that users of terminals using the Android operating system and the iOS operating system currently occupy most of them, and the requirements of most of users can be met by registering the iOS connection channel and the Android connection channel.
Wherein one type of connection channel comprises one or more connection channels. When one type of connection channel comprises one connection channel, terminals of the same operating system in the field terminal are connected and communicated with the Bluetooth module through the corresponding type of connection channel in sequence. Namely, when one field terminal is connected with the Bluetooth module and data transmission is completed, the connection channel is released; and the other field terminal is connected with the Bluetooth module and completes data transmission.
When one type of connection channel comprises a plurality of connection channels, terminals of the same operating system in the field terminal are respectively connected and communicated with the Bluetooth module through an independent corresponding type of connection channel. Wherein, each connecting channel can correspond to different connecting channel numbers so as to distinguish each connecting channel.
It will be appreciated that, when the type of connection channel includes an iOS connection channel corresponding to the iOS operating system, in step S1, the bluetooth module performs self-checking and initializing, and further includes, communicating with the MFi coprocessor, detecting the MFi coprocessor and detecting version compatibility, so as to ensure normal registration of the iOS connection channel and subsequent normal communication with the terminal of the iOS operating system. Wherein the MFi coprocessor can be a CP3.0 coprocessor.
S2, establishing Bluetooth connection with the field terminal according to the connection request sent by the field terminal.
It can be understood that when the terminal of the user is located in a place where the functional device is located, the user can send a connection request to the bluetooth module through the terminal according to the own requirement, and the bluetooth module establishes a bluetooth connection of a corresponding type with the field terminal through a corresponding connection channel according to the connection request sent by the field terminal.
Specifically, when the operating system of the field terminal is an Android operating system, the Bluetooth module establishes SPP Bluetooth connection with the field terminal; when the operating system of the field terminal is an iOS operating system, the Bluetooth module establishes iAP2 Bluetooth connection with the field terminal. It will be appreciated that when the field terminal operating system is an iOS operating system, the bluetooth module communicates with the field terminal through the cryptographic authentication function of the MFi coprocessor and the iAP2 protocol.
S3, generating at least one format of function information to be transmitted, wherein the format of the function information to be transmitted corresponds to the type of the terminal operating system.
It will be appreciated that the functional device includes other modules in addition to the bluetooth module, for example, a functional module that generates at least one format of functional information to be transmitted. It will be appreciated that, in order to ensure the validity of the function information to be transmitted received by the field terminal, the format of the function information to be transmitted corresponds to the type of the terminal operating system. For example, when the original function data is packaged according to the format specified by the iAP2 protocol, the packaged data is the function information to be sent corresponding to the iOS operating system, and the format of the function information to be sent accords with the format requirement of the iOS operating system; and when the original function data is packaged according to the format specified by the SPP protocol, the packaged data is the function information to be transmitted corresponding to the Android operating system, and the format of the function information to be transmitted meets the format requirement of the Android operating system.
The bluetooth module and the field terminal in the step S2 can be connected by bluetooth, and then the function information to be sent is generated, namely, when the bluetooth module is in an idle state, the function information to be sent does not need to be generated, so that the working power consumption is reduced; or, the generation of the function information to be sent is completed before step S2, and it can be understood that, in the process from the start-up operation to the shutdown end operation of the function device, the generation of the function information to be sent can be completed once without generating again under the condition that the function information to be sent is unchanged or has no error. Therefore, after the Bluetooth module and the field terminal are connected by Bluetooth, the function information to be transmitted in a corresponding format can be transmitted to the field terminal with a corresponding operating system type, and the communication efficiency is improved.
It is understood that the at least one format of function information to be transmitted includes one or more formats of function information to be transmitted. When the function information to be sent in one format is included, the function information to be sent corresponding to the iOS operating system is included, or the function information to be sent corresponding to the Android operating system is included; when the function information to be sent in multiple formats is included, the function information to be sent corresponding to the iOS operating system and/or the function information to be sent corresponding to the Android operating system are included. It is to be understood that the format of the function information to be transmitted generated in step S3 corresponds to the type of the connection channel registered in step S1.
The function information to be sent may be information of various functions, specifically, information corresponding to functions of the function module. For example, when the function device is a bluetooth locator, the function device includes a bluetooth module and a locating module, and the locating module is the function module of the function device, at this time, the function information to be sent may include location information, that is, GPS locating data, and the location information is generated by the locating module. It can be understood that when the functional module is a positioning module, the original functional data is GPS positioning data, the positioning module packages the GPS positioning data according to a data format specified by a corresponding protocol, and the format of the packaged functional information to be sent is a format conforming to a corresponding operating system.
And S4, transmitting the function information to be transmitted in a corresponding format to the field terminal through a connection channel corresponding to the type of the field terminal operating system.
It can be understood that, after the bluetooth module establishes bluetooth connection with the field terminal and generates the function information to be transmitted, the function information to be transmitted in a corresponding format is transmitted to the corresponding field terminal through a connection channel corresponding to the type of the operating system of the field terminal.
When a plurality of field terminals of the same type of operating system are connected with the Bluetooth module through a plurality of connecting channels, the field terminals are sequentially connected with the Bluetooth module through an independent connecting channel respectively and keep connection, and after at least one format of function information to be transmitted is generated, the Bluetooth module transmits the function information to be transmitted in a corresponding format to the corresponding terminal through the corresponding connecting channel in a time sharing manner; that is, when a plurality of field terminals are on-line, the Bluetooth module transmits the function information to be transmitted to one field terminal, and then transmits the next field terminal, so that the networking transmission capacity is effectively improved.
And the field terminal presents the received function information to be sent to the user. For example, when the function information to be transmitted includes location information, the field terminal presents the received location information to the user, providing location services to the user.
In this embodiment, the bluetooth module may record and store the type of the existing part or all of terminal operating systems in advance, and the corresponding relation between the type of the terminal operating system and the format and the type of the connection channel of the function information to be sent, so as to select the function information to be sent in a corresponding format according to the type of the terminal operating system of the field terminal of the bluetooth connection, and send the function information to the corresponding terminal through the corresponding connection channel, thereby ensuring the validity of the function information to be sent received by the field terminal, and implementing the effective propagation of the function information to be sent.
Referring to fig. 2, fig. 2 is a flowchart of a second embodiment of the bluetooth communication method according to the present invention, wherein the bluetooth communication method according to the embodiment includes the following steps:
s1, registering at least one type of connection channel, wherein the type of the connection channel corresponds to the type of a terminal operating system.
S2, establishing Bluetooth connection with the field terminal according to the connection request sent by the field terminal.
S3, generating at least one format of function information to be transmitted, wherein the format of the function information to be transmitted corresponds to the type of the terminal operating system.
And S4, transmitting the function information to be transmitted in a corresponding format to the field terminal through a connection channel corresponding to the type of the field terminal operating system.
The present embodiment differs from the first embodiment in that in the present embodiment, in step S2, it includes:
s2-1, broadcasting connection information outwards for the field terminal to search for connection.
It can be understood that after the bluetooth module completes self-checking and initialization, connection information is broadcast outwards at any time for the field terminal to search for connection, wherein the connection information includes bluetooth names of the functional devices.
When the terminal of the user is located in the signal range of the connection information broadcast by the Bluetooth module and the user starts the Bluetooth function of the Bluetooth option of the terminal, the user can search the corresponding page of the terminal for the connection information corresponding to the current function equipment and select connection, so that a connection request is initiated to the Bluetooth module.
It will be appreciated that a terminal may include one or more bluetooth options, including a system bluetooth option located in a system setup page, or a bluetooth option located in an APP with bluetooth functions, that a user may turn on one or more bluetooth options' bluetooth functions simultaneously.
In step S1, when the same type of connection channel includes one and one terminal starts the bluetooth function of multiple bluetooth options, each bluetooth option of the terminal is connected to and communicates with the bluetooth module sequentially through the one connection channel. When the same type of connection channel comprises a plurality of connection channels and one terminal starts the Bluetooth functions of a plurality of Bluetooth options, the plurality of Bluetooth options are sequentially connected with the Bluetooth module through an independent connection channel, and the subsequent Bluetooth module respectively transmits the function information to be transmitted in a corresponding format to the terminal system or the APP where the Bluetooth options are located in a time-sharing mode through the corresponding connection channel.
It will be appreciated that in the embodiments of the present invention, a case where one terminal includes one bluetooth option is specifically described as an example, but the embodiments are equally applicable to a case where one terminal includes a plurality of bluetooth options.
S2-2, establishing bottom Bluetooth connection with the field terminal according to the connection information and the connection request sent by the field terminal through the corresponding connection channel.
It will be appreciated that the field terminal sends a connection request through a connection channel corresponding to its operating system type. And after receiving a connection request of the field terminal through the corresponding connection channel, the Bluetooth module establishes bottom Bluetooth connection with the field terminal.
S2-3, determining the type of the field terminal operating system according to the connection channel through which the connection request passes.
It will be appreciated that in step S1, the connection channels are registered, and unique connection channel numbers are assigned to each connection channel, and a correspondence between the connection channel numbers and the types of terminal operating systems is established.
When the Bluetooth module receives the connection request, the type of the operating system of the field terminal can be determined according to the connection channel number of the connection channel through which the connection request passes.
S2-4, handshake is carried out with the field terminal through a communication protocol corresponding to the type of the field terminal operating system, and the handshake is connected.
It may be appreciated that at least one type of communication protocol is stored in the bluetooth module, where the type of communication protocol corresponds to the type of terminal operating system, and includes, for example, the iAP2 protocol corresponding to the iOS operating system and the SPP protocol corresponding to the Android operating system.
And after the type of the operating system of the field terminal is determined, reading a communication protocol corresponding to the type of the operating system, carrying out handshake with the field terminal, and connecting the communication protocol with the field terminal, so as to establish Bluetooth connection between the Bluetooth module and the field terminal. After the connection is successful, the field terminal gives out corresponding prompt information to prompt the user.
When a plurality of field terminals exist, each field terminal repeats the Bluetooth connection steps, so that the plurality of field terminals are online simultaneously.
Further, in step S4, it includes:
s4-1, setting at least one type of control signal, wherein the type of the control signal corresponds to the format of the function information to be sent and the type of the connection channel.
It can be understood that in step S3, at least one format of function information to be transmitted is generated, and in step S4, by setting at least one type of control signal, a correspondence relationship between the type of the control signal and the format of the function information to be transmitted and the type of the connection channel is established. And judging the format of the function information to be sent according to the type of the control signal, and further selecting the type of a transmission channel for sending the function information to be sent.
The control signal may be generated by the function module and sent to the bluetooth module, and the corresponding relationship between the type of the control signal and the format of the function information to be sent, and the type of the connection channel may be stored in the bluetooth module, or may exist in the function module at the same time. It can be understood that the function module simultaneously sends the function information to be sent and the corresponding control signal to the bluetooth module, and the bluetooth module judges the format of the function information to be sent according to the control signal, so as to select a connection channel with the corresponding format for sending; or the Bluetooth module does not need to judge the format of the function information to be sent, and directly selects a corresponding connection channel to send according to the type of the control signal.
Wherein, the type distinction of the control signal can be realized by setting the level signal type of the control signal, for example, when the control signal is a high level signal, the format of the function information to be transmitted is an iOS format, and the function information should be transmitted through an iOS connection channel; when the control signal is a low-level signal, the format of the functional information to be sent is the Android format, and the functional information should be sent through an Android connection channel.
S4-2, determining the type of the connecting channel for sending the function information according to the type of the current control signal.
It can be understood that, when the bluetooth module receives the function information to be sent and the control signal sent by the function module, the type of the connection channel for sending the function information to be sent can be determined according to the control signal.
And S4-3, transmitting the function information to be transmitted to the field terminal through the corresponding type of connection channel.
And after determining the type of the connection channel, transmitting the function information to be transmitted to the field terminal through the connection channel of the type.
Because the iOS operating system has high requirements on the data format, in order to ensure the validity of the function information to be sent received by the terminal of the iOS operating system, further, after step S4-2, the method further includes:
S4-2-1, judging whether the format of the function information to be sent corresponds to an iOS operating system or not; if yes, executing the step S4-2-2; if not, step S4-3 is executed.
It can be understood that when the format of the function information to be sent corresponds to the iOS operating system, the format of the function information to be sent is judged, and when the format of the function information to be sent corresponds to other operating systems, for example, an Android operating system and the like, because the Android operating system has higher adaptability to the data format, the format judgment is not needed, the step S4-3 is directly executed, and the working power consumption is reduced.
S4-2-2, analyzing the function information to be sent, and obtaining format information of the function information to be sent.
It can be understood that the function information to be sent corresponding to the iOS operating system is parsed, and format information of the function information to be sent is obtained, so as to determine whether the format information meets the corresponding format requirement.
S4-2-3, judging whether the format information is consistent with the preset format information; if yes, executing the step S4-3; if not, step S4-2-4 is executed.
Understandably, in the bluetooth module, preset format information of function information to be sent corresponding to the iOS operating system is recorded and stored in advance; when the format information of the function information to be sent is consistent with the preset format information, judging that the current function information to be sent meets the format requirement, and executing the step S4-3; otherwise, if the current function information to be sent is judged to be not in accordance with the format requirement, executing the step S4-2-4.
S4-2-4, discarding the function information to be sent.
It can be appreciated that, when the functional device fails or other defects exist, the format of the to-be-sent functional information generated in step S3 may not match the format of the to-be-sent functional information expected to be generated, and in this embodiment, the to-be-sent functional information sent to the field terminal corresponding to the iOS operating system is made to conform to the format requirement by determining the format of the to-be-sent functional information corresponding to the iOS operating system, so that the integrity of the to-be-sent functional information is ensured.
It can be understood that the function of the bluetooth module is controlled by the bluetooth controllers, in this embodiment, the number of bluetooth controllers in the bluetooth module is fixed, for example, 1 bluetooth controller is included, and the above bluetooth communication method is programmed into the bluetooth controllers. The types of the registered connection channels and the number of the connection channels of various types are controlled by a program, namely, the types and the number of the connection channels can be increased or decreased in a program modifying mode, so that the system has expandability. Wherein, the Bluetooth module can be selected from FSC-BT836 Bluetooth module.
The bluetooth communication method of the embodiment is applicable to a bluetooth positioner, namely, the functional device can be the bluetooth positioner, the bluetooth positioner comprises a bluetooth module and a positioning module, namely, the positioning module is a functional module of the bluetooth positioner, and the bluetooth module is connected with the positioning module through a UART serial port.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a first embodiment of a bluetooth communication device according to the present invention, the bluetooth communication device 10 performs functions corresponding to the bluetooth communication method according to the first embodiment, and as shown in fig. 3, the bluetooth communication device 10 includes a bluetooth module 100 and a function module 200, wherein the bluetooth module 100 includes a registration unit 101, a connection establishment unit 102, and an information transmission unit 103, and the function module 200 includes a generation unit 201.
A registration unit 101, configured to register at least one type of connection channel, where the type of connection channel corresponds to the type of terminal operating system.
It will be appreciated that upon powering up of the bluetooth communication device 10, the bluetooth module 100 performs self-checking and initialization. Specifically including one or more of initialization and parameter configuration, memory self-checking, and parameter checking of the bluetooth controller and bluetooth protocol to ensure proper use of the bluetooth module 100 functions. In the initialization of the bluetooth protocol, the registration unit 101 registers the connection channel to ensure the connection and communication between the bluetooth module 100 and the terminal.
Wherein at least one type of connection channel is registered, the type of connection channel corresponding to the type of terminal operating system. For example, if a connection channel is registered and bound with a service class UUID specified by the iAP2 protocol, the connection channel is corresponding to the iOS connection channel; and if one connecting channel is registered and bound with the UUID of the universal SPP service class, the connecting channel is correspondingly an Android connecting channel. It can be appreciated that the service class UUID includes a plurality of kinds, and when the service class UUID is specified by the iAP2 protocol, the service class UUID corresponds to the iOS operating system; when the service class UUID is the generic SPP, the service class UUID may correspond to other operating systems in addition to the Android operating system.
It is understood that the terminal includes, but is not limited to, mobile phones, notebook computers, tablet computers, palm computers, PAD and other electronic devices, and the operating system of the terminal may include, but is not limited to, an Android operating system, an iOS operating system, a Symbian operating system, a Black Berry operating system, a Windows Phone operating system and the like; by registering the connection channel corresponding to the type of the terminal operation system, the subsequent connection and communication with the terminal of the corresponding type are facilitated.
The at least one type of connection channel comprises one type or a plurality of types of connection channels. When the connection channel of one type is included, the connection channel of the iOS corresponding to the iOS or the Android connection channel corresponding to the Android operating system is included; when multiple types of connection channels are included, the connection channels include iOS connection channels corresponding to iOS operating systems and/or Android connection channels corresponding to Android operating systems. It can be understood that users of terminals using the Android operating system and the iOS operating system currently occupy most of them, and the requirements of most of users can be met by registering the iOS connection channel and the Android connection channel.
Wherein one type of connection channel comprises one or more connection channels. When one type of connection channel includes one connection channel, terminals of the same operating system in the field terminal are sequentially connected to and communicate with the bluetooth module 100 through the one corresponding type of connection channel. Namely, when one field terminal is connected with the Bluetooth module and data transmission is completed, the connection channel is released; and the other field terminal is connected with the Bluetooth module and completes data transmission.
When one type of connection channel includes a plurality of connection channels, terminals of the same operating system in the field terminal are each connected to and communicate with the bluetooth module 100 through a separate one of the corresponding types of connection channels. Wherein, each connecting channel can correspond to different connecting channel numbers so as to distinguish each connecting channel.
It will be appreciated that when the type of connection channel includes an iOS connection channel corresponding to an iOS operating system, the bluetooth module 100 performs self-checking and initializing, and further includes, the bluetooth module 100 communicating with the MFi coprocessor, detecting the MFi coprocessor and detecting version compatibility, so as to ensure normal registration of the iOS connection channel and subsequent normal communication with the terminal of the iOS operating system. Wherein the MFi coprocessor can be a CP3.0 coprocessor.
The connection establishment unit 102 is configured to establish a bluetooth connection with the field terminal according to a connection request sent by the field terminal.
It may be appreciated that, when the user's terminal is located in a location where the function device is located, the user may send a connection request to the bluetooth module 100 through the terminal according to his own needs, and the connection establishment unit 102 establishes a corresponding type of bluetooth connection with the field terminal through a corresponding connection channel according to the connection request sent by the field terminal.
Specifically, when the operating system of the field terminal is an Android operating system, the connection establishment unit 102 establishes an SPP bluetooth connection with the field terminal; when the operating system of the field terminal is the iOS operating system, the connection establishment unit 102 establishes an iAP2 bluetooth connection with the field terminal. It will be appreciated that when the field terminal operating system is an iOS operating system, the bluetooth module 100 communicates with the field terminal through the cryptographic authentication function of the MFi coprocessor and the iAP2 protocol.
A generating unit 201, configured to generate function information to be sent in at least one format, where the format of the function information to be sent corresponds to the type of the terminal operating system.
It will be appreciated that the function device includes other modules in addition to the bluetooth module 100, for example, the function module 200, and the function module 200 includes a generating unit 201, and the generating unit 201 generates function information to be transmitted in at least one format. It will be appreciated that, in order to ensure the validity of the function information to be transmitted received by the field terminal, the format of the function information to be transmitted corresponds to the type of the terminal operating system. For example, when the original function data is packaged according to the format specified by the iAP2 protocol, the packaged data is the function information to be sent corresponding to the iOS operating system, and the format of the function information to be sent accords with the format requirement of the iOS operating system; and when the original function data is packaged according to the format specified by the SPP protocol, the packaged data is the function information to be transmitted corresponding to the Android operating system, and the format of the function information to be transmitted meets the format requirement of the Android operating system.
Wherein, after the connection establishment unit 102 establishes bluetooth connection with the field terminal, the function information to be sent can be generated, that is, when the bluetooth module 100 is in an idle state, the function information to be sent does not need to be generated, so as to reduce the working power consumption; alternatively, the generation of the function information to be sent is completed before the connection establishment unit 102 establishes the bluetooth connection with the field terminal, and it can be understood that, in the process from the start-up operation to the shutdown end operation of the bluetooth communication device 10, the generation of the function information to be sent may be completed once without generating again when the function information to be sent is unchanged or has no error. Therefore, after the connection establishment unit 102 establishes bluetooth connection with the field terminal, the function information to be sent in a corresponding format can be sent to the field terminal with a corresponding operating system type, so that the communication efficiency is improved.
It is understood that the at least one format of function information to be transmitted includes one or more formats of function information to be transmitted. When the function information to be sent in one format is included, the function information to be sent corresponding to the iOS operating system is included, or the function information to be sent corresponding to the Android operating system is included; when the function information to be sent in multiple formats is included, the function information to be sent corresponding to the iOS operating system and/or the function information to be sent corresponding to the Android operating system are included. It is to be understood that the format of the function information to be transmitted generated in the generating unit 201 corresponds to the type of the connection channel registered in the registering unit 101.
The function information to be sent may be information of various functions, specifically, information corresponding to the functions of the function module 200. For example, when the bluetooth communication device 10 is a bluetooth locator, the functional apparatus includes a bluetooth module 100 and a positioning module, i.e., the functional module 200 of the bluetooth locator, and at this time, the functional information to be transmitted may include location information, i.e., GPS positioning data, and the location information is generated by the generating unit 201. It may be understood that when the functional module 200 is a positioning module, the original functional data is GPS positioning data, the positioning module packages the GPS positioning data according to a data format specified by a corresponding protocol, and the format of the packaged functional information to be sent is a format conforming to a corresponding operating system.
An information sending unit 103, configured to send the function information to be sent in a corresponding format to the field terminal through a connection channel corresponding to the type of the field terminal operating system.
As can be appreciated, after the connection establishment unit 102 establishes a bluetooth connection with the field terminal and the generation unit 201 generates the function information to be transmitted, the information transmission unit 103 transmits the function information to be transmitted in a corresponding format to the corresponding field terminal through a connection channel corresponding to the type of the operating system of the field terminal.
When a plurality of field terminals of the same type of operating system are connected with the Bluetooth module 100 through a plurality of connecting channels, the field terminals are sequentially connected with the Bluetooth module 100 through an independent connecting channel respectively and keep connection, and after the generating unit 201 generates at least one format of function information to be transmitted, the information transmitting unit 103 respectively transmits the function information to be transmitted in a corresponding format to the corresponding terminals in a time sharing manner through the corresponding connecting channels; that is, when a plurality of field terminals are on-line, the information transmitting unit 103 transmits the function information to be transmitted to one field terminal, and then transmits the next field terminal, thereby effectively improving the networking transmission capability.
And the field terminal presents the received function information to be sent to the user. For example, when the function information to be transmitted includes location information, the field terminal presents the received location information to the user, providing location services to the user.
In this embodiment, the bluetooth module 100 may further include a storage unit, where the storage unit may record and store the type of the existing part or all of terminal operating systems in advance, and the correspondence between the type of the terminal operating system and the format of the function information to be sent and the type of the connection channel, so that the function information to be sent in a corresponding format is selected according to the type of the terminal operating system of the field terminal of the bluetooth connection, and is sent to the corresponding terminal through the corresponding connection channel, thereby ensuring the validity of the function information to be sent received by the field terminal and implementing effective propagation of the function information to be sent.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a second embodiment of the bluetooth communication device according to the present invention, where functions implemented by the bluetooth communication device 10 according to the present invention correspond to those of the bluetooth communication method according to the second embodiment, and as shown in fig. 4, the bluetooth communication device 10 includes a bluetooth module 100 and a function module 200, where the bluetooth module 100 includes a registration unit 101, a connection establishment unit 102, an information transmission unit 103, and the function module 200 includes a generation unit 201.
A registration unit 101, configured to register at least one type of connection channel, where the type of connection channel corresponds to the type of terminal operating system.
The connection establishment unit 102 is configured to establish a bluetooth connection with the field terminal according to a connection request sent by the field terminal.
A generating unit 201, configured to generate function information to be sent in at least one format, where the format of the function information to be sent corresponds to the type of the terminal operating system.
An information sending unit 103, configured to send the function information to be sent in a corresponding format to the field terminal through a connection channel corresponding to the type of the field terminal operating system.
The present embodiment differs from the first embodiment described above in that in the present embodiment, the connection establishment unit 102 includes:
And a broadcasting unit 1021 for broadcasting connection information outwards for the field terminal to search for connection.
As can be appreciated, after the bluetooth module 100 completes the self-checking and initialization, the broadcasting unit 1021 broadcasts the connection information outwards at the moment for the field terminal to search for the connection, wherein the connection information includes the bluetooth name of the bluetooth communication device 10.
When the user's terminal is located within the signal range of the connection information broadcast by the broadcasting unit 1021 and the user turns on the bluetooth function of the bluetooth option of the terminal, the user may search for the connection information corresponding to the current bluetooth communication device 10 in the page corresponding to the terminal and select a connection, thereby initiating a connection request to the bluetooth module 100.
It will be appreciated that a terminal may include one or more bluetooth options, including a system bluetooth option located in a system setup page, or a bluetooth option located in an APP with bluetooth functions, that a user may turn on one or more bluetooth options' bluetooth functions simultaneously.
In the registration unit 101, when the same type of connection channel includes one and one terminal turns on the bluetooth functions of a plurality of bluetooth options, each bluetooth option of the terminal is connected to and communicates with the bluetooth module sequentially through the one connection channel. When the same type of connection channel comprises a plurality of connection channels and one terminal starts the Bluetooth functions of a plurality of Bluetooth options, the plurality of Bluetooth options are sequentially connected with the Bluetooth module through an independent connection channel, and the subsequent Bluetooth module respectively transmits the function information to be transmitted in a corresponding format to the terminal system or the APP where the Bluetooth options are located in a time-sharing mode through the corresponding connection channel.
It will be appreciated that in the embodiments of the present invention, a case where one terminal includes one bluetooth option is specifically described as an example, but the embodiments are equally applicable to a case where one terminal includes a plurality of bluetooth options.
The bottom layer connection unit 1022 is configured to establish a bottom layer bluetooth connection with the field terminal according to the connection information and a connection request sent by the field terminal through a corresponding connection channel.
It will be appreciated that the field terminal sends a connection request through a connection channel corresponding to its operating system type. The bottom layer connection unit 1022 establishes a bottom layer bluetooth connection with the field terminal after receiving a connection request of the field terminal through the corresponding connection channel.
A first determining unit 1023, configured to determine a type of the field terminal operating system according to the connection channel through which the connection request passes.
It is understood that in the registration unit 101, connection channels are registered, and unique connection channel numbers are assigned to the respective connection channels, while a correspondence relationship between the connection channel numbers and the types of terminal operating systems is established.
When receiving the connection request, the first determining unit 1023 may determine the operating system type of the field terminal according to the connection channel number of the connection channel through which the connection request passes.
And a protocol handshaking unit 1024, configured to handshake with the field terminal through a communication protocol corresponding to the type of operating system of the field terminal, and connect with the field terminal.
It may be appreciated that at least one type of communication protocol is stored in the protocol handshaking unit 1024, where the type of communication protocol corresponds to the type of the terminal operating system, and includes, for example, the iAP2 protocol corresponding to the iOS operating system and the SPP protocol corresponding to the Android operating system.
When the operating system type of the field terminal is determined, the protocol handshaking unit 1024 reads the communication protocol corresponding to the operating system type, performs handshaking with the field terminal, and connects the communication protocol to the field terminal, thereby establishing a bluetooth connection between the bluetooth module 100 and the field terminal. After the connection is successful, the field terminal gives out corresponding prompt information to prompt the user.
When a plurality of field terminals exist, each field terminal repeats the Bluetooth connection steps, so that the plurality of field terminals are online simultaneously.
Further, the functional module 200 further includes a setting unit 202, and the information transmitting unit 103 includes a second determining unit 1031, a sub transmitting unit 1032.
A setting unit 202, configured to set at least one type of control signal, where the type of control signal corresponds to a format of the function information to be sent and a type of the connection channel.
It is to be understood that, in the generating unit 201, the function information to be transmitted in at least one format is generated, and in the setting unit 202, by setting at least one type of control signal, a correspondence relationship between the type of control signal and the format of the function information to be transmitted, the type of connection channel is established. And judging the format of the function information to be sent according to the type of the control signal, and further selecting the type of a transmission channel for sending the function information to be sent.
Wherein, the control signal may be generated by the setting unit 202 and transmitted to the bluetooth module 100, and the correspondence relationship between the type of the control signal and the format of the function information to be transmitted, the type of the connection channel may be stored in the bluetooth module 100, or the function module 200 may exist at the same time. As can be appreciated, the function module 200 simultaneously sends the function information to be sent and the corresponding control signal to the bluetooth module 100, and the bluetooth module 100 determines the format of the function information to be sent according to the control signal, so as to select a connection channel with a corresponding format for sending; or, the bluetooth module 100 directly selects a corresponding connection channel to transmit according to the type of the control signal without judging the format of the function information to be transmitted.
Wherein, the type distinction of the control signal can be realized by setting the level signal type of the control signal, for example, when the control signal is a high level signal, the format of the function information to be transmitted is an iOS format, and the function information should be transmitted through an iOS connection channel; when the control signal is a low-level signal, the format of the functional information to be sent is the Android format, and the functional information should be sent through an Android connection channel.
A second determining unit 1031, configured to determine a type of connection channel for which the function information is to be transmitted according to a type of the current control signal.
It may be appreciated that, when the bluetooth module 100 receives the function information to be transmitted from the generating unit 201 and the control signal transmitted from the setting unit 202, the second determining unit 1031 may determine the type of the connection channel for transmitting the function information to be transmitted according to the control signal.
And a sub-transmitting unit 1032 for transmitting the function information to be transmitted to the field terminal through the corresponding type of connection channel.
When the type of the connection channel is determined, the sub-transmission unit 1032 transmits the function information to be transmitted to the field terminal through the connection channel of the type.
Since the iOS operating system has a high requirement on the data format, in order to ensure the validity of the function information to be sent, which is received by the terminal of the iOS operating system, further, after the second determining unit 1031, the method further includes:
A first judging unit 301, configured to judge whether a format of the function information to be sent corresponds to the iOS operating system; if yes, entering an analysis acquisition unit 302; if not, the sub-transmission unit 1032 is entered.
It can be understood that, when the format of the function information to be sent corresponds to the iOS operating system, the format of the function information to be sent is judged, and when the format of the function information to be sent corresponds to other operating systems, for example, an Android operating system or the like, the Android operating system has higher adaptability to the data format, so that the format is not required to be judged, the function information directly enters the sub-sending unit 1032, and the working power consumption is reduced.
The parsing and acquiring unit 302 is configured to parse the function information to be sent, and acquire format information of the function information to be sent.
It can be understood that the function information to be sent corresponding to the iOS operating system is parsed, and format information of the function information to be sent is obtained, so as to determine whether the format information meets the corresponding format requirement.
A second judging unit 303, configured to judge whether the format information is consistent with the preset format information; if yes, entering a sub-sending unit 1032; if not, the information discarding unit 304 is entered.
As can be appreciated, in the bluetooth module 100, preset format information of function information to be transmitted corresponding to the iOS operating system is recorded and stored in advance; when the format information of the function information to be transmitted is consistent with the preset format information, judging that the current function information to be transmitted meets the format requirement, and entering a sub-transmitting unit 1032; otherwise, if the function information to be sent does not meet the format requirement, the information discarding unit 304 is entered.
An information discarding unit 304, configured to discard the function information to be sent.
It may be appreciated that, when the bluetooth communication device 10 fails or other defects exist, which may cause the format of the to-be-transmitted function information generated in the step generating unit 201 to be inconsistent with the format of the to-be-transmitted function information expected to be generated, in this embodiment, the to-be-transmitted function information sent to the field terminal corresponding to the iOS operating system is enabled to conform to the format requirement by determining the format of the to-be-transmitted function information corresponding to the iOS operating system, so that the integrity of the to-be-transmitted function information is ensured.
It should be understood that the functions of the bluetooth module 100 are controlled by bluetooth controllers, and in this embodiment, the number of bluetooth controllers in the bluetooth module 100 is fixed, for example, 1 bluetooth controller is included, and the functions executed by the units in the bluetooth module 100 are programmed into the bluetooth controllers. The types of the registered connection channels and the number of the connection channels of various types are controlled by a program, namely, the types and the number of the connection channels can be increased or decreased in a program modifying mode, so that the system has expandability. Among them, the bluetooth module 100 may be an FSC-BT836 bluetooth module.
The bluetooth communication device 10 of the present embodiment may be a bluetooth positioner, where the bluetooth positioner includes a bluetooth module 100 and a positioning module, that is, the positioning module is a functional module 200 of the bluetooth positioner, and the bluetooth module 100 is connected with the positioning module through a UART serial port.
A readable storage medium of the present invention has stored thereon a computer program which, when executed by a processor, implements the steps of the bluetooth communication method according to any of the embodiments described above.
Those skilled in the art will appreciate that all or part of the procedures in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the above program may be stored in a readable storage medium of a terminal device such as a computer, a mobile phone, etc., and the program may include the procedures of the embodiments of the above methods when executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
It is to be understood that the above examples only represent preferred embodiments of the present invention, which are described in more detail and are not to be construed as limiting the scope of the invention; it should be noted that, for a person skilled in the art, the above technical features can be freely combined, and several variations and modifications can be made without departing from the scope of the invention; therefore, all changes and modifications that come within the meaning and range of equivalency of the claims are to be embraced within their scope.

Claims (9)

1. A bluetooth communication method, comprising:
s1, registering at least one type of connection channel, wherein the type of the connection channel corresponds to the type of a terminal operating system;
s2, establishing Bluetooth connection with the field terminal according to a connection request sent by the field terminal, wherein the Bluetooth connection comprises the following steps:
s2-1, broadcasting connection information outwards for searching connection by a field terminal;
s2-2, establishing a bottom Bluetooth connection with the field terminal according to the connection information and a connection request sent by the field terminal through the corresponding connection channel;
s2-3, determining the type of the field terminal operating system according to the connection channel through which the connection request passes;
s2-4, handshake with the field terminal through a communication protocol corresponding to the type of the field terminal operating system and connecting the field terminal with the field terminal;
s3, generating at least one format of function information to be transmitted, wherein the format of the function information to be transmitted corresponds to the type of a terminal operating system;
and S4, transmitting the function information to be transmitted in a corresponding format to the field terminal through the connection channel corresponding to the type of the field terminal operating system.
2. The bluetooth communication method according to claim 1, wherein the at least one type of connection channel comprises an iOS connection channel corresponding to an iOS operating system and/or an Android connection channel corresponding to an Android operating system;
In step S2, an iAP2 bluetooth connection is established with the field terminal according to a connection request sent by the field terminal of the iOS operating system, and/or an SPP bluetooth connection is established with the field terminal according to a connection request sent by the field terminal of the Android operating system.
3. The bluetooth communication method according to claim 1, wherein in step S4, comprising:
s4-1, setting at least one type of control signal, wherein the type of the control signal corresponds to the format of the function information to be sent and the type of the connection channel;
s4-2, determining the type of the connecting channel of the function information to be sent according to the type of the current control signal;
s4-3, the function information to be sent is sent to the field terminal through a corresponding type of connection channel.
4. A bluetooth communication method according to claim 3, further comprising, after step S4-2:
s4-2-1, judging whether the format of the function information to be sent corresponds to an iOS operating system or not; if yes, executing the step S4-2-2; if not, executing the step S4-3;
s4-2-2, analyzing the function information to be sent, and acquiring format information of the function information to be sent;
S4-2-3, judging whether the format information is consistent with preset format information or not; if yes, executing the step S4-3; if not, executing the step S4-2-4;
s4-2-4, discarding the function information to be sent.
5. The bluetooth communication method according to any of claims 1-4, wherein the function information to be transmitted comprises location information.
6. A bluetooth communication device, characterized by comprising a bluetooth module (100) and a functional module (200), wherein the bluetooth module (100) comprises a registration unit (101), a connection establishment unit (102) and an information transmission unit (103), and the functional module (200) comprises a generation unit (201);
the registration unit (101) is configured to register at least one type of connection channel, where the type of connection channel corresponds to the type of the terminal operating system;
the connection establishment unit (102) is used for establishing Bluetooth connection with the field terminal according to a connection request sent by the field terminal; wherein the connection establishment unit (102) comprises:
a broadcasting unit (1021) for broadcasting connection information to the outside for the field terminal to search for a connection;
the bottom layer connection unit (1022) is used for establishing bottom layer Bluetooth connection with the field terminal according to the connection information and the connection request sent by the field terminal through the corresponding connection channel;
A first determining unit (1023) for determining the type of the field terminal operating system according to the connection channel through which the connection request passes;
a protocol handshake unit (1024) for performing handshake with the field terminal through a communication protocol corresponding to the type of the field terminal operating system, and connecting the handshake unit;
the generating unit (201) is configured to generate function information to be sent in at least one format, where the format of the function information to be sent corresponds to a type of a terminal operating system;
the information sending unit (103) is configured to send the function information to be sent in a corresponding format to the field terminal through the connection channel corresponding to the type of the field terminal operating system.
7. The bluetooth communication device according to claim 6, wherein the at least one type of connection channel comprises an iOS connection channel corresponding to an iOS operating system and/or an Android connection channel corresponding to an Android operating system;
the connection establishment unit (102) is used for establishing iAP2 Bluetooth connection with the field terminal according to a connection request sent by the field terminal of the iOS operating system and/or establishing SPP Bluetooth connection with the field terminal according to a connection request sent by the field terminal of the Android operating system.
8. The bluetooth communication device according to claim 6, wherein the functional module (200) further comprises a setting unit (202), and the information transmitting unit (103) comprises a second determining unit (1031), a sub-transmitting unit (1032);
the setting unit (202) is configured to set at least one type of control signal, where the type of the control signal corresponds to the format of the function information to be sent and the type of the connection channel;
the second determining unit (1031) is configured to determine a type of the connection channel of the function information to be sent according to a type of a current control signal;
the sub-sending unit (1032) is configured to send the function information to be sent to the field terminal through a connection channel of a corresponding type.
9. A readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the bluetooth communication method according to any of the preceding claims 1-5.
CN202110560279.9A 2021-05-21 2021-05-21 Bluetooth communication method and device and readable storage medium Active CN113347615B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110560279.9A CN113347615B (en) 2021-05-21 2021-05-21 Bluetooth communication method and device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110560279.9A CN113347615B (en) 2021-05-21 2021-05-21 Bluetooth communication method and device and readable storage medium

Publications (2)

Publication Number Publication Date
CN113347615A CN113347615A (en) 2021-09-03
CN113347615B true CN113347615B (en) 2023-06-02

Family

ID=77470790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110560279.9A Active CN113347615B (en) 2021-05-21 2021-05-21 Bluetooth communication method and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN113347615B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103167432A (en) * 2012-08-07 2013-06-19 深圳市金立通信设备有限公司 System and method for achieving near-field information sending based on bluetooth transmission protocol

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015144402A (en) * 2013-12-24 2015-08-06 クラリオン株式会社 On-vehicle device and on-vehicle device control method
CN106612368B (en) * 2015-10-27 2019-11-05 比亚迪股份有限公司 Speech collecting system, voice collector and its information transmission and control method
KR101907075B1 (en) * 2017-03-28 2018-10-12 (주)신흥정밀 Method and apparatus for data communication using bluetooth low energy
CN107220089A (en) * 2017-06-06 2017-09-29 赵桂银 A kind of general packaging method of application program and device
CN108848127B (en) * 2018-05-23 2022-02-25 北京五八信息技术有限公司 Data transmission method and device, computer equipment and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103167432A (en) * 2012-08-07 2013-06-19 深圳市金立通信设备有限公司 System and method for achieving near-field information sending based on bluetooth transmission protocol

Also Published As

Publication number Publication date
CN113347615A (en) 2021-09-03

Similar Documents

Publication Publication Date Title
RU2659805C2 (en) Method and device for determining the location of the target portable device
EP3484196B1 (en) Method and apparatus for registering wireless device in wireless communication system
US7818022B2 (en) Communication apparatus and electric power control method
CN100512176C (en) A communication control method and wireless communication apparatus
RU2004132709A (en) METHOD FOR QUICK REGISTRATION FOR USER IDENTIFICATION AND PAYMENT SETTINGS USING TWO DIFFERENT COMMUNICATION CHANNELS AND ITS IMPLEMENTATION SYSTEM
US20100211685A1 (en) Pairing exchange
CN1874282B (en) Communication system, and device used in such system
US7565210B2 (en) Data communications
CN110167192A (en) Bluetooth connection management method and device, electronic equipment and non-transient storage media
CN114024790A (en) Distribution network binding method of intelligent household appliance, mobile terminal and cloud server
CN101656730A (en) Communication device, communication system, communication method and program
EP1365611B1 (en) Mobile communication system and apparatus constituting the same
KR20080088535A (en) Mobile terminal and method for operating a mobile terminal
CN104301882A (en) Device and method for perceiving identity information of 3G mobile terminal user
CN113347615B (en) Bluetooth communication method and device and readable storage medium
CN106231538A (en) A kind of method and apparatus of OneM2M framework apparatus bound
CN103517373A (en) Network access method and device
CN110213748A (en) Data transmission method, device, terminal and system
CN112543514A (en) Method and device for link recovery processing under narrowband Internet of things
JP2004015455A (en) Network receptacle
US7116784B2 (en) Method and apparatus for authenticated reporting in a mobile communication device
CN210839641U (en) Device for realizing OTA firmware upgrade based on LoRa proprietary protocol
GB2370899A (en) Remote controller having hypermedia communication capabilities
CN111935679B (en) Method and system for initial communication between Internet of things terminal and wireless terminal small program
CN108737497B (en) Intelligent patch board binding method and system

Legal Events

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