CN107231605B - The method with Bluetooth communication compatibility between flash memory IoT equipment and Android device of solution - Google Patents

The method with Bluetooth communication compatibility between flash memory IoT equipment and Android device of solution Download PDF

Info

Publication number
CN107231605B
CN107231605B CN201710485913.0A CN201710485913A CN107231605B CN 107231605 B CN107231605 B CN 107231605B CN 201710485913 A CN201710485913 A CN 201710485913A CN 107231605 B CN107231605 B CN 107231605B
Authority
CN
China
Prior art keywords
connection
module
equipment
connecting quantity
parameter
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
CN201710485913.0A
Other languages
Chinese (zh)
Other versions
CN107231605A (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.)
New Cloud Technology Group Co ltd
Original Assignee
Central South University
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 Central South University filed Critical Central South University
Priority to CN201710485913.0A priority Critical patent/CN107231605B/en
Publication of CN107231605A publication Critical patent/CN107231605A/en
Application granted granted Critical
Publication of CN107231605B publication Critical patent/CN107231605B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Abstract

The invention discloses a kind of method of the solution with Bluetooth communication compatibility between flash memory IoT equipment and Android device, it is therefore an objective to provide a kind of compatible method for solving Bluetooth communication between IoT equipment and different vendor's Android device with flash.Technical solution be design one by IoT equipment use by initialization module, parameter updating request module and parameter update the flash memory compatible modules of processing module composition, so that IoT equipment is sent Connecting quantity to main equipment and updates request, the negotiation of parameter is attached with Android device, the Connecting quantity progress Bluetooth communication for meeting IoT equipment flash requirement can be used in IoT equipment and Android device, so that IoT equipment is when carrying out Bluetooth communication with Android device, it is not in because Connecting quantity is improper, make IoT equipment to flash operation without the phenomenon that having handled and bluetooth is caused to frequently cut off, completely solve Bluetooth communication compatibility issue between IoT equipment and Android device.

Description

