CN110557725A - Method and device for setting Bluetooth working state - Google Patents

Method and device for setting Bluetooth working state Download PDF

Info

Publication number
CN110557725A
CN110557725A CN201910872371.1A CN201910872371A CN110557725A CN 110557725 A CN110557725 A CN 110557725A CN 201910872371 A CN201910872371 A CN 201910872371A CN 110557725 A CN110557725 A CN 110557725A
Authority
CN
China
Prior art keywords
bluetooth
module
key
state
working state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910872371.1A
Other languages
Chinese (zh)
Other versions
CN110557725B (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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201910872371.1A priority Critical patent/CN110557725B/en
Publication of CN110557725A publication Critical patent/CN110557725A/en
Application granted granted Critical
Publication of CN110557725B publication Critical patent/CN110557725B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals

Abstract

The invention discloses a method and a device for setting a Bluetooth working state; the method comprises the following steps: the device judges the working state of the Bluetooth, judges whether a key is triggered or not, judges whether a Bluetooth event is monitored or not, judges whether trusted equipment is stored or not if the working state of the Bluetooth is an externally invisible state, and sets the working state of the Bluetooth to be a visible and connectable state only for the trusted equipment if the working state of the Bluetooth is the externally invisible state; if the key is triggered and the type of the triggered key is the first key, the Bluetooth working state is set to be the externally visible connectable state after the legal input key is acquired; if a Bluetooth event is monitored and the Bluetooth event is a Bluetooth broadcast event, judging the type of a Bluetooth working state, if the Bluetooth working state is a connectable state visible only to trusted equipment, judging whether an equipment identifier in the Bluetooth broadcast event is matched with trusted equipment information stored in the equipment identifier, and if the equipment identifier is matched with the trusted equipment information stored in the equipment identifier, returning the equipment identifier through a Bluetooth channel; and if the connection state is visible to the outside, returning the device identification through the Bluetooth channel.

Description

method and device for setting Bluetooth working state
Technical Field
The present invention relates to the field of bluetooth communication technologies, and in particular, to a method and an apparatus for setting a bluetooth operating state.
background
with the improvement of the bluetooth function, more and more wireless terminal devices use bluetooth to wirelessly transmit data, so that the working safety of bluetooth is more and more emphasized. In the prior art, a device is easily attacked by untrusted equipment in the bluetooth communication process with the equipment, and how to ensure the security of bluetooth communication is a difficult problem to be solved urgently in the technical field of current bluetooth communication.
disclosure of Invention
the invention provides a method and a device for setting a Bluetooth working state, which solve the technical problems.
The invention provides a method for setting a Bluetooth working state, which comprises the following steps:
step s 0: the device is powered on, the working state of the Bluetooth of the device is in an invisible state, and key interruption and Bluetooth interruption are started;
step s 1: the device judges the own bluetooth working state, judges whether a key is triggered or not, monitors a bluetooth event, and executes the step s2 if the own bluetooth working state is judged to be an invisible state; if the key is triggered and the type of the triggered key is the first key according to the key value of the key, executing step s 3; if the bluetooth event is monitored and the monitored bluetooth event is judged to be a bluetooth broadcast event according to the bluetooth event identifier, executing step s 4; otherwise, return to step s 1;
Step s 2: the device judges whether the trusted equipment is stored or not, if so, the working state of the Bluetooth of the device is set to be the visible and connectable state only for the trusted equipment, and the step s1 is returned; otherwise, return to step s 1;
Step s 3: the device waits for obtaining an input key, and after a legal input key is obtained, the device sets the Bluetooth working state of the device to be a visible and connectable state to the outside; returning to step s 1;
step s 4: the device judges the type of the own Bluetooth working state, if the type is that the connectable state can be seen only to the trusted device, the step s5 is executed; if the connection state is visible to the outside, executing step s 6; otherwise, return to step s 1;
step s 5: the device judges whether the equipment identification in the Bluetooth broadcast event is matched with the trust equipment information stored by the device, if so, the device identification of the device is returned to the equipment through the Bluetooth channel, and the step s1 is returned; otherwise, return to step s 1;
step s 6: the device returns its own device identification to the apparatus through the bluetooth channel, and returns to step s 1;
the method further comprises the following steps:
if the key interruption is detected to be triggered, judging the type of the triggered key, and if the first key is triggered, setting the key value of the key to be a first preset value;
if the Bluetooth interruption is triggered, setting a Bluetooth event identifier according to the type of the monitored Bluetooth event, and if the Bluetooth event is a Bluetooth broadcast event, setting the Bluetooth event identifier as a first preset identifier.
the present invention also provides an apparatus comprising: the device comprises a key interruption module, a Bluetooth interruption module, a first judgment module, a second judgment module, a third judgment module, a fourth judgment module, a first setting module, a first acquisition module, a second setting module, a fifth judgment module, a sixth judgment module, a first return module and a second return module;
the key interruption module is used for judging the type of the triggered key after detecting that the key interruption is triggered, and setting a key value of the key to be a first preset value if a first key is triggered;
The Bluetooth interruption module is used for setting a Bluetooth event identifier according to the type of the monitored Bluetooth event after detecting that the Bluetooth interruption is triggered, and setting the Bluetooth event identifier as a first preset identifier if the Bluetooth event is a Bluetooth broadcast event;
The first judgment module is used for judging the Bluetooth working state of the device;
The second judgment module is used for judging whether a key is triggered or not and judging the type of the triggered key according to the key value of the key;
the third judging module is used for monitoring the Bluetooth event and judging the type of the monitored Bluetooth event according to the Bluetooth event identifier;
The fourth judging module is used for judging whether the device stores the trusted equipment or not after the first judging module judges that the Bluetooth working state of the device is invisible to the outside;
the first setting module is used for setting the Bluetooth working state of the device to be a visible and connectable state only for the trusted equipment after the fourth judging module judges that the Bluetooth working state is the visible and connectable state;
The first obtaining module is configured to wait for obtaining an input key after the second determining module determines that the type of the triggered key is the first key according to the key value of the key;
the second setting module is used for setting the Bluetooth working state of the device to be an externally visible and connectable state after the first acquisition module acquires the legal input key;
the fifth judging module is used for judging the type of the Bluetooth working state of the device when the third judging module judges that the monitored Bluetooth event is a Bluetooth broadcast event;
the sixth judging module is used for judging whether the equipment identifier in the Bluetooth broadcast event is matched with the information of the trusted equipment stored in the sixth judging module after the fifth judging module judges that the self state of the device is the visible and connectable state only for the trusted equipment;
the first returning module is used for returning the device identifier of the first returning module to the equipment through a Bluetooth channel after the sixth judging module judges that the device identifier of the first returning module is positive;
And the second returning module is used for returning the device identification to the equipment through the Bluetooth channel when the fifth judging module judges that the state of the device is the externally visible and connectable state.
The invention has the beneficial effects that:
The invention provides a method and a device for setting a Bluetooth working state, wherein if the device is in an invisible state, if the device has trusted equipment, the Bluetooth working state of the device is directly converted from the invisible state to the visible state and is only in visible connection with the trusted equipment, so that the device is protected from being attacked by the untrusted equipment; and only after the key triggering is detected and the legal input key is obtained, the device can be switched to the externally visible and connectable state to communicate with the equipment, so that the Bluetooth communication safety of the device and the equipment is further ensured.
Drawings
fig. 1-8 are flowcharts of a method for setting a bluetooth operating state according to embodiment 2 of the present invention;
fig. 9 is a block diagram of an apparatus according to embodiment 3 of the present invention.
Detailed Description
the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
the embodiment provides a method for setting a bluetooth working state, which comprises the following steps:
step s 0: powering on the device, and starting key interruption and Bluetooth interruption;
in this embodiment, after the device is powered on, its own bluetooth operating state is in an invisible state to the outside.
Step s 1: the device judges the own bluetooth working state, judges whether a key is triggered or not, monitors a bluetooth event, and executes the step s2 if the own bluetooth working state is judged to be an invisible state; if the key is triggered and the type of the triggered key is the first key according to the key value of the key, executing step s 3; if the bluetooth event is monitored and the monitored bluetooth event is judged to be a bluetooth broadcast event according to the bluetooth event identifier, executing step s 4; otherwise, return to step s 1;
step s 2: the device judges whether the trusted device is stored, if so, the working state of the bluetooth of the device is set to be the visible and connectable state only for the trusted device, and the step s1 is returned; otherwise, return to step s 1;
Step s 3: the device waits for obtaining an input key, and sets the Bluetooth working state of the device to be an externally visible and connectable state after obtaining a legal input key; returning to step s 1;
step s 4: the device judges the type of the own bluetooth working state, if the device only can see the connectable state to the trusted device, the step s5 is executed; if the connection state is visible to the outside, executing step s 6; otherwise, return to step s 1;
step s 5: the device judges whether the equipment identification in the Bluetooth broadcast event is matched with the trust equipment information stored by the device, if so, the device identification of the device is returned to the equipment through the Bluetooth channel, and the step s1 is returned; otherwise, return to step s 1;
Step s 6: the device returns its own device identification to the apparatus through the bluetooth channel, and returns to step s 1;
the method further comprises the following steps:
If the key interruption is detected to be triggered, judging the type of the triggered key, and if the first key is triggered, setting the key value of the key to be a first preset value;
if the Bluetooth interruption is triggered, setting a Bluetooth event identifier according to the type of the monitored Bluetooth event, and if the Bluetooth event is a Bluetooth broadcast event, setting the Bluetooth event identifier as a first preset identifier.
in this embodiment, after detecting that the bluetooth interrupt is triggered and setting the bluetooth event identifier according to the type of the monitored bluetooth event, the method further includes:
if the Bluetooth event is a Bluetooth pairing event, setting the Bluetooth event identifier as a second preset identifier; if the Bluetooth event is a Bluetooth connection event, setting a Bluetooth event identifier as a third preset identifier;
step s1 further includes:
if a bluetooth event is monitored and the monitored bluetooth event is judged to be a bluetooth pairing event according to the bluetooth event identifier, executing step a 1; if the bluetooth event is monitored and the monitored bluetooth event is judged to be a bluetooth connection event according to the bluetooth event identifier, executing step b 1;
Step a 1: judging whether the own Bluetooth working state is an externally visible connectable state, if so, performing Bluetooth pairing with the equipment according to the own pairing mode to obtain a pairing result, and returning to the step s 1; otherwise, deleting the stored trusted device information, and setting the Bluetooth working state of the device to be invisible to the outside; returning to step s 1;
step b 1: judging whether the pairing with the equipment is successful or not according to the pairing result, if so, establishing Bluetooth connection with the equipment, taking the equipment information as trusted equipment information and storing the trusted equipment information, setting the Bluetooth working state of the equipment to be an invisible state in connection, and returning to the step s 1; otherwise, the bluetooth operation status of the bluetooth communication device is set to the externally invisible status, and the procedure returns to step s 1.
further, after detecting that the bluetooth interrupt is triggered and setting the bluetooth event identifier according to the type of the monitored bluetooth event, the method further includes:
if the Bluetooth event is a Bluetooth disconnection event, setting the Bluetooth event identifier as a fourth preset identifier;
Step s1 further includes: if the bluetooth event is monitored and the monitored bluetooth event is judged to be a bluetooth disconnection event according to the bluetooth event identifier, executing step c 1;
Step c 1: the device sets the Bluetooth working state of the device to be invisible to the outside; returning to step s 1.
further, step c1 is preceded by:
the device judges whether the trusted device information is stored, if so, judges the number of the stored trusted device information, if one, executes the step c 1; if the number of the stored trusted device information is multiple, screening out one piece of trusted device information according to preset conditions, deleting other pieces of trusted device information, and executing the step c 1; otherwise, the Bluetooth working state of the Bluetooth module is set to be invisible to the outside.
in this embodiment, before the apparatus performs step s3, the apparatus further includes:
the device judges whether the own Bluetooth working state is an externally visible connectable state, if so, the step s1 is returned to; otherwise, step s3 is executed.
in this embodiment, step s1 further includes: if the key is triggered and the type of the triggered key is judged to be the second key according to the key value of the key, executing the step d 1;
step d 1: the apparatus determines whether trusted device information has been stored, and if so, performs step d 2; otherwise, setting the own Bluetooth working state as an externally invisible state, and returning to the step s 1;
Step d 2: the device sets the own Bluetooth working state to be a visible and connectable state only for the trusted device, and returns to the step s 1;
after the key interruption is triggered, judging the type of the triggered key further comprises: and if the second key is triggered, setting the key value of the key as a second preset value.
Further, after detecting that the second key is triggered, before performing step d1, the method further includes: the device judges whether the own Bluetooth working state is an externally visible connectable state, if so, the step d1 is executed; otherwise, return to step s 1.
further, the step d1, after the apparatus determines yes, further includes:
The apparatus judges the number of the stored trusting equipment information, if the stored trusting equipment information is one, carry out step d 2; if the number of the stored trusted device information is multiple, screening out one trusted device information according to a preset condition, deleting other trusted device information, and executing the step d 2.
in this embodiment, bluetooth pairing is performed with the device according to the pairing mode of the device, specifically: and performing Bluetooth pairing according to the password input pairing mode or the user confirmation pairing mode.
In this embodiment, step s1 is preceded by:
Step e 1: the apparatus determines whether trusted device information has been stored, and if so, performs step e 2; otherwise, go to step s 1;
Step e 2: the apparatus sets its own bluetooth operation state to a reconnection invisible state, sends a request for establishing bluetooth connection to the device according to the trusted device information, and executes step s 1.
In this embodiment, step s1 further includes:
if the Bluetooth working state of the user is judged to be the visible and connectable state only for the trusted device, executing step f 1;
step f 1: after the first preset time interval, the device sets its own bluetooth working state to the reconnection invisible state, sends a request for establishing bluetooth connection to the device according to the trusted device information, and returns to step s 1.
further, before returning to step s1 in step f1, the method further includes:
Judging whether a second preset time interval is reached, if so, setting the working state of the Bluetooth of the user to be a visible and connectable state only for the trusted device, and returning to the step s 1; otherwise, continuously judging whether a second preset time interval is reached.
in this embodiment, after the key interruption is triggered, determining the type of the triggered key further includes: if the third key is triggered, setting the key value of the key to be a third preset value; if the fourth key is triggered, setting the key value of the key to be a fourth preset value;
Step s1 further includes:
if the key is triggered and the type of the triggered key is judged to be a third key according to the key value of the key, executing the step g 1; if the key is triggered and the type of the triggered key is judged to be the fourth key according to the key value of the key, executing the step g 2;
step g 1: the device deletes the stored trusted device information, sets the bluetooth working state of the device to be invisible to the outside, and returns to the step s 1;
step g 2: the device updates the pairing mode, deletes the stored trusted device information, sets the bluetooth working state of the device to be invisible to the outside, and returns to step s 1.
further, before setting the bluetooth working state of itself to the externally invisible state, the method further includes:
Judging whether the working state of the Bluetooth of the user is invisible to the outside, and if not, setting the working state of the Bluetooth of the user to be invisible to the outside; if so, return to step s 1.
in this embodiment, judge whether the bluetooth operating condition of self is the externally visible and connectable state, specifically be:
detecting whether a safety menu sign is set or not, and if so, judging that the Bluetooth working state of the safety menu sign is an externally visible connectable state; otherwise, judging that the own Bluetooth working state is not an externally visible and connectable state;
step s1 is preceded by: the device resets the secure menu sign; after a legal input key is acquired, the method further comprises the following steps: the device sets a secure menu flag;
Step b1 further includes: the device resets the secure menu sign.
In this embodiment, after the device is powered on or before the device is powered off, the method further includes: and setting the own Bluetooth working state into an invisible state.
In this embodiment, set up the bluetooth operating condition of self to the invisible state outside, specifically be:
The device closes a first register of a Bluetooth module of the device, and sets the Bluetooth working state in a main control module of the device into an invisible state;
set up the bluetooth operating condition of self into the external visible and connectable state, specifically be: the device opens a first register of a Bluetooth module of the device, and sets the Bluetooth working state in a main control module of the device into an externally visible and connectable state;
Set up the bluetooth operating condition of self to invisible state in connecting, specifically do: the device opens the second register of the own Bluetooth module and sets the Bluetooth working state in the own main control module to be invisible in connection.
In this embodiment, the device sets the bluetooth operating condition of itself to the invisible state of the loopback, specifically:
The device opens the third register of the own Bluetooth module and sets the Bluetooth working state in the own main control module to be a loop invisible state.
the embodiment provides a method for setting a Bluetooth working state, which is characterized in that if a device is in an invisible state, and if the device has trusted equipment, the Bluetooth working state of the device is directly converted from the invisible state to the visible state and is only in visible connection with the trusted equipment, so that the device is protected from being attacked by untrusted equipment; and only after the key triggering is detected and the legal input key is obtained, the device can be switched to the externally visible and connectable state, so that the Bluetooth communication safety of the device and the equipment is further ensured.
example 2
the embodiment provides a method for setting a bluetooth operating state, as shown in fig. 1 to 8, including:
Step 100: the device is electrified and initialized, key interruption and Bluetooth interruption are started, the Bluetooth working state, the stored equipment information and the pairing mode are read from the Bluetooth module, the Bluetooth working state, the stored equipment information and the pairing mode are stored in the structure body, and the safety menu sign is reset;
Specifically, a main control module in the device is powered on and initialized, a Bluetooth module in the device is powered on and initialized, key interruption and Bluetooth interruption are started, the main control module reads a Bluetooth working state, stored equipment information and a pairing mode from the Bluetooth module, stores the Bluetooth working state, the stored equipment information and the pairing mode in a structural body, and resets a safety menu sign;
in this embodiment, preferably, the bluetooth module initializes the bluetooth operating state to an invisible state. In this embodiment, if the bluetooth operating state of the bluetooth module is an invisible state, the apparatus cannot be discovered or connected by any device.
specifically, the device can close the first register in the bluetooth module through the main control module or the bluetooth module, and set the initial bluetooth working state of the bluetooth module to an invisible state.
Step 101: the device judges the type of the Bluetooth working state, judges whether a key is triggered or not, judges whether a Bluetooth event is monitored or not, and executes step 102 if the Bluetooth working state is an invisible state; if the first key is triggered, executing step 201; if the second key is triggered, go to step 213; if the third key is triggered, go to step 207; if the fourth key is triggered, go to step 210; if a bluetooth pairing event is monitored, executing step 301; if a Bluetooth connection event is monitored, executing step 401; if a bluetooth disconnection event is monitored, executing step 501; if a bluetooth broadcast event is monitored, executing step 601; otherwise, returning to the step 101;
specifically, the device determines whether the bluetooth operating state in the structure is an externally invisible state, and if so, determines that the type of the bluetooth operating state is an externally invisible state, and executes step 102; judging whether a key is triggered, if yes, executing step 201 according to the type of the triggered key of the key value of the key, if the first key is triggered; if the second key is triggered, go to step 213; if the third key is triggered, go to step 207; if the fourth key is triggered, go to step 210; judging whether a Bluetooth event is monitored, if so, judging the type of the monitored Bluetooth event according to a Bluetooth event identifier, if so, executing a step 301, if so, executing a step 401, and if so, executing a step 501; if the monitored bluetooth event is a bluetooth broadcast event, executing step 601; otherwise, return to step 101.
it should be noted that, in the present embodiment,
after the key interruption is started, if the device detects that the key is pressed down, the key interruption is triggered, the type of the triggered key is judged, and if the first key is triggered, the key value of the key is set to be a first preset value; if the second key is triggered, setting the key value of the key to be a second preset value; if the third key is triggered, setting the key value of the key to be a third preset value; if the fourth key is triggered, setting the key value of the key to be a fourth preset value;
after a Bluetooth interrupt is started, if the device monitors a Bluetooth event and the Bluetooth interrupt is triggered, setting a Bluetooth event identifier according to the type of the monitored Bluetooth event, and if the Bluetooth event is a Bluetooth broadcast event, setting the Bluetooth event identifier as a first preset identifier; if the Bluetooth event is a Bluetooth pairing event, setting the Bluetooth event identifier as a second preset identifier; if the Bluetooth event is a Bluetooth connection event, setting a Bluetooth event identifier as a third preset identifier; and if the Bluetooth event is a Bluetooth disconnection event, setting the Bluetooth event identifier as a fourth preset identifier.
It should be further noted that, in step 101 of this embodiment, there is no fixed sequence between three operations, such as determining the type of the bluetooth working state, determining whether there is a key trigger, and determining whether it is monitored that a bluetooth event occurs, for example: the type of the Bluetooth working state can be judged firstly, if the Bluetooth working state is not an externally invisible state, whether key triggering exists is judged, if no key triggering exists, whether a Bluetooth event is monitored is judged, whether key triggering exists can also be judged firstly, if no key triggering exists, whether the Bluetooth event is monitored is judged, and if no Bluetooth event is monitored, the type of the Bluetooth working state is judged; whether a Bluetooth event is monitored or not can be judged, if the Bluetooth event is not monitored, the type of the Bluetooth working state is judged, and if the Bluetooth working state is not an externally invisible state, whether a key is triggered or not is judged; or other sequential combinations.
step 102: the device judges whether the trusted equipment is stored, if not, the step returns to the step 101; if yes, resetting the safety menu sign, judging the number of the stored trusted device information, if a plurality of trusted device information are stored, screening out one trusted device information according to preset conditions, deleting other trusted device information, and executing step 103; if the stored trusted device information is one, executing step 103;
Preferably, screening out a piece of trusted device information according to a preset condition specifically includes: and taking the latest stored trusted device information as the trusted device information.
Step 103: the device sets the Bluetooth working state to be a visible and connectable state only for the trusted equipment;
Specifically, the device sets the bluetooth working state in the structure body to a connectable state visible only to the trusted device; and setting the Bluetooth working state in the Bluetooth module to be a connectable state which can be seen only by the trusted device.
in this embodiment, if the bluetooth operating state of the bluetooth module is a connectable state visible only to the trusted device, the apparatus may be discovered and connected only by the trusted device.
step 104: the device determines whether the loopback function is enabled, if so, performs step 105; otherwise, returning to the step 101;
step 105: the device judges whether a first preset time interval is reached, if so, step 106 is executed; otherwise, returning to step 104;
step 106: the device judges whether the own Bluetooth working state is an invisible state in the connection or an invisible state in the connection, if so, the step 101 is returned to; otherwise, go to step 107;
step 107: the device sets the Bluetooth working state of the device to be invisible in the loop; sending a request for establishing Bluetooth connection to the equipment according to the information of the trusted equipment;
specifically, the device sets the bluetooth working state in the bluetooth module to an invisible state in the loopback; setting the Bluetooth working state in the structure body to be invisible in the loop; sending a request for establishing Bluetooth connection to the equipment according to the information of the trusted equipment;
in this embodiment, the device sets the bluetooth working state in the bluetooth module to an invisible state in the loopback; the method specifically comprises the following steps: and opening a third register of the Bluetooth module through the main control module or the Bluetooth module, and setting the Bluetooth working state in the Bluetooth module into an invisible state in the loop.
step 108: the device judges whether a second preset time interval is reached, if so, the step returns to the step 103; otherwise, returning to step 108;
step 201: the device judges whether the security menu identification is set, if so, the step returns to the step 101; otherwise, go to step 202;
step 202: the device waits for obtaining the input key within a fourth preset time, and if the input key is obtained within the fourth preset time, step 203 is executed; otherwise, returning to the step 101;
step 203: the device judges whether the acquired input key is legal, if so, the step 204 is executed; otherwise, returning to the step 101;
step 204: setting a safety menu sign by the device, judging whether the type of the Bluetooth working state is an invisible state, if so, executing the step 205; otherwise, setting the Bluetooth working state in the Bluetooth module to be invisible to the outside; and setting the bluetooth working state in the structure body to be invisible to the outside, and executing the step 205.
in the embodiment, the working state of the Bluetooth in the Bluetooth module is set to be invisible to the outside; the method specifically comprises the following steps: a first register in the Bluetooth module is opened through the main control module or the Bluetooth module, and the Bluetooth working state in the Bluetooth module is set to be invisible to the outside.
Step 205: the device judges the number of the stored trusting equipment information, if the number of the stored trusting equipment information is more than one, one trusting equipment information is screened out according to the preset condition, other trusting equipment information is deleted, and the step 206 is executed; otherwise, go to step 206;
Step 206: the device sets the Bluetooth working state in the Bluetooth module to be an externally visible and connectable state; setting the Bluetooth working state in the structure body to be an externally visible and connectable state; returning to the step 101;
in this embodiment, the device sets the bluetooth working state in the bluetooth module to an externally visible connectable state; specifically, the device opens a first register in the Bluetooth module through the main control module or the Bluetooth module, and sets the Bluetooth working state in the Bluetooth module to be an externally visible and connectable state.
In this embodiment, if the bluetooth operating state is a visible connection state, the apparatus may be discovered and connected by any device;
step 207: the device judges whether the security menu identification is set, if so, the step returns to the step 101; otherwise, go to step 208;
step 208: the device judges whether the type of the bluetooth working state is an externally invisible state, if so, step 209 is executed; otherwise, setting the Bluetooth working state in the Bluetooth module to be invisible to the outside; the bluetooth operation state in the structure is set to the invisible state, and step 209 is executed.
Step 209: the device deletes the trusted device information in the stored device information in the structure body, deletes the trusted device information in the stored device information in the Bluetooth module, and returns to the step 101;
step 210: the device judges whether the security menu identification is set, if so, returns to step 201; otherwise, go to step 211;
step 211: the device judges whether the type of the bluetooth working state is an invisible state, if so, the step 212 is executed; otherwise, setting the Bluetooth working state in the Bluetooth module to be invisible to the outside; and setting the bluetooth working state in the structure body to be invisible to the outside, and executing the step 212.
step 212: the device updates the pairing mode in the Bluetooth module and the structural body, deletes the trusted device information in the stored device information in the Bluetooth module, and returns to the step 101.
Step 213: the device determines whether the secure menu flag is set, and if so, performs step 214; otherwise, returning to the step 101;
step 214: the device resets the secure menu sign;
step 215: the device judges the number of the stored trusting equipment information, if the number of the stored trusting equipment information is more than one, one trusting equipment information is screened out according to the preset condition, other trusting equipment information is deleted, and the step 216 is executed; if the number of the stored trusted device information is 1, executing step 216; otherwise, go to step 218;
step 216: the device judges whether the type of the bluetooth working state is an externally invisible state, if so, step 217 is executed; otherwise, setting the Bluetooth working state in the Bluetooth module to be invisible to the outside; and setting the Bluetooth working state in the structure body to be invisible to the outside, and executing the step 217.
step 217: the device sets the Bluetooth working state in the Bluetooth module to be a visible and connectable state only for the trusted device; setting the Bluetooth working state in the structure body to be a visible and connectable state only for the trusted device; returning to the step 101;
step 218: the device judges whether the type of the Bluetooth working state is an invisible state, if so, the step 101 is returned to; otherwise, setting the Bluetooth working state in the Bluetooth module to be invisible to the outside; and setting the Bluetooth working state in the structural body to be invisible to the outside, and returning to the step 101.
Step 301: the device determines whether the security menu flag is set, if so, performs step 302; otherwise, go to step 303;
Step 302: the device is paired with the equipment through the Bluetooth module according to a pairing mode; returning to the step 101;
specifically, the device performs bluetooth pairing according to a password input (passkey entry) pairing mode or a user confirmation (user confirm) pairing mode through a bluetooth module, and returns to step 101;
Step 303: the device deletes trusted device information in stored device information in the structure body, deletes trusted device information in stored device information in the Bluetooth module, and sets the Bluetooth working state in the Bluetooth module to be invisible to the outside; setting the Bluetooth working state in the structure body to be invisible to the outside; returning to the step 101;
step 401: the apparatus determines whether the pairing with the device has been successful, and if so, performs step 402; otherwise, resetting the security menu sign, and executing step 404;
step 402: the device establishes a Bluetooth connection with the equipment; judging whether the connection is successful, if so, resetting a safety menu sign, and executing step 403; otherwise, resetting the security menu sign, and executing step 404;
Step 403: the device takes the equipment information as the trusted equipment information and stores the trusted equipment information, and sets the Bluetooth working state in the Bluetooth module to be invisible in connection; and setting the Bluetooth working state in the structure body to be invisible in connection, and returning to the step 101.
In the embodiment, the bluetooth working state in the bluetooth module is set to be invisible in connection; the method specifically comprises the following steps: and opening a second register in the Bluetooth module through the main control module or the Bluetooth module, and setting the Bluetooth working state in the Bluetooth module into an invisible state in connection.
in this embodiment, if the bluetooth operating state of the bluetooth module is an invisible state in connection, the apparatus cannot be discovered or connected by other devices other than the connected device;
step 404: the device judges whether the type of the Bluetooth working state is an externally invisible state, if so, the step 101 is returned to; otherwise, setting the Bluetooth working state in the Bluetooth module to be invisible to the outside; and setting the Bluetooth working state in the structural body to be invisible to the outside, and returning to the step 101.
step 501: the device sets the Bluetooth working state in the Bluetooth module to be invisible to the outside; setting the Bluetooth working state in the structure body to be invisible to the outside; returning to the step 101;
Step 601: the device judges the type of the own Bluetooth working state, if the Bluetooth working state is the connectable state which can be seen only to the trusted device, the step 602 is executed; if yes, the connectable state is visible to the outside, then step 603 is executed; otherwise, returning to the step 101;
step 602: the device judges whether the equipment identification in the Bluetooth broadcast data is matched with the trust equipment information stored by the device, if so, the device identification of the device is returned to the equipment through a Bluetooth channel, and the step 101 is returned; otherwise, returning to the step 101;
step 603: the device returns its own device identification to the apparatus through the bluetooth channel, returning to step 101.
in this embodiment, step 101 may further include:
step e 1: the apparatus determines whether trusted device information has been stored, and if so, performs step e 2; otherwise, executing step 101;
Step e 2: the device sets the own Bluetooth working state as a reconnection invisible state, sends a Bluetooth connection establishing request to the equipment according to the trust equipment information, and executes the step 101;
example 3
the present embodiment provides an apparatus, as shown in fig. 9, including: the device comprises a key interruption module 01, a Bluetooth interruption module 02, a first judgment module 03, a second judgment module 04, a third judgment module 05, a fourth judgment module 06, a first setting module 07, a first acquisition module 08, a second setting module 09, a fifth judgment module 10, a sixth judgment module 11, a first return module 12 and a second return module 13;
the key interruption module 01 is used for judging the type of a triggered key after detecting that key interruption is triggered, and setting a key value of the key to be a first preset value if a first key is triggered;
the bluetooth interrupt module 02 is used for setting a bluetooth event identifier according to the type of the monitored bluetooth event after detecting that the bluetooth interrupt is triggered, and setting the bluetooth event identifier as a first preset identifier if the bluetooth event is a bluetooth broadcast event;
The first judgment module 03 is used for judging the Bluetooth working state of the device;
The second judging module 04 is configured to judge whether a key is triggered, and judge the type of the triggered key according to a key value of the key;
the third judging module 05 is configured to monitor a bluetooth event, and judge the type of the monitored bluetooth event according to the bluetooth event identifier;
the fourth judging module 06, configured to judge whether the device itself has stored the trusted device after the first judging module 03 judges that the bluetooth operating state of the device itself is an externally invisible state;
the first setting module 07 is configured to set a bluetooth working state of the apparatus itself to a state in which only the trusted device is visible and connectable when the fourth determination module 06 determines that the bluetooth working state is yes;
The first obtaining module 08 is configured to wait to obtain an input key after the second determining module 04 determines that the type of the triggered key is the first key according to the key value of the key;
The second setting module 09 is configured to set a bluetooth working state of the device to an externally visible and connectable state after the first obtaining module 08 obtains the legal input key;
a fifth judging module 10, configured to judge a type of a bluetooth working state of the apparatus itself when the third judging module 05 judges that the monitored bluetooth event is a bluetooth broadcast event;
a sixth judging module 11, configured to, when the fifth judging module 10 judges that the state of the apparatus itself is the visible and connectable state only to the trusted device, judge whether the device identifier in the bluetooth broadcast event matches with the trusted device information stored in itself;
The first returning module 12 is configured to return the device identifier of the device to the apparatus through the bluetooth channel when the sixth determining module 11 determines that the device identifier is the device identifier;
and a second returning module 13, configured to, after the fifth determining module 10 determines that the self state of the device is an externally visible and connectable state, return the device identifier of the device to the device through the bluetooth channel.
Further, the bluetooth interrupt module 02 is further configured to: if the Bluetooth event is a Bluetooth pairing event, setting the Bluetooth event identifier as a second preset identifier; if the Bluetooth event is a Bluetooth connection event, setting a Bluetooth event identifier as a third preset identifier;
The device still includes: the device comprises a seventh judging module, a first pairing module, a first deleting module, a third setting module, an eighth judging module, a first connecting module, a first storage module, a fourth setting module and a fifth setting module;
a seventh judging module, configured to, when the third judging module 05 judges that the monitored bluetooth event is a bluetooth pairing event according to the bluetooth event identifier, judge whether a bluetooth working state of the device itself is an externally visible connectable state;
the first pairing module is used for carrying out Bluetooth pairing with the equipment according to the pairing mode of the device to obtain a pairing result after the seventh judging module judges that the Bluetooth pairing is positive;
The first deleting module is used for deleting the stored trusted device information when the seventh judging module judges that the trusted device information is not stored;
The third setting module is used for setting the Bluetooth working state of the device to be invisible to the outside after the seventh judging module judges that the Bluetooth working state is not visible;
the eighth judging module is configured to, after the third judging module 05 judges that the monitored bluetooth event is a bluetooth connection event according to the bluetooth event identifier, judge whether the pairing with the device is successful according to the pairing result;
the first connection module is used for establishing Bluetooth connection with the equipment after the eighth judgment module judges that the equipment is connected with the equipment;
the first storage module is used for taking and storing the equipment information as trusting equipment information after the first connection module establishes connection between the device and the equipment;
the fourth setting module is used for setting the Bluetooth working state of the device to be invisible in connection after the first connection module establishes connection between the device and the equipment;
And the third setting module is also used for setting the Bluetooth working state of the device into an invisible state after the eighth judging module judges that the Bluetooth working state is not visible.
further, the bluetooth interrupt module 02 is further configured to: if the Bluetooth event is a Bluetooth disconnection event, setting the Bluetooth event identifier as a fourth preset identifier;
And the third setting module is further configured to set the bluetooth working state of the device itself to an invisible state when the third determining module 05 determines that the monitored bluetooth event is a bluetooth disconnection event according to the bluetooth event identifier.
still further, still include: a ninth judging module, a tenth judging module and a first screening module;
the ninth judging module is used for judging whether the trust equipment information is stored or not;
the tenth judging module is used for judging the number of the stored trusted device information after the ninth judging module is yes;
The third setting module is also used for setting the Bluetooth working state of the device to be invisible to the outside after the tenth judging module judges that the stored trust equipment information is one; when the ninth judgment module judges that the Bluetooth work state of the device is not visible, the Bluetooth work state of the device is set to be invisible to the outside; when the first screening module screens out one piece of trust equipment information according to a preset condition, and deletes other pieces of trust equipment information, the Bluetooth working state of the device is set to be invisible to the outside;
and the first screening module is used for screening out one piece of trusted equipment information according to a preset condition and deleting other pieces of trusted equipment information after the tenth judging module judges that the number of the stored trusted equipment information is multiple.
in this embodiment, the apparatus may further include: an eleventh judging module;
the eleventh judging module is used for judging whether the Bluetooth working state of the second judging module 04 is an externally visible and connectable state or not after judging that the type of the triggered key is the first key according to the key value of the key;
the first obtaining module 08 is specifically configured to wait to obtain the input key after the eleventh determining module determines that the input key is not obtained.
in this embodiment, the key interruption module 01 is further configured to: judging the type of the triggered key after detecting that the key interruption is triggered, and setting the key value of the key to be a second preset value if a second key is triggered;
the device still includes: a twelfth judging module and a fifth setting module;
a twelfth judging module, configured to judge whether the trusted device information has been stored after the second judging module 04 judges, according to the key value of the key, that the type of the triggered key is the second key;
The first setting module 07 is further configured to set a bluetooth working state of the apparatus itself to a state in which only the trusted device is visible and connectable when the twelfth determination module determines that the bluetooth working state is yes;
and the fifth setting module is used for setting the Bluetooth working state of the device to be invisible to the outside after the twelfth judging module judges that the Bluetooth working state is not visible to the outside.
further, the apparatus may further include: a thirteenth judging module;
The thirteenth judging module is used for judging whether the Bluetooth working state of the second judging module 04 is an externally visible and connectable state or not after judging that the type of the triggered key is the second key according to the key value of the key;
And the twelfth judging module is specifically configured to judge whether the trusted device information has been stored after the thirteenth judging module judges that the trusted device information has been stored.
further, the apparatus may further include: a fourteenth judging module and a second screening module;
a fourteenth judging module, configured to, when the twelfth judging module judges that the trust device information is stored in the storage device, judge the number of stored trust device information;
The second screening module is used for screening out one piece of trusted equipment information according to a preset condition and deleting other pieces of trusted equipment information when the fourteenth judging module judges that the number of the stored trusted equipment information is more than one;
the first setting module 07 is specifically configured to set a bluetooth working state of the apparatus to a state in which only the trusted device is visible and connectable when the fourth determining module 06 determines that the bluetooth working state is yes; when the fourteenth judging module judges that the number of the stored trusted device information is one, the Bluetooth working state of the device is set to be a visible and connectable state only for the trusted device; when the second screening module screens out one piece of trusted equipment information according to the preset condition, and deletes other pieces of trusted equipment information, the Bluetooth working state of the device is set to be a state that only the trusted equipment can be seen and connected.
in this embodiment, the first pairing module is specifically configured to, after the seventh determining module determines that the pairing mode is the bluetooth pairing mode, input a password for the pairing mode or confirm the pairing mode by the user.
in this embodiment, the apparatus may further include: a fifteenth judging module, a sixth setting module and a second connecting module;
a fifteenth judging module, configured to judge whether trusted device information has been stored after the apparatus is powered on;
the sixth setting module is used for setting the Bluetooth working state of the device to be a reconnection invisible state after the fifteenth judging module judges that the Bluetooth working state is the reconnection invisible state;
and the second connection module is used for sending a Bluetooth connection establishment request to the equipment according to the trusted equipment information after the sixth setting module sets the Bluetooth working state of the device to a loop invisible state.
further, the apparatus may further include: a sixteenth judging module;
the sixteenth judging module is used for judging whether the second preset time interval is reached or not after the second connecting module sends a request for establishing the Bluetooth connection to the equipment according to the trusted equipment information; after judging that the second preset time interval is not reached, continuously judging whether the second preset time interval is reached;
the first setting module 07 is further configured to set the bluetooth working status of the first setting module to a status that only the trusted device is visible and connectable after the sixteenth determining module determines that the bluetooth working status of the first setting module is yes.
in this embodiment, the apparatus may further include: a seventh setting module and a third connecting module;
the seventh setting module is configured to set the bluetooth working state of the device itself to a reconnection invisible state after the first determining module 03 determines that the bluetooth working state of the device itself is the visible and connectable state only to the trusted device and after a first preset time interval;
and the third connecting module is used for sending a Bluetooth connection establishing request to the equipment according to the trusted equipment information after the seventh setting module sets the Bluetooth working state of the third connecting module to be a loop-back invisible state.
Further, the apparatus may further include: a seventeenth judging module;
A seventeenth judging module, configured to judge whether a second preset time interval is reached after the third connecting module sends a request for establishing a bluetooth connection to the device according to the trusted device information; after judging that the second preset time interval is not reached, continuously judging whether the second preset time interval is reached;
the first setting module 07 is further configured to set the bluetooth working status of the first setting module to a status that only the trusted device is visible and connectable after the seventeenth determining module determines that the bluetooth working status of the first setting module is yes.
in this embodiment, the key interruption module 01 is further configured to: judging the type of the triggered key after detecting that the key interruption is triggered, and if a third key is triggered, setting a key value of the key to be a third preset value; if the fourth key is triggered, setting the key value of the key to be a fourth preset value;
The device still includes: the device comprises a second deleting module, an eighth setting module, an updating pairing module and a third deleting module;
the second deleting module is used for deleting the stored trusted device information after the second judging module 04 judges that the type of the triggered key is the third key according to the key value of the key;
the eighth setting module is used for setting the Bluetooth working state of the device to be invisible to the outside when the second deleting module deletes the stored trusted device information; when the third deleting module deletes the stored trusted device information, the Bluetooth working state of the device is set to be invisible to the outside;
the updating pairing module is used for updating the pairing mode after the second judging module 04 judges that the type of the triggered key is the fourth key according to the key value of the key;
And the third deleting module is configured to delete the stored trusted device information after the second determining module 04 determines that the type of the triggered key is the fourth key according to the key value of the key.
further, the apparatus may further include: an eighteenth judgment module;
the eighteenth judging module is used for judging whether the own Bluetooth working state is an invisible state;
and the eighth setting module is specifically configured to set the bluetooth working state of the device itself to an externally invisible state after the eighteenth determining module determines that the bluetooth working state is not visible.
in this embodiment, the seventh determining module is specifically configured to detect whether the security menu flag is set after the third determining module 05 determines that the monitored bluetooth event is a bluetooth pairing event according to the bluetooth event identifier, and if so, determine that the bluetooth working state of the third determining module is an externally visible connectable state; otherwise, judging that the own Bluetooth working state is not an externally visible and connectable state;
The device still includes: a secure menu sign module;
the safety menu sign module is used for resetting the safety menu sign after the device is powered on; after the first obtaining module 08 obtains a legal input key, setting a safe menu sign; and when the third judging module 05 judges that the monitored Bluetooth event is a Bluetooth connection event according to the Bluetooth event identifier, resetting the safety menu sign.
in this embodiment, the apparatus may further include a ninth setting module;
and the ninth setting module is used for setting the Bluetooth working state of the device into an invisible state after the device is powered on or before the device is powered off.
In this embodiment, the third setting module is specifically configured to close the first register of the bluetooth module of the apparatus itself, and set a bluetooth working state in the main control module of the apparatus itself to an externally invisible state;
the second setting module 09 is specifically configured to open a first register of a bluetooth module of the device itself, and set a bluetooth working state in a main control module of the device itself to an externally visible connectable state;
and the fourth setting module is specifically used for opening a second register of the Bluetooth module of the device and setting the Bluetooth working state in the main control module of the device into an invisible state in connection.
In this embodiment, the sixth setting module is specifically configured to open a third register of a bluetooth module of the device itself, and set a bluetooth working state in a main control module of the device itself to a reconnection invisible state.
in this embodiment, the seventh setting module is specifically configured to open a third register of a bluetooth module of the device itself, and set a bluetooth working state in a main control module of the device itself to a reconnection invisible state.
the above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (38)

1. a method of setting a bluetooth operating state, comprising:
Step s 0: the device is powered on, the working state of the Bluetooth of the device is in an invisible state, and key interruption and Bluetooth interruption are started;
step s 1: the device judges the working state of the own Bluetooth, judges whether a key is triggered or not, judges whether a Bluetooth event is monitored or not, and if the working state of the own Bluetooth is judged to be an invisible state, executes a step s 2; if the key is triggered and the type of the triggered key is the first key according to the key value of the key, executing step s 3; if the monitored bluetooth event is judged to be the bluetooth broadcast event according to the bluetooth event identifier, executing step s 4; otherwise, return to step s 1;
step s 2: the device judges whether the trusted equipment is stored or not, if so, the working state of the Bluetooth of the device is set to be the visible and connectable state only for the trusted equipment, and the step s1 is returned; otherwise, return to step s 1;
step s 3: the device waits for obtaining an input key, and after a legal input key is obtained, the device sets the Bluetooth working state of the device to be a visible and connectable state to the outside; returning to step s 1;
step s 4: the device judges the type of the own Bluetooth working state, if the type is that the connectable state can be seen only to the trusted device, the step s5 is executed; if the connection state is visible to the outside, executing step s 6; otherwise, return to step s 1;
step s 5: the device judges whether the equipment identification in the Bluetooth broadcast event is matched with the trust equipment information stored by the device, if so, the device identification of the device is returned to the equipment through the Bluetooth channel, and the step s1 is returned; otherwise, return to step s 1;
step s 6: the device returns its own device identification to the apparatus through the bluetooth channel, and returns to step s 1;
the method further comprises the following steps:
if the key interruption is detected to be triggered, judging the type of the triggered key, and if the first key is triggered, setting the key value of the key to be a first preset value;
If the Bluetooth interruption is triggered, setting a Bluetooth event identifier according to the type of the monitored Bluetooth event, and if the Bluetooth event is a Bluetooth broadcast event, setting the Bluetooth event identifier as a first preset identifier.
2. the method of claim 1, wherein after setting the bluetooth event identifier according to the type of the monitored bluetooth event when detecting that the bluetooth interrupt is triggered, further comprising:
if the Bluetooth event is a Bluetooth pairing event, setting the Bluetooth event identifier as a second preset identifier; if the Bluetooth event is a Bluetooth connection event, setting a Bluetooth event identifier as a third preset identifier;
the step s1 further includes:
if the monitored Bluetooth event is judged to be a Bluetooth pairing event according to the Bluetooth event identification, executing the step a 1; if the monitored Bluetooth event is judged to be a Bluetooth connection event according to the Bluetooth event identification, executing the step b 1;
step a 1: judging whether the own Bluetooth working state is an externally visible connectable state, if so, performing Bluetooth pairing with the equipment according to the own pairing mode to obtain a pairing result, and returning to the step s 1; otherwise, deleting the stored trusted device information, and setting the Bluetooth working state of the device to be invisible to the outside; returning to step s 1;
Step b 1: judging whether the pairing with the equipment is successful or not according to the pairing result, if so, establishing Bluetooth connection with the equipment, taking the equipment information as trusted equipment information and storing the trusted equipment information, setting the Bluetooth working state of the equipment to be an invisible state in connection, and returning to the step s 1; otherwise, the bluetooth operation status of the bluetooth communication device is set to the externally invisible status, and the procedure returns to step s 1.
3. the method of claim 2, wherein after setting the bluetooth event identifier according to the type of the monitored bluetooth event when detecting that the bluetooth interrupt is triggered, further comprising:
if the Bluetooth event is a Bluetooth disconnection event, setting the Bluetooth event identifier as a fourth preset identifier;
the step s1 further includes: if the monitored bluetooth event is judged to be a bluetooth disconnection event according to the bluetooth event identifier, executing step c 1;
step c 1: the device sets the Bluetooth working state of the device to be invisible to the outside; returning to step s 1.
4. the method of claim 3, wherein said step c1 is preceded by the steps of:
the device judges whether the trusted device information is stored or not, if so, judges the number of the stored trusted device information, and if one, executes the step c 1; if the number of the stored trusted device information is multiple, screening out one piece of trusted device information according to preset conditions, deleting other pieces of trusted device information, and executing the step c 1; otherwise, the Bluetooth working state of the Bluetooth module is set to be invisible to the outside.
5. the method according to claim 1, wherein before the step s3, the method further comprises:
the device judges whether the own Bluetooth working state is an externally visible connectable state, and if so, returns to the step s 1; otherwise, step s3 is executed.
6. the method according to claim 1, wherein the step s1 further comprises: if the key is triggered and the type of the triggered key is judged to be the second key according to the key value of the key, executing the step d 1;
step d 1: the apparatus determines whether trusted device information has been stored, and if so, performs step d 2; otherwise, setting the own Bluetooth working state as an externally invisible state, and returning to the step s 1;
step d 2: the device sets the own Bluetooth working state to be a visible and connectable state only for the trusted device, and returns to the step s 1;
after the key interruption is triggered, judging the type of the triggered key further comprises: and if the second key is triggered, setting the key value of the key as a second preset value.
7. The method of claim 6, wherein after detecting that the second key is activated, before performing step d1, the method further comprises: the device judges whether the own Bluetooth working state is an externally visible connectable state, if so, the step d1 is executed; otherwise, return to step s 1.
8. The method according to claim 6, wherein after the step d1, the method further comprises:
The apparatus judges the number of the stored trusting device information, if the stored trusting device information is one, carry out step d 2; if the number of the stored trusted device information is multiple, screening out one trusted device information according to a preset condition, deleting other trusted device information, and executing the step d 2.
9. the method according to claim 2, wherein the bluetooth pairing is performed with the device according to its own pairing mode, specifically: and performing Bluetooth pairing according to the password input pairing mode or the user confirmation pairing mode.
10. the method according to claim 1, wherein said step s1 is preceded by the further step of:
step e 1: the apparatus determines whether trusted device information has been stored, and if so, performs step e 2; otherwise, go to step s 1;
Step e 2: the apparatus sets its own bluetooth operating state to a reconnection invisible state, sends a request for establishing bluetooth connection to the device according to the trusted device information, and executes step s 1.
11. the method according to claim 1, wherein the step s1 further comprises: if the Bluetooth working state of the user is judged to be the visible and connectable state only for the trusted device, executing step f 1;
Step f 1: after the device has a first preset time interval, the working state of the bluetooth is set to be the reconnection invisible state, a request for establishing bluetooth connection is sent to the device according to the trusted device information, and the step s1 is returned.
12. the method according to claim 10 or 11, wherein before returning to step s1 in step f1, further comprising:
judging whether a second preset time interval is reached, if so, setting the working state of the Bluetooth of the user to be a visible and connectable state only for the trusted device, and returning to the step s 1; otherwise, continuously judging whether a second preset time interval is reached.
13. the method of claim 1, wherein after the key interrupt is triggered, determining the type of the triggered key further comprises: if the third key is triggered, setting the key value of the key to be a third preset value; if the fourth key is triggered, setting the key value of the key to be a fourth preset value;
the step s1 further includes:
if the key is triggered and the type of the triggered key is judged to be a third key according to the key value of the key, executing the step g 1; if the key is triggered and the type of the triggered key is judged to be the fourth key according to the key value of the key, executing the step g 2;
Step g 1: the device deletes the stored trusted device information, sets the bluetooth working state of the device to be invisible to the outside, and returns to the step s 1;
Step g 2: the device updates the pairing mode, deletes the stored trusted device information, sets the bluetooth working state of the device to be invisible to the outside, and returns to step s 1.
14. the method of claim 13, wherein before setting the bluetooth operating state of the bluetooth device to the externally invisible state, the method further comprises:
Judging whether the working state of the Bluetooth of the user is invisible to the outside, and if not, setting the working state of the Bluetooth of the user to be invisible to the outside; if so, return to step s 1.
15. the method according to claim 2, wherein the determining whether the bluetooth operating state of the bluetooth device is an externally visible connectable state specifically includes:
detecting whether a safety menu sign is set or not, and if so, judging that the Bluetooth working state of the safety menu sign is an externally visible connectable state; otherwise, judging that the own Bluetooth working state is not an externally visible and connectable state;
the step s1 is preceded by: the device resets the secure menu sign; after the legal input key is obtained, the method further comprises the following steps: the device sets a secure menu flag;
the step b1 further includes: the device resets the secure menu sign.
16. the method of claim 1, further comprising: after the device is powered on or before the device is powered off, the Bluetooth working state of the device is set to be invisible to the outside.
17. the method according to claim 2, wherein the setting of the bluetooth operating state of the bluetooth device to an externally invisible state specifically includes:
The device closes a first register of a Bluetooth module of the device, and sets the Bluetooth working state in a main control module of the device into an invisible state;
Set up the bluetooth operating condition of self into the external visible and connectable state, specifically do: the device opens a first register of a Bluetooth module of the device, and sets the Bluetooth working state in a main control module of the device to be an externally visible and connectable state;
set up the bluetooth operating condition of self to invisible state in connecting, specifically do: the device opens the second register of the own Bluetooth module and sets the Bluetooth working state in the own main control module to be invisible in connection.
18. the method according to claim 10 or 11, wherein the device sets its own bluetooth operating state to a loopback invisible state, specifically:
the device opens the third register of the own Bluetooth module and sets the Bluetooth working state in the own main control module to be a loop invisible state.
19. an apparatus, comprising: the device comprises a key interruption module, a Bluetooth interruption module, a first judgment module, a second judgment module, a third judgment module, a fourth judgment module, a first setting module, a first acquisition module, a second setting module, a fifth judgment module, a sixth judgment module, a first return module and a second return module;
The key interruption module is used for judging the type of the triggered key after detecting that the key interruption is triggered, and setting a key value of the key to be a first preset value if a first key is triggered;
the Bluetooth interruption module is used for setting a Bluetooth event identifier according to the type of the monitored Bluetooth event after detecting that the Bluetooth interruption is triggered, and setting the Bluetooth event identifier as a first preset identifier if the Bluetooth event is a Bluetooth broadcast event;
The first judgment module is used for judging the Bluetooth working state of the device;
the second judgment module is used for judging whether a key is triggered or not and judging the type of the triggered key according to the key value of the key;
the third judging module is used for monitoring the Bluetooth event and judging the type of the monitored Bluetooth event according to the Bluetooth event identifier;
the fourth judging module is used for judging whether the device stores the trusted equipment or not after the first judging module judges that the Bluetooth working state of the device is invisible to the outside;
The first setting module is used for setting the Bluetooth working state of the device to be a visible and connectable state only for the trusted equipment after the fourth judging module judges that the Bluetooth working state is the visible and connectable state;
The first obtaining module is configured to wait for obtaining an input key after the second determining module determines that the type of the triggered key is the first key according to the key value of the key;
the second setting module is used for setting the Bluetooth working state of the device to be an externally visible and connectable state after the first acquisition module acquires the legal input key;
The fifth judging module is used for judging the type of the Bluetooth working state of the device when the third judging module judges that the monitored Bluetooth event is a Bluetooth broadcast event;
The sixth judging module is used for judging whether the equipment identifier in the Bluetooth broadcast event is matched with the information of the trusted equipment stored in the sixth judging module after the fifth judging module judges that the self state of the device is the visible and connectable state only for the trusted equipment;
the first returning module is used for returning the device identifier of the first returning module to the equipment through a Bluetooth channel after the sixth judging module judges that the device identifier of the first returning module is positive;
and the second returning module is used for returning the device identification to the equipment through the Bluetooth channel when the fifth judging module judges that the state of the device is the externally visible and connectable state.
20. the apparatus of claim 19, wherein the bluetooth interrupt module is further configured to: if the Bluetooth event is a Bluetooth pairing event, setting the Bluetooth event identifier as a second preset identifier; if the Bluetooth event is a Bluetooth connection event, setting a Bluetooth event identifier as a third preset identifier;
the device further comprises: the device comprises a seventh judging module, a first pairing module, a first deleting module, a third setting module, an eighth judging module, a first connecting module, a first storage module, a fourth setting module and a fifth setting module;
the seventh judging module is used for judging whether the Bluetooth working state of the device is an externally visible and connectable state or not after the third judging module judges that the monitored Bluetooth event is a Bluetooth pairing event according to the Bluetooth event identifier;
the first pairing module is used for carrying out Bluetooth pairing with the equipment according to the pairing mode of the device to obtain a pairing result after the seventh judging module judges that the device is the Bluetooth pairing device;
the first deleting module is used for deleting the stored trusted device information after the seventh judging module judges that the trusted device information is not stored;
The third setting module is used for setting the Bluetooth working state of the device to be invisible to the outside after the seventh judging module judges that the Bluetooth working state is not visible;
The eighth judging module is configured to, after the third judging module judges that the monitored bluetooth event is a bluetooth connection event according to the bluetooth event identifier, judge whether the pairing with the device is successful according to a pairing result;
the first connection module is used for establishing Bluetooth connection with the equipment after the eighth judgment module judges that the equipment is in the Bluetooth connection state;
The first storage module is used for taking and storing the equipment information as the trusted equipment information after the first connection module establishes the connection between the device and the equipment;
the fourth setting module is used for setting the Bluetooth working state of the device to be invisible in connection after the first connection module establishes connection between the device and the equipment;
and the third setting module is further configured to set the bluetooth working state of the device itself to an externally invisible state after the eighth determining module determines that the bluetooth working state is not visible.
21. the apparatus of claim 20, wherein the bluetooth interrupt module is further configured to: if the Bluetooth event is a Bluetooth disconnection event, setting the Bluetooth event identifier as a fourth preset identifier;
And the third setting module is further used for setting the Bluetooth working state of the device to be invisible to the outside after the third judging module judges that the monitored Bluetooth event is a Bluetooth disconnection event according to the Bluetooth event identifier.
22. the apparatus of claim 21, further comprising: a ninth judging module, a tenth judging module and a first screening module;
the ninth judging module is used for judging whether the trust equipment information is stored or not;
The tenth judging module is used for judging the number of the stored trusted device information after the ninth judging module is yes;
The third setting module is further configured to set a bluetooth working state of the apparatus to an externally invisible state after the tenth determining module determines that one piece of stored trusted device information is stored; when the ninth judgment module judges that the Bluetooth work state of the device is not visible, the Bluetooth work state of the device is set to be invisible to the outside; when the first screening module screens out one piece of trusted equipment information according to a preset condition, and deletes other pieces of trusted equipment information, the Bluetooth working state of the device is set to be invisible to the outside;
the first screening module is configured to screen out one piece of trusted device information according to a preset condition and delete other pieces of trusted device information when the tenth determining module determines that the number of pieces of stored trusted device information is multiple.
23. the apparatus of claim 19, further comprising: an eleventh judging module;
The eleventh judging module is configured to judge whether the bluetooth working state of the second judging module is an externally visible and connectable state after the second judging module judges that the type of the triggered key is the first key according to the key value of the key;
the first obtaining module is specifically configured to wait to obtain an input key after the eleventh determining module determines that the input key is not obtained.
24. The apparatus of claim 19, wherein the key interrupt module is further configured to: judging the type of the triggered key after detecting that the key interruption is triggered, and setting the key value of the key to be a second preset value if a second key is triggered;
The device further comprises: a twelfth judging module and a fifth setting module;
the twelfth judging module is configured to judge whether the trusted device information is stored or not after the second judging module judges that the type of the triggered key is the second key according to the key value of the key;
the first setting module is further configured to set a bluetooth working state of the apparatus to a state in which only the trusted device is visible and connectable when the twelfth judging module judges that the bluetooth working state is the visible and connectable state;
And the fifth setting module is used for setting the Bluetooth working state of the device to be invisible to the outside after the twelfth judging module judges that the Bluetooth working state is not visible to the outside.
25. The apparatus of claim 24, further comprising: a thirteenth judging module;
the thirteenth judging module is configured to, after the second judging module judges that the type of the triggered key is the second key according to the key value of the key, judge whether the bluetooth operating state of the second judging module is an externally visible connectable state;
the twelfth judging module is specifically configured to judge whether the trusted device information has been stored after the thirteenth judging module judges that the trusted device information has been stored.
26. the apparatus of claim 24, further comprising: a fourteenth judging module and a second screening module;
the fourteenth judging module is configured to, when the twelfth judging module judges that the trust device information is stored, judge the number of stored trust device information;
the second screening module is used for screening out one piece of trusted device information according to a preset condition and deleting other pieces of trusted device information when the fourteenth judging module judges that the number of the stored trusted device information is more than one;
the first setting module is specifically configured to set a bluetooth working state of the apparatus to a state in which only the trusted device is visible and connectable when the fourth determination module determines that the bluetooth working state is the visible and connectable state; when the fourteenth judging module judges that the number of the stored trusted device information is one, the Bluetooth working state of the device is set to be a state that only the trusted device can be seen and connected; when the second screening module screens out one piece of trusted equipment information according to preset conditions, and deletes other pieces of trusted equipment information, the Bluetooth working state of the device is set to be a state which can be only visible and connectable to the trusted equipment.
27. the apparatus according to claim 20, wherein the first pairing module is specifically configured to perform bluetooth pairing according to a password input pairing mode or a user confirmation pairing mode after the seventh determining module determines that the pairing is yes.
28. The apparatus of claim 19, further comprising: a fifteenth judging module, a sixth setting module and a second connecting module;
the fifteenth judging module is used for judging whether the trust equipment information is stored or not after the device is powered on;
The sixth setting module is configured to set a bluetooth working state of the device itself to a loop invisible state after the fifteenth determining module determines that the bluetooth working state is the loop invisible state;
and the second connection module is used for sending a Bluetooth connection establishment request to equipment according to the information of the trusted equipment after the sixth setting module sets the Bluetooth working state of the device to a loop invisible state.
29. the apparatus of claim 28, further comprising: a sixteenth judging module;
the sixteenth judging module is used for judging whether a second preset time interval is reached or not after the second connecting module sends a request for establishing the Bluetooth connection to the equipment according to the trusted equipment information; after judging that the second preset time interval is not reached, continuously judging whether the second preset time interval is reached;
the first setting module is further configured to set the bluetooth working state of the first setting module to a state in which the bluetooth working state is visible and connectable only to the trusted device after the sixteenth determining module determines that the bluetooth working state is yes.
30. The apparatus of claim 19, further comprising: a seventh setting module and a third connecting module;
The seventh setting module is configured to set the bluetooth working state of the device to a reconnection invisible state after a first preset time interval after the first determining module determines that the bluetooth working state of the device is the visible and connectable state only to the trusted device;
and the third connection module is used for sending a Bluetooth connection establishment request to the equipment according to the trusted equipment information after the seventh setting module sets the Bluetooth working state of the third connection module to be a loop-back invisible state.
31. the apparatus of claim 30, further comprising: a seventeenth judging module;
the seventeenth judging module is used for judging whether a second preset time interval is reached or not after the third connecting module sends a request for establishing Bluetooth connection to the equipment according to the information of the trusted equipment; after judging that the second preset time interval is not reached, continuously judging whether the second preset time interval is reached;
The first setting module is further configured to set the bluetooth working state of the first setting module to a state in which the bluetooth working state is visible and connectable only to the trusted device after the seventeenth determining module determines that the bluetooth working state is yes.
32. the apparatus of claim 19, wherein the key interrupt module is further configured to: judging the type of the triggered key after detecting that the key interruption is triggered, and if a third key is triggered, setting a key value of the key to be a third preset value; if the fourth key is triggered, setting the key value of the key to be a fourth preset value;
The device further comprises: the device comprises a second deleting module, an eighth setting module, an updating pairing module and a third deleting module;
The second deleting module is used for deleting the stored trusted device information after the second judging module judges that the type of the triggered key is a third key according to the key value of the key;
the eighth setting module is configured to set a bluetooth working state of the apparatus itself to an externally invisible state when the second deletion module deletes the stored trusted device information; when the third deleting module deletes the stored trusted device information, the Bluetooth working state of the device is set to be invisible to the outside;
the updating pairing module is used for updating the pairing mode after the second judging module judges that the type of the triggered key is a fourth key according to the key value of the key;
and the third deleting module is used for deleting the stored trusted device information after the second judging module judges that the type of the triggered key is the fourth key according to the key value of the key.
33. The apparatus of claim 32, further comprising: an eighteenth judgment module;
the eighteenth judging module is used for judging whether the own Bluetooth working state is an invisible state;
and the eighth setting module is specifically configured to set the bluetooth working state of the device itself to an externally invisible state after the eighteenth determining module determines that the bluetooth working state is not visible.
34. the apparatus according to claim 20, wherein the seventh determining module is specifically configured to, after the third determining module determines that the monitored bluetooth event is a bluetooth pairing event according to the bluetooth event identifier, detect whether a security menu flag is set, and if so, determine that the bluetooth operating state of the third determining module is an externally visible connectable state; otherwise, judging that the own Bluetooth working state is not an externally visible and connectable state;
the device further comprises: a secure menu sign module;
the safety menu sign module is used for resetting a safety menu sign after the device is powered on; setting a safe menu sign after the first acquisition module acquires a legal input key; and when the third judging module judges that the monitored Bluetooth event is a Bluetooth connection event according to the Bluetooth event identifier, resetting the safety menu sign.
35. the apparatus of claim 19, further comprising a ninth setup module;
And the ninth setting module is used for setting the Bluetooth working state of the device into an invisible state after the device is powered on or before the device is powered off.
36. the apparatus according to claim 20, wherein the third setting module is specifically configured to close a first register of a bluetooth module of the apparatus itself, and set a bluetooth operating state in a main control module of the apparatus itself to an externally invisible state;
the second setting module is specifically used for opening a first register of a Bluetooth module of the device and setting the Bluetooth working state in a main control module of the device into an externally visible and connectable state;
the fourth setting module is specifically configured to open a second register of a bluetooth module of the device itself, and set a bluetooth working state in a main control module of the device itself to an invisible state in connection.
37. The apparatus according to claim 28, wherein the sixth setting module is specifically configured to open a third register of a bluetooth module of the apparatus itself, and set a bluetooth working status in a main control module of the apparatus itself to a loopback invisible status.
38. the apparatus according to claim 30, wherein the seventh setting module is specifically configured to open a third register of a bluetooth module of the apparatus itself, and set a bluetooth working status in a main control module of the apparatus itself to a loopback invisible status.
CN201910872371.1A 2019-09-16 2019-09-16 Method and device for setting Bluetooth working state Active CN110557725B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910872371.1A CN110557725B (en) 2019-09-16 2019-09-16 Method and device for setting Bluetooth working state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910872371.1A CN110557725B (en) 2019-09-16 2019-09-16 Method and device for setting Bluetooth working state

Publications (2)

Publication Number Publication Date
CN110557725A true CN110557725A (en) 2019-12-10
CN110557725B CN110557725B (en) 2021-07-30

Family

ID=68740378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910872371.1A Active CN110557725B (en) 2019-09-16 2019-09-16 Method and device for setting Bluetooth working state

Country Status (1)

Country Link
CN (1) CN110557725B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101511066A (en) * 2009-03-19 2009-08-19 李海 Shortcut method and system for interacting information with Bluetooth equipment
CN102594987A (en) * 2012-02-09 2012-07-18 深圳市中兴移动通信有限公司 Method for realizing safe and quick Bluetooth pairing connection
CN103312508A (en) * 2013-05-15 2013-09-18 飞天诚信科技股份有限公司 Working method of dynamic token
CN104320412A (en) * 2014-11-11 2015-01-28 福建联迪商用设备有限公司 Bluetooth POS and safe Bluetooth POS connecting method and device
CN105577688A (en) * 2016-01-30 2016-05-11 飞天诚信科技股份有限公司 Binding method and apparatus based on Bluetooth device
CN205880745U (en) * 2016-05-27 2017-01-11 北京小鸟看看科技有限公司 Electronic device
CN107835518A (en) * 2017-10-09 2018-03-23 惠州Tcl移动通信有限公司 Selectivity connection and control method, mobile terminal and the storage medium of search bluetooth

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101511066A (en) * 2009-03-19 2009-08-19 李海 Shortcut method and system for interacting information with Bluetooth equipment
CN102594987A (en) * 2012-02-09 2012-07-18 深圳市中兴移动通信有限公司 Method for realizing safe and quick Bluetooth pairing connection
CN103312508A (en) * 2013-05-15 2013-09-18 飞天诚信科技股份有限公司 Working method of dynamic token
CN104320412A (en) * 2014-11-11 2015-01-28 福建联迪商用设备有限公司 Bluetooth POS and safe Bluetooth POS connecting method and device
CN105577688A (en) * 2016-01-30 2016-05-11 飞天诚信科技股份有限公司 Binding method and apparatus based on Bluetooth device
CN205880745U (en) * 2016-05-27 2017-01-11 北京小鸟看看科技有限公司 Electronic device
CN107835518A (en) * 2017-10-09 2018-03-23 惠州Tcl移动通信有限公司 Selectivity connection and control method, mobile terminal and the storage medium of search bluetooth

Also Published As

Publication number Publication date
CN110557725B (en) 2021-07-30

Similar Documents

Publication Publication Date Title
US9450750B2 (en) Communication apparatus and secret information sharing method
WO2018072215A1 (en) Security verification method and apparatus
US9270640B2 (en) Communication device, control method for communication device, and storage medium
KR101101797B1 (en) Wireless terminal and method for managing network connection using the same
CN103391203A (en) Unlocking method, system and device of mobile terminal
CN103488932A (en) Desktop security intercommunication system for mobile device and personal computer and implementation method thereof
CN104301318B (en) The method and apparatus of network reconnection for instant messaging application
CN105141756B (en) It is a kind of to handle abnormal method and apparatus
CN105873028A (en) Terminal control method, terminal control device, and terminal
CN108811181A (en) Intelligent wearable device, security method and computer readable storage medium
CN106154997B (en) Vehicle-mounted control device, terminal device, and vehicle control program updating method and system
CN106211355B (en) Equipment and system for controlling data interaction and working method thereof
CN106648396A (en) Unlocking method and apparatus for mobile terminal
US9451074B2 (en) Method of installing a home-automation system, and an associated home-automation system
CN106685843B (en) Method for safely strengthening router
CN110557725B (en) Method and device for setting Bluetooth working state
CN106302957A (en) Control method, device and the relevant device of the anti-lost contact of a kind of terminal
CN102402651A (en) Device and method for protecting information and portable terminal
CN103442120A (en) Smart phone locking and unlocking method
CN105824450A (en) Error touch preventing method for mobile communication terminal and mobile communication terminal
CN105577635A (en) File transmission method and mobile terminals
CN105744023B (en) A kind of antitheft mobile phone and anti-theft method of mobile phone
CN105426330B (en) A kind of method and device automatically opening extended channel
CN105530360B (en) Dual-system switching method and terminal
KR20110134774A (en) Cordless phone apparatus for controlling the surrounding equipment using short message service and method for controlling thereof

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