patents.google.com

CN111787514B - Method and device for acquiring equipment control data, storage medium and electronic device - Google Patents

  • ️Fri Mar 22 2024

Disclosure of Invention

The embodiment of the invention provides a method for acquiring equipment control data, an encryption method, a method for acquiring equipment control data, an encryption device, a storage medium and an electronic device, which are used for at least solving the problems of low safety and the like when data plaintext authentication is performed based on BLE GATEE in the related art.

According to an embodiment of the present invention, there is provided a method for acquiring device control data, including: and under the condition that the target Bluetooth equipment authorizes the target object to carry out authentication, sending key information to a terminal of the target object, wherein the key information comprises the following components: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; receiving encrypted data which is sent by the terminal and is encrypted according to the KEY and the KEY ID; and under the condition that the KEY corresponding to the KEY ID is inquired through the target Bluetooth device, decrypting the encrypted data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs with one-to-one correspondence.

In an exemplary embodiment, sending key information to the terminal of the target object includes: selecting a group of key information for the terminal from a plurality of groups of key information stored in the target Bluetooth device; and sending the selected set of key information to the terminal of the target object.

In an exemplary embodiment, in a case that the KEY corresponding to the KEY ID is queried by the target bluetooth device, after decrypting the encrypted data according to the KEY corresponding to the KEY ID, the method further includes: after the encrypted data is successfully decrypted, responding to the data; and controlling the target Bluetooth equipment to execute control operation corresponding to the data according to the data.

In an exemplary embodiment, before decrypting the encrypted data according to the KEY corresponding to the KEY ID, the method further includes: determining whether a KEY corresponding to the KEY ID sent by the terminal is found; and under the condition that the encrypted data is not found, sending response information to the terminal, wherein the response information is used for indicating the failure of the target Bluetooth equipment to decrypt the encrypted data to the terminal.

According to an embodiment of the present invention, there is provided a method for acquiring device control data, including: under the condition that the target Bluetooth equipment authorizes the target object to authenticate, receiving key information sent by the target Bluetooth equipment, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; encrypting the data to be transmitted according to the KEY to obtain encrypted data; and sending the encrypted data and the KEY ID to the target Bluetooth device, so that the target Bluetooth device inquires a KEY corresponding to the KEY ID and decrypts the encrypted data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs with one-to-one correspondence.

In an exemplary embodiment, encrypting data to be sent according to the KEY to obtain encrypted data, including: storing the key information; and under the condition that a target request is received, encrypting data to be sent according to the KEY KEY to obtain encrypted data, wherein the target request is used for indicating a terminal to control the target Bluetooth device.

According to another embodiment of the present invention, there is provided a device control data acquisition method apparatus, including: the first sending module is used for sending key information to a terminal of a target object under the condition that the target Bluetooth device authorizes the target object to authenticate, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; the first receiving module is used for receiving the encrypted data encrypted according to the KEY and the KEY ID sent by the terminal; and the processing module is used for inquiring the KEY corresponding to the KEY ID and decrypting the encrypted data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs with one-to-one correspondence.

In an exemplary embodiment, the first sending module is further configured to select a set of key information from a plurality of sets of key information stored in the target bluetooth device, where the set of key information is used for the terminal; and sending the selected set of key information to the terminal of the target object through the target Bluetooth device.

In an exemplary embodiment, the processing module is further configured to respond to the encrypted data after the encrypted data is successfully decrypted; and controlling the target Bluetooth equipment to execute control operation corresponding to the data according to the data.

According to another embodiment of the present invention, there is provided a device control data acquisition method apparatus, including: the second receiving module is configured to receive key information sent by a target bluetooth device when the target bluetooth device authorizes the target object to authenticate, where the key information includes: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; the encryption module is used for encrypting the data to be transmitted according to the KEY to obtain encrypted data; and the second sending module is used for sending the encrypted data and the KEY ID to the target Bluetooth device so that the target Bluetooth device can inquire a KEY corresponding to the KEY ID and decrypt the encrypted data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs with one-to-one correspondence.

