CN110505609B - Bluetooth interaction method, bluetooth interaction device and terminal equipment - Google Patents

Bluetooth interaction method, bluetooth interaction device and terminal equipment Download PDF

Info

Publication number
CN110505609B
CN110505609B CN201811091856.9A CN201811091856A CN110505609B CN 110505609 B CN110505609 B CN 110505609B CN 201811091856 A CN201811091856 A CN 201811091856A CN 110505609 B CN110505609 B CN 110505609B
Authority
CN
China
Prior art keywords
bluetooth connection
sub
initialization process
timer
bluetooth
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811091856.9A
Other languages
Chinese (zh)
Other versions
CN110505609A (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.)
Shenzhen Excelsecu Data Technology Co Ltd
Original Assignee
Shenzhen Excelsecu Data Technology 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 Shenzhen Excelsecu Data Technology Co Ltd filed Critical Shenzhen Excelsecu Data Technology Co Ltd
Priority to CN201811091856.9A priority Critical patent/CN110505609B/en
Publication of CN110505609A publication Critical patent/CN110505609A/en
Application granted granted Critical
Publication of CN110505609B publication Critical patent/CN110505609B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • 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
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/18Management of setup rejection or failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/19Connection re-establishment
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application is applicable to the technical field of communication, and provides a Bluetooth interaction method, a Bluetooth interaction device and terminal equipment, which comprise: initiating a bluetooth connection request to a slave device; after the Bluetooth connection with the slave equipment is established, initiating an initialization process to the slave equipment and detecting whether the initialization process is successful; and if the initialization process fails, initiating the Bluetooth connection request to the slave equipment again. By the method, the problems of long time consumption and easy failure in the Bluetooth connection and initialization process are effectively solved.

Description

