A smart home appliance safety control method based on applet

By synchronizing the handshake action and secret key in the Bluetooth control between the applet and the device, combined with AES encryption and permission management, the security risks and permission management issues of Bluetooth control of smart home appliances are solved, and effective management of data security and user permissions is achieved.

CN115883276BActive Publication Date: 2024-09-06MIANYANG MEILING REFRIGERATION CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202211327704.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-27
Publication Date
2024-09-06
Estimated Expiration
2042-10-27

AI Technical Summary

Technical Problem

The existing Bluetooth control method of smart home appliances has problems such as unencrypted data communication and unset operating permissions, which leads to security risks and difficulty in user rights management.

Method used

Before the mini program communicates with the device, a series of handshake actions are performed to obtain the encryption key generated by the device, and the secret key information is synchronously updated during the interaction with the cloud server. The AES encryption algorithm is used for data transmission, and the device is processed on the mini program. Registration and rights management.

Benefits of technology

It improves the data security of Bluetooth-controlled smart devices, ensures the security of communication data, and enables the judgment and management of operator permissions, preventing unauthorized users from controlling the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115883276B
    Figure CN115883276B
Patent Text Reader

Abstract

The present invention discloses a smart home appliance safety control method based on a small program. The method comprises the following steps: two flag parameters and two groups of data parameters are saved in the flash of the device end. When the device end is powered on, the four groups of information are first read, and the device end turns on the Bluetooth hotspot; the small program end is connected to the device end by Bluetooth; the device end selects whether to communicate data with the small program according to the flags of the registration flag and the secret key flag, and ensures that the device end completes the device registration and secret key reporting on the small program end. After completion, the communication data between the small program end and the device end is the data encrypted with the control key. The present invention optimizes the data security of the Bluetooth control smart device technology by performing a series of handshake actions before the small program establishes communication with the device end, so as to ensure that the small program obtains the encryption secret key generated by the device end. At the same time, the small program needs to synchronously update the relevant secret key information during the interaction with the cloud server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of smart home appliances, and in particular relates to a smart home appliance safety control method based on a small program. Background Art

[0002] In recent years, with the rapid development of IOT (Internet of Things) technology, the shipment of IoT devices has been booming, especially represented by smart home products. At present, there are many ways to control smart homes on the market, such as remote control through manufacturer-specific APP, online voice control, NFC (Near Field Communication, meaning short-range wireless communication technology) control, etc. The above control methods all require the smart device to be connected to the home router. Users first need to solve the network configuration problem of the device at the beginning of use. At present, a new way to directly control smart devices through mini programs has been added. Users can search for mini programs through WeChat, and can discover devices through Bluetooth in the mini program and establish connections with devices, thus realizing short-distance device control. We call this control method "digital remote control". On the one hand, this method can replace traditional remote controls, and on the other hand, it does not require users to download APPs and perform network configuration and binding operations on devices, making this method very popular in user experience.

[0003] Application No. CN202210437635.2 (A mobile terminal control method, device and storage medium) proposes a mobile terminal that obtains the Bluetooth information of the controlled device and establishes a connection with it, and controls the controlled device according to the control instructions. This direct connection and direct control solution without Bluetooth encryption poses certain security risks during data communication. Summary of the invention

[0004] The purpose of the present invention is to provide a smart home appliance security control method based on mini-programs. The mini-program performs a series of handshake actions before establishing communication with the device to ensure that the mini-program obtains the encryption key generated by the device. At the same time, the mini-program needs to synchronously update the relevant key information during the interaction with the cloud server. The data security of the Bluetooth control smart device technology is optimized to ensure the security of communication data; and it is convenient to judge the operating authority of the control personnel.

[0005] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:

[0006] The present invention is a smart home appliance safety control method based on a mini-program, comprising the following steps:

[0007] Stp1. Save two flag parameters and two sets of data parameters in the flash of the device. The flag parameters are the registration flag and the secret key flag, and the two sets of data parameters are the registration key and the secret key key.

[0008] When the device is powered on, it first reads the four sets of information. If the registration key and secret key are empty, the device generates these two sets of information first. Then the device turns on the Bluetooth hotspot and broadcasts to wait for connection.

[0009] Step 2: After opening the mobile applet, start scanning and searching for devices. When the Bluetooth hotspot in step Stp1 is found, save the device in the nearby device list.

[0010] Stp3. The mini program and the device are connected via Bluetooth. The device chooses whether to communicate with the mini program based on the registration flag and the secret key flag, ensuring that the device completes device registration and secret key reporting on the mini program.

[0011] If the above steps have been completed, the device sends a communication command to confirm that data communication with the mini program can begin. The communication data between the mini program and the device is encrypted using the control key.

[0012] If the device is not registered, go to step Stp4;

[0013] Stp4. After receiving the registration key and secret key from the device, the mini program side registers the device and reports the secret key to the device server through the mini program server, and returns the processing result of the cloud server to the device side; and returns to step Stp3;

[0014] Stp5. If the device is deleted from the device list on the mini program side, the mini program side sends a reset command to the device side. After the device side clears the secret key and secret key flag, it sends the reset result back to the mini program side. After receiving it, the mini program side requests the cloud server to unbind the device from the list.

[0015] Preferably, the device end is a BT module of a smart home appliance, and the BT module is connected to the MCU of the smart home appliance through a UART interface for data communication.

[0016] Preferably, the mini program end is a mini program installed on a mobile phone.

[0017] Preferably, the device side only completes the registration action once on the mini program server, and then the device side only updates the secret key and the secret key flag. During the encrypted data transmission process between the device side and the mini program side, the data encryption method uses the AES encryption algorithm.

[0018] Preferably, the cloud server includes a mini-program server and a device-side server, the mini-program server is used to store the device data of the mini-program; the device-side server is used to store the device data of the device side.

[0019] Preferably, when the device side does not send a communication instruction to confirm that data communication with the mini program can be started in step Stp3, the mini program side saves the device side to my device list by calling the device binding interface of the mini program server side;

[0020] After the device sends a communication command to confirm that data communication with the mini program can begin, the mini program obtains the control key of the device by directly calling the interface on the mini program server to conduct encrypted data communication with the device.

[0021] Preferably, the communication content for data communication with the mini program in step Stp3 includes a registration key and a secret key.

[0022] The present invention has the following beneficial effects:

[0023] The present invention performs a series of handshake actions before the mini program establishes communication with the device to ensure that the mini program obtains the encryption key generated by the device. At the same time, during the interaction between the mini program and the cloud server, the mini program needs to synchronously update the relevant key information, thereby optimizing the data security of Bluetooth control smart device technology, ensuring the security of communication data, and facilitating the judgment of the control personnel's operating authority.

[0024] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0026] Figure 1 A system flow chart of a smart home appliance safety control method based on a mini-program of the present invention;

[0027] Figure 2 It is a data encryption system flow chart of a smart home appliance security control method based on applet;

[0028] Figure 3 Run the flowchart for the mini program end;

[0029] Figure 4 This is a diagram of a Bluetooth connection control system in the prior art;

[0030] Figure 5 This is a diagram of the Bluetooth connection control system of the present invention. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] like Figure 4 As shown, a Bluetooth connection and controlled system of a smart device (taking a smart air conditioner as an example) in the prior art includes a single Bluetooth smart module, an air conditioner electronic control (MCU), a cloud platform, and a mobile phone applet; the Bluetooth smart module and the air conditioner electronic control communicate data through a serial port, and the mobile phone application applet directly establishes a Bluetooth connection with the smart module and performs Bluetooth data communication, and the control of the device is realized during the communication process. This control process is called "direct connection and direct control";