In an exemplary embodiment, the second receiving module is further configured to store the key information; and under the condition that a target request is received, encrypting data to be sent according to the KEY KEY to obtain encrypted data, wherein the target request is used for indicating a terminal to control the target Bluetooth device.

In an exemplary embodiment, the encryption module is further configured to generate the data to be sent according to the target request.

According to a further embodiment of the invention, there is also provided a storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.

According to a further embodiment of the invention, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.

According to the invention, under the condition that the target Bluetooth equipment authorizes the target object to authenticate, key information is sent to the terminal of the target object through the target Bluetooth equipment, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; receiving encrypted data which is sent by the terminal and is encrypted according to the KEY and the KEY ID; the target Bluetooth equipment inquires a KEY corresponding to the KEY ID and decrypts the encrypted data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth equipment stores a plurality of groups of KEY IDs and KEY KEYs which have a one-to-one correspondence, namely, through the technical scheme of the invention, the terminal can encrypt the data to be transmitted according to the KEY transmitted by the target Bluetooth equipment and transmit the encrypted data to the target Bluetooth equipment so as to decrypt the target Bluetooth equipment, thereby solving the problems of low security and the like in the prior art when data plaintext authentication is carried out based on BLE GATEE, improving the security of the data in the BLE network and ensuring the security and flexibility of the data when the data plaintext authentication is carried out by Bluetooth pairing.

Detailed Description

The invention will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.

It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.

The method embodiments provided by the embodiments of the present application may be executed in a computer terminal or a computing device similar to a bluetooth device. Taking the example of running on a bluetooth device, fig. 1 is a block diagram of a hardware structure of a bluetooth device according to an embodiment of the present invention, where the method is used to obtain device control data. As shown in fig. 1, the bluetooth device may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and in one exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the bluetooth device described above. For example, a Bluetooth device may also include more or fewer components than shown in FIG. 1, or have a different configuration than the equivalent functions shown in FIG. 1 or more than the functions shown in FIG. 1.

The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for acquiring device control data in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104, thereby executing various functional applications and acquiring device control data, that is, implementing the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located with respect to the processor 102, which may be connected to the bluetooth device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The transmission means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of bluetooth devices. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.

According to an aspect of the embodiment of the present invention, there is provided a method for acquiring device control data, optionally, as an optional implementation manner, the method for acquiring device control data may be applied, but not limited to, in an environment as shown in fig. 2, and as shown in fig. 2, the system architecture 200 may include one or more of terminals 201, 202, 203 of a target object, a network 204 and a target bluetooth device 205. The network 204 is used as a medium to provide a communication link between the terminals 201, 202, 203 of the target object and the target bluetooth device 205. The network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. The terminals 201, 202, 203 of the target object may be various electronic devices having a display screen, including but not limited to desktop computers, portable computers, smartphones, tablet computers, and the like. It should be understood that the number of terminals, networks and target bluetooth devices of the target object in fig. 2 is merely illustrative. Terminals, networks, and target bluetooth devices having any number of target objects may be provided as desired for implementation. For example, the target bluetooth device 205 may be a bluetooth device cluster formed by a plurality of target bluetooth devices.

In this embodiment, there is provided a method for acquiring device control data of the target bluetooth device, and fig. 3 is a flowchart of a method for acquiring device control data according to an embodiment of the present invention, where the flowchart includes the following steps:

step S202, when the target bluetooth device authorizes the target object to authenticate, key information is sent to the terminal of the target object, where the key information includes: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence;

it may be appreciated that, after the target object is authorized by the target bluetooth device in the authentication mode, the target bluetooth device sends a KEY ID and a KEY having a correspondence to the terminal, where the correspondence includes one or more types.

Step S204, receiving the encrypted data and the KEY ID which are sent by the terminal and encrypted according to the KEY KEY;

optionally, under the condition that the KEY information sent by the target Bluetooth device to the terminal only has the KEY ID and the KEY of one corresponding relation, the data are directly encrypted according to the KEY to obtain encrypted data, under the condition that the KEY information sent by the target Bluetooth device to the terminal has the KEY ID and the KEY of multiple corresponding relations, the terminal side can select a designated KEY from the KEY IDs and KEY KEYs of various corresponding relations to encrypt the data, and send the encrypted data and the KEY ID corresponding to the designated KEY to the target Bluetooth device;

