CN108616855A - Bluetooth equipment tele-control system and method - Google Patents
Bluetooth equipment tele-control system and method Download PDFInfo
- Publication number
- CN108616855A CN108616855A CN201810284191.7A CN201810284191A CN108616855A CN 108616855 A CN108616855 A CN 108616855A CN 201810284191 A CN201810284191 A CN 201810284191A CN 108616855 A CN108616855 A CN 108616855A
- Authority
- CN
- China
- Prior art keywords
- bluetooth
- network module
- module
- control commands
- equipment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
Abstract
The invention discloses a kind of bluetooth equipment tele-control system and methods, and wherein bluetooth equipment tele-control system includes host side and Bluetooth gateway;Host side includes bluetooth applications program, virtual bluetooth protocol stack and first network module, and Bluetooth gateway includes the second network module and the first bluetooth module;First network module with the second network module for communicating;Bluetooth applications program is for sending Bluetooth control commands to virtual bluetooth protocol stack, and virtual bluetooth protocol stack is for sending Bluetooth control commands to first network module;First network module is for sending Bluetooth control commands to the second network module;Second network module is for calling the first bluetooth module to execute Bluetooth control commands so that the first bluetooth module and external bluetooth devices.Data transmission distance in the bluetooth equipment tele-control system of the present invention between host side and external bluetooth equipment is unrestricted, and the application range of bluetooth equipment is more extensive.
Description
Technical field
The present invention relates to the communications field more particularly to a kind of bluetooth equipment tele-control system and methods.
Background technology
As a kind of communication, bluetooth can realize the communication between bluetooth host and bluetooth equipment.Blue-teeth data
It is wirelessly transmitted between bluetooth host and bluetooth equipment, uses a kind of 2.4GHz (frequency unit) working frequency range.
Although theoretical transmission distance up to hundred meters, in actual scene, is limited, consumer level is blue by factors such as transmission power, wall barriers
The transmission range very little of tooth wireless signal can guarantee that the actual range for stablizing transmission often only has several meters or more than ten meters.This limit
The data transmission distance between the application of bluetooth host and bluetooth equipment is made.
Conventional method to expand transmission range includes increasing transmission power, removes barrier, to keep scene more open,
But increases transmission power, power consumption can be caused to increase, the device battery lost of life;Furthermore national relevant laws and regulations are to transmission power
There is restriction (2.4GHz frequency ranges must not exceed 100mW (milliwatt) or 20dBm (dBm)), thus can not possibly infinitely increase work(
Rate.
Invention content
The technical problem to be solved by the present invention is in order to overcome the number between bluetooth host and bluetooth equipment in the prior art
Short according to transmission range, the restricted defect of application range provides a kind of bluetooth equipment tele-control system and method.
The present invention is to solve above-mentioned technical problem by following technical proposals:
A kind of bluetooth equipment tele-control system, the bluetooth equipment tele-control system includes host side and bluetooth network
It closes;The host side is used for through the Bluetooth gateway and external bluetooth devices;
The host side includes bluetooth applications program, virtual bluetooth protocol stack and first network module, the Bluetooth gateway
Including the second network module and the first bluetooth module;
The first network module with second network module for communicating;
The bluetooth applications program is for sending Bluetooth control commands to the virtual bluetooth protocol stack, the virtual bluetooth
Protocol stack is for sending the Bluetooth control commands to the first network module;
The first network module is for sending the Bluetooth control commands to second network module;
Second network module is for calling first bluetooth module to execute the Bluetooth control commands, and described first
Bluetooth module is used for according to the Bluetooth control commands and the external bluetooth devices.
Optionally, the Bluetooth control commands include in bluetooth discovery, Bluetooth pairing, bluetooth connection and Bluetooth communication extremely
Few one kind.
Optionally, the Bluetooth control commands include call method title and parameter.
Optionally, the host side further includes the second bluetooth module, and the bluetooth applications program is for judging the outside
Whether bluetooth equipment is within the scope of short-range communication, if so, logical by second bluetooth module and the external bluetooth equipment
Letter, if it is not, then passing through the Bluetooth gateway and the external bluetooth devices.
Optionally, first bluetooth module is used to execute the result after the Bluetooth control commands and is sent to described the
Two network modules;
Second network module is for sending the result to the first network module;
The first network module is answered for the result to be sent to the bluetooth by the virtual bluetooth protocol stack
Use program;
The bluetooth applications program is for receiving and processing the result.
A kind of bluetooth equipment long-range control method, the bluetooth equipment long-range control method are set based on bluetooth as described above
Standby tele-control system is realized;
The bluetooth equipment long-range control method includes:
S1, the first network module are communicated with second network module;
S2, the bluetooth applications program send Bluetooth control commands to the virtual bluetooth protocol stack, the virtual bluetooth
Protocol stack sends the Bluetooth control commands to the first network module;
S3, the first network module send the Bluetooth control commands to second network module;
S4, second network module calling the first bluetooth module execution Bluetooth control commands, described first
Bluetooth module is according to the Bluetooth control commands and the external bluetooth devices.
Optionally, the Bluetooth control commands include in bluetooth discovery, Bluetooth pairing, bluetooth connection and Bluetooth communication extremely
Few one kind.
Optionally, the Bluetooth control commands include call method title and parameter.
Optionally, when the host side includes the second bluetooth module, the bluetooth applications program judges described external blue
Whether tooth equipment is within the scope of short-range communication, if so, by second bluetooth module and the external bluetooth devices,
If it is not, then passing through the Bluetooth gateway and the external bluetooth devices.
Optionally, the bluetooth equipment long-range control method further includes:
Result after executing the Bluetooth control commands is sent to the second network mould by S5, first bluetooth module
Block;
S6, second network module send the result to the first network module;
The result is sent to the bluetooth applications by S7, the first network module by the virtual bluetooth protocol stack
Program;
S8, the bluetooth applications program receive and process the result.
The positive effect of the present invention is that:
The bluetooth equipment tele-control system of the present invention utilizes virtual bluetooth protocol stack and first by bluetooth applications program
Bluetooth control commands are sent to Bluetooth gateway by network module, and Bluetooth gateway receives Bluetooth control commands using the second network module
And the first bluetooth module is called to execute Bluetooth control commands, so that the first bluetooth module and external bluetooth devices.This hair
Host side remotely can carry out communication interaction by Bluetooth gateway and external bluetooth equipment in bright bluetooth equipment tele-control system,
So that the data transmission distance between host side and external bluetooth equipment is unrestricted, the application range of bluetooth equipment is wider
It is general.
Description of the drawings
Fig. 1 is the module diagram of the bluetooth equipment tele-control system of the embodiment of the present invention 1.
Fig. 2 is the module diagram of the remote procedure call of the bluetooth equipment tele-control system of the embodiment of the present invention 1.
Fig. 3 is the flow chart of the bluetooth equipment long-range control method of the embodiment of the present invention 2.
Specific implementation mode
It is further illustrated the present invention below by the mode of embodiment, but does not therefore limit the present invention to the reality
It applies among a range.
Embodiment 1
The present embodiment provides a kind of bluetooth equipment tele-control systems, as shown in Figure 1, bluetooth equipment tele-control system packet
Include host side 1 and Bluetooth gateway 2;Host side 1 is used to communicate with external bluetooth equipment 3 by Bluetooth gateway 2;
Host side includes bluetooth applications program 101, virtual bluetooth protocol stack 102, first network module 103 and the second bluetooth
Module 104, Bluetooth gateway 2 include the second network module 201 and the first bluetooth module 202.
Bluetooth applications program 101 is for judging external bluetooth equipment 3 whether within the scope of short-range communication, if so, passing through
Second bluetooth module 104 is communicated with external bluetooth equipment 3, if it is not, then being communicated with external bluetooth equipment 3 by Bluetooth gateway 2.
When bluetooth applications program 101 judges that external bluetooth equipment 3 is within the scope of short-range communication, then pass through the second bluetooth mould
Block 104 is communicated with external bluetooth equipment 3.
Second bluetooth module 104 includes bluetooth protocol repertory API (application programming interface), bluetooth drive module and bluetooth
Hardware, bluetooth applications program 101 call bluetooth protocol repertory API to realize bluetooth equipment discovery procedure, equipment connection procedure, communicated
The Bluetooth functions such as journey (send instruction to external bluetooth equipment, obtain bluetooth equipment data).Bluetooth protocol repertory API then calls bluetooth
The related interface of drive module sends out various types of communication instruction to bluetooth hardware, executes specific corresponding action with blue with outside
Tooth equipment 3 communicates.
When the judgement of bluetooth applications program 101 does not search external bluetooth equipment 3, bluetooth applications program 101 is for leading to
Bluetooth gateway 2 is crossed to communicate with external bluetooth equipment 3:
First network module 103 with the second network module 201 for communicating;
Bluetooth applications program 101 is for sending Bluetooth control commands to virtual bluetooth protocol stack 102, virtual bluetooth protocol stack
102 for sending Bluetooth control commands to first network module 103;Wherein, Bluetooth control commands include that bluetooth discovery, bluetooth are matched
To at least one of, bluetooth connection and Bluetooth communication, more specifically, Bluetooth control commands include call method title and ginseng
Number.
First network module 103 is for sending Bluetooth control commands to the second network module 201;
Second network module 201 is for calling the first bluetooth module 202 to execute Bluetooth control commands, the first bluetooth module
202 according to Bluetooth control commands with external bluetooth equipment 3 for communicating.
First bluetooth module 202 includes bluetooth protocol repertory API, bluetooth drive module and bluetooth hardware, the second network module
201 for call bluetooth protocol repertory API realize the discovery procedure of external bluetooth equipment 3, equipment connection procedure, communication process (to
External bluetooth equipment sends instruction, obtains external bluetooth equipment data) etc. Bluetooth functions.Bluetooth protocol repertory API then calls bluetooth
The related interface of drive module sends out various types of communication instruction to bluetooth hardware, executes specific corresponding action with blue with outside
Tooth equipment 3 communicates.
First bluetooth module 202 is used to the result after execution Bluetooth control commands being sent to the second network module 201;
Second network module 201 is for sending result to first network module 103;
First network module 103 is used to that result to be sent to bluetooth applications program 101 by virtual bluetooth protocol stack 102;
Bluetooth applications program 101 is for receiving and processing result.
First network module and the second network module in the present embodiment may include using TCP/IP (network communication protocol)
The internet of agreement may also comprise but be not limited to LAN, (a kind of permission electronic equipment is connected to a wireless local to Wi-Fi
The technology of net) wireless network or GPRS/3G/4G/5G (being the one mode of network insertion) mobile Internet etc.;The present embodiment
In, the agreement of network module uses TCP/IP procotols.
Virtual bluetooth protocol stack 102 is the simulated implementation to standard bluetooth protocol stack, functionally sees that it is fully equivalent to
Standard bluetooth protocol stack is also fully equivalent to standard bluetooth protocol stack API based on the API that virtual bluetooth protocol stack 102 encapsulates.
Unlike, in this case, virtual bluetooth protocol stack 102 no longer directly invokes bluetooth drive module, and only by bluetooth
The Bluetooth control commands of application program 101 by TCP/IP network transmissions to the Bluetooth gateway 2 of distal end, by the Bluetooth gateway of distal end
2 execute realization standard bluetooth protocol stack API, and return value then can be returned to virtual bluetooth protocol stack by the latter by TCP/IP networks
102, then bluetooth applications program 101 is returned to by virtual bluetooth protocol stack 102.
The combination of host side 1 plus Bluetooth gateway 2 can both have been realized traditional close between host side 1 and outside bluetooth equipment 3
Apart from interactive mode, long-range interactive mode can also be realized, but bluetooth applications program is general, when host side does not include indigo plant
When tooth module or direct communications range beyond external bluetooth equipment, the bluetooth between bluetooth applications program and distal end bluetooth equipment
The interaction of control command can also be indirectly by virtual bluetooth protocol stack, the TCP/ of the TCP/IP networks of host side, Bluetooth gateway
IP network carries out transparent transmission to the Bluetooth control commands that bluetooth applications program is sent out, and the bluetooth module to be sent to Bluetooth gateway executes
Bluetooth control commands, to ensure that the compatibility of bluetooth applications program, without to bluetooth applications program again customized development.
The API approach of virtual bluetooth protocol stack is realized in the present embodiment using the mode of remote procedure call (RPC).It will be by
The method name and parameter of calling pass through Bluetooth gateway after TCP/IP networks fluidisation, and the second network module of Bluetooth gateway exists
After receiving the title of called method, parameter, the API approach in standard bluetooth protocol stack is called, and by the result of acquisition through the
Two network modules return to virtual bluetooth protocol stack by first network module, and bluetooth applications are transmitted to by virtual bluetooth protocol stack
Program.
Far call can be two-way.Virtual bluetooth protocol stack calls Bluetooth gateway, Bluetooth gateway that can also call indigo plant
The call back function of tooth application program setting, concrete implementation are that a unified callback interface is arranged in Bluetooth gateway, it will ginseng
Number passes through virtual bluetooth protocol stack, and the call back function that virtual bluetooth protocol stack recalls the setting of bluetooth applications program will be corresponding
Returned data is sent to bluetooth applications program.
About the foundation of virtual bluetooth protocol stack, only retain the whole based on standard bluetooth protocol stack called for application layer
The name of API structures, i.e. API, parameter and return value are consistent with the API of standard bluetooth protocol stack.Virtual bluetooth protocol stack
API never call bluetooth drive module and bluetooth hardware, not with bluetooth drive module direct interaction, and will can directly call virtual
Each API approach of bluetooth protocol repertory is by being packaged the Bluetooth gateway execution for encapsulating and passing to distal end by TCP/IP networks.
Bluetooth gateway end by TCP/IP network modules receive that host side sends out include Bluetooth control commands message
Afterwards, the standard bluetooth protocol stack in Bluetooth gateway is called to execute corresponding Bluetooth control commands.
RPC is highly developed, a large amount of maturation RPC products or realization has occurred.As famous RPC realizes that frame has
A kind of Java (Object-Oriented Programming Language) RMI (remote method call), (Alibaba increases income out Alibaba Dubbo
One distributed service framework), Apache Thrift (the RPC communication frame across language that Facebook increases income), Google
(Twitter is based on Netty by GRPC (high-performance that Google increases income, the RPC frames across language), Twitter Finagle
The RPC frames that the support of exploitation is fault-tolerant, agreement is unrelated) etc..These products or frame superior performance apply ten in internet
Divide extensive.
As to how realizing that remote interface calls, as embodiment, the RMI frames of Java can be utilized.Wherein such as Fig. 2
RMI clients inquire the registered available long-range method of RMI server-sides from RMI registers, then call on RMI stub
Method, the title of the method for calling, parameter by TCP/IP networks pass to RMI skeleton by RMI stub after being packaged,
RMI skeleton obtain called method and parameter after unpacking, and then call the side called accordingly in RMI server-sides
Method.RMI clients are attached with RMI server-sides by TCP/IP networks.
Scene is called specific to the bluetooth remote of the present embodiment, virtual bluetooth protocol stack and first network module are equivalent to
RMI stub, the second network module are equivalent to RMI skeleton, and the bluetooth applications program of host side is equivalent to RMI clients,
First bluetooth module is equivalent to RMI server-sides.Specific work process is as follows:
API approach in the bluetooth applications routine call virtual bluetooth protocol stack of host side;RMI stub (i.e. virtual bluetooths
Protocol stack) API approach (variable and method name) is packaged, bluetooth is then sent to by TCP/IP networks (first network module)
The RMI skeleton (i.e. the second network module) of gateway;The API approach that RMI skeleton send RMI stub unpacks,
Parse called method, parameter and object where this method;RMI skeleton call corresponding in the first bluetooth module
Method, and implementing result is returned into RMI skeleton, implementing result is packaged and delivered to RMI by RMI skeleton
Stub, RMI stub are unpacked to obtain implementing result and implementing result are returned to bluetooth applications program.
By taking bluetooth 4.0Android platform hosts end executes bluetooth scanning as an example.
The API of the bluetooth applications routine call of host side BluetoothAdapter carries out the operation of device scan:
Wherein BluetoothAdapter.LeScanCallback is that monitoring for host side bluetooth applications program setting is swept
The class of result is retouched, this class realizes call back function onLeScan ().
After bluetooth applications routine call startLeScan () method of host side, RMI stub are to RMI registry queries
It is no that there are this method.And if so, by parameter BluetoothAdapter.LeScanCallback and method name
StartLeScan () is packaged and delivered to RMI skeleton.After RMI skeleton are unpacked, adjusted after finding corresponding method
RMI stub are returned to and by return value packing, there are the required values of readjustment onLeScan () in return value;RMI stub solutions
The bluetooth applications program of host side, including readjustment LeScanCallback.onLeScan () are returned to after packet.
The API approach of packing is transmitted in transmission process in the form of Java object.The remote transmission of Java object is necessary
Serializing, i.e. Java object need to inherit Serializable.By taking startLeScan () this API approach as an example, RMI
Return value is serialized in a manner of ScanCallBack objects and returns to RMI stub by skeleton.
After RMI stub receive the ScanCallBack objects of RMI skeleton passbacks, corresponding device is therefrom extracted
(equipment), rssi (signal strength), scanRecord (broadcast data) attribute call the setting of bluetooth applications program program
LeScanCallback.onLeScan (), to make bluetooth applications program program obtain aforementioned scanning result.
The present embodiment can lead to effectively by the method and parameter involved by TCP/IP network transmission virtual bluetooth protocol stacks
TCP/IP network transmissions are crossed to the standard bluetooth protocol stack in the Bluetooth gateway of distal end, and then are transferred to bluetooth drive module, bluetooth
Hardware.This can make operating distance between bluetooth applications program, bluetooth equipment be extended to TCP/IP from traditional several meters, tens meters
The accessible distance of network, such as tens kilometers or even thousands of kilometers realize bluetooth applications program to external bluetooth equipment
Remote control and data acquisition.
Host side can remotely be set by Bluetooth gateway and external bluetooth in the bluetooth equipment tele-control system of the present embodiment
It is standby to carry out communication interaction so that the data transmission distance between host side and external bluetooth equipment is unrestricted, can also short range
Communication interaction is directly directly carried out with external bluetooth equipment by the bluetooth module of host side so that the application range of bluetooth equipment
More extensively.
Embodiment 2
The present embodiment provides a kind of bluetooth equipment long-range control method, bluetooth equipment long-range control method is based on such as embodiment
Bluetooth equipment tele-control system in 1 is realized.As shown in figure 3, bluetooth equipment long-range control method includes:
Step 300, bluetooth applications program judge external bluetooth equipment whether within the scope of short-range communication, if so, executing
Step 301;If it is not, thening follow the steps 302;
Step 301, bluetooth applications program pass through the second bluetooth module and external bluetooth devices.
Second bluetooth module includes that bluetooth protocol repertory API (application programming interface), bluetooth drive module and bluetooth are hard
Part, bluetooth call bluetooth protocol repertory API to realize bluetooth equipment discovery procedure, equipment connection procedure, communication process (to external bluetooth
Equipment sends instruction, obtains bluetooth equipment data) etc. Bluetooth functions.Bluetooth protocol repertory API then calls having for bluetooth drive module
Close interface, various types of communication instruction sent out to bluetooth hardware, execute specific corresponding action with external bluetooth devices.
Step 302, bluetooth applications program pass through Bluetooth gateway and external bluetooth devices.
Step 302 includes:
Step 3021, first network module are communicated with the second network module;
First network module and the second network module in the present embodiment may include the internet using ICP/IP protocol,
It may include but be not limited to LAN, Wi-Fi wireless networks or GPRS/3G/4G/5G mobile Internets etc.;In the present embodiment, network
The agreement of module uses TCP/IP procotols..
Step 3022, bluetooth applications program send Bluetooth control commands to virtual bluetooth protocol stack, virtual bluetooth protocol stack
Bluetooth control commands are sent to first network module;Bluetooth control commands include bluetooth discovery, Bluetooth pairing, bluetooth connection and indigo plant
At least one of tooth communication, Bluetooth control commands include call method title and parameter.
Step 3023, first network module send Bluetooth control commands to the second network module;
Step 3024, the second network module call the first bluetooth module to execute Bluetooth control commands, the first bluetooth module root
According to Bluetooth control commands and external bluetooth devices.
First bluetooth module includes bluetooth protocol repertory API, bluetooth drive module and bluetooth hardware, and the second network module is used for
The discovery procedure of bluetooth equipment, equipment connection procedure, communication process are (to external bluetooth outside the API realizations of calling bluetooth protocol repertory
Equipment sends instruction, obtains external bluetooth equipment data) etc. Bluetooth functions.Bluetooth protocol repertory API then calls bluetooth drive module
Related interface, send out various types of communication instruction to bluetooth hardware, execute specific corresponding action with logical with external bluetooth equipment
Letter.
Result after executing Bluetooth control commands is sent to the second network module by step 3025, the first bluetooth module;
Step 3026, the second network module send result to first network module;
Result is sent to bluetooth applications program by step 3027, first network module by virtual bluetooth protocol stack;
Step 3028, bluetooth applications program receive and process result.
Virtual bluetooth protocol stack is the simulated implementation to the bluetooth protocol repertory of standard, functionally sees that it is fully equivalent to mark
Accurate bluetooth protocol repertory is also fully equivalent to the bluetooth protocol repertory API of standard based on the API of virtual bluetooth protocol stack encapsulation.No
With, in this case, virtual bluetooth protocol stack no longer directly invokes bluetooth drive module, and only by bluetooth applications journey
The Bluetooth control commands of sequence, to the Bluetooth gateway of distal end, are executed by the Bluetooth gateway of distal end by TCP/IP network transmissions and realize mark
Return value then can be returned to virtual bluetooth protocol stack by accurate bluetooth protocol repertory API, the latter by TCP/IP networks, then by virtual
Bluetooth protocol repertory returns to bluetooth applications program.
Host side adds the combination of Bluetooth gateway that can both realize traditional short distance between host side and external bluetooth equipment
Interactive mode can also realize long-range interactive mode, but bluetooth applications program is general, when host side does not include bluetooth mould
When block or direct communications range beyond bluetooth equipment, the Bluetooth control commands between bluetooth applications program and distal end bluetooth equipment
Interaction can also by virtual bluetooth protocol stack, the TCP/IP networks of host side, Bluetooth gateway TCP/IP networks to bluetooth
The Bluetooth control commands that application program is sent out carry out transparent transmission, and the bluetooth module to be sent to Bluetooth gateway executes Bluetooth control life
It enables, to ensure that the compatibility of bluetooth applications program, without to bluetooth applications program again customized development.
The API approach of virtual bluetooth protocol stack is realized in the present embodiment using the mode of remote procedure call (RPC).It will be by
The method name and parameter of calling pass through Bluetooth gateway after TCP/IP networks fluidisation, and the second network module of Bluetooth gateway exists
After receiving called method name and parameter, the API approach in standard bluetooth protocol stack is called, and by the result of acquisition through the
Two network modules return to virtual bluetooth protocol stack by first network module, and bluetooth applications are transmitted to by virtual bluetooth protocol stack
Program.
Far call can be two-way.Virtual bluetooth protocol stack calls Bluetooth gateway, Bluetooth gateway that can also call indigo plant
The call back function of tooth application program setting, concrete implementation are that a unified callback interface is arranged in Bluetooth gateway, it will ginseng
Number passes through virtual bluetooth protocol stack, and the call back function that virtual bluetooth protocol stack recalls the setting of bluetooth applications program will be corresponding
Returned data is sent to bluetooth applications program.
About the foundation of virtual bluetooth protocol stack, only retain the whole based on standard bluetooth protocol stack called for application layer
The name of API structures, i.e. API, parameter and return value are consistent with the API of standard bluetooth protocol stack.Virtual bluetooth protocol stack
API never call bluetooth drive module and bluetooth hardware, not with bluetooth drive module direct interaction, and will can directly call virtual
Each API approach of bluetooth protocol repertory is encapsulated by being packaged, and the Bluetooth gateway execution of distal end is passed to by TCP/IP networks.
Bluetooth gateway end by TCP/IP network modules receive that host side sends out include Bluetooth control commands message
The standard bluetooth protocol stack in Bluetooth gateway is called to execute corresponding Bluetooth control commands afterwards.
RPC is highly developed, a large amount of maturation RPC products or realization has occurred.As famous RPC realizes that frame has
A kind of Java (Object-Oriented Programming Language) RMI (remote method call), (Alibaba increases income out Alibaba Dubbo
One distributed service framework), Apache Thrift (the RPC communication frame across language that Facebook increases income), Google
(Twitter is based on Netty by GRPC (high-performance that Google increases income, the RPC frames across language), Twitter Finagle
The RPC frames that the support of exploitation is fault-tolerant, agreement is unrelated) etc..These products or frame superior performance apply ten in internet
Divide extensive.
As to how realizing that remote interface calls, as embodiment, the RMI frames of Java can be utilized.As shown in Fig. 2,
Wherein RMI clients inquire the registered available long-range method of RMI server-sides from RMI registers, then call RMI
Method on stub, RMI stub will pass to RMI after the title of the method for calling, parameter packing by TCP/IP networks
Skeleton, RMI skeleton obtain called method and parameter after unpacking, and then call corresponding in RMI server-sides
The method of calling.RMI clients are attached with RMI server-sides by TCP/IP networks.
Scene, virtual bluetooth protocol stack is called to be equivalent to RMI stub, the second net specific to the bluetooth remote of the present embodiment
Network module is equivalent to RMI skeleton, and the bluetooth applications program of host side is equivalent to RMI clients, and the first bluetooth module is suitable
In RMI server-sides.Specific work process is as follows:
API approach in the bluetooth applications routine call virtual bluetooth protocol stack of host side;RMI stub (i.e. virtual bluetooths
Protocol stack) API approach (variable and method name) is packaged, bluetooth is then sent to by TCP/IP networks (first network module)
The RMI skeleton (i.e. the second network module) of gateway;The API approach that RMI skeleton send RMI stub unpacks,
Parse called method, parameter and object where this method;RMI skeleton call corresponding in the first bluetooth module
Method, and implementing result is returned into RMI skeleton, implementing result is packaged and delivered to RMI by RMI skeleton
Stub, RMI stub are unpacked to obtain implementing result and implementing result are returned to bluetooth applications program.
By taking bluetooth 4.0Android platform hosts end executes bluetooth scanning as an example.
The API of the bluetooth applications routine call of host side BluetoothAdapter carries out the operation of device scan:
Wherein BluetoothAdapter.LeScanCallback is that monitoring for host side bluetooth applications program setting is swept
The class of result is retouched, this class realizes call back function onLeScan ().
After bluetooth applications routine call startLeScan () method of host side, RMI stub are to the inquiry of RMI registers
It is no that there are this method.And if so, by parameter BluetoothAdapter.LeScanCallback and method name
StartLeScan () is packaged and delivered to RMI skeleton.After RMI skeleton are unpacked, adjusted after finding corresponding method
RMI stub are returned to and by return value packing, there are the required values of readjustment onLeScan () in return value;RMI stub solutions
The bluetooth applications program of host side, including readjustment LeScanCallback.onLeScan () are returned to after packet.
The API approach of packing is transmitted in transmission process in the form of Java object.The remote transmission of Java object is necessary
Serializing, i.e. Java object need to inherit Serializable.By taking startLeScan () this API approach as an example, RMI
Return value is serialized in a manner of ScanCallBack objects and returns to RMI stub by skeleton.
After RMI stub receive the ScanCallBack objects of RMI skeleton passbacks, corresponding device is therefrom extracted
(equipment), rssi (signal strength), scanRecord (broadcast data) attribute call the setting of bluetooth applications program program
LeScanCallback.onLeScan (), to make bluetooth applications program program obtain aforementioned scanning result.
The present embodiment can lead to effectively by the method and parameter involved by TCP/IP network transmission virtual bluetooth protocol stacks
TCP/IP network transmissions are crossed to the standard bluetooth protocol stack in the Bluetooth gateway of distal end, and then are transferred to bluetooth drive module, bluetooth
Hardware.This can make operating distance between bluetooth applications program, bluetooth equipment be extended to TCP/IP from traditional several meters, tens meters
The accessible distance of network, such as tens kilometers or even thousands of kilometers realize bluetooth applications program to external bluetooth equipment
Remote control and data acquisition.
Host side can remotely be set by Bluetooth gateway and external bluetooth in the bluetooth equipment long-range control method of the present embodiment
It is standby to carry out communication interaction so that the data transmission distance between host side and external bluetooth equipment is unrestricted, can also short range
Communication interaction is directly directly carried out between external bluetooth equipment by the bluetooth module of host side so that the application of bluetooth equipment
Range is more extensive.
Although specific embodiments of the present invention have been described above, it will be appreciated by those of skill in the art that this is only
For example, protection scope of the present invention is to be defined by the appended claims.Those skilled in the art without departing substantially from
Under the premise of the principle and substance of the present invention, many changes and modifications may be made, but these change and
Modification each falls within protection scope of the present invention.
Claims (10)
1. a kind of bluetooth equipment tele-control system, which is characterized in that the bluetooth equipment tele-control system includes host side
And Bluetooth gateway;The host side is used for through the Bluetooth gateway and external bluetooth devices;
The host side includes bluetooth applications program, virtual bluetooth protocol stack and first network module, and the Bluetooth gateway includes
Second network module and the first bluetooth module;
The first network module with second network module for communicating;
The bluetooth applications program is for sending Bluetooth control commands to the virtual bluetooth protocol stack, the virtual bluetooth agreement
Stack is for sending the Bluetooth control commands to the first network module;
The first network module is for sending the Bluetooth control commands to second network module;
Second network module is for calling first bluetooth module to execute the Bluetooth control commands, first bluetooth
Module is used for according to the Bluetooth control commands and the external bluetooth devices.
2. bluetooth equipment tele-control system as described in claim 1, which is characterized in that the Bluetooth control commands include indigo plant
At least one of tooth search, Bluetooth pairing, bluetooth connection and Bluetooth communication.
3. bluetooth equipment long-range control method as described in claim 1, which is characterized in that the Bluetooth control commands include adjusting
With method name and parameter.
4. bluetooth equipment tele-control system as described in claim 1, which is characterized in that the host side further includes the second indigo plant
Tooth module, the bluetooth applications program is for judging the external bluetooth equipment whether within the scope of short-range communication, if so, logical
Second bluetooth module and the external bluetooth devices are crossed, if it is not, then passing through the Bluetooth gateway and the external indigo plant
Tooth equipment communicates.
5. bluetooth equipment tele-control system as described in claim 1, which is characterized in that first bluetooth module is used for will
It executes the result after the Bluetooth control commands and is sent to second network module;
Second network module is for sending the result to the first network module;
The first network module is used to that the result to be sent to the bluetooth applications journey by the virtual bluetooth protocol stack
Sequence;
The bluetooth applications program is for receiving and processing the result.
6. a kind of bluetooth equipment long-range control method, which is characterized in that the bluetooth equipment long-range control method is based on such as right
It is required that the bluetooth equipment tele-control system described in 1-5 any one is realized;
The bluetooth equipment long-range control method includes:
S1, the first network module are communicated with second network module;
S2, the bluetooth applications program send Bluetooth control commands to the virtual bluetooth protocol stack, the virtual bluetooth agreement
Stack sends the Bluetooth control commands to the first network module;
S3, the first network module send the Bluetooth control commands to second network module;
S4, second network module call first bluetooth module to execute the Bluetooth control commands, first bluetooth
Module is according to the Bluetooth control commands and the external bluetooth devices.
7. bluetooth equipment tele-control system as claimed in claim 6, which is characterized in that the Bluetooth control commands include indigo plant
At least one of tooth search, Bluetooth pairing, bluetooth connection and Bluetooth communication.
8. bluetooth equipment long-range control method as claimed in claim 6, which is characterized in that the Bluetooth control commands include adjusting
With method name and parameter.
9. bluetooth equipment tele-control system as claimed in claim 6, which is characterized in that when the host side includes second blue
When tooth module, the bluetooth applications program judges the external bluetooth equipment whether within the scope of short-range communication, if so, passing through
Second bluetooth module and the external bluetooth devices, if it is not, then passing through the Bluetooth gateway and the external bluetooth
Equipment communicates.
10. bluetooth equipment tele-control system as claimed in claim 6, which is characterized in that the bluetooth equipment remote control
Method further includes:
Result after executing the Bluetooth control commands is sent to second network module by S5, first bluetooth module;
S6, second network module send the result to the first network module;
The result is sent to the bluetooth applications journey by S7, the first network module by the virtual bluetooth protocol stack
Sequence;
S8, the bluetooth applications program receive and process the result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810284191.7A CN108616855A (en) | 2018-04-02 | 2018-04-02 | Bluetooth equipment tele-control system and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810284191.7A CN108616855A (en) | 2018-04-02 | 2018-04-02 | Bluetooth equipment tele-control system and method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108616855A true CN108616855A (en) | 2018-10-02 |
Family
ID=63659397
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810284191.7A Pending CN108616855A (en) | 2018-04-02 | 2018-04-02 | Bluetooth equipment tele-control system and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108616855A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111427617A (en) * | 2019-01-09 | 2020-07-17 | 阿里巴巴集团控股有限公司 | Data processing method, device and equipment |
CN112929863A (en) * | 2021-02-25 | 2021-06-08 | 浙江大华技术股份有限公司 | Bluetooth information transmission method, and remote control method and device of intelligent door lock |
CN113395293A (en) * | 2021-07-13 | 2021-09-14 | 上海睿赛德电子科技有限公司 | RPC-based network socket implementation method |
WO2023088198A1 (en) * | 2021-11-17 | 2023-05-25 | 维沃移动通信有限公司 | Network connection method and apparatus, and electronic device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105978606A (en) * | 2016-07-22 | 2016-09-28 | 青岛海信电器股份有限公司 | Remote communication method for Bluetooth device, Bluetooth device and client |
US20170109726A1 (en) * | 2015-10-15 | 2017-04-20 | Yuexi CHEN | Bridge device for linking wireless protocols |
CN106604204A (en) * | 2016-11-03 | 2017-04-26 | 惠州Tcl移动通信有限公司 | Remote Bluetooth terminal application control method and system |
CN107453970A (en) * | 2017-09-25 | 2017-12-08 | 四川长虹电器股份有限公司 | The intelligent home control system of home gateway and method are used as using smart mobile phone |
CN107508919A (en) * | 2017-09-29 | 2017-12-22 | 珠海市领创智能物联网研究院有限公司 | A kind of electrical appliances intelligent control method based on smart mobile phone |
CN206894673U (en) * | 2017-06-30 | 2018-01-16 | 广州创想健康信息科技有限公司 | Server, gateway and system that bluetooth peripheral hardware remotely accesses are provided |
-
2018
- 2018-04-02 CN CN201810284191.7A patent/CN108616855A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170109726A1 (en) * | 2015-10-15 | 2017-04-20 | Yuexi CHEN | Bridge device for linking wireless protocols |
CN105978606A (en) * | 2016-07-22 | 2016-09-28 | 青岛海信电器股份有限公司 | Remote communication method for Bluetooth device, Bluetooth device and client |
CN106604204A (en) * | 2016-11-03 | 2017-04-26 | 惠州Tcl移动通信有限公司 | Remote Bluetooth terminal application control method and system |
CN206894673U (en) * | 2017-06-30 | 2018-01-16 | 广州创想健康信息科技有限公司 | Server, gateway and system that bluetooth peripheral hardware remotely accesses are provided |
CN107453970A (en) * | 2017-09-25 | 2017-12-08 | 四川长虹电器股份有限公司 | The intelligent home control system of home gateway and method are used as using smart mobile phone |
CN107508919A (en) * | 2017-09-29 | 2017-12-22 | 珠海市领创智能物联网研究院有限公司 | A kind of electrical appliances intelligent control method based on smart mobile phone |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111427617A (en) * | 2019-01-09 | 2020-07-17 | 阿里巴巴集团控股有限公司 | Data processing method, device and equipment |
CN111427617B (en) * | 2019-01-09 | 2023-05-30 | 斑马智行网络(香港)有限公司 | Data processing method, device and equipment |
CN112929863A (en) * | 2021-02-25 | 2021-06-08 | 浙江大华技术股份有限公司 | Bluetooth information transmission method, and remote control method and device of intelligent door lock |
CN113395293A (en) * | 2021-07-13 | 2021-09-14 | 上海睿赛德电子科技有限公司 | RPC-based network socket implementation method |
CN113395293B (en) * | 2021-07-13 | 2023-09-15 | 上海睿赛德电子科技有限公司 | Network socket realizing method based on RPC |
WO2023088198A1 (en) * | 2021-11-17 | 2023-05-25 | 维沃移动通信有限公司 | Network connection method and apparatus, and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108616855A (en) | Bluetooth equipment tele-control system and method | |
CN102497630B (en) | Machine to machine (M2M) equipment, method for realizing service, intelligent card and communication module | |
CN101986648B (en) | Negotiation method, device and network device of TCP option | |
KR20180034554A (en) | (S) Select MTC service on GI-LAN | |
CN102447627B (en) | Message encapsulation/decapsulation device and method | |
DE102022202963A1 (en) | TRAFFIC SPLITTING AND RETRANSMITTING MECHANISMS WITH CROSS-SHIFT AND CROSS-ACCESS TECHNOLOGY | |
CN104519129A (en) | Data transmission method, device and system | |
CN110752966A (en) | Network protocol security test method and device, electronic equipment and storage medium | |
CN108183855A (en) | The design method of smart home home gateway software architecture based on Internet of Things | |
CN112491588A (en) | Management method and system for equipment in 230M power Internet of things | |
CN102315981A (en) | Equipment and method for testing evolved packet core network equipment | |
CN109696867A (en) | Method, user terminal and the GNSS device management system of user terminal processes GNSS device data | |
CN107798067A (en) | Suitable for the database normalization storage system and method for polytypic satellite test | |
CN103795729A (en) | Unified device control method based on multiple protocols | |
CN108848569B (en) | Mobile self-organizing network resource sharing system based on Netty communication | |
CN110958590A (en) | Heterogeneous equipment integration system based on multi-protocol edge computing gateway | |
CN110933114A (en) | Configuration parameter management method, device, storage medium and control terminal | |
CN107911157B (en) | Universal satellite command automation technology data processing system and method | |
CN103457645B (en) | A kind of method of being carried out industrial equipment maintenance on post by blue tooth wireless technology | |
CN101453741A (en) | Method and system for mobile terminal data service debugging | |
CN107925630A (en) | Communication strategy control in machine-to-machine communication system | |
CN104935490A (en) | Mobile internet terminal accessing apparatus based on cloud virtual machine | |
KR101898486B1 (en) | Information collection and analysis system for industrial network monitor and remote control | |
CN213484894U (en) | Internet of things gateway capable of being connected with multiple data platforms simultaneously | |
CN106408773A (en) | Electricity meter using Internet of Things sensing module with information processing |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20181002 |
|
WD01 | Invention patent application deemed withdrawn after publication |