[0033] The Bluetooth smart module in this process will release the Bluetooth broadcast hotspot marked with SN after it is powered on. After connecting to the Bluetooth hotspot of SN, the mini program enters the control interface of the corresponding device according to the material code in the SN identification information. At the same time, the mini program needs to follow a set of communication protocols with the air-conditioning electronic control. The Bluetooth smart module only serves as a data transmission channel between the mini program and the air-conditioning electronic control (for example: the mini program sends a control instruction, which is sent to the air-conditioning electronic control through the Bluetooth smart module serial port. After the air-conditioning electronic control parses and executes the corresponding instruction, the new electronic control status parameter serial port is sent back to the Bluetooth smart module, and then the Bluetooth smart module sends it to the mini program. The mini program parses the data and synchronizes the corresponding control results);

[0034] The "direct connection and direct control" operation mode in existing Bluetooth communication technology allows any customer to connect and control devices at will, which creates two security risks. First, the communication data is not encrypted, and there is a possibility of tampering during the short-distance Bluetooth data interaction. Second, there is no permission setting for operators. Based on the above two points, the existing technology has a lot of room for improvement.

[0035] like Figure 5As shown, the system of the present invention includes a device side, a mini-program side, a mini-program server side, and a device server side; the mini-program is used to connect to a Bluetooth smart device and control the device. The device side will be used to replace the single BT module below. Compared with the existing "direct connection and direct control" technology, the focus of the present invention is on the series of handshake actions performed by the mini-program before establishing communication with the device side to ensure that the mini-program obtains the encryption key generated by the device side. At the same time, the mini-program needs to synchronously update the relevant key information during the interaction with the cloud server; secondly, in the process of data communication between the mini-program and the device side, a new function of setting unbinding is added to enable the mini-program to set corresponding permissions for the operation and management of the device.

[0036] See also Figure 1 As shown, the present invention is a smart home appliance safety control method based on a mini-program, comprising the following steps:

[0037] Stp1, the device side is the BT module of the smart home appliance. The BT module is connected to the MCU of the smart home appliance through the UART interface for data communication. The mini program side is the mini program installed on the mobile phone.

[0038] Two flag parameters and two sets of data parameters are saved in the flash of the device. The flag parameters are the registration flag and the secret key flag, and the two sets of data parameters are the registration key and the secret key key.

[0039] When the device is powered on, it first reads the four sets of information. If the registration key and secret key are empty, the device generates these two sets of information first. Then the device turns on the Bluetooth hotspot and broadcasts to wait for connection.

[0040] Step 2: After opening the mobile applet, start scanning and searching for devices. When the Bluetooth hotspot in step Stp1 is found, save the device in the nearby device list.

[0041] Stp3. The mini program and the device are connected via Bluetooth. The device chooses whether to communicate with the mini program based on the registration flag and the secret key flag. The communication content includes the registration key and the secret key. Ensure that the device completes the device registration and secret key reporting on the mini program.

[0042] If the above steps have been completed, the device sends a communication command to confirm that data communication with the mini program can begin. The communication data between the mini program and the device is encrypted using the control key.

[0043] When the device does not send a communication command to confirm that it can start data communication with the mini program, the mini program calls the device binding interface of the mini program server to save the device to the My Device List. Note that this list is different from the list in step Stp2. One is only a nearby device list, and the other is a My Device List.

[0044] After the device sends a communication command to confirm that data communication with the mini program can begin, the mini program obtains the control key of the device by directly calling the interface on the mini program server to conduct encrypted data communication with the device.

[0045] If the device is not registered, go to step Stp4;

[0046] Stp4. After receiving the registration key and secret key from the device, the mini program side registers the device and reports the secret key to the device server through the mini program server, and returns the processing result of the cloud server to the device side; and returns to step Stp3;

[0047] It includes the following sub-steps:

[0048] SS01. The device sends the encrypted string of the registration key to the mini program.