In step S206, in the case that the KEY corresponding to the KEY ID is queried through the target bluetooth device, the encrypted data is decrypted according to the KEY corresponding to the KEY ID, where the target bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs having a one-to-one correspondence.

After receiving the data and the KEY ID which are sent by the terminal of the target object and are encrypted by the KEY information, the target Bluetooth device searches the KEY corresponding to the KEY ID according to the KEY ID, decrypts the encrypted data received by the target Bluetooth device, and completes the data interaction between the terminal of the target object and the target Bluetooth device.

Through the steps, under the condition that the target Bluetooth equipment authorizes the target object to carry out authentication, key information is sent to the terminal of the target object through the target Bluetooth equipment, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; receiving encrypted data which is sent by the terminal and is encrypted according to the KEY and the KEY ID; the target Bluetooth equipment inquires a KEY corresponding to the KEY ID and decrypts the encrypted data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth equipment stores a plurality of groups of KEY IDs and KEY KEYs which have a one-to-one correspondence, namely, through the technical scheme of the invention, the terminal can encrypt the data to be transmitted according to the KEY transmitted by the target Bluetooth equipment and transmit the encrypted data to the target Bluetooth equipment so as to decrypt the target Bluetooth equipment, thereby solving the problems of low security and the like in the prior art when data plaintext authentication is carried out based on BLE GATEE, improving the security of the data in the BLE network and ensuring the security and flexibility of the data when the data plaintext authentication is carried out by Bluetooth pairing.

In an exemplary embodiment, sending, by the target bluetooth device, key information to the terminal of the target object includes: selecting a group of key information for the terminal from a plurality of groups of key information stored in the target Bluetooth device; and sending the selected set of key information to the terminal of the target object through the target Bluetooth device.

That is, the target bluetooth device stores a plurality of sets of KEY information including the KEY ID and the KEY, and selects one set of transmission from the stored plurality of sets of KEY information when transmitting to the terminal of the target object.

In an exemplary embodiment, in a case that the KEY corresponding to the KEY ID is queried by the target bluetooth device, after decrypting the encrypted data according to the KEY corresponding to the KEY ID, the method further includes: after the encrypted data is successfully decrypted, responding to the data; and controlling the target Bluetooth equipment to execute control operation corresponding to the data according to the data.

After receiving the encrypted data and the KEY ID sent by the terminal of the target object, the target Bluetooth device inquires a plurality of groups of KEY information containing the KEY ID and the KEY stored in the target Bluetooth device to obtain a KEY corresponding to the KEY ID, decrypts the encrypted data according to the KEY, and executes control operation corresponding to the encrypted data according to the data content contained in the encrypted data after the encrypted data is decrypted.

In an exemplary embodiment, before decrypting the encrypted data according to the KEY corresponding to the KEY ID, the method further includes: determining whether a KEY corresponding to the KEY ID sent by the terminal is found; and under the condition that the encrypted data is not found, sending response information to the terminal, wherein the response information is used for indicating the failure of the target Bluetooth equipment to decrypt the encrypted data to the terminal.

That is, after the target bluetooth device receives the encrypted data and the KEY ID, if the KEY ID is changed during transmission, it is highly likely that the target bluetooth device cannot find the KEY corresponding to the KEY ID transmitted by the terminal, and in this case, the target bluetooth device transmits response information to the terminal to notify the terminal: the target Bluetooth device fails to decrypt the encrypted data, and also can inform the target Bluetooth device of the reason of the failure of decrypting the data.

In this embodiment, another method for acquiring device control data is provided and applied to a terminal of a target object, and fig. 4 is a flowchart of a method for acquiring device control data according to an embodiment of the present invention, where the flowchart includes the following steps:

Step S302, receiving key information sent by a target bluetooth device when the target bluetooth device authorizes a target object to authenticate, where the key information includes: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence;

step S304, encrypting the data to be transmitted according to the KEY to obtain encrypted data;