The method with Bluetooth communication compatibility between flash memory IoT equipment and Android device of solution
Technical field
The present invention relates to Bluetooth communication fields, more particularly to a kind of IoT for having flash (flash memory, generally as external memory) (Internet of Things, Internet of Things) Bluetooth communication compatibility solution between equipment and Android device.
Background technique
With the development of IoT technology, the industry using IoT technology is more and more, including manufactures industry, consumer electronics Industry, medical treatment & health industry etc..The development of IoT develops our life towards more automation, intelligentized direction, gives life band Carry out bigger convenience, it is following to become a part indispensable in our lives.The network that IoT is connected as object object, nothing Line communication technology is particularly significant, bluetooth with its inexpensive, it is low in energy consumption the features such as become a kind of nothing that IoT equipment more welcomes Line communication protocol.However, there are some compatibility issues also to hinder its development to a certain degree for bluetooth, and such as: connection cannot The problems such as establishing, disconnecting often, these problems become one of the emphasis of Bluetooth domain research.
There is bluetooth module in IoT equipment, bluetooth module can be attached with Android device by bluetooth, at Android device end IoT equipment is managed, is supervised, data analysis etc..General IoT equipment is used as from equipment, and Android device is as main equipment, example Such as: wearable smartwatch is managed wrist-watch by Android mobile phone.But at present with flash IoT equipment be used as from When carrying out Bluetooth communication between equipment and Android device, need to carry out flash erasable operation and serious compatibility is caused to be asked Topic, bluetooth compatibility issue is more significant especially in software development process.The compatibility issue of Bluetooth communication refers to, has The IoT equipment of flash can only carry out stable Bluetooth communication with the Android device of certain particular vendor specific models, for some Android device, even with the operating system of identical version, under identical environment, the IoT equipment with flash with these When Android device carries out Bluetooth communication, it may appear that the phenomenon that bluetooth connection is unstable, frequently cuts off.Lead to the problem of this main original Because being: when IoT equipment and Android device carry out Bluetooth communication, main equipment is usually used as by Android device, IoT equipment as from Equipment, Bluetooth connection parameter are determined by main equipment (Android device), can only passively receive these connection ginsengs from equipment (IoT equipment) Number.Meanwhile when IoT equipment to flash carry out erasable operation when, due to erasable needs of the IoT equipment to flash it is certain when Between, cause IoT equipment to require the Connecting quantity of bluetooth connection event, if IoT equipment is to the erasable time BELAND of flash The connection interval (Connection Interval) of tooth connection event is long, may cause bluetooth connection event and is skipped, it is also possible to The access to flash is caused to be postponed.The Connecting quantity defined in Bluetooth protocol haves a wide reach, and each Android manufacturer is realizing indigo plant The Connecting quantity disunity defined when tooth function, therefore IoT equipment carries out the connection used when bluetooth connection from different Android devices Parameter disunity, the Connecting quantity for not being able to satisfy erasable operation of the IoT equipment to flash will cause bluetooth connection time-out or blue Tooth connection disconnects and causes compatibility issue.Lance between overcoming bluetooth connection interval and flash to store access it would therefore be desirable to have one kind The method of shield, thus solve bluetooth mutual communication exception between IoT equipment and different vendor's Android device with flash and generate Compatibility issue.The solution of relevant issues is not yet found from the data published at present.
One bluetooth connection event refers to the process of main equipment and from mutually sending data packet between equipment, main equipment and from Equipment is established after connection, and all data communications are carried out in connection event (Connection Events).Bluetooth A variety of connection events are defined in agreement, including event is established in connection, Connecting quantity updates request event, Connecting quantity updates Event and some user's customized events etc..Although being defined in Bluetooth protocol a variety of different to realize different functions Event, but in the realization of bluetooth applications, some functions are not essential functions, i.e., are not that each connection event can all be answered With, such as Connecting quantity updates request event, this event is not all applied in most of bluetooth equipments, so that Connecting quantity only exists It is determined when establishing connection by main equipment.
Connecting quantity update event is the connection event initiated by main equipment, and Connecting quantity is determined by main equipment, from equipment It can only receive and use these Connecting quantities, or disconnect.If the Connecting quantity current from equipment desired modifications, can To initiate the connection parameter updating request event to main equipment.Connecting quantity updates request event and is only used for sending out from equipment to main equipment It send, if the event is sent by main equipment, a mistake can be regarded as from equipment.Ginseng can be sent at any time from equipment Number updates request event, if the main equipment for receiving the connection event agrees to modification Connecting quantity, will return to Connecting quantity more New response events, carrying result parameter is " receiving ".Then, main equipment starts Connecting quantity update event.If main equipment is not Agree to update from the Connecting quantity of equipment and request, then sends the Connecting quantity that result parameter is " refusal " and update response events to refuse Request absolutely.From equipment, there are two selections at this time: receiving Connecting quantity currently in use or terminates connection.Currently, Android device When as main equipment, it can all receive to update from the Connecting quantity of equipment and request, to make to set with master from equipment (IoT equipment) The standby negotiation for being attached parameter main equipment and can be used full after initiating the connection parameter updating request from equipment from equipment Foot carries out Bluetooth communication from the Connecting quantity of equipment requirement.
Summary of the invention
The technical problem to be solved by the present invention is providing a kind of IoT equipment and different vendor's Android solved with flash The compatible method of equipment room Bluetooth communication guarantees that IoT equipment when carrying out bluetooth connection with different vendor's Android device, can have Effect supports the operation stored to IoT equipment to flash, and bluetooth is kept to be in connection status.
The technical scheme is that
For the exploitation of IoT equipment, design the flash memory compatible modules used by IoT equipment (i.e. from equipment), make from Equipment can be attached the negotiation of parameter with main equipment, to solve rushing between bluetooth connection interval and flash storage access Prominent problem.
Specific step is as follows:
The first step designs a flash memory compatible modules, is connected with the bluetooth module in IoT equipment, carries out in IoT equipment When connection event processing, negotiates Connecting quantity by flash memory compatible modules and Android device, meet Connecting quantity in IoT equipment The requirement of flash storage access.Flash memory compatible modules update processing mould by initialization module, parameter updating request module and parameter Block composition.
Initialization module updates processing module with parameter updating request module and parameter and is connected, and function is asked for parameter update Modulus block provides Connecting quantity, updates processing module for parameter and provides Connecting quantity and connection mode mark.
Connecting quantity includes connection interval (wishing that main equipment allows to send the frequency of data packet from equipment from equipment), from setting Standby retardation coefficient (can ignore that the maximum value of the connection event number of main equipment from equipment) and supervision time-out time are (from equipment The maximum time for keeping connecting there is no communication with main equipment).
There are three types of connection mode marks, i.e. unknown pattern mark, fast connection mode mark and connection mode mark at a slow speed, Respectively correspond unknown pattern, at a slow speed connection mode and fast connection mode.Unknown pattern mark refers to from the not no company of initiation of equipment The connection mode mark used when connecing parameter updating request;Fast connection mode mark is quickly connected from equipment to main equipment initiation The connection mode mark used after parameter updating request is connect, the connection interval of connection event is shorter at this time (only meets master-slave equipment Between normal communication Smallest connection interval) or it is smaller (being traditionally arranged to be 0) from equipment retardation coefficient, need to handle in bluetooth module When mass data, the treatment effeciency to connection event can be improved using fast connection mode between master-slave equipment;Connect at a slow speed Connecing mode flags is to initiate Connecting quantity at a slow speed to main equipment from equipment to update the connection mode mark used after request, Zhu Congshe When between standby using connection mode at a slow speed, Connecting quantity of the Connecting quantity relative to fast connection mode, between the connection of connection event Every it is longer or from equipment retardation coefficient it is larger, this mode can reduce from equipment processing bluetooth event frequency, thus reduce from The power consumption of equipment.As from the IoT equipment of equipment be generally battery power supply or charging it is more difficult, energy conservation it is very heavy to IoT equipment It wants, when bluetooth module does not have data to need to handle or have low volume data to need to handle, connection mode can reduce bluetooth at a slow speed The energy consumption of module.
Parameter updating request module is connected with initialization module and bluetooth module;Parameter updating request module is from bluetooth module It receives connection and establishes event or big data event (the customized connection event for needing to handle mass data of user), if received It is that event is established in connection, is that connection mode mark will if received is big data event at a slow speed by connection mode traffic sign placement Connection mode traffic sign placement is fast connection mode mark, and connection mode mark is sent to initialization module;Meanwhile parameter It updates request module and obtains Connecting quantity from initialization module, Connecting quantity is stored in after bluetooth module and sends company to bluetooth module Parameter updating request is connect, Connecting quantity is sent to main equipment from bluetooth module and updates request event, carry Connecting quantity.
Parameter updates processing module and is connected with initialization module and bluetooth module, and function is the company judged in initialization module It connects whether parameter is updated successfully, if success, keeps connection with new Connecting quantity, if unsuccessful, sent to bluetooth module Order is disconnected, disconnects bluetooth module with main equipment.Parameter updates processing module and obtains connection from initialization module Parameter and connection mode mark return to the Connecting quantity obtained from initialization module with the main equipment obtained from bluetooth module Connecting quantity is compared, if the connection that main equipment returns is spaced Smallest connection interval and most Dalian not in initialization module It connects in the range of being spaced and (is less than the Smallest connection interval in initialization module or is greater than maximum connection and be spaced), then to bluetooth mould Block transmission disconnects order, disconnects bluetooth module with main equipment, if the connection that main equipment returns is spaced in initialization Smallest connection interval in module (is more than or equal between the Smallest connection in initialization module in the range of connecting interval with maximum Every and less than or equal to maximum connection interval), then it is not processed, bluetooth module continues and main equipment keeps connecting.
Second step, initialization module initialization Connecting quantity and connection mode mark, connection mode mark are initialized as not Know mode, Connecting quantity is arranged by developer, and method is: connection interval can be the arbitrary value in 7.5ms~4s, but necessary For the integral multiple of 1.25ms;It can be 0~499 from equipment retardation coefficient range;Supervising time-out time range is 100ms~32s. Connection interval meets following formula from equipment delay and supervision this three of time-out time:
Supervise time-out time > (1+ from equipment retardation coefficient) × (connection interval) (formula one)
In view of the operation to flash, the time for wiping 4096 bytes (minimum erasure unit) is about 22ms, that is, is wiped Time is the integral multiple of 22ms, and the time for writing 256 bytes is about 13ms, when supervision time-out time is greater than 6 times of connection interval And connection is spaced when being greater than 60ms, it is relatively high to operate successful probability to flash storage as the IOT equipment from equipment.It is setting It must guarantee that IoT equipment has time enough to carry out erasable operation to flash in a bluetooth event when setting Connecting quantity, that is, connect It connects interval and is greater than the time operated to flash.
In order to have biggish probability to be received by main equipment in the parameter updating request initiated from equipment, one need to be arranged The value range at interval is connected, i.e. connection interval can be the arbitrary value in Smallest connection interval and maximum connection interval.Generally, IoT equipment bluetooth reception caching (a part in IoT device memory) is bigger, and Smallest connection interval is spaced with maximum connection will It is bigger, because receiving caching represents the ability that IoT equipment receives data volume in a bluetooth event, if a connection thing Data volume in part, which is equal to, receives caching, then by the time of these data write-in flash are as follows: bluetooth receives cache size (unit For byte) ÷ 256 × 13, unit is that millisecond (such as receives caching when be 1KB, writes the time of flash as 52ms), these are counted According to the time of erasing are as follows:Unit is millisecond;It indicates to reality It is rounded on number x.(such as receive caching be 1KB when, wipe flash time be 22ms).So receiving company when caching is 1KB It connects interval and is greater than 22+52=74ms.
The IOT equipment that caching is n KB is received for bluetooth, parameter setting preferred method is when connection mode at a slow speed: most Small connection interval is greater than (÷ of n × 1,024 256 × 13)+(n ÷ 4+1) × 22 (ms) and meets the integral multiple of 1.25ms;Most Dalian Smallest connection interval+20ms is divided between connecing;It is greater than 1 from the value of equipment retardation coefficient;Time-out time is supervised to meet in supervision time-out At least to 6 chances listened to are reserved from equipment in time, i.e., (from equipment retardation coefficient+1) × 6 × connection interval < it supervises super When the time.Parameter setting preferred method is when fast connection mode: from equipment retardation coefficient be 0, other Connecting quantities at a slow speed Connection mode is identical.
For example, the IoT equipment used bluetooth receive caching for 1K when, at a slow speed when connection mode parameter setting can such as table 1, Parameter setting can be such as table 2 when fast connection mode.
The connection mode at a slow speed of table 1
Smallest connection interval Maximum connection interval From equipment retardation coefficient Supervise time-out time
80ms 100ms 2 4s
2 fast connection mode of table
Smallest connection interval Maximum connection interval From equipment retardation coefficient Supervise time-out time
80ms 100ms 0 4s
Third step receives the connection that main equipment is sent from the bluetooth module of equipment and establishes event or big data event, will even It connects the event of foundation or big data event is sent to parameter updating request module.
4th step, connection event is that event or big data thing are established in connection to parameter updating request module based on the received Part sends Connecting quantity to bluetooth module and updates request, and method is:
4.1 parameter updating request modules judge according to the connection status carried from the received connection event of bluetooth module from setting Whether standby bluetooth state is in connection mode.If connection status is invalid, updates and request without Connecting quantity, turn third Step;If connection status is effective, turn 4.2;
4.2 parameter updating request modules judge that the connection event received from bluetooth module is that event or big is established in connection Connection mode traffic sign placement is then connection mode mark at a slow speed, and will connect at a slow speed if event is established in connection by data event Mode flags are sent to initialization module;It is then fast connection mode mark by connection mode traffic sign placement if big data event Will, and fast connection mode mark is sent to initialization module;
4.3 parameter updating request modules read Connecting quantity from initialization module, and Connecting quantity is sent to bluetooth mould Block, method are: if parameter updating request module received from bluetooth module be connection establish event, from initialization module read It takes the Connecting quantity of connection mode at a slow speed and is sent to bluetooth module;If parameter updating request module is received from bluetooth module It is big data event, then reads the Connecting quantity of fast connection mode from initialization module and be sent to bluetooth module;
4.4 parameter updating request modules send Connecting quantity to bluetooth module and update request, Connecting quantity are carried, if parameter What update request module was received from bluetooth module is that event is established in connection, then carries the Connecting quantity of connection mode at a slow speed;If What parameter updating request module was received from bluetooth module is big data event, then carries the Connecting quantity of fast connection mode.
The Connecting quantity received is updated request from equipment bluetooth module and is sent to main equipment by the 5th step.
6th step, main equipment receive after the Connecting quantity update request event that equipment bluetooth module is sent, Xiang Congshe Preparation send Connecting quantity to update response events, carries result parameter " receiving " or " refusal ".
7th step receives the Connecting quantity that main equipment is sent from equipment bluetooth module and updates response events, judging result Parameter is " receiving " or " refusal ".If result parameter is " receiving ", the Connecting quantity for waiting main equipment to send updates thing Part turns the 8th step;If result parameter is " refusal ", bluetooth module uses before initiating the connection parameter updating request from equipment Old Connecting quantity be sent to parameter update processing module, turn the 9th step.
8th step receives the Connecting quantity update event that main equipment is sent from the bluetooth module of equipment, more by Connecting quantity New events are sent to parameter and update processing module, carry main equipment and determine the new Connecting quantity used.New Connecting quantity is that master sets It is standby to update what the Connecting quantity carried in request determined according to from the Connecting quantity of equipment transmission, i.e., the connection of new Connecting quantity Interval is more than or equal to the Smallest connection interval carried in parameter updating request and is less than or equal to maximum connection interval, postpones from equipment Coefficient and supervision time-out time are identical as in parameter updating request.
9th step, parameter update processing module and handle parameter update result.Method is:
9.1 parameters update processing module according in initialization module connection mode mark judgement be fast connection mode also It is connection mode at a slow speed, if fast connection mode, turns 9.2, if connection mode at a slow speed, then turn 9.3;
9.2 parameters update processing module and obtain the Connecting quantity of fast connection mode from initialization module, and judge parameter The connection Smallest connection interval that whether is arranged in fast connection mode of interval in the Connecting quantity that update event carries and most Within big connection interval, if not turning 9.4 within Smallest connection interval and maximum connection interval;If most Within small connection interval and maximum connection interval, turn 9.5;
9.3 parameters update processing module and obtain the Connecting quantity of connection mode at a slow speed from initialization module, and judge parameter The connection Smallest connection interval that whether is arranged in connection mode at a slow speed of interval in the Connecting quantity that update event carries and most Within big connection interval, if not turning 9.4 within Smallest connection interval and maximum connection interval;If most Within small connection interval and maximum connection interval, turn 9.5;
9.4 parameters update processing module and send Connecting quantity update request to bluetooth module, according in initialization module Connection mode mark carries the Connecting quantity under corresponding modes, turns the 5th step.
9.5 parameters update processing module and the Connecting quantity that parameter update event carries are saved in bluetooth module, by bluetooth Module keeps the bluetooth connection with main equipment.
Following technical effect can achieve using the present invention: using the invention enables can send to connect to main equipment from equipment Parameter updating request is connect, thus make the negotiation that can be attached parameter with main equipment (Android device) from equipment (IoT equipment), After initiating the connection parameter updating request from equipment, the company for meeting and requiring from equipment flash can be used from equipment and main equipment It connects parameter and carries out Bluetooth communication, so that the IoT equipment with flash is not in when carrying out Bluetooth communication with Android device Because Connecting quantity is improper, make IoT equipment to flash operation no the phenomenon that having handled and bluetooth is caused to frequently cut off, completely Solves Bluetooth communication compatibility issue between IoT equipment and Android device.
Detailed description of the invention
Fig. 1 is overview flow chart of the present invention;
Fig. 2 is the flash memory compatible modules structure chart of first step design of the present invention.
Specific embodiment
Fig. 1 is overview flow chart of the present invention.The present invention the following steps are included:
The first step designs flash memory compatible modules as shown in Figure 2, is connected with the bluetooth module in IoT equipment, in IoT When equipment is attached event handling, negotiates Connecting quantity by flash memory compatible modules and Android device, Connecting quantity is made to meet IoT The requirement of flash storage access in equipment.Flash memory compatible modules are updated by initialization module, parameter updating request module and parameter Processing module composition.
Initialization module updates processing module with parameter updating request module and parameter and is connected, and function is asked for parameter update Modulus block provides Connecting quantity, updates processing module for parameter and provides Connecting quantity and connection mode mark.
Parameter updating request module is connected with initialization module and bluetooth module;Parameter updating request module is from bluetooth module Connection event or big data event are received, is connection mode at a slow speed by connection mode traffic sign placement if received is connection event Connection mode traffic sign placement is fast connection mode mark, and by connection mode if received is big data event by mark Mark is sent to initialization module;Meanwhile parameter updating request module obtains Connecting quantity from initialization module, by Connecting quantity It is stored in after bluetooth module and sends Connecting quantity update request to bluetooth module, send Connecting quantity more from bluetooth module to main equipment New request event carries Connecting quantity.
Parameter updates processing module and is connected with initialization module and bluetooth module, and function is the company judged in initialization module It connects whether parameter is updated successfully, if success, keeps connection with new Connecting quantity, if unsuccessful, sent to bluetooth module Order is disconnected, disconnects bluetooth module with main equipment.Parameter updates processing module and obtains connection from initialization module Parameter and connection mode mark return to the Connecting quantity obtained from initialization module with the main equipment obtained from bluetooth module Connecting quantity is compared, if the connection that main equipment returns is spaced Smallest connection interval and most Dalian not in initialization module In the range of connecing interval, then order is disconnected to bluetooth module transmission, disconnect bluetooth module with main equipment, if master sets In the range of the Smallest connection interval that the standby connection returned is spaced in initialization module connect interval with maximum, does not then do and locate Reason, bluetooth module continue to keep connecting with main equipment.
Second step, initialization module initialization Connecting quantity and connection mode mark, connection mode mark are initialized as not Know mode, Connecting quantity is arranged by developer.
Third step receives the connection that main equipment is sent from the bluetooth module of equipment and establishes event or big data event, will even It connects the event of foundation or big data event is sent to parameter updating request module.
4th step, connection event is that event or big data thing are established in connection to parameter updating request module based on the received Part sends Connecting quantity to bluetooth module and updates request, and method is:
4.1 parameter updating request modules judge according to the connection status carried from the received connection event of bluetooth module from setting Whether standby bluetooth state is in connection mode.If connection status is invalid, updates and request without Connecting quantity, turn third Step;If connection status is effective, turn 4.2;
4.2 parameter updating request modules judge that the connection event received from bluetooth module is that event or big is established in connection Connection mode traffic sign placement is then connection mode mark at a slow speed, and will connect at a slow speed if event is established in connection by data event Mode flags are sent to initialization module;It is then fast connection mode mark by connection mode traffic sign placement if big data event Will, and fast connection mode mark is sent to initialization module;
4.3 parameter updating request modules read Connecting quantity from initialization module, and Connecting quantity is sent to bluetooth mould Block, method are: if parameter updating request module received from bluetooth module be connection establish event, from initialization module read It takes the Connecting quantity of connection mode at a slow speed and is sent to bluetooth module;If parameter updating request module is received from bluetooth module It is big data event, then reads the Connecting quantity of fast connection mode from initialization module and be sent to bluetooth module;
4.4 parameter updating request modules send Connecting quantity to bluetooth module and update request, Connecting quantity are carried, if parameter What update request module was received from bluetooth module is that event is established in connection, then carries the Connecting quantity of connection mode at a slow speed;If What parameter updating request module was received from bluetooth module is big data event, then carries the Connecting quantity of fast connection mode.
The Connecting quantity received is updated request from equipment bluetooth module and is sent to main equipment by the 5th step.
6th step, main equipment receive after the Connecting quantity update request event that equipment bluetooth module is sent, Xiang Congshe Preparation send Connecting quantity to update response events, carries result parameter " receiving " or " refusal ".
7th step receives the Connecting quantity that main equipment is sent from equipment bluetooth module and updates response events, judging result Parameter is " receiving " or " refusal ".If result parameter is " receiving ", the Connecting quantity for waiting main equipment to send updates thing Part turns the 8th step;If result parameter is " refusal ", bluetooth module uses before initiating the connection parameter updating request from equipment Old Connecting quantity be sent to parameter update processing module, turn the 9th step.
8th step receives the Connecting quantity update event that main equipment is sent from the bluetooth module of equipment, more by Connecting quantity New events are sent to parameter and update processing module, carry main equipment and determine the new Connecting quantity used.New Connecting quantity is that master sets It is standby to update what the Connecting quantity carried in request determined according to from the Connecting quantity of equipment transmission, i.e., the connection of new Connecting quantity Interval is more than or equal to the Smallest connection interval carried in parameter updating request and is less than or equal to maximum connection interval, postpones from equipment Coefficient and supervision time-out time are identical as in parameter updating request.
9th step, parameter update processing module and handle parameter update result.Method is:
9.1 parameters update processing module according in initialization module connection mode mark judgement be fast connection mode also It is connection mode at a slow speed, if fast connection mode, turns 9.2, if connection mode at a slow speed, then turn 9.3;
9.2 parameters update processing module and obtain the Connecting quantity of fast connection mode from initialization module, and judge parameter The connection Smallest connection interval that whether is arranged in fast connection mode of interval in the Connecting quantity that update event carries and most Within big connection interval, if not turning 9.4 within Smallest connection interval and maximum connection interval;If most Within small connection interval and maximum connection interval, turn 9.5;
9.3 parameters update processing module and obtain the Connecting quantity of connection mode at a slow speed from initialization module, and judge parameter The connection Smallest connection interval that whether is arranged in connection mode at a slow speed of interval in the Connecting quantity that update event carries and most Within big connection interval, if not turning 9.4 within Smallest connection interval and maximum connection interval;If most Within small connection interval and maximum connection interval, turn 9.5;
9.4 parameters update processing module and send Connecting quantity update request to bluetooth module, according in initialization module Connection mode mark carries the Connecting quantity under corresponding modes, turns the 5th step.
9.5 parameters update processing module and the Connecting quantity that parameter update event carries are saved in bluetooth module, by bluetooth Module keeps the bluetooth connection with main equipment.

