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 invention. It will be apparent, however, to one skilled in the art that the present invention 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 invention 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 invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the specification of the present invention 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 means of the present invention, the following description will be given by way of specific examples.
Referring to fig. 1, fig. 1 is a flowchart illustrating a bluetooth dual-mode data communication method according to an embodiment of the present invention. The method can be applied to any Bluetooth dual-mode terminal equipment, such as a robot, a mobile phone, a PDA (Personal Digital Assistant), and the like, and particularly can be applied to a coexistence control module of a Bluetooth dual-mode data communication system of any terminal equipment.
S101: and after the classic Bluetooth module and the low-power-consumption Bluetooth module finish the initialization examples, receiving a Bluetooth communication request sent by the target terminal equipment, wherein the Bluetooth communication request carries the identity of the target terminal equipment.
In this embodiment, the instantiation of the classic bluetooth module and the bluetooth low energy module refers to running the classic bluetooth module and the bluetooth low energy module on the terminal device, and waiting for other connected terminal devices to connect the classic bluetooth module or the bluetooth low energy module. The target terminal device identity may be a device ID or a factory code of the device.
S102: and authenticating the identity of the target terminal equipment.
In this embodiment, the bluetooth communication request further carries an identity identifier, and whether the identity identifier exists in the pre-stored authentication identifier is determined. If the identity identification exists in the pre-stored authentication identification, the identity identification of the target terminal equipment passes the authentication; and if the identity identification does not exist in the pre-stored authentication identification, the identity identification authentication of the target terminal equipment is not passed.
S103: and if the identity identification of the target terminal equipment passes the authentication, detecting the protocol type of the Bluetooth communication request.
In the present embodiment, the protocol type of the bluetooth communication request is classified into a classic bluetooth protocol and a bluetooth low energy protocol according to the type that the data transmission required by the communication protocol needs to satisfy.
S104: and establishing data communication between the target terminal equipment and the classic Bluetooth module or the low-power-consumption Bluetooth module according to the protocol type.
In this embodiment, if the protocol type is a classic bluetooth protocol type, data communication is established between the target terminal device and a classic bluetooth module; and if the protocol type is the low-power-consumption Bluetooth protocol type, establishing data communication between the target terminal equipment and the low-power-consumption Bluetooth module.
As can be seen from this embodiment, after the classic bluetooth module and the low-power-consumption bluetooth module complete the initialization instance, a bluetooth communication request sent by the target terminal device is received, where the bluetooth communication request carries the target user identity; authenticating the identity of the target user; if the identity identification of the target user passes the authentication, detecting the protocol type of the Bluetooth communication request; the target terminal equipment and the classic Bluetooth module or the low-power-consumption Bluetooth module are in data communication according to the protocol type, the terminal equipment and the classic Bluetooth module or the low-power-consumption Bluetooth module can be in data communication according to the protocol type of communication data, and the classic Bluetooth and the low-power-consumption Bluetooth are compatible.
Referring to fig. 2, fig. 2 is a flowchart illustrating a bluetooth dual-mode data communication method according to another embodiment of the present invention. On the basis of the foregoing embodiment, the content of S201 in this embodiment is similar to that of S101 described above, and for specific content, reference is made to the related description of S101, which is not described herein again.
S202: and updating the recorded device connection number according to the Bluetooth communication request.
In this embodiment, the recorded device connection number refers to a device that establishes a connection with the bluetooth dual-mode terminal device.
S203: and judging whether the updated device connection number is lower than a preset connection threshold value.
In this embodiment, the preset connection threshold may be configured according to the needs of the user. Because too many devices are connected with the bluetooth dual-mode terminal device, the bluetooth dual-mode terminal device is controlled by too many devices, and user data security is affected. Preferably, the preset connection threshold may be 1, so as to implement one-to-one control of the bluetooth dual-mode terminal device.
S204: and if the updated equipment connection quantity is lower than the preset connection threshold value, executing the step of authenticating the target user identity.
S205: and if the updated device connection number is judged to be equal to or larger than the preset connection threshold, executing a first shielding instruction, wherein the first shielding instruction is used for shielding the Bluetooth communication request of the target terminal device.
The first shielding instruction can be sent to an automatic shielding module of the target terminal device, and the automatic shielding module can be used for shielding the target terminal device which sends the bluetooth communication request.
It can be seen from this embodiment that, by updating the recorded device connection number according to the bluetooth communication request, it is determined whether the updated device connection number is lower than a preset connection threshold, if it is determined that the updated device connection number is lower than the preset connection threshold, the step of authenticating the target user identity is performed, and if it is determined that the updated device connection number is equal to or greater than the preset connection threshold, the target terminal device is shielded to prevent excessive devices from being connected with the bluetooth dual-mode terminal device, which causes the bluetooth dual-mode terminal device to be controlled by the excessive devices and affects user data security.
Referring to fig. 3, fig. 3 is a flowchart illustrating a bluetooth dual-mode data communication method according to still another embodiment of the present invention. On the basis of the above embodiments, the contents of S301 to S302 in this embodiment are the same as the contents of S101 to S102, and for details, reference is made to the related description of S101 to S102, which is not repeated herein.
S303: and if the identity identification of the target terminal equipment is not authenticated, executing a second shielding instruction if the identity identification of the target user is not authenticated, wherein the second shielding instruction is used for shielding the Bluetooth communication request of the target terminal equipment.
Specifically, the bluetooth communication request also carries an identity; judging whether the identity identification exists in the pre-stored authentication identification; if the identity identification exists in the pre-stored authentication identification, the identity identification of the target terminal equipment passes the authentication; and if the identity identification does not exist in the pre-stored authentication identification, the identity identification authentication of the target terminal equipment is not passed. The target terminal device identity may be any form of password ID.
According to the embodiment, the target terminal equipment is shielded according to the identity of the target terminal equipment so as to prevent an unauthorized user from connecting the Bluetooth dual-mode terminal equipment.
Referring to fig. 4, fig. 4 is a flowchart illustrating a bluetooth dual-mode data communication method according to another embodiment of the present invention. On the basis of the above embodiments, the contents of S401 to S404 in this embodiment are the same as the contents of S101 to S104, and for specific contents, reference is made to the related description of S101 to S104, which is not repeated herein.
S405: after data communication is established with the terminal device through the classic bluetooth module, the bluetooth scanning mode of the classic bluetooth module is turned off.
In this embodiment, the bluetooth scan mode of the classic bluetooth module refers to a state in which the classic bluetooth module is in operation and waits for connection of other devices.
S406: after establishing data communication with the terminal device through the bluetooth low energy module, the bluetooth scanning mode of the bluetooth low energy module is turned off.
In this embodiment, the bluetooth scan mode of the bluetooth low energy module means that the bluetooth low energy module is in a state of running and waiting for connection of other devices.
It can be seen from this embodiment that the power consumption of the classic bluetooth module and the bluetooth low energy module can be reduced by turning off the bluetooth scanning mode of the classic bluetooth module and the bluetooth low energy module.
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 invention.
Fig. 5 is a block diagram of a bluetooth dual-mode data communication apparatus according to an embodiment of the present invention, which corresponds to the bluetooth dual-mode data communication method in the foregoing embodiment. For ease of illustration, only portions relevant to embodiments of the present invention are shown. Referring to fig. 5, the system apparatus includes: a request receiving unit 501, an authentication unit 502, a detection unit 503, and a communication establishing unit 504.
The request receiving unit 501 is configured to receive a bluetooth communication request sent by a target terminal device after a classic bluetooth module and a low-power-consumption bluetooth module complete initialization instances, where the bluetooth communication request carries an identity of the target terminal device;
An authentication unit 502, configured to authenticate the identity of the target terminal device;
a detecting unit 503, configured to detect a protocol type of the bluetooth communication request if the identity authentication of the target terminal device passes;
a communication establishing unit 504, configured to establish data communication between the target terminal device and the classic bluetooth module or the bluetooth low energy module according to the protocol type.
As can be seen from this embodiment, after the classic bluetooth module and the low-power-consumption bluetooth module complete the initialization instance, a bluetooth communication request sent by the target terminal device is received, where the bluetooth communication request carries the target user identity; authenticating the identity of the target user; if the identity identification of the target user passes the authentication, detecting the protocol type of the Bluetooth communication request; the target terminal equipment and the classic Bluetooth module or the low-power-consumption Bluetooth module are in data communication according to the protocol type, the terminal equipment and the classic Bluetooth module or the low-power-consumption Bluetooth module can be in data communication according to the protocol type of communication data, and the classic Bluetooth and the low-power-consumption Bluetooth are compatible.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the above embodiment, the communication establishing unit 504 includes:
A first communication establishing subunit 5041, configured to establish data communication between the target terminal device and the classic bluetooth module if the protocol type is a classic bluetooth protocol type;
a second communication establishing subunit 5042, configured to establish data communication between the target terminal device and the bluetooth low energy module if the protocol type is a bluetooth low energy protocol type.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the above embodiment, the apparatus further includes:
an updating unit 505, configured to update the recorded device connection number according to the bluetooth communication request;
a determining unit 506, configured to determine whether the updated device connection number is lower than a preset connection threshold;
the authenticating unit 502 is further configured to perform a step of authenticating the target user identity if it is determined that the updated device connection number is lower than the preset connection threshold.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the above embodiment, the apparatus further includes:
a first shielding unit 507, configured to execute a first shielding instruction if it is determined that the updated device connection number is equal to or greater than the preset connection threshold, where the first shielding instruction is used to shield the bluetooth communication request of the target terminal device.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the above embodiment, the apparatus further includes:
a second shielding unit 508, configured to execute a second shielding instruction if the target user id authentication fails, where the second shielding instruction is used to shield the bluetooth communication request of the target terminal device.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the above embodiment, the apparatus further includes:
a bluetooth scan mode closing unit 509 which closes the bluetooth scan mode of the classic bluetooth module after establishing data communication with the terminal device through the classic bluetooth module; or after establishing data communication with the terminal equipment through the low-power-consumption Bluetooth module, closing the Bluetooth scanning mode of the low-power-consumption Bluetooth module.
Referring to fig. 6, fig. 6 is a schematic block diagram of a terminal device for bluetooth dual-mode data communication according to an embodiment of the present invention. The terminal 600 in the present embodiment shown in fig. 6 may include: one or more processors 601, one or more input devices 602, one or more output devices 603, and one or more memories 604. The processor 601, the input device 602, the output device 603 and the memory 604 are all connected to each other via a communication bus 605. The memory 604 is used to store a computer program comprising program instructions. Processor 601 is operative to execute program instructions stored in memory 604. Wherein the processor 601 is configured to call the program instruction to perform the following operations:
The processor 601 is configured to receive a bluetooth communication request sent by a target terminal device after a classic bluetooth module and a low-power-consumption bluetooth module complete initialization instances, where the bluetooth communication request carries a target user identity; authenticating the target user identity; if the target user identity identification passes the authentication, detecting the protocol type of the Bluetooth communication request; and establishing data communication between the target terminal equipment and the classic Bluetooth module or the low-power Bluetooth module according to the protocol type.
Further, the processor 601 is further configured to update the recorded device connection number according to the bluetooth communication request after receiving the bluetooth communication request sent by the target terminal device; judging whether the updated connection quantity of the equipment is lower than a preset connection threshold value or not; and if the updated equipment connection quantity is lower than the preset connection threshold value, executing the step of authenticating the target user identity.
Further, the processor 601 is further configured to establish data communication between the target terminal device and the classic bluetooth module if the protocol type is the classic bluetooth protocol type; and if the protocol type is a low-power-consumption Bluetooth protocol type, establishing data communication between the target terminal equipment and the low-power-consumption Bluetooth module.
Further, the processor 601 is further configured to execute a first shielding instruction if it is determined that the updated device connection number is equal to or greater than the preset connection threshold, where the first shielding instruction is used to shield the bluetooth communication request of the target terminal device.
Further, the processor 601 is further configured to execute a second shielding instruction if the target user identity authentication fails, where the second shielding instruction is used to shield the bluetooth communication request of the target terminal device.
Further, the processor 601 is further configured to turn off the bluetooth scanning mode of the classic bluetooth module after establishing data communication with the terminal device through the classic bluetooth module; or after establishing data communication with the terminal equipment through the low-power-consumption Bluetooth module, closing the Bluetooth scanning mode of the low-power-consumption Bluetooth module.
It should be understood that in the embodiment of the present invention, the Processor 601 may be a Central Processing Unit (CPU), and the Processor may also be other general purpose 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, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 602 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 603 may include a display (LCD, etc.), a speaker, etc.
The memory 604 may include both read-only memory and random access memory, and provides instructions and data to the processor 601. A portion of the memory 604 may also include non-volatile random access memory. For example, the memory 604 may also store device type information.
In a specific implementation, the processor 601, the input device 602, and the output device 603 described in this embodiment of the present invention may execute the implementation manners described in the first embodiment and the second embodiment of the service request method provided in this embodiment of the present invention, and may also execute the implementation manner of the terminal described in this embodiment of the present invention, which is not described herein again.
In another embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program, where the computer program includes program instructions, where the program instructions implement all or part of the procedures in the method of the above embodiments when executed by a processor, and may also be implemented by a computer program instructing associated hardware, where the computer program may be stored in a computer-readable storage medium, and where the computer program can implement the steps of the above method embodiments when 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 computer readable storage medium may be an internal storage unit of the terminal according to any of the foregoing embodiments, for example, a hard disk or a memory of the terminal. The computer readable storage medium may also be an external storage device of the terminal, 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 provided on the terminal. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. 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 invention.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the terminal and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed terminal and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, 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 also be an electric, mechanical or other form of connection.
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 of the present invention.
In addition, functional units in the embodiments of the present invention 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 may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.