Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
At present, in the process of Bluetooth connection, a user needs to start the Bluetooth function of Bluetooth equipment at first, then the Bluetooth equipment searches for surrounding target Bluetooth equipment, and selects the target Bluetooth equipment manually for pairing, establishes communication connection after pairing is successful, and transmits data.
In the embodiment of the application, the geographical position information of the current environment of the terminal is obtained, and the connection attribute value corresponding to the geographical position information is inquired; when the connection attribute value is true, the Bluetooth connection is automatically opened, paired Bluetooth devices are scanned, automatic connection with the paired Bluetooth devices is achieved, the number of times that a user manually opens a Bluetooth connection function of the terminal is reduced, and Bluetooth connection efficiency is improved while Bluetooth connection safety is guaranteed.
Fig. 1 shows a schematic flow chart of an implementation process of a bluetooth connection method provided in an embodiment of the present application, where the method is applied to a terminal, and can be executed by a bluetooth connection device configured on the terminal, and the bluetooth connection device can be implemented in a hardware and/or software manner, and is suitable for a situation where it is necessary to improve bluetooth connection efficiency. The method may includesteps 101 to 104.
In 101, geographical location information of an environment where the terminal is currently located is obtained, and a connection attribute value corresponding to the geographical location information is queried.
In the embodiment of the application, the Bluetooth connection is selected to be opened or not according to the connection attribute value by acquiring the geographical position information of the current environment of the terminal and inquiring the connection attribute value corresponding to the geographical position information according to the geographical position information.
The terminal comprises intelligent terminals such as a smart phone, a tablet computer, a Personal Digital Assistant (PDA) and a learning machine which are provided with a Bluetooth connection function. The terminal can be provided with applications such as a photographing application, a map navigation application, an electronic book reader, a music player and a video player.
The acquiring the geographical position information of the current environment of the terminal comprises the following steps: obtaining geographic position information obtained by positioning by third-party application software on the terminal, for example: a Baidu map or a geographical position information obtained by positioning of a Gade map; it may also be position coordinates detected by a satellite navigation system, such as: latitude and longitude coordinates detected by the Global Positioning System (GPS).
The querying of the connection attribute value corresponding to the geographic location information includes: and searching a corresponding relation record table of the geographical position information and the connection attribute according to the geographical position information, and acquiring a connection attribute value corresponding to the geographical position information.
At 102, it is determined whether the connection attribute value is true.
And the connection attribute value comprises true (true) and false (false) and is used for representing whether the Bluetooth connection is automatically opened or not when the terminal reaches the geographic position corresponding to the geographic position information again.
In the embodiment of the application, the subsequent Bluetooth connection step is triggered by judging whether the connection attribute value is true.
In 103, if the connection attribute value is true, the bluetooth connection is opened, and the paired bluetooth devices are scanned.
And when the connection attribute value is judged to be true, the terminal automatically starts Bluetooth connection and scans whether paired Bluetooth equipment exists around. For example, the terminal opens a bluetooth connection in the bottom layer, and scans the paired bluetooth devices around to perform the bluetooth connection.
It should be noted that the paired bluetooth devices may be all the bluetooth devices successfully paired in the terminal historical bluetooth pairing record; or, the Bluetooth device is successfully paired in the historical Bluetooth pairing record corresponding to the current geographic position of the terminal; or the Bluetooth device which is successfully paired at the current geographic position for the last time by the terminal.
For example, when the terminal reaches the geographic position a and inquires that the connection attribute value corresponding to the geographic position a is true, starting bluetooth connection, and scanning all successfully paired bluetooth devices in the historical bluetooth pairing record of the terminal; or scanning all the Bluetooth devices successfully paired at the geographic position A of the terminal; or only scanning the Bluetooth equipment successfully paired when the terminal reaches the geographic position A last time. The geographic location a may be a resident address such as a home address and a company address preset by the user, or a temporary address such as a restaurant, a coffee shop and a movie theater where the user has opened a bluetooth connection.
Optionally, in order to ensure the security of the bluetooth connection, when the bluetooth connection is opened, scanning the bluetooth device successfully paired at the current geographic location by default.
The bluetooth device can be a bluetooth sound box, a bluetooth headset, a smart phone, a tablet computer, a Personal Digital Assistant (PDA), a learning machine, or a household appliance with a bluetooth connection function, such as a television, a refrigerator, an air conditioner, and the like. It should be noted that, this is only an example and is not meant to limit the scope of the present application, and in other embodiments of the present application, the bluetooth device may also be another terminal having a bluetooth connection function.
At 104, if the paired bluetooth device is scanned, the paired bluetooth device is connected.
And when the paired Bluetooth equipment is scanned by the terminal, the paired Bluetooth equipment is reconnected, and when the connection is successful, a Bluetooth icon is displayed in an interface of the terminal and used for indicating that the terminal opens Bluetooth connection.
In the embodiment of the application, by combining the geographic position information of the current environment of the terminal and the connection attribute value corresponding to the geographic position information, the automatic connection of the paired Bluetooth devices is realized, the times of manually starting the Bluetooth connection function of the terminal by a user are reduced, and the Bluetooth connection efficiency is improved while the Bluetooth connection safety is ensured. For some specific users, for example, users who like to connect a bluetooth speaker at home to play music, the use experience of the bluetooth speaker can be improved.
Optionally, if the paired bluetooth device is scanned, connecting the paired bluetooth device includes: displaying the connected bluetooth device. Therefore, the user can check the Bluetooth equipment connected with the terminal at any time, and the safety of Bluetooth connection is ensured.
In some embodiments of the present application, the starting a bluetooth connection if the connection attribute value is true, and after scanning paired bluetooth devices, the starting the bluetooth connection includes: and if the paired Bluetooth equipment is not scanned or successfully connected, closing Bluetooth connection and setting a connection attribute value corresponding to the geographic position information as false.
For example, the paired bluetooth device does not open a bluetooth connection, or the paired bluetooth device fails, or the paired bluetooth device has been moved away from the current geographic location of the terminal, so that the terminal does not scan the paired bluetooth device; or the paired Bluetooth equipment changes the pairing mode, so that the terminal scans the paired Bluetooth equipment but fails to be successfully connected with the Bluetooth equipment; and closing the Bluetooth connection of the terminal so as to reduce the power consumption of the terminal, and setting the connection attribute value corresponding to the geographic position information to be false so that the Bluetooth connection is not automatically opened when the terminal reaches the current geographic position again, but the Bluetooth connection is opened when a user actively triggers a Bluetooth connection triggering instruction, and Bluetooth pairing is performed so as to reduce the risk of illegal equipment connection.
In some embodiments of the present application, as shown in fig. 2, after the determining whether the connection attribute value is true, the method further includes:steps 105 to 107.
In 105, if the connection attribute value is false, then it is monitored whether the bluetooth connection is triggered.
And 106, according to the monitored Bluetooth connection triggering instruction, starting Bluetooth connection and carrying out Bluetooth pairing.
In 107, when pairing with the bluetooth device is successful, recording identification information for uniquely identifying the paired bluetooth device; and storing the geographical position information of the current environment of the terminal, and simultaneously setting the connection attribute value corresponding to the geographical position information as true.
In the embodiment of the application, in order to ensure the safety of bluetooth connection, when the connection attribute value corresponding to the geographical location information of the current environment of the terminal is false, the terminal does not automatically start the bluetooth connection function. Therefore, when the connection attribute value corresponding to the geographical location information of the current environment of the terminal is false, it is required to monitor whether the user actively starts the bluetooth connection function.
And when a Bluetooth connection triggering instruction triggered by a user is monitored, the terminal starts Bluetooth connection and performs Bluetooth pairing.
Wherein, when pairing with bluetooth equipment, its pairing mode includes: and a pairing mode of digital comparison and input pairing code comparison. The number comparison means that a user compares the numbers on the terminal and the Bluetooth equipment, and clicks to determine connection when the number displayed on the terminal is consistent with the number displayed on the Bluetooth equipment needing to be connected so as to complete Bluetooth pairing; or the user inputs the number displayed on the Bluetooth equipment to be connected, and the Bluetooth equipment receives the number input by the user and then compares the number to complete Bluetooth pairing.
The input pairing code comparison means that the user inputs the pairing code of the Bluetooth equipment to carry out Bluetooth pairing, when the pairing code input by the user is correct, the Bluetooth pairing is successful, and otherwise, the Bluetooth pairing is failed. The pairing code comprises a Bluetooth device ID, a serial number or other identification numbers for uniquely identifying the Bluetooth device.
When the Bluetooth device is successfully paired, recording identification information for uniquely identifying the paired Bluetooth device; and storing the geographical position information of the current environment of the terminal, and simultaneously setting the connection attribute value corresponding to the geographical position information as true.
For example, when the terminal and the bluetooth device are successfully paired, the ID number of the bluetooth device or the serial number of the bluetooth device is correspondingly stored with the geographic location information of the current environment of the terminal, and the connection attribute value corresponding to the geographic location information is set to true and recorded in the corresponding relationship record table of the geographic location information and the connection attribute, so that when the terminal reaches the geographic location corresponding to the current geographic location information next time, the connection attribute value corresponding to the geographic location information is inquired, and automatic bluetooth connection is realized.
In some embodiments of the present application, the obtaining geographic location information of a current environment in which the terminal is located, and querying a connection attribute value corresponding to the geographic location information includes: acquiring geographical position information of a current environment of a terminal, and matching the geographical position information of the current environment of the terminal with geographical position information stored by the terminal; and if the matching is successful, inquiring a connection attribute value corresponding to the geographic position information of the current environment of the terminal.
That is, the connection attribute value corresponding to the geographical location information is acquired only after the geographical location information is described. And if the geographic position information of the current environment of the terminal is unsuccessfully matched with the geographic position information stored by the terminal, not inquiring a connection attribute value corresponding to the geographic position information of the current environment of the terminal, and quickly determining whether to automatically start Bluetooth connection.
In some embodiments of the present application, before acquiring geographic location information of an environment where a terminal is currently located and querying a connection attribute value corresponding to the geographic location information, the method includes: and receiving a resident address setting instruction and setting resident address information. Correspondingly, the obtaining of the geographical location information of the current environment of the terminal, and the querying of the connection attribute value corresponding to the geographical location information includes: acquiring the geographical position information of the current environment of the terminal, and matching the geographical position information of the current environment of the terminal with the resident address information; and if the matching is successful, inquiring a connection attribute value corresponding to the geographic position information of the current environment of the terminal.
That is to say, the user may preset the resident address of the terminal, so that when the terminal arrives at the resident address, the connection attribute value corresponding to the geographical location information of the current environment of the terminal is queried, and when the connection attribute value is true, the bluetooth connection is automatically opened.
Optionally, the receiving a resident address setting instruction, after setting the resident address information, includes: and setting the connection attribute value corresponding to the resident address information to be false.
For example, when the user sets the permanent address as the company address in advance, in order to ensure the security of bluetooth connection, it is necessary for the terminal to perform bluetooth connection for the first time, and the operation process of pairing with the bluetooth device is performed by the user. Therefore, the terminal is actively started by the user when the resident address performs the first Bluetooth connection, so that illegal equipment which does not need Bluetooth verification is prevented from being connected to the terminal, and the safety of the terminal in connection with Bluetooth equipment is improved.
If the user does not enter the regular station again next time when the resident address is not connected with the Bluetooth device, the Bluetooth connection is not automatically opened, so that the safety of the terminal connected with the Bluetooth device is improved.
Fig. 3 shows a schematic structural diagram of abluetooth connection apparatus 300 according to an embodiment of the present application, which includes aninquiry unit 301, adetermination unit 302, ascanning unit 303, and aconnection unit 304.
Aquery unit 301, configured to obtain geographic position information of a current environment where a terminal is located, and query a connection attribute value corresponding to the geographic position information;
a judgingunit 302, configured to judge whether the connection attribute value is true;
ascanning unit 303, configured to open a bluetooth connection and scan paired bluetooth devices if the connection attribute value is true;
aconnection unit 304, configured to connect the paired bluetooth device if the paired bluetooth device is scanned.
In some embodiments of the present application, thebluetooth connection apparatus 300 further includes a setting unit, configured to close the bluetooth connection and set a connection attribute value corresponding to the geographic location information to false if the paired bluetooth devices are not scanned.
In some embodiments of the present application, as shown in fig. 4, thebluetooth connection apparatus 300 further includes:
amonitoring unit 305, configured to monitor whether the bluetooth connection is triggered if the connection attribute value is false.
Thepairing unit 306 is used for starting the Bluetooth connection according to the monitored Bluetooth connection triggering instruction and performing Bluetooth pairing;
arecording unit 307, configured to record, when pairing with a bluetooth device is successful, identification information for uniquely identifying the paired bluetooth device; and storing the geographical position information of the current environment of the terminal, and simultaneously setting the connection attribute value corresponding to the geographical position information as true.
Optionally, thequery unit 301 is further configured to obtain geographic location information of a current environment of the terminal, and match the geographic location information of the current environment of the terminal with the geographic location information stored in the terminal; and if the matching is successful, inquiring a connection attribute value corresponding to the geographic position information of the current environment of the terminal.
Optionally, the bluetooth connection apparatus further includes an address setting unit, configured to receive a resident address setting instruction and set resident address information; correspondingly, the query unit is further configured to acquire geographic position information of a current environment where the terminal is located, and match the geographic position information of the current environment where the terminal is located with the resident address information; and if the matching is successful, inquiring a connection attribute value corresponding to the geographic position information of the current environment of the terminal.
Optionally, the bluetooth connection apparatus further includes a setting subunit, configured to set, after the receiving a resident address setting instruction and setting resident address information, a connection attribute value corresponding to the resident address information to false.
It should be noted that, for convenience and brevity of description, the specific working process of thebluetooth connection apparatus 300 described above may refer to the corresponding process of the method described in fig. 1 to fig. 2, and is not described herein again.
As shown in fig. 5, the present application provides a terminal for implementing the bluetooth connection method, where the terminal may be a terminal such as a smart phone, a tablet computer, a Personal Computer (PC), a Personal Digital Assistant (PDA), a learning machine, and includes: one or more input devices 53 (only one shown in fig. 5) and one or more output devices 54 (only one shown in fig. 5). Theprocessor 51,memory 52,input device 53 andoutput device 54 are connected by abus 55.
It should be understood that, in the embodiment of the present Application, theProcessor 51 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Theinput device 53 may include a keyboard, a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and theoutput device 54 may include a display, a speaker, etc.
Thememory 52 may include a read-only memory and a random access memory, and provides instructions and data to theprocessor 51. Some or all of thememory 51 may also include non-volatile random access memory. For example, thememory 52 may also store device type information.
Thememory 52 stores a computer program that is executable on theprocessor 51, for example, a program of a method of bluetooth connection. Theprocessor 51 implements the steps in the above-described method embodiment of bluetooth connection, such assteps 101 to 104 shown in fig. 1, when executing the computer program. Alternatively, theprocessor 51, when executing the computer program, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of theunits 301 to 304 shown in fig. 3.
The computer program may be divided into one or more modules/units, which are stored in thememory 52 and executed by theprocessor 51 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the bluetooth connected terminal. For example, the computer program may be divided into an inquiry unit, a judgment unit, a scanning unit and a connection unit, and each unit has the following specific functions: the query unit is used for acquiring the geographical position information of the current environment of the terminal and querying the connection attribute value corresponding to the geographical position information; a judging unit, configured to judge whether the connection attribute value is true; the scanning unit is used for starting Bluetooth connection and scanning paired Bluetooth equipment if the connection attribute value is true; and the connection unit is used for connecting the paired Bluetooth equipment if the paired Bluetooth equipment is scanned.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.