Claims (6)

1. a kind of method of the solution with Bluetooth communication compatibility between flash memory IoT equipment and Android device, it is characterised in that including with Lower step:
The first step designs a flash memory compatible modules, is connected with the bluetooth module of IoT equipment i.e. from the device, in IoT equipment When being attached event handling, negotiates Connecting quantity by flash memory compatible modules and Android device, Connecting quantity is made to meet IoT equipment The requirement of middle flash storage access;Flash memory compatible modules are handled by initialization module, parameter updating request module and parameter update Module composition;
Initialization module updates processing module with parameter updating request module and parameter and is connected, and function is for parameter updating request mould Block provides Connecting quantity, updates processing module for parameter and provides Connecting quantity and connection mode mark;Connecting quantity includes connection It is spaced, from equipment retardation coefficient and supervision time-out time, connection interval, which refers to from equipment, wishes that main equipment allows from equipment transmission The frequency of data packet, the connection interval are greater than the time operated to flash, and referring to from equipment retardation coefficient from equipment can ignore that The maximum value of the connection event number of main equipment, supervision time-out time refer to from equipment and main equipment there is no communicating The lower maximum time for keeping connection;There are three types of connection mode marks, i.e. unknown pattern mark, fast connection mode mark and at a slow speed Connection mode mark respectively corresponds unknown pattern, at a slow speed connection mode and fast connection mode;Unknown pattern mark refers to from setting For the connection mode mark used when not initiating the connection parameter updating request;Fast connection mode mark is set from equipment to master Preparation plays fast connection parameter and updates the connection mode mark used after request;Connection mode mark is set from equipment to master at a slow speed Preparation plays Connecting quantity at a slow speed and updates the connection mode mark used after request;
Parameter updating request module is connected with initialization module and bluetooth module;Parameter updating request module is received from bluetooth module Event or big data event are established in connection, are to connect at a slow speed by connection mode traffic sign placement if received is that event is established in connection Connection mode traffic sign placement is fast connection mode mark if received is big data event by mode flags, and will connection Mode flags are sent to initialization module;Meanwhile parameter updating request module obtains Connecting quantity from initialization module, will connect Parameter is stored in after bluetooth module and sends Connecting quantity update request to bluetooth module, sends connection ginseng from bluetooth module to main equipment Number updates request event, carries Connecting quantity;
Parameter updates processing module and is connected with initialization module and bluetooth module, and function is the connection ginseng judged in initialization module Whether number is updated successfully, if success, keeps connection with new Connecting quantity, if unsuccessful, send and disconnect to bluetooth module Bind command disconnects bluetooth module with main equipment;Parameter updates processing module and obtains Connecting quantity from initialization module With connection mode mark, the connection that the Connecting quantity obtained from initialization module is returned with the main equipment obtained from bluetooth module Parameter is compared, if the connection interval that main equipment returns is less than the Smallest connection interval in initialization module or is greater than most Dalian Interval is connect, then disconnects order to bluetooth module transmission, disconnects bluetooth module with main equipment, if what main equipment returned Connection interval is more than or equal to the Smallest connection interval in initialization module and less than or equal to maximum connection interval, then is not processed, Bluetooth module continues to keep connecting with main equipment;
Second step, initialization module initialization Connecting quantity and connection mode mark, connection mode mark are initialized as unknown mould Formula, Connecting quantity are arranged by developer;
Third step receives the connection that main equipment is sent from the bluetooth module of equipment and establishes event or big data event, connection is built Vertical event or big data event are sent to parameter updating request module;
4th step, connection event is that event or big data event are established in connection to parameter updating request module based on the received, to Bluetooth module sends Connecting quantity and updates request, and method is:
4.1 parameter updating request modules judge according to the connection status carried from the received connection event of bluetooth module from equipment indigo plant Whether dental phenomenon is, if connection status is invalid, to update and request without Connecting quantity, turn third step in connection mode; If connection status is effective, turn 4.2;
4.2 parameter updating request modules judge that the connection event received from bluetooth module is that event or big data are established in connection Connection mode traffic sign placement is then connection mode mark at a slow speed if event is established in connection by event, and will connection mode at a slow speed Mark is sent to initialization module;It is then fast connection mode mark by connection mode traffic sign placement if big data event, and Fast connection mode mark is sent to initialization module;
4.3 parameter updating request modules read Connecting quantity from initialization module, and Connecting quantity is sent to bluetooth module;
4.4 parameter updating request modules send Connecting quantity to bluetooth module and update request, carry Connecting quantity;
The Connecting quantity received is updated request from equipment bluetooth module and is sent to main equipment by the 5th step;
6th step, main equipment are received after the Connecting quantity update request event that equipment bluetooth module is sent, are sent out to from equipment It send Connecting quantity to update response events, carries result parameter " receiving " or " refusal ";
7th step receives the Connecting quantity that main equipment is sent from equipment bluetooth module and updates response events, judging result parameter It is " receiving " or " refusal ", if result parameter is " receiving ", the Connecting quantity update event for waiting main equipment to send turns 8th step;If result parameter is " refusal ", bluetooth module is old by what is used before initiating the connection parameter updating request from equipment Connecting quantity is sent to parameter and updates processing module, turns the 9th step;
8th step receives the Connecting quantity update event that main equipment is sent from the bluetooth module of equipment, Connecting quantity is updated thing Part is sent to parameter and updates processing module, carries main equipment and determines the new Connecting quantity used;Between the connection of new Connecting quantity Every being more than or equal to the Smallest connection interval carried in parameter updating request and being spaced less than or equal to maximum connection, postpone system from equipment Number and supervision time-out time are identical as in parameter updating request;
9th step, parameter update processing module and handle parameter update result, and method is:
It according to the connection mode mark judgement in initialization module is fast connection mode or slow that 9.1 parameters, which update processing module, Fast connection mode turns 9.2, if connection mode at a slow speed, then turn 9.3 if fast connection mode;
9.2 parameters update processing module and obtain the Connecting quantity of fast connection mode from initialization module, and judge that parameter updates The Smallest connection interval and most Dalian whether the connection interval in the Connecting quantity that event carries is arranged in fast connection mode It connects within interval, if not turning 9.4 within Smallest connection interval and maximum connection interval;If connected in minimum It connects within interval and maximum connection interval, turns 9.5;
9.3 parameters update processing module and obtain the Connecting quantity of connection mode at a slow speed from initialization module, and judge that parameter updates The Smallest connection interval and most Dalian whether the connection interval in the Connecting quantity that event carries is arranged in connection mode at a slow speed It connects within interval, if not turning 9.4 within Smallest connection interval and maximum connection interval;If connected in minimum It connects within interval and maximum connection interval, turns 9.5;
9.4 parameters update processing module and send Connecting quantity update request to bluetooth module, according to the connection in initialization module Mode flags carry the Connecting quantity under corresponding modes, turn the 5th step;
9.5 parameters update processing module and the Connecting quantity that parameter update event carries are saved in bluetooth module, by bluetooth module Keep the bluetooth connection with main equipment.
2. the method with Bluetooth communication compatibility between flash memory IoT equipment and Android device is solved as described in claim 1, it is special Sign is described in second step that the method for initialization module initialization Connecting quantity is: connection interval is initialized as in 7.5ms~4s Any 1.25ms integral multiple, and be greater than time for operating to flash;It is 0~499 from equipment retardation coefficient range;Supervision Time-out time range is 100ms~32s;And connection is spaced, is as follows from equipment delay and supervision this three of time-out time satisfaction Formula:
Supervise time-out time > (1+ from equipment retardation coefficient) × (connection interval) (formula one).
3. the method with Bluetooth communication compatibility between flash memory IoT equipment and Android device is solved as claimed in claim 2, it is special Sign is the arbitrary value being divided into Smallest connection interval and maximum connection interval between connecting;IoT equipment bluetooth reception caching is bigger, Smallest connection interval and maximum connection interval are bigger.
4. the method with Bluetooth communication compatibility between flash memory IoT equipment and Android device is solved as claimed in claim 3, it is special Parameter setting method is when sign is for connection mode at a slow speed: Smallest connection interval is greater than (÷ of n × 1,024 256 × 13)+(n ÷ 4+1) × 22 (ms) and meet the integral multiple of 1.25ms, n is the KB number that IOT equipment bluetooth receives caching, i.e. bluetooth receives slow Save as n KB;Smallest connection interval+20ms is divided between maximum connection;It is greater than 1 from the value of equipment retardation coefficient;Supervise time-out time Meet at least to 6 chances listened to are reserved from equipment in supervision time-out time, i.e., (from equipment retardation coefficient+1), × 6 × connect Connect interval <supervision time-out time;Parameter setting method is when fast connection mode: it is 0 from equipment retardation coefficient, other connection ginsengs Number is identical as connection mode at a slow speed.
5. the method with Bluetooth communication compatibility between flash memory IoT equipment and Android device is solved as described in claim 1, it is special Sign is that the method that Connecting quantity is sent to bluetooth module is by parameter updating request module described in 4.3 steps: if parameter update is asked What modulus block was received from bluetooth module is that event is established in connection, then the connection ginseng of connection mode at a slow speed is read from initialization module It counts and is sent to bluetooth module;If what parameter updating request module was received from bluetooth module is big data event, from initial Change module to read the Connecting quantity of fast connection mode and be sent to bluetooth module.
6. the method with Bluetooth communication compatibility between flash memory IoT equipment and Android device is solved as described in claim 1, it is special Sign is that parameter updating request module described in 4.4 steps is sent when Connecting quantity updates request to bluetooth module and carries Connecting quantity Method is: if parameter updating request module received from bluetooth module be connection establish event, carry connection mode at a slow speed Connecting quantity;If what parameter updating request module was received from bluetooth module is big data event, quickly connection mould is carried The Connecting quantity of formula.
CN201710485913.0A 2017-06-23 2017-06-23 The method with Bluetooth communication compatibility between flash memory IoT equipment and Android device of solution Active CN107231605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710485913.0A CN107231605B (en) 2017-06-23 2017-06-23 The method with Bluetooth communication compatibility between flash memory IoT equipment and Android device of solution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710485913.0A CN107231605B (en) 2017-06-23 2017-06-23 The method with Bluetooth communication compatibility between flash memory IoT equipment and Android device of solution