Bluetooth interaction method, bluetooth interaction device and terminal equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a bluetooth interaction method, a bluetooth interaction apparatus, and a terminal device.
Background
Bluetooth Low Energy (BLE) technology is a low-cost, short-range, interoperable, robust wireless technology that employs very fast connection means. Therefore, a bluetooth device using BLE technology may be in "disconnected" state (saving energy) at ordinary times, and at this time, devices at both ends of a link know each other, and only turn on the link when data needs to be transmitted, and then turn off the link in as short a time as possible.
Although BLE has the advantage of fast connection, after being connected with a bluetooth security device, an initialization procedure is usually required to be executed, and in some devices, problems of long time consumption and easy failure may occur in the bluetooth connection and the initialization procedure, so that the advantage of BLE fast connection cannot be effectively embodied.
Disclosure of Invention
In view of this, embodiments of the present application provide a bluetooth interaction method, a bluetooth interaction apparatus, and a terminal device, so as to solve the problems in the prior art that a bluetooth connection and initialization process is time-consuming and prone to failure.
A first aspect of an embodiment of the present application provides a bluetooth interaction method, including:
initiating a bluetooth connection request to a slave device;
after the Bluetooth connection with the slave equipment is established, initiating an initialization process to the slave equipment and detecting whether the initialization process is successful;
and if the initialization process fails, initiating a Bluetooth connection request to the slave equipment again.
A second aspect of the embodiments of the present application provides a bluetooth interaction apparatus, including:
a request unit for initiating a bluetooth connection request to a slave device;
the initialization unit is used for initiating an initialization process to the slave equipment after the Bluetooth connection with the slave equipment is established, and detecting whether the initialization process is successful or not;
and the connection unit is used for initiating the Bluetooth connection request to the slave equipment again if the initialization process fails.
A third aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method provided in the first aspect of the embodiment of the present application when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
Compared with the prior art, the embodiment of the application has the advantages that:
in the embodiment of the application, after the Bluetooth connection is established with the slave equipment, an initialization process is initiated to the slave equipment, and whether the initialization process is successful or not is detected; and if the initialization process fails, initiating a Bluetooth connection request to the slave equipment again. By the method, the occurrence probability of initialization failure is effectively avoided, and the success rate of Bluetooth interaction is effectively increased.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart illustrating an implementation process of a bluetooth interaction method according to an embodiment of the present application;
fig. 2 is a schematic diagram of an initialization procedure provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a bluetooth interaction apparatus provided in an embodiment of the present application;
fig. 4 is a schematic diagram of a terminal device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic implementation flowchart of a bluetooth interaction method provided in an embodiment of the present application, and as shown in the figure, the method may include the following steps:
step S101, a Bluetooth connection request is initiated to the slave device.
In one embodiment, after initiating the bluetooth connection request to the slave device, the method further comprises:
detecting whether a Bluetooth connection is established with a slave device within a first preset time after a Bluetooth connection request is initiated to the slave device.
If the Bluetooth connection with the slave equipment is detected to be established within first preset time after the Bluetooth connection request is initiated to the slave equipment, initiating an initialization process to the slave equipment.
And if the Bluetooth connection with the slave equipment is detected not to be established within the first preset time after the Bluetooth connection request is initiated to the slave equipment, the Bluetooth connection request is initiated to the slave equipment again.
In practical application, the embodiment of the application is applied to the master device, the master device initiates a bluetooth connection request to the slave device, and detects whether the connection with the slave device is successfully established within a first preset time after the request is sent. Under the normal condition, the master device initiates a bluetooth connection request to the slave device and then can detect the time when the connection with the slave device is successfully established. In practical application, the first preset time can be manually preset according to actual conditions. It should be noted that the master device and the slave device are not used to define the slave relationship of the bluetooth device, and the bluetooth device initiating the bluetooth connection request may be the master device. Therefore, in practical applications, the roles of the master device and the slave device may be switched.
Step S102, after the Bluetooth connection is established with the slave device, initiating an initialization process to the slave device, and detecting whether the initialization process is successful.
In one embodiment, the initialization procedure includes at least one sub-procedure. The detecting whether the initialization process is successful includes:
and if any sub-process processing of the initialization process fails, judging that the initialization process fails.
And if any sub-process of the initialization process succeeds, processing the next sub-process.
And if all the sub-processes of the initialization process are successfully processed, judging that the initialization process is successful.
In one embodiment, the initialization process includes an authentication sub-process and a key agreement sub-process. It should be noted that, in practical application, the bluetooth connection process may further include other sub-processes, and the processing sequence of each sub-process may not be sequential, or may be performed according to a certain sequence. For example, the key agreement sub-process may be performed after the authentication sub-process.
Specific initialization process can be referred to fig. 2, fig. 2 is a schematic diagram of an initialization process provided in the embodiment of the present application, and as shown in the figure, the initialization process includes:
step S201, performing the sub-process processing, and detecting whether the information that the sub-process processing is successful is received within a second preset time after the sub-process processing.
Step S202, if the information that the sub-process processing is successful is not received within the second preset time after the sub-process processing, it is determined that the sub-process processing fails.
Step S203, if the information that the sub-process is successfully processed is received within the second preset time after the sub-process is processed, determining that the sub-process is successfully processed.
And the second preset time is the time for receiving the information of the success/failure of the sub-process processing after the sub-process is processed under the normal condition. In practical application, the second preset time can be preset manually according to practical conditions.
Illustratively, when the bluetooth initialization process is performed, the authentication sub-process is performed first, and whether the information of successful authentication is received is detected within a second preset time after the authentication sub-process is performed. And if the information of successful authentication is not received within the second preset time after the authentication subprocess is processed, the processing of the authentication subprocess fails. And if the information that the authentication sub-process is successfully processed is received within the second preset time after the authentication sub-process is processed, the authentication sub-process is successfully processed, and the key agreement sub-process is continuously processed. And detecting whether the information of successful key agreement is received or not within a third preset time after the key agreement sub-process is processed. If the information of successful key agreement is not received within the third preset time after the key agreement sub-process is processed, the processing of the key agreement process fails. And if the information that the key negotiation sub-process is successfully processed is received within the third preset time after the key negotiation sub-process is processed, the key negotiation sub-process is successfully processed, and the initialization is successful until the processing of the Bluetooth connection process is finished.
It should be noted that the first, second, and third of the first preset time, the second preset time, and the third preset time do not represent a sequence or a counting relationship, but are used to represent different preset times.
Step S103, if the initialization process fails, a Bluetooth connection request is initiated to the slave device again.
In an embodiment, after the initialization procedure fails, a failure reason may also be obtained, and if the failure reason is caused by abnormal communication, the bluetooth connection request is re-initiated to the slave device, where the failure reason caused by abnormal communication may be no response of the slave device or data confusion. And if the failure reason is not caused by the communication abnormity, the initialization process or the sub-process thereof is reinitiated.
In one embodiment, the number of retries may be preset, where the number of retries is the number of times of re-initiating the bluetooth connection request to the slave device, and when the number of retries is exceeded, the user is directly prompted for failure information.
In one embodiment, after detecting that the bluetooth connection is established with the slave device, the method further includes:
it is confirmed whether a timer associated with the bluetooth connection time has started.
And if the timer is not started, starting the timer, and setting the time of the timer as an initial value.
In practical application, after detecting that the connection with the slave device is successfully established, it needs to determine whether a timer is started, and if the timer is started, the master device performs the processing of the bluetooth connection process before the bluetooth connection, and the processing of the bluetooth initialization process fails; at this time, the timer is only required to continuously record the connection time. If the timer is not started, the Bluetooth connection is the first connection, and if the Bluetooth connection is the first connection, the timer needs to be started, the time of the timer is set to be an initial value, and the connection time is recorded by the timer. Wherein, the initial value can be 00.
In one embodiment, before initiating a bluetooth connection request to the slave device again if the initialization procedure fails, the method further includes:
and acquiring the current time of the timer.
And if the current time of the timer is greater than or equal to the preset value, judging that the initialization process fails.
And if the current time of the timer is less than the preset value, initiating a Bluetooth connection request to the slave equipment again.
In practical application, the preset value can be manually preset, the preset value is used for judging whether the time recorded by the timer is overtime, and if the time is not overtime, the Bluetooth connection request is initiated to the slave equipment again; if it times out, initialization fails. Therefore, the time of the initialization process in the Bluetooth interaction process is controlled. Assuming that the bluetooth initialization process requires 1s, the preset value is set to 1. After the master device and the slave device are successfully connected, the timer starts to count time, and when any sub-process in the bluetooth initialization process is processed each time, the current time of the timer needs to be judged and acquired, and whether the time is overtime or not is judged. If the time exceeds 1s, the initialization fails, and if the time does not exceed 1s, the subsequent process is performed.
Illustratively, in an example of performing the processing of the bluetooth initialization procedure, if the processing of the authentication sub-procedure fails, the current time of the timer is acquired, and if the time is not exceeded, the bluetooth connection request is initiated to the slave again; if time out, initialization fails. Similarly, if the processing of the key negotiation subprocess fails, the current time of the timer is acquired, and if the time is not overtime, a bluetooth connection request is initiated to the slave equipment again; if time out, initialization fails.
In the embodiment of the application, after the Bluetooth connection is established with the slave equipment, an initialization process is initiated to the slave equipment, and whether the initialization process is successful or not is detected; and if the initialization process fails, initiating a Bluetooth connection request to the slave equipment again. By the method, the occurrence probability of initialization failure is effectively avoided, and the success rate of Bluetooth interaction is effectively increased.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 3 is a schematic diagram of a bluetooth interaction apparatus provided in an embodiment of the present application, and for convenience of description, only portions related to the embodiment of the present application are shown.
The bluetooth interaction apparatus shown in fig. 3 may be a software unit, a hardware unit, or a combination of software and hardware unit built in the existing terminal device, may also be integrated into the terminal device as an independent pendant, and may also exist as an independent terminal device.
The bluetooth interaction apparatus 3 includes:
a request unit 31 for initiating a bluetooth connection request to a slave device;
an initialization unit 32, configured to initiate an initialization procedure to the slave device after establishing a bluetooth connection with the slave device, and detect whether the initialization procedure is successful;
a connection unit 33, configured to initiate a bluetooth connection request to the slave device again if the initialization procedure fails.
Optionally, the apparatus 3 further comprises:
the device comprises a detection unit and a control unit, wherein the detection unit is used for detecting whether the Bluetooth connection is established with the slave equipment or not within a first preset time after the Bluetooth connection request is initiated to the slave equipment.
The initialization unit 32 is further configured to initiate an initialization procedure to the slave device if it is detected that a bluetooth connection is established with the slave device within a first preset time after the bluetooth connection request is initiated to the slave device.
The requesting unit 31 is further configured to, if it is detected that the bluetooth connection with the slave device is not established within a first preset time after the bluetooth connection request is initiated to the slave device, initiate the bluetooth connection request to the slave device again.
Optionally, the apparatus 3 further comprises:
a confirming unit for confirming whether a timer associated with a Bluetooth connection time has been started after detecting that a Bluetooth connection is established with the slave device.
And the starting unit is used for starting the timer if the timer is not started and setting the time of the timer as an initial value.
Optionally, the apparatus 3 further comprises:
and the obtaining unit is used for obtaining the current time of the timer before initiating the Bluetooth connection request to the slave equipment again if the initialization process fails.
And the judging unit is used for judging that the initialization process fails if the current time of the timer is greater than or equal to the preset value.
And the initiating unit is used for initiating the Bluetooth connection request to the slave equipment again if the current time of the timer is less than the preset value.
Optionally, the initialization process includes at least one sub-process.
The initialization unit 32 includes:
and the first judgment module is used for judging that the initialization process fails if any sub-process of the initialization process fails to process.
And the second judgment module is used for processing the next sub-process if any sub-process of the initialization process is successfully processed.
And the third judging module is used for judging that the initialization process is successful if all the sub-processes of the initialization process are successfully processed.
Optionally, the initialization process includes:
and processing the sub-process, and detecting whether the information that the sub-process is successfully processed is received within second preset time after the sub-process is processed.
And if the information that the sub-process is successfully processed is not received within the second preset time after the sub-process is processed, judging that the sub-process is failed to be processed.
And if the information that the sub-process is successfully processed is received within the second preset time after the sub-process is processed, judging that the sub-process is successfully processed.
Optionally, the initialization process includes an authentication sub-process and a key agreement sub-process.
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. For the specific working processes of the units and modules in the system, reference may be made to the corresponding processes in the foregoing method embodiments, which are not described herein again.
Fig. 4 is a schematic diagram of a terminal device provided in an embodiment of the present application. As shown in fig. 4, the terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in said memory 41 and executable on said processor 40. The processor 40 implements the steps in the above embodiments of the bluetooth connection method, such as the steps S101 to S105 shown in fig. 1, when executing the computer program 42. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 31 to 35 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing certain functions, which are used to describe the execution of the computer program 42 in the terminal device 4. For example, the computer program 42 may be divided into a request unit, an initialization unit, and a connection unit, and the specific functions of each unit are as follows:
a request unit for initiating a bluetooth connection request to a slave device;
the initialization unit is used for initiating an initialization process to the slave equipment after the Bluetooth connection with the slave equipment is established, and detecting whether the initialization process is successful or not;
and the connection unit is used for initiating the Bluetooth connection request to the slave equipment again if the initialization process fails.
Optionally, the computer program further comprises:
the device comprises a detection unit and a control unit, wherein the detection unit is used for detecting whether to establish Bluetooth connection with the slave equipment within a first preset time after initiating a Bluetooth connection request to the slave equipment.
The initialization unit is further configured to initiate an initialization procedure to the slave device if it is detected that a bluetooth connection is established with the slave device within a first preset time after the bluetooth connection request is initiated to the slave device.
The request unit is further configured to, if it is detected that the bluetooth connection with the slave device is not established within a first preset time after the bluetooth connection request is initiated to the slave device, re-initiate the bluetooth connection request to the slave device.
Optionally, the computer program further comprises:
a confirming unit for confirming whether a timer associated with a Bluetooth connection time has been started after detecting that a Bluetooth connection is established with the slave device.
And the starting unit is used for starting the timer if the timer is not started and setting the time of the timer as an initial value.
Optionally, the computer program further comprises:
and the obtaining unit is used for obtaining the current time of the timer before initiating the Bluetooth connection request to the slave equipment again if the initialization process fails.
And the judging unit is used for judging that the initialization process fails if the current time of the timer is greater than or equal to the preset value.
And the initiating unit is used for initiating the Bluetooth connection request to the slave equipment again if the current time of the timer is less than the preset value.
Optionally, the initialization process includes at least one sub-process.
The initialization unit includes:
and the first judging module is used for judging that the initialization process fails if any sub-process of the initialization process fails to process.
And the second judgment module is used for processing the next sub-process if any sub-process of the initialization process is successfully processed.
And the third judging module is used for judging that the initialization process is successful if all the sub-processes of the initialization process are successfully processed.
Optionally, the initialization process includes:
and processing the sub-process, and detecting whether the information of successful sub-process processing is received within second preset time after the sub-process processing.
And if the information that the sub-process is successfully processed is not received within the second preset time after the sub-process is processed, judging that the sub-process is failed to be processed.
And if the information that the sub-process is successfully processed is received within the second preset time after the sub-process is processed, judging that the sub-process is successfully processed.
Optionally, the initialization process includes an authentication sub-process and a key agreement sub-process.
The terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a terminal device 4 and does not constitute a limitation of terminal device 4 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing the computer program and other programs and data required by the terminal device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
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 device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device 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 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 position, or may be distributed on multiple 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 other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit 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.

