Summary of the invention
The main purpose of the present invention is to provide a kind of mode switching methods based on bluetooth connection, it is intended to solve existing skillThe bluetooth equipment of art is to provide using effect and be unable to active switch machine in disconnected situation to cause the technical issues of energy consumption is high.
To achieve the above object, the present invention provides a kind of mode switching method based on bluetooth connection, including the following contents:
Bluetooth equipment detection instruction is initiated, currently whether has bluetooth equipment to be paired to detect;
When receiving the response message of bluetooth equipment to be paired, bluetooth connection is established with the bluetooth equipment to be paired;
Starting device power supply simultaneously switches current standby mode to operating mode.
Preferably, described when receiving the response message of bluetooth equipment to be paired, it is built with the bluetooth equipment to be pairedThe step of vertical bluetooth connection, comprising:
The facility information of the bluetooth equipment to be paired is read, to confirm whether the bluetooth equipment to be paired can connect;
When confirming that the bluetooth equipment to be paired can connect, bluetooth connection is established with the bluetooth equipment to be paired.
Preferably, it after whether the confirmation has the step of history linkage record with the bluetooth equipment to be paired, also wrapsIt includes:
When confirming that the bluetooth equipment to be paired can not connect, keep current standby mode constant.
Preferably, the facility information for reading the bluetooth equipment to be paired, to confirm the bluetooth equipment to be pairedWhether attachable step, further includes:
According to the facility information of the bluetooth equipment to be paired read, confirm whether the bluetooth equipment to be paired has historyLinkage record;
When confirming that the bluetooth equipment to be paired has history linkage record, confirm that the bluetooth equipment to be paired can connectIt connects.
Preferably, the starting device power supply and the step of switch current standby mode to working condition after, also wrapIt includes:
When detecting that bluetooth connection disconnects, current equipment power supply is cut off;
And switch current operating mode to standby mode.
Preferably, described when detecting that bluetooth connection disconnects, the step of cutting off current equipment power supply, further includes:
The turn-off time that the bluetooth connection disconnects is counted, and when confirming that the turn-off time is greater than preset time, is heldRow cuts off the step of current equipment power supply.
In addition, to achieve the above object, the present invention also provides a kind of bluetooth equipment, the bluetooth equipment include: memory,Processor and it is stored in the mode switching program based on bluetooth connection that can be run on the memory and on the processor,It is described to realize as described above based on the mould of bluetooth connection when being executed based on the mode switching program of bluetooth connection by the processorThe step of formula switching method.
The present invention also provides a kind of mode-changeover device based on bluetooth connection, the pattern switching based on bluetooth connectionDevice includes: bluetooth equipment, memory, processor and is stored on the memory and can run on the processorThe mode switching program based on bluetooth connection, the realization when mode switching program based on bluetooth connection is executed by processorThe step of mode switching method based on bluetooth connection as described above.
The present invention also provides a kind of mode switching system based on bluetooth connection, the pattern switching based on bluetooth connectionSystem includes bluetooth equipment as described above and as described above based on the mode-changeover device of bluetooth connection.
A kind of mode switching method based on bluetooth connection that the embodiment of the present invention proposes is protected based on current standby modeBluetooth module work is demonstrate,proved, to initiate bluetooth equipment detection instruction, whether detection currently has bluetooth equipment to be paired;Receive toWhen matching the response message of bluetooth equipment, bluetooth connection is established with the bluetooth equipment to be paired;Starting device power supply simultaneously switchesCurrent standby mode is to operating mode.Initiate bluetooth equipment detection instruction by the operation of current standby mode with detect toBluetooth equipment is configured, and is establishing pattern switching of the starting device based on bluetooth connection after bluetooth connection with bluetooth equipment to be pairedTo operating mode, operating mode is compared, standby mode does not need too many electricity, therefore switches work by bluetooth connection statusOperation mode realizes the beneficial effect for reducing energy consumption.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Whether the primary solutions of the embodiment of the present invention are: initiating bluetooth equipment detection instruction, currently needed with detectionMatch bluetooth equipment;When receiving the response message of bluetooth equipment to be paired, bluetooth is established with the bluetooth equipment to be pairedConnection;Starting device power supply simultaneously switches current standby mode to operating mode.
Since smart machines more and more in current family occur, such as smart television, speaker, routing, these equipmentIt takes a long time when also resulting in starting while complete function is provided, is inconvenient when user thinks to use at any time, becauseThis many equipment is just no longer shut down once connecting with the mains, and also increases equipment loss and power consumption to a certain degree.
The present invention provides a solution, by the operation of current standby mode initiate bluetooth equipment detection instruction withIt detects bluetooth equipment to be configured, and is establishing mould of the starting device based on bluetooth connection after bluetooth connection with bluetooth equipment to be pairedFormula switches to operating mode, compares operating mode, standby mode does not need too many electricity, therefore passes through bluetooth connection statusSwitching working mode realizes the beneficial effect for reducing energy consumption.
As shown in Figure 1, Fig. 1 is the terminal structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
The terminal of that embodiment of the invention can be PC, be also possible to smart phone, tablet computer, E-book reader, portableThe packaged type bluetooth-capable such as computer or irremovable formula terminal device.
As shown in Figure 1, the terminal may include: processor 1001, such as CPU, network interface 1004, user interface1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is for realizing the connection communication between these components.User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include that the wired of standard connectsMouth, wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory, be also possible to stable memory(non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor1001 storage device.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal of terminal structure shown in Fig. 1, can wrapIt includes than illustrating more or fewer components, perhaps combines certain components or different component layouts.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage mediumBelieve module, Subscriber Interface Module SIM and the pattern switching application program based on bluetooth connection.
In terminal shown in Fig. 1, network interface 1004 is mainly used for connecting background server, carries out with background serverData communication;User interface 1003 is mainly used for connecting client (user terminal), carries out data communication with client;And processor1001 can be used for calling the pattern switching application program based on bluetooth connection stored in memory 1005, and execute following behaviourMake:
Bluetooth equipment detection instruction is initiated, currently whether has bluetooth equipment to be paired to detect;
When receiving the response message of bluetooth equipment to be paired, bluetooth connection is established with the bluetooth equipment to be paired;
Starting device power supply simultaneously switches current standby mode to operating mode.
Further, processor 1001 can call the pattern switching based on bluetooth connection stored in memory 1005 to answerWith program, following operation is also executed:
The facility information of the bluetooth equipment to be paired is read, to confirm whether the bluetooth equipment to be paired can connect;
When confirming that the bluetooth equipment to be paired can connect, bluetooth connection is established with the bluetooth equipment to be paired.
Further, processor 1001 can call the pattern switching based on bluetooth connection stored in memory 1005 to answerWith program, following operation is also executed:
When confirming that the bluetooth equipment to be paired can not connect, keep current standby mode constant.
Further, processor 1001 can call the pattern switching based on bluetooth connection stored in memory 1005 to answerWith program, following operation is also executed:
According to the facility information of the bluetooth equipment to be paired read, confirm whether the bluetooth equipment to be paired has historyLinkage record;
When confirming that the bluetooth equipment to be paired has history linkage record, confirm that the bluetooth equipment to be paired can connectIt connects.
Further, processor 1001 can call the pattern switching based on bluetooth connection stored in memory 1005 to answerWith program, following operation is also executed:
When detecting that bluetooth connection disconnects, current equipment power supply is cut off;
And switch current operating mode to standby mode.
Further, processor 1001 can call the pattern switching based on bluetooth connection stored in memory 1005 to answerWith program, following operation is also executed:
The turn-off time that the bluetooth connection disconnects is counted, and when confirming that the turn-off time is greater than preset time, is heldRow cuts off the step of current equipment power supply.
Referring to Fig. 2, Fig. 2 be the present invention is based on the flow diagram of the mode switching method first embodiment of bluetooth connection,The mode switching method based on bluetooth connection includes:
Step S10 initiates bluetooth equipment detection instruction, currently whether has bluetooth equipment to be paired to detect;
In current Bluetooth equipment when not having bluetooth connection, i.e., the described bluetooth equipment does not have corresponding bluetooth equipment to be pairedWhen carrying out bluetooth connection, into standby mode.At runtime, meeting cut-off equipment power supply leads to the standby mode of the bluetooth equipmentThe remaining power supply for crossing the bluetooth equipment supports the standby mode of the bluetooth equipment to run.The bluetooth equipment is in standby modeOnly bluetooth module is supported to start when operation, the detection signal of bluetooth equipment to be paired is issued with the preset time cycle.Pass throughThe bluetooth equipment detection signal confirmation of sending is nearby either with or without the bluetooth equipment to be paired that can be matched, to realize that bluetooth connection is graspedMake.
Step S20 is established blue when receiving the response message of bluetooth equipment to be paired with the bluetooth equipment to be pairedTooth connection;
According to the detection instruction of the bluetooth equipment of initiation, if needing in the detection range of the detection instruction of the bluetooth equipmentWhen matching bluetooth equipment, the bluetooth equipment to be paired is in the detection instruction of the bluetooth equipment received, returning responseInformation.The response message of bluetooth equipment to be paired is received, and is established according to the corresponding information and the bluetooth equipment to be pairedBluetooth connection.The operation of the bluetooth connection is existing bluetooth connection operation, not described here any more.In addition, in foundation and instituteWhen stating the bluetooth connection of bluetooth equipment to be paired, confirm whether the bluetooth equipment to be paired allows to connect, i.e., it is described to receiveTo bluetooth equipment to be paired response message when, the step of establishing bluetooth connection with the bluetooth equipment to be paired, comprising:
The facility information of the bluetooth equipment to be paired is read, to confirm whether the bluetooth equipment to be paired can connect;
When confirming that the bluetooth equipment to be paired can connect, bluetooth connection is established with the bluetooth equipment to be paired.
The facility information of the bluetooth equipment to be paired is read, the facility information includes the correlations such as device id, network IDFacility information relevant to bluetooth connection.Confirm whether the bluetooth equipment to be paired can be real according to the facility information readExisting bluetooth connection operation.It specifically confirms whether bluetooth equipment to be paired can realize the operation of bluetooth connection, with described wait matchThe bluetooth of bluetooth equipment is arranged related, the bluetooth setting includes the functions such as connection password, pairing limitation, specifically and equipmentFunction setting is related.And in practical applications, do not consider bluetooth setting bluetooth connection operation, mainly with history linkage record phaseIt closes.Therefore, the facility information for reading the bluetooth equipment to be paired, to confirm whether the bluetooth equipment to be paired can connectThe step of connecing, further includes:
According to the facility information of the bluetooth equipment to be paired read, confirm whether the bluetooth equipment to be paired has historyLinkage record;
When confirming that the bluetooth equipment to be paired has history linkage record, confirm that the bluetooth equipment to be paired can connectIt connects.
According to the facility information of the bluetooth equipment to be paired, confirm whether have in current Bluetooth equipment with it is described to be pairedThe consistent history linkage record information of the facility information of bluetooth equipment.The history linkage record is potentially stored in current Bluetooth and setsIn the correspondence storage region of standby history linkage record, validation testing be by the facility information of the bluetooth equipment to be paired withStored history linkage record is compared one by one, is had and the indigo plant to be paired in confirming stored history linkage recordWhen the consistent history linkage record of the facility information of tooth equipment, confirm that the bluetooth equipment to be paired can connect.
In this way, when the correspondence bluetooth equipment to be paired of response message that confirmation receives can connect, establish with it is described toMatch the bluetooth connection of bluetooth equipment.
In addition, after whether the confirmation has the step of history linkage record with the bluetooth equipment to be paired, further includes:
When confirming that the bluetooth equipment to be paired can not connect, keep current standby mode constant.
When confirming that the bluetooth equipment to be paired can not connect, i.e., the described bluetooth equipment to be paired does not allow bluetooth connectionOr the bluetooth equipment to be paired confirms that the bluetooth equipment to be paired can not connect, keeps when not having history linkage recordThe standby mode of current Bluetooth equipment is constant, and continues to initiate bluetooth equipment detection instruction with predetermined period, with rediscover canThe bluetooth equipment to be paired of connection.
Step S30, starting device power supply simultaneously switch current standby mode to operating mode.
According to current bluetooth connection, starts the equipment power supply of current Bluetooth equipment and switch currently running standby modeTo operating mode, to execute equipment application operation based on current Bluetooth operation.
Further, the bluetooth applications of the bluetooth equipment to be paired based on current bluetooth connection and connection operate, instituteAfter the step of stating starting device power supply and switching current standby mode to working condition, further includes:
When detecting that bluetooth connection disconnects, current equipment power supply is cut off;
And switch current operating mode to standby mode.
Based on current bluetooth connection, when detecting that bluetooth connection disconnects.To reduce energy consumption, current Bluetooth equipment is cut offEquipment power supply, and switch the operating mode of current Bluetooth equipment to standby mode, so that current Bluetooth equipment is in low energy consumptionIn the state of run, and by support bluetooth module operation initiate bluetooth equipment detection instruction.Further, connected based on bluetoothThe connection state connect influences user's use to avoid bluetooth connection from disconnecting in the state of improper, passes through and record bluetooth connectionThe turn-off time of disconnection determines whether to switch to standby mode operation, i.e., described when detecting that bluetooth connection disconnects, cuttingThe step of current equipment power supply, further includes:
The turn-off time that the bluetooth connection disconnects is counted, and when confirming that the turn-off time is greater than preset time, is heldRow cuts off the step of current equipment power supply.
When detecting that bluetooth connection disconnects, the turn-off time that the bluetooth connection disconnects is recorded.And it is disconnected by what is be recordedETAD expected time of arrival and departure is compared with preset time, confirms whether current Bluetooth equipment will switch to standby mode according to comparison result, described pre-If the time is that defined bluetooth disconnects upper limit time, specific setting can be according to the bluetooth connection port of current Bluetooth equipmentOr facility information sets corresponding preset time, more accurately to define the time of bluetooth connection and disconnection.Remember in confirmationWhen the turn-off time recorded is greater than the preset time, confirm that the current bluetooth opening operation normal off that is positive is opened, to reduceThe energy consumption of current Bluetooth equipment switches currently running operating mode to standby mode.
In the present embodiment, bluetooth equipment detection instruction is initiated to detect indigo plant to be configured by the operation of current standby modeTooth equipment, and pattern switching of the starting device based on bluetooth connection extremely works after establishing bluetooth connection with bluetooth equipment to be pairedMode compares operating mode, and standby mode does not need too many electricity, therefore passes through bluetooth connection status switch operating mouldFormula realizes the beneficial effect for reducing energy consumption.
The present invention also provides a kind of mode switching system based on bluetooth connection, the pattern switching based on bluetooth connectionSystem realizes the content of the embodiment of the mode switching method based on bluetooth connection as described above at runtime.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-rowHis property includes, so that the process, method, drug or the system that include a series of elements not only include those elements, andAnd further include other elements that are not explicitly listed, or further include for this process, method, drug or system institute it is intrinsicElement.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to doThere is also other identical elements in the process, method of element, drug or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment sideMethod can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many casesThe former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior artThe part contributed out can be embodied in the form of software products, which is stored in one as described aboveIn storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone,Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hairEquivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skillsArt field, is included within the scope of the present invention.