Publications (2)

Publication Number Publication Date
CN107231605A CN107231605A (en) 2017-10-03
CN107231605B true CN107231605B (en) 2019-10-08

Family

ID=59935703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710485913.0A Active CN107231605B (en) 2017-06-23 2017-06-23 The method with Bluetooth communication compatibility between flash memory IoT equipment and Android device of solution

Country Status (1)

Country Link
CN (1) CN107231605B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108231196A (en) * 2018-01-09 2018-06-29 四川长虹智慧健康科技有限公司 A kind of chronic disease monitoring, prevention system and application method
CN110366039A (en) * 2019-07-12 2019-10-22 四川长虹电器股份有限公司 The compatibility method of different bluetooth mould groups under a kind of android system
CN111277987B (en) * 2020-03-17 2022-03-25 北京百瑞互联技术有限公司 Method for dynamically negotiating Bluetooth connection interval
CN114286433B (en) * 2022-03-07 2022-07-12 荣耀终端有限公司 Method for reducing power consumption of equipment and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508680A (en) * 2011-11-09 2012-06-20 惠州Tcl移动通信有限公司 Mobile-terminal-based automatic audio parameter updating method and system
CN103945507A (en) * 2013-01-22 2014-07-23 诺基亚公司 Method, apparatus, and computer program product for power save control for tethering connections
CN104135734A (en) * 2013-05-02 2014-11-05 诺基亚公司 Method and apparatus for signal-strength-based connection parameter adjustment
CN104486379A (en) * 2014-11-26 2015-04-01 中国建设银行股份有限公司 Parameter updating method as well as relevant equipment and system
CN104601203A (en) * 2014-12-23 2015-05-06 广东欧珀移动通信有限公司 Dynamic connection parameter regulation method and device for low-power consumption Bluetooth equipment
CN105451369A (en) * 2015-12-04 2016-03-30 小米科技有限责任公司 Method and apparatus for updating connection parameter of Bluetooth device with low power consumption
CN105872655A (en) * 2016-03-25 2016-08-17 北京小米移动软件有限公司 Device control methods and apparatuses, and electronic devices
CN106341782A (en) * 2016-09-27 2017-01-18 美的智慧家居科技有限公司 Mobile terminal and household electric appliance communication method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508680A (en) * 2011-11-09 2012-06-20 惠州Tcl移动通信有限公司 Mobile-terminal-based automatic audio parameter updating method and system
CN103945507A (en) * 2013-01-22 2014-07-23 诺基亚公司 Method, apparatus, and computer program product for power save control for tethering connections
CN104135734A (en) * 2013-05-02 2014-11-05 诺基亚公司 Method and apparatus for signal-strength-based connection parameter adjustment
CN104486379A (en) * 2014-11-26 2015-04-01 中国建设银行股份有限公司 Parameter updating method as well as relevant equipment and system
CN104601203A (en) * 2014-12-23 2015-05-06 广东欧珀移动通信有限公司 Dynamic connection parameter regulation method and device for low-power consumption Bluetooth equipment
CN105451369A (en) * 2015-12-04 2016-03-30 小米科技有限责任公司 Method and apparatus for updating connection parameter of Bluetooth device with low power consumption
CN105872655A (en) * 2016-03-25 2016-08-17 北京小米移动软件有限公司 Device control methods and apparatuses, and electronic devices
CN106341782A (en) * 2016-09-27 2017-01-18 美的智慧家居科技有限公司 Mobile terminal and household electric appliance communication method and system