Claims (8)

1. A Bluetooth interaction method, comprising:
initiating a bluetooth connection request to a slave device;
after the Bluetooth connection with the slave equipment is established, initiating an initialization process to the slave equipment and detecting whether the initialization process is successful;
confirming whether a timer associated with a Bluetooth connection time has been started;
if the timer is not started, starting the timer, and setting the time of the timer as an initial value;
if any sub-process of the initialization process fails to process, acquiring the current time of the timer;
if the current time of the timer is greater than or equal to a preset value, judging that the initialization process fails;
if the current time of the timer is less than the preset value, a Bluetooth connection request is initiated to the slave equipment again;
if the initialization process fails, initiating a bluetooth connection request to the slave device again, including: after the initialization process fails, acquiring a failure reason, and if the failure reason is caused by communication abnormity, re-initiating a Bluetooth connection request to the slave equipment; and if the failure reason is not caused by abnormal communication, restarting the initialization process.
2. The bluetooth interaction method of claim 1, further comprising, after initiating the bluetooth connection request to the slave device:
detecting whether a Bluetooth connection is established with a slave device within a first preset time after a Bluetooth connection request is initiated to the slave device;
if the Bluetooth connection with the slave equipment is detected to be established within first preset time after the Bluetooth connection request is initiated to the slave equipment, initiating an initialization process to the slave equipment;
and if the Bluetooth connection with the slave equipment is detected not to be established within the first preset time after the Bluetooth connection request is initiated to the slave equipment, the Bluetooth connection request is initiated to the slave equipment again.
3. The bluetooth interaction method of claim 1, wherein the initialization process includes at least one sub-process;
the detecting whether the initialization process is successful includes:
if any sub-process processing of the initialization process fails, judging that the initialization process fails;
if any sub-process of the initialization process is successfully processed, processing the next sub-process;
and if all the sub-processes of the initialization process are successfully processed, judging that the initialization process is successful.
4. The bluetooth interaction method of claim 3, wherein the initialization procedure comprises:
processing the sub-process, and detecting whether the information that the sub-process is successfully processed is received within second preset time after the sub-process is processed;
if the information that the sub-process is successfully processed is not received within the second preset time after the sub-process is processed, determining that the sub-process is failed to be processed;
and if the information that the sub-process is successfully processed is received within the second preset time after the sub-process is processed, judging that the sub-process is successfully processed.
5. The bluetooth interaction method according to claim 4, wherein the initialization process comprises an authentication sub-process and a key agreement sub-process.
6. An apparatus for bluetooth interaction, the apparatus further comprising:
a request unit for initiating a bluetooth connection request to a slave device;
the initialization unit is used for initiating an initialization process to the slave equipment after the Bluetooth connection with the slave equipment is established, and detecting whether the initialization process is successful or not;
a confirmation unit configured to confirm whether a timer associated with a bluetooth connection time has been started after detecting establishment of a bluetooth connection with the slave device;
the starting unit is used for starting the timer if the timer is not started, and setting the time of the timer as an initial value;
an obtaining unit, configured to obtain current time of the timer before initiating a bluetooth connection request to the slave device again if any of the initialized sub-processes fails to process;
the judging unit is used for judging that the initialization process fails if the current time of the timer is greater than or equal to a preset value;
the initiating unit is used for initiating the Bluetooth connection request to the slave equipment again if the current time of the timer is less than the preset value;
a connection unit, configured to initiate a bluetooth connection request to the slave device again if the initialization procedure fails, including: after the initialization process fails, acquiring a failure reason, and if the failure reason is caused by communication abnormity, re-initiating a Bluetooth connection request to the slave equipment; and if the failure reason is not caused by abnormal communication, restarting the initialization process.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor realizes the steps of the method according to any of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201811091856.9A 2018-09-19 2018-09-19 Bluetooth interaction method, bluetooth interaction device and terminal equipment Active CN110505609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811091856.9A CN110505609B (en) 2018-09-19 2018-09-19 Bluetooth interaction method, bluetooth interaction device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811091856.9A CN110505609B (en) 2018-09-19 2018-09-19 Bluetooth interaction method, bluetooth interaction device and terminal equipment