[0049] SS02, the applet registers the device on the cloud server, and the applet server registers by calling the interface on the device server;

[0050] SS03. After the device is successfully registered, the mini program server returns the result to the device; the device modifies the registration flag after receiving the data;

[0051] SS04, the device sends the encrypted string of the key to the mini program,

[0052] SS05, the mini program sets the device key by calling the interface on the cloud server, and the mini program server sets the key on the device server;

[0053] SS06. After the key is set successfully, the mini program server returns the result to the device; the device modifies the key flag after receiving the data.

[0054] Stp5. If the device is deleted from the device list on the mini program side, the mini program side sends a reset command to the device side. After the device side clears the secret key and secret key flag, it sends the reset result back to the mini program side. After receiving it, the mini program side requests the cloud server to unbind the device from the list.

[0055] The cloud server includes the mini-program server and the device-side server. The mini-program server is used to store the device data of the mini-program; the device-side server is used to store the device data of the device side.

[0056] Embodiment 1:

[0057] The device only completes the registration action once on the mini program server, and then the device only updates the secret key and secret key flag. During the encrypted data transmission between the device and the mini program, the data encryption method uses the AES encryption algorithm.

[0058] The data encryption communication protocol between the mini program and the device is shown in the following table:

[0059]

[0060] like Figure 2-3 As shown, the Bluetooth data encryption system and implementation process of the present invention are further described, wherein the process before the encrypted data communication between the device end and the applet is performed. Figure 1 The relevant description has been explained in the previous section. Here we will focus on further describing the relevant processes of the Mini Program.

[0061] When the applet receives command 5 sent by the device (according to Table 4, the device requires to start encrypted data transmission), and during the encrypted data communication process of command 6, it will determine:

[0062] Does my device list contain the device? (after command 5)

[0063] Is the user's mobile number shared? (After command 5)

[0064] Is the device reset flag not reset at this time? (during command 6)

[0065] First, if my device list includes the device or does not include the device, the result value obtained by the mini program is -1; secondly, if the user's mobile phone number is shared or not shared, the result value obtained by the mini program is also -1; finally, only when the reset mark of the device is reset successfully, the result value is 0. The result value is returned by the device end, and the initial value of the result in the mini program should be -1;

[0066] The mini program further processes the logic according to the value of result:

[0067] If the result value is -1, it means that the device has not been reset. Further check whether the device is in the user's device list:

[0068] If it does not exist, call the binding device interface:

[0069] If the binding is successful, the key acquisition interface is further called until the UI package is entered to control the device (click from the nearby device list to enter the device control page and the user becomes the homeowner at this time);

[0070] If the binding fails, the user will be prompted that he has no operation authority and needs to reset the settings before the device can be controlled (the device has been bound to a user and the device has not been shared with the current operating user);

[0071] If it exists, directly call the key acquisition interface until entering the UI package to control the device (click from the My Device List to enter the device control page, at this time the user is either the homeowner or the homeowner shares the device with the user);

[0072] If the result value is 0, it means that the device has been reset successfully (the device has cleared the secret key and restored the secret key flag). The applet requests the reset interface of the cloud, deletes the device binding relationship, and changes the reset flag to reset. After the device is successfully reset, it returns from the My Device List to the Nearby Device List. After clicking on the device in the Nearby Device List again, the communication sequence starts from Command 0, Command 3, Command 4, and Command 5. Since the device is an unbound device, it will directly call the Bind Device Interface, become the new homeowner, and further call the Get Secret Key Interface until entering the UI package to control the device (enter the My Device List from the Nearby Device List again);

[0073] The above describes the user's operating authority settings in detail, which effectively avoids the problem of "any customer can directly connect and control Bluetooth smart devices". Only when the operating user binds the device for the first time to become the homeowner or the operating user is invited by the homeowner, he has the authority to control the device. Otherwise, he will not have the authority to control the devices in the nearby device list.