Also Published As

Publication number Publication date
CN107231605A (en) 2017-10-03

Similar Documents

Publication Publication Date Title
CN107231605B (en) The method with Bluetooth communication compatibility between flash memory IoT equipment and Android device of solution
EP3258737B1 (en) Mobile terminal, power supply adapter, and upgrading method thereof
US10474452B2 (en) Firmware upgrade through GPIO port via UART protocol
CN104601203A (en) Dynamic connection parameter regulation method and device for low-power consumption Bluetooth equipment
JP6024288B2 (en) Information processing system and external device
CN107529211B (en) Wireless communication system and method
CN104065144A (en) System and method for dynamically adjusting output voltage and output current of USB charger through VBUS signal
CN106909081B (en) Household electrical appliance and expansion platform based on same
EP2922267A1 (en) Method for achieving communication based on mbim interface and device therefor
US9971591B2 (en) Mobile terminal, power adapter, and upgrade method thereof
CN110825422A (en) System for managing MCU version of intelligent household equipment
CN112714426A (en) Intelligent upgrading method and device for Bluetooth equipment, electronic equipment and medium
JP2012015803A (en) Communication device, program, and communication method
CN105138107A (en) Mobile terminal downloading method and device and mobile terminal
CN112350895B (en) Keep-alive method and device for application program, equipment and computer readable storage medium
CN113824612B (en) Network equipment compatibility testing method, terminal equipment and storage medium
CN113726608B (en) Data processing method and device
CN107547315B (en) Method and device for optimizing data communication
CN204464525U (en) The tongue of electric power connector, socket type electronic connector, mobile terminal, plug-type electronic connector and power supply adaptor
JP2005102135A (en) Line connection control apparatus and communication card
US9210658B2 (en) Communication device, communication system, communication method, and program
CN111988864A (en) Data transmission method and device based on wireless charging equipment
CN209882105U (en) Intelligent module for bridge communication between Bluetooth network and Internet of things
CN217880305U (en) USB switching circuit and electronic equipment
CN214227849U (en) Electronic device

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