Publications (2)

Publication Number Publication Date
CN110505609A CN110505609A (en) 2019-11-26
CN110505609B true CN110505609B (en) 2023-04-18

Family

ID=68584928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811091856.9A Active CN110505609B (en) 2018-09-19 2018-09-19 Bluetooth interaction method, bluetooth interaction device and terminal equipment

Country Status (1)

Country Link
CN (1) CN110505609B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112714505A (en) * 2020-12-25 2021-04-27 上海东普信息科技有限公司 Wireless communication method for unmanned aerial vehicle and carrying box and related equipment
CN112612593A (en) * 2020-12-28 2021-04-06 深圳Tcl新技术有限公司 Bluetooth control method, device, terminal equipment and computer readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES2303464B1 (en) * 2007-01-19 2009-06-04 Vodafone España, S.A. METHOD OF IDENTIFICATION, AUTHENTICATION AND CONTROL OF COVERAGE BASED ON THE BLUETOOTH STANDARD.
US20120238216A1 (en) * 2011-03-17 2012-09-20 Polycom, Inc. Systems and methods for managing bluetooth device pairings
CN105430595A (en) * 2015-10-26 2016-03-23 上海斐讯数据通信技术有限公司 Connection method of bluetooth equipment and bluetooth equipment
CN105430603A (en) * 2015-12-03 2016-03-23 北京握奇智能科技有限公司 Secure connection method and system for Bluetooth equipment
CN106028319B (en) * 2016-07-18 2019-06-04 北京京东尚科信息技术有限公司 A kind of method and apparatus for resisting illegal connection attack in slave Bluetooth equipment
CN107635290B (en) * 2017-07-25 2021-09-17 深圳市文鼎创数据科技有限公司 Mobile terminal, Bluetooth Key, connection method, storage medium and system