step S306, the encrypted data and the KEY ID are sent to the target bluetooth device, so that the target bluetooth device queries a KEY corresponding to the KEY ID, and decrypts the encrypted data according to the KEY corresponding to the KEY ID, where the target bluetooth device stores multiple groups of KEY IDs and KEY KEYs having a one-to-one correspondence.

Through the steps, under the condition that the target Bluetooth equipment authorizes the target object to authenticate, key information sent by the target Bluetooth equipment is received, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; encrypting the data to be transmitted according to the KEY to obtain encrypted data; the encryption data and the KEY ID are sent to the target Bluetooth device, so that the target Bluetooth device inquires a KEY corresponding to the KEY ID and decrypts the encryption data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs which have a one-to-one correspondence relationship.

In an exemplary embodiment, after receiving the KEY information sent by the target bluetooth device, encrypting data to be sent according to the KEY, to obtain encrypted data includes: storing the key information; and under the condition that a target request is received, encrypting data to be sent according to the KEY in the stored KEY information to obtain encrypted data, wherein the target request is used for indicating a terminal to control the target Bluetooth device.

In an exemplary embodiment, before encrypting the data to be sent according to the KEY to obtain encrypted data, the method further includes: and under the condition that a target request is received, responding to the target request, and generating the data to be transmitted for controlling the target Bluetooth equipment.

In short, after receiving the KEY information sent by the target bluetooth device, the terminal of the target object stores the received KEY information, generates data to be sent according to a target request for controlling the target bluetooth device issued by the terminal of the target object, encrypts the data to be sent through a KEY, and encrypts the data.

In order to better understand the process of the method for acquiring device control data, the following describes the flow of the method for acquiring device control data in combination with an alternative embodiment.

In an alternative embodiment of the invention, a safety mechanism for carrying out safety encryption communication based on BLE GATT is mainly provided instead of using Bluetooth pairing of a BLE protocol stack, thereby not only meeting the requirement of safety access, but also bypassing the compatibility problem of Bluetooth pairing. Fig. 5 is a schematic flow chart of an application of encrypted communication to a bluetooth intelligent home device according to an alternative embodiment of the invention, which includes the following steps:

step 1: when authenticating a connected Bluetooth intelligent household appliance (corresponding to a target Bluetooth device in the embodiment of the invention), a user (corresponding to a target object in the embodiment of the invention) enters an authentication mode through a mobile phone terminal to communicate with the Bluetooth intelligent household appliance, so as to confirm whether the user is authorized.

Step 2: the Bluetooth intelligent home appliance receives the communication information and enters an authentication mode.

Step 3: under the condition that the current user is authorized, the Bluetooth intelligent household appliance broadcasts the authorized message of the user through the BLE GATT, and sends the KEY information containing the KEY ID and the KEY KEY to the mobile phone end (the terminal equivalent to the target object in the embodiment of the invention).

Step 4: and correspondingly storing the transmitted KEY information containing the KEY ID and the KEY in a KEY queue of the Bluetooth intelligent device.

Step 5: and the mobile phone receives and stores the key information data.

Step 6: the mobile phone end informs the user through display, and authentication can be finished.

Step 7: after the user confirms, the information of exiting the authentication mode and entering the normal mode is sent through the mobile phone terminal.

Step 8: and the Bluetooth intelligent device receives the information of exiting the authentication mode and entering the normal mode, and enters the normal connection mode.

Step 9: the user is authorized to control the Bluetooth intelligent device.

Step 10: the user control mobile phone terminal is connected to the Bluetooth intelligent household appliance through the BLE GATT.

Step 11: and the mobile phone terminal generates plaintext data (A data) for controlling the Bluetooth intelligent household electrical appliance.

Step 12: and (3) encrypting plaintext (A data) for controlling the Bluetooth intelligent household appliance by receiving and storing the key information data through the mobile phone to obtain B data (which is equivalent to the encrypted data in the embodiment of the invention).

Step 13: and sending the B data and the key ID generated by the mobile phone terminal to the Bluetooth intelligent household appliance through the established BLE GATT connection channel.