Effective date of registration: 20201229

Address after: 410000 Yuelu District Yuelu street, Changsha, Hunan Province, 5 left 101 rooms of R & D headquarters of Central South University Science Park.

Patentee after: HUNAN NEW CLOUDNET TECHNOLOGY Co.,Ltd.

Address before: Yuelu District City, Hunan province 410083 Changsha Lushan Road No. 932

Patentee before: CENTRAL SOUTH University

PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Solution of Bluetooth communication compatibility between IOT device with flash memory and Android device

Effective date of registration: 20210126

Granted publication date: 20191008

Pledgee: Agricultural Bank of China Limited Changsha Yuhua District sub branch

Pledgor: HUNAN NEW CLOUDNET TECHNOLOGY Co.,Ltd.

Registration number: Y2021980000747

PE01 Entry into force of the registration of the contract for pledge of patent right
CP01 Change in the name or title of a patent holder

Address after: 410000 Yuelu District Yuelu street, Changsha, Hunan Province, 5 left 101 rooms of R & D headquarters of Central South University Science Park.

Patentee after: New Cloud Technology Group Co.,Ltd.

Address before: 410000 Yuelu District Yuelu street, Changsha, Hunan Province, 5 left 101 rooms of R & D headquarters of Central South University Science Park.

Patentee before: HUNAN NEW CLOUDNET TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder
CB03 Change of inventor or designer information

Inventor after: Zhang Yaoxue

Inventor after: Shi Qiuju

Inventor after: Peng Xuhong

Inventor before: Liu Yaping

Inventor before: Zhang Yaoxue

Inventor before: Shi Qiuju

Inventor before: Liao Haining

Inventor before: Peng Xuhong

CB03 Change of inventor or designer information