Also Published As

Publication number Publication date
CN110505609A (en) 2019-11-26

Similar Documents

Publication Publication Date Title
CN109213530B (en) USB-based communication connection method, mobile terminal and storage medium
CN111338662A (en) Firmware upgrading method and device for slave station and terminal
CN110505609B (en) Bluetooth interaction method, bluetooth interaction device and terminal equipment
CN106412293B (en) Foreign matter detection method and device and terminal equipment
WO2018112942A1 (en) Device authentication method, apparatus, electronic device and slave device
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN112235370B (en) Equipment information synchronization method, synchronization device, main equipment and storage medium
EP3065097B1 (en) Device and method for facilitating a transaction
CN107526955B (en) Screen-off unlocking method and device
AU2021273648A1 (en) Multi-use near field communication front end on a point of sale system
US20210099526A1 (en) Electronic device for controlling registration session, and operation method therefor; and server, and operation method therefor
WO2020001111A1 (en) Signature verification method for downloading firmware, firmware release method, mobile terminal and server
CN107548055B (en) Multi-region SIM card selection method, system and device and industrial personal computer
CN108391281B (en) Bridging method of wireless network, terminal equipment and storage medium
CN112187937B (en) Unpairing method and device, terminal equipment and storage medium
CN111596929A (en) Burning method, device, system, equipment and medium
CN107885674B (en) Bluetooth device simulator, working method thereof and Bluetooth device operating system
CN108629175B (en) Access control method and access control device of USB mass storage equipment
WO2020097863A1 (en) Flashing control method, flashing control apparatus and terminal device
WO2016168989A1 (en) Contactless front-end configuration method and terminal
CN107295177B (en) Application disabling method and device and terminal equipment
CN113534691A (en) Control system and method of terminal equipment
CN107977334B (en) Electronic card and detection method thereof
CN113708938B (en) Token obtaining method, token obtaining device and terminal equipment
US11330415B2 (en) Near field communication device and method of operating the same

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