Step 14: and the Bluetooth intelligent home appliance retrieves the corresponding KEY from the KEY queue of the Bluetooth intelligent home appliance according to the KEY ID.

Step 15: and decrypting the B data according to the retrieved KEY to obtain the A data.

Step 16: and responding the control of the A data by the Bluetooth intelligent household appliance according to the content of the A data.

Step 17: and replying control ACK (Acknowledge character, ACK for short, namely acknowledgement character) to the mobile phone terminal through the established BLE GATT connection channel.

Step 18: and after receiving the control ACK, the mobile phone replies the result of the control equipment to the user.

In summary, through the alternative embodiment of the present invention, the secure encryption communication based on BLE GATT is introduced, and after the user physically contacts the device, the device distributes the key through BLE broadcast, so as to achieve user authentication and secure access to the BLE device, and in addition, the alternative embodiment of the present invention has the following advantages: an authentication server is not required to be additionally arranged; can be done separately within the BLE network; the authentication information is dynamically generated, and the intelligent household appliance can also clear the existing authentication information, so that the safety and the flexibility are improved; a degree of security may be provided; the user can complete authentication work only by simple interaction, so that usability is improved; no additional hardware cost is required; based on the mature BLE technology, the method is beneficial to popularization.

From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.

The embodiment also provides a device for acquiring device control data, which is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.

Fig. 6 is a block diagram of a device control data acquisition apparatus according to an embodiment of the present invention, applied to a target bluetooth device, as shown in fig. 6, including:

(1) A first sending module 52, configured to send key information to a terminal of a target object when the target bluetooth device authorizes the target object to perform authentication, where the key information includes: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence;

(2) A first receiving module 54, configured to receive encrypted data sent by the terminal and encrypted according to the KEY and the KEY ID;

(3) And the processing module 56 is configured to query a KEY corresponding to the KEY ID, and decrypt the encrypted data according to the KEY corresponding to the KEY ID, where the target bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs that have a one-to-one correspondence.

By the device, under the condition that the target Bluetooth equipment authorizes the target object to authenticate, key information is sent to the terminal of the target object by the target Bluetooth equipment, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; receiving encrypted data which is sent by the terminal and is encrypted according to the KEY and the KEY ID; the target Bluetooth equipment inquires a KEY corresponding to the KEY ID and decrypts the encrypted data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth equipment stores a plurality of groups of KEY IDs and KEY KEYs which have a one-to-one correspondence, namely, through the technical scheme of the invention, the terminal can encrypt the data to be transmitted according to the KEY transmitted by the target Bluetooth equipment and transmit the encrypted data to the target Bluetooth equipment so as to decrypt the target Bluetooth equipment, thereby solving the problems of low security and the like in the prior art when data plaintext authentication is carried out based on BLE GATEE, improving the security of the data in the BLE network and ensuring the security and flexibility of the data when the data plaintext authentication is carried out by Bluetooth pairing.

In an exemplary embodiment, the first sending module is further configured to select a set of key information from a plurality of sets of key information stored in the target bluetooth device, where the set of key information is used for the terminal; and sending the selected set of key information to the terminal of the target object through the target Bluetooth device.

That is, the target bluetooth device stores a plurality of sets of KEY information including the KEY ID and the KEY, and selects one set of transmission from the stored plurality of sets of KEY information when transmitting to the terminal of the target object.

In an exemplary embodiment, the processing module is further configured to respond to the encrypted data after the encrypted data is successfully decrypted; and controlling the target Bluetooth equipment to execute control operation corresponding to the data according to the data.

After receiving the encrypted data and the KEY ID sent by the terminal of the target object, the target Bluetooth device inquires a plurality of groups of KEY information containing the KEY ID and the KEY stored in the target Bluetooth device to obtain a KEY corresponding to the KEY ID, decrypts the encrypted data according to the KEY, and executes control operation corresponding to the encrypted data according to the data content contained in the encrypted data after the encrypted data is decrypted.

In an exemplary embodiment, the processing module 56 is further configured to determine whether to find a KEY corresponding to the KEY ID sent by the terminal; and under the condition that the encrypted data is not found, sending response information to the terminal, wherein the response information is used for indicating the failure of the target Bluetooth equipment to decrypt the encrypted data to the terminal.