[0074] It is worth noting that in the above system embodiment, the various units included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0075] In addition, a person skilled in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by instructing related hardware through a program, and the corresponding program can be stored in a computer-readable storage medium, such as a ROM / RAM, a disk or an optical disk.

[0076] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A smart home appliance safety control method based on applet, characterized in that: The following steps are involved: Stp1. Save two flag parameters and two sets of data parameters in the flash of the device. The flag parameters are the registration flag and the secret key flag, and the two sets of data parameters are the registration key and the secret key key. When the device is powered on, it first reads the four sets of information. If the registration key and secret key are empty, the device generates these two sets of information first. Then the device turns on the Bluetooth hotspot and broadcasts to wait for connection. Step 2: After opening the mobile applet, start scanning and searching for devices. When the Bluetooth hotspot in step Stp1 is found, save the device in the nearby device list. Stp3. The mini program and the device are connected via Bluetooth. The device chooses whether to communicate with the mini program based on the registration flag and the secret key flag, ensuring that the device completes device registration and secret key reporting on the mini program. If the above steps have been completed, the device sends a communication command to confirm that data communication with the mini program can begin. The communication data between the mini program and the device is encrypted using the control key. If the device is not registered, go to step Stp4; Stp4. After receiving the registration key and secret key from the device, the mini program registers the device and reports the secret key to the device server through the mini program server, and returns the processing result of the cloud server to the device. And return to step Stp3; Stp5. If the device is deleted from the device list of the mini program, the mini program sends a reset command to the device. After the device clears the secret key and secret key flag, it sends the reset result back to the mini program. After receiving the result, the mini program requests the cloud server to unbind the device from the list. The cloud server includes a mini-program server and a device-side server, wherein the mini-program server is used to store the device data of the mini-program; the device-side server is used to store the device data of the device side; The device only completes the registration action once on the mini program server, and then the device only updates the secret key and secret key flag. During the encrypted data transmission between the device and the mini program, the data encryption method uses the AES encryption algorithm; When the device does not send a communication instruction to confirm that data communication with the mini program can be started in step Stp3, the mini program saves the device to the list of my devices by calling the device binding interface of the mini program server; When the device sends a communication command to confirm that it can start data communication with the mini program, the mini program obtains the control key of the device by directly calling the interface on the mini program server to perform encrypted data communication with the device. The step Stp4 includes the following sub-steps: SS01. The device sends the encrypted string of the registration key to the mini program; SS02, the applet registers the device on the cloud server, and the applet server registers by calling the interface on the device server; SS03. After the device is successfully registered, the mini program server returns the result to the device; The device modifies the registration flag after receiving the data; SS04. The device sends the encrypted string of the key to the mini program. SS05, the mini program sets the device key by calling the interface on the cloud server, and the mini program server sets the key on the device server; SS06. After the key is set successfully, the mini program server returns the result to the device; The device modifies the key flag after receiving the data.

2. According to claim 1, a smart home appliance safety control method based on applet is characterized in that: The device end is a BT module of a smart home appliance, and the BT module is connected to the MCU of the smart home appliance device through a UART interface for data communication.

3. According to claim 1, a smart home appliance safety control method based on applet is characterized in that: The mini program end is a mini program installed on a mobile phone.

4. According to claim 1, a smart home appliance safety control method based on applet is characterized in that: The communication content for data communication with the mini program in step Stp3 includes the registration key and the secret key.

Citation Information

Patent Citations

  • Mobile terminal control method and device and storage medium

    CN114900787A

  • Smart door lock and wireless communication original data encryption and decryption method thereof

    CN109961545A

  • Method and device for communicating with Bluetooth equipment based on applet platform

    CN110913380A

  • Implementation method and system for downloading Bluetooth device certificate through WeChat applet

    CN112104672A

  • Intelligent door lock code scanning unlocking method and system based on application program

    CN113689607A