That is, after the target bluetooth device receives the encrypted data and the KEY ID, if the KEY ID changes during the transmission, it is likely that the target bluetooth device cannot find the KEY corresponding to the KEY ID sent by the terminal, and the processing module 56 is further configured to send response information to the terminal to notify the terminal: the target Bluetooth device fails to decrypt the encrypted data, and also can inform the target Bluetooth device of the reason of the failure of decrypting the data.

In this embodiment, there is further provided another apparatus for acquiring device control data, applied to a terminal of a target object, and fig. 7 is a block diagram of a device for acquiring device control data according to an embodiment of the present invention, as shown in fig. 7, where the apparatus includes:

(1) The second receiving module 62 is configured to receive key information sent by the target bluetooth device when the target bluetooth device authorizes the target object to authenticate, where the key information includes: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence;

(2) The encryption module 64 is configured to encrypt data to be sent according to the KEY to obtain encrypted data;

(3) And a second sending module 66, configured to send the encrypted data and the KEY ID to the target bluetooth device, so that the target bluetooth device queries a KEY corresponding to the KEY ID, and decrypts the encrypted data according to the KEY corresponding to the KEY ID, where the target bluetooth device stores multiple sets of KEY IDs and KEY KEYs that have a one-to-one correspondence.

By the device, under the condition that the target Bluetooth equipment authorizes the target object to authenticate, key information sent by the target Bluetooth equipment is received, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence; encrypting the data to be transmitted according to the KEY to obtain encrypted data; the encryption data and the KEY ID are sent to the target Bluetooth device, so that the target Bluetooth device inquires a KEY corresponding to the KEY ID and decrypts the encryption data according to the KEY corresponding to the KEY ID, wherein the target Bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs which have a one-to-one correspondence relationship.

In an exemplary embodiment, the second receiving module is further configured to store the key information; and under the condition that a target request is received, encrypting data to be sent according to the KEY KEY to obtain encrypted data, wherein the target request is used for indicating a terminal to control the target Bluetooth device.

In an exemplary embodiment, the encryption module is further configured to, in a case where a target request is received, generate the data to be sent for controlling the bluetooth-compliant device in response to the target request.

In short, after receiving the KEY information sent by the target bluetooth device, the terminal of the target object stores the received KEY information, generates data to be sent according to a target request for controlling the target bluetooth device issued by the terminal of the target object, encrypts the data to be sent through a KEY, and encrypts the data.

It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.

An embodiment of the invention also provides a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.

In an exemplary embodiment, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:

s1, under the condition that a target Bluetooth device authorizes a target object to authenticate, key information is sent to a terminal of the target object, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence;

s2, receiving the encrypted data encrypted according to the KEY and the KEY ID sent by the terminal;

s3, under the condition that the KEY corresponding to the KEY ID is inquired through the target Bluetooth device, the encrypted data is decrypted according to the KEY corresponding to the KEY ID, wherein the target Bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs with one-to-one correspondence.

In an exemplary embodiment, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.

An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.

In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.

In an exemplary embodiment, in this embodiment, the above-mentioned processor may be configured to execute the following steps by a computer program:

s1, under the condition that a target Bluetooth device authorizes a target object to authenticate, key information is sent to a terminal of the target object, wherein the key information comprises: a KEY ID and a KEY KEY, wherein the KEY ID and the KEY KEY have a one-to-one correspondence;

s2, receiving the encrypted data encrypted according to the KEY and the KEY ID sent by the terminal;

s3, under the condition that the KEY corresponding to the KEY ID is inquired through the target Bluetooth device, the encrypted data is decrypted according to the KEY corresponding to the KEY ID, wherein the target Bluetooth device stores a plurality of groups of KEY IDs and KEY KEYs with one-to-one correspondence.

In an exemplary embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementations, and this embodiment is not repeated herein.

It will be apparent to those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, and in one exemplary embodiment they may be implemented in program code executable by a computing device, so that they may be stored in a memory device for execution by a computing device, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps in them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.

The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.