Authorization method for smart device and computer-readable storage medium
By using the verification mechanism of device information, user identification information and authorization code during the intelligent device authorization process, the problem of waste of whitelist storage resources and low security is solved, and a more efficient and secure authorization connection is achieved.
Patent Information
- Application Number
- CN202211122586.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-09-15
AI Technical Summary
The prior art has problems of wasted storage resources and low security in the process of smart device authorization, especially when the whitelist is lost, it requires re-authorization, which is cumbersome and lacks security.
The master control device sends an authorization connection request including device information, user identification information and authorization code to the controlled device. The controlled device performs verification based on this information, and sends a successful verification instruction after the verification is passed to realize the authorization connection, avoiding whitelist storage and permanent authorization period, and using the decrypted authorization code for verification.
Reduce resource usage, improve the security of the authorization process, simplify the operation process, and enhance the security of the system.
Smart Images

Figure CN115643046B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an authorization method for a smart device and a computer-readable storage medium. Background Art
[0002] With the continuous development of smart home systems, various smart devices have entered users' lives and work, bringing great intelligence and convenience to users' lives and work. Currently, when using smart devices, it is necessary to establish a control and controlled relationship between smart devices and to conduct information exchange between smart devices.
[0003] In the existing technology, the Message Queuing Telemetry Transport (MQTT) protocol can be used to realize information interaction between smart devices. The MQTT protocol is a client-server based message publish / subscribe transmission protocol. The master device sends user identification information, device information and user password to the controlled device, so that the controlled device makes the first connection based on the user identification information and user password. After the first connection is successful, in response to the authorization request sent by the master device, the user is asked to choose whether to authorize the master device on a pop-up interface. If the authorization is agreed, the device information is stored in the whitelist, and an authorization success message is sent to the master device to indicate that the authorization of the master device is successful.
[0004] However, the existing technology has the problem of wasting storage resources, and due to the loss of the whitelist, it is necessary to re-authorize the controlled device, which is cumbersome and has low security. Summary of the Invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an authorization method for a smart device and a computer-readable storage medium. The method verifies the first device information, first user identification information, and first authorization code included in the first authorization connection request to determine whether the first authorization connection request of the master device is approved. This avoids the operation of the prior art of querying the whitelist to determine whether the master device is an authorized trusted device. That is, there is no need to store the authorized master device in the whitelist, which reduces resource usage. In addition, security is improved by decrypting the authorization code to perform the authorization connection verification. In order to achieve the above purpose, the technical solutions provided by the embodiments of the present disclosure are as follows:
[0006] In a first aspect, the present disclosure provides an authorization method for a smart device, which is applied to a controlled device and includes:
[0007] receiving a first authorization connection request sent by the master device, wherein the first authorization connection request includes first device information, first user identification information, and a first authorization code, wherein the first authorization code is generated by the controlled device according to the second device information and a first valid authorization duration after receiving the authorization code acquisition instruction sent by the master device, and sent to the master device, wherein the first valid authorization duration is the effective duration of the master device's authority to control the controlled device;
[0008] A check is performed based on the first device information, the first user identification information and the first authorization code. After determining that the check passes, a first check success instruction is sent to the master device to indicate that the master device and the controlled device have successfully authorized a connection.
[0009] In a second aspect, the present disclosure provides an authorization method for a smart device, which is applied to a master control device, comprising:
[0010] Sending a first authorization connection request to the controlled device, so that the controlled device performs a verification based on the first device information, the first user identification information, and the first authorization code, and after determining that the verification passes, sending a first verification success instruction to the master device, wherein the first authorization request includes the first device information, the first user identification information, and the first authorization code;
[0011] The first verification success instruction sent by the controlled device is received to indicate that the authorized connection between the master device and the controlled device is successful.
[0012] In a third aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any one of the first aspect or the method described in any one of the second aspect.
[0013] Compared with the prior art, the technical solution provided by the embodiment of the present disclosure has the following advantages: first, a first authorization connection request is sent to the controlled device through the master device, and the controlled device receives the first authorization connection request sent by the master device, wherein the first authorization connection request includes first device information, first user identification information and a first authorization code. The first authorization code is generated by the controlled device according to the second device information and the first valid authorization duration after receiving the authorization code acquisition instruction sent by the master device and sent to the master device. The first valid authorization duration is the effective authority duration of the master device to control the controlled device. The controlled device performs a check based on the first device information, the first user identification information and the first authorization code. After determining that the check is passed, the controlled device sends a first check success instruction to the master device to indicate that the authorized connection between the master device and the controlled device is successful. In the above process, the first device information, the first user identification information and the first authorization code included in the first authorization connection request are verified to determine whether the first authorization connection request of the master device is passed, thereby avoiding the operation of the trusted device in the prior art of querying in the white list to determine whether the master device is authorized. That is, there is no need to store the authorized master device in the white list, which reduces resource usage, and improves security by decrypting the authorization code to perform authorization connection verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0015] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0016] Figure 1A A schematic diagram of an application scenario of an authorization method for a smart device provided in an embodiment of the present disclosure;
[0017] Figure 1B A schematic diagram of an authorization method for a smart device provided in the prior art;
[0018] Figure 1C A schematic diagram of another explicit authorization method provided in the prior art;
[0019] Figure 2A A hardware configuration block diagram of an electronic device according to one or more embodiments of the present disclosure;
[0020] Figure 2B A schematic diagram of software configuration of an electronic device according to one or more embodiments of the present disclosure;
[0021] Figure 2C A schematic diagram showing an icon control interface of an application included in a controlled device according to one or more embodiments of the present disclosure;
[0022] Figure 3A A flowchart of a smart device authorization method provided in an embodiment of the present disclosure;
[0023] Figure 3B A schematic diagram of the interaction process of an authorization method for a smart device provided in an embodiment of the present disclosure;
[0024] Figure 4A A flowchart of another smart device authorization method provided by an embodiment of the present disclosure;
[0025] Figure 4B An interactive diagram of another smart device authorization method provided by an embodiment of the present disclosure;
[0026] Figure 5A A flowchart of another method for authorizing a smart device provided in an embodiment of the present disclosure;
[0027] Figure 5B An interactive diagram of another smart device authorization method provided by an embodiment of the present disclosure;
[0028] Figure 6A A flowchart of another method for authorizing a smart device provided in an embodiment of the present disclosure;
[0029] Figure 6B An interactive diagram of another smart device authorization method provided by an embodiment of the present disclosure;
[0030] Figure 7 A flowchart of another method for authorizing a smart device provided in an embodiment of the present disclosure;
[0031] Figure 8 A schematic diagram of the structure of a method and apparatus for authorizing a smart device provided in an embodiment of the present disclosure;
[0032] Figure 9 This is a structural diagram of another smart device authorization method and apparatus provided by an embodiment of the present disclosure;
[0033] Figure 10 It is a structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0035] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0036] The terms "first" and "second" in this disclosure are used to distinguish different objects rather than to describe a specific order of objects. For example, the first processing result and the second processing result are used to distinguish different processing results rather than to describe a specific order of processing results.
[0037] With the continuous development of smart home systems, various smart devices have entered the lives and work of users, bringing great intelligence and convenience to their lives and work. When using smart devices, users need to establish a control and controlled relationship between smart devices and conduct information exchange between smart devices. At present, the message queue telemetry transport protocol (MQTT) can be used to realize information exchange between smart devices. The MQTT protocol is a message publish / subscribe transmission protocol based on client-server. For smart devices that need to exchange messages, they are connected to the MQTT server as clients. The MQTT server forwards the message to the corresponding client (smart device) according to the publication or subscription. For example, in daily life, users often use mobile terminal devices such as mobile phones as analog remote controls to control smart devices such as TVs. In this way, the mobile terminal device such as mobile phones is the client of MQTT. By connecting the mobile terminal device such as mobile phones to the MQTT server of the smart device such as TV, information exchange between the mobile terminal device such as mobile phones and the smart device such as TV can be realized.
[0038] However, when using the MQTT protocol to implement information exchange between smart devices, in order to ensure the security of message exchange between smart devices, the client, i.e., a mobile terminal device such as a mobile phone, needs to provide user identification information and user password. The connection is established based on the user identification information and user password. However, this method cannot explicitly obtain the user's intention and authorize the connected smart device. In the prior art, after the MQTT connection is successfully completed for the first time based on the user identification information and user password, the client, i.e., the mobile terminal device such as a mobile phone, usually sends an authorization request to the server, i.e., the smart device such as a TV. In response to the authorization request, the smart device such as the TV actively pops up an interface to ask the user for authorization, such as a prompt such as "Device 1 is trying to connect to your TV, do you agree?" The user can determine whether to allow the smart device such as the TV to accept the access from the client, i.e., the mobile terminal device such as the mobile phone. If the user agrees, the mobile terminal device such as the mobile phone is designated as a trusted device and stored in a whitelist. The whitelist can be stored in a database or a physical file. This facilitates the subsequent mobile terminal device such as the mobile phone to determine whether the current mobile terminal device such as the mobile phone is an authorized trusted device by consulting the stored whitelist when the mobile terminal device such as the mobile phone needs to control the smart device such as the TV.
[0039] However, with the existing technology, since the authorization period for the controlled device is a permanent period specified by the system or a fixed value preset by the system, the user cannot change the authorization period of the controlled device, and the device information is stored in the whitelist, which wastes storage resources and may cause the whitelist to be lost, resulting in the need to re-authorize the controlled device, which is cumbersome and has low security.
[0040] Figure 1A A schematic diagram of an application scenario of an authorization method for a smart device provided in an embodiment of the present disclosure. Figure 1A The mobile smart device, namely the mobile phone 201, serves as the master device, and the display device, namely the TV 200, serves as the controlled device. When the mobile phone 201 wants to control the display device 200, the display device 200 needs to authenticate the authorized connection of the mobile phone 201 to determine whether the mobile phone 201 is allowed to control the display device 200.
[0041] Figure 1BThis is a schematic diagram of a smart device authorization method provided in the prior art. A master device sends an authorization connection request to a controlled device. The controlled device responds to the authorization connection request sent by the master device by consulting a stored whitelist to check whether the master device's information, such as its device identifier, exists in the whitelist. This determines whether the master device is a trusted device authorized by the controlled device. If the master device's information is found in the whitelist, the master device is determined to be a trusted device authorized by the controlled device. A message indicating that the connection was authorized is sent to the master device, and the master device information is stored in the whitelist. Upon receiving the authorization connection message, the master device can now control the controlled device. However, since the information of the authorized master device is stored in the whitelist, storage resources are wasted. Although the user can explicitly authorize the master device and determine whether to agree that the master device is a trusted device authorized by the controlled device, the master device can only be authorized for the first time, and the validity period of the authorization is a permanent period specified by the system, or a fixed value preset by the system. The user cannot change the authorization period of the controlled device. Once the master device is attacked by a hacker, the hacker will continue to control the controlled device, and the user cannot solve the problem. At the same time, when the controlled device undergoes a clearing operation such as restoring the factory settings, the whitelist will be cleared, resulting in the loss of the whitelist. The only option is to explicitly authorize the master device again, which is cumbersome.
[0042] Figure 1C FIG. 1 is a schematic diagram of another explicit authorization method provided in the prior art. Figure 1C As shown, the master device sends an authorization connection request to the controlled device. In response to the authorization connection request, the controlled device actively pops up an interface in the controlled device to ask the user to authorize. The interface includes "Mobile terminal device 1 is trying to connect to your TV, do you agree to the authorization?" The user can use the virtual buttons "Reject" and "Agree" in the lower right corner of the interface to determine whether to agree that the master device is authorized as a trusted device for the controlled device according to user needs. When the user selects "Agree", the controlled device TV sends a message that the authorization connection is successful to the mobile terminal device 1, and stores the mobile terminal device 1 as a trusted device in the whitelist. When the user selects "Reject", the controlled device TV sends a message that the authorization connection fails to the mobile terminal device 1.
[0043] In order to solve the problems existing in the prior art, this embodiment proposes an authorization method for smart devices, first, a first authorization connection request is sent to the controlled device through the master device, and the controlled device receives the first authorization connection request sent by the master device, wherein the first authorization connection request includes first device information, first user identification information and a first authorization code. The first authorization code is generated by the controlled device according to the second device information and the first valid authorization period after receiving the authorization code acquisition instruction sent by the master device and sent to the master device. The first valid authorization period is the effective authority period of the master device to control the controlled device. The controlled device performs a check based on the first device information, the first user identification information and the first authorization code. After determining that the check is passed, the controlled device sends a first check success instruction to the master device to indicate that the authorization connection between the master device and the controlled device is successful. In the above process, the first device information, the first user identification information and the first authorization code included in the first authorization connection request are verified to determine whether the first authorization connection request of the master device is passed, thereby avoiding the operation of the trusted device in the prior art of querying in the white list to determine whether the master device is authorized. That is, there is no need to store the authorized master device in the white list, which reduces resource usage, and improves security by decrypting the authorization code to perform authorization connection verification.
[0044] The authorization method for a smart device provided by the embodiments of the present disclosure may be implemented based on the electronic device, or a functional module or functional entity in the electronic device.
[0045] The electronic device may be a personal computer (PC), a server, a mobile phone, a tablet computer, a laptop computer, a mainframe computer, etc., and the embodiments of the present disclosure do not specifically limit this.
[0046] For example, Figure 2A FIG. 1 is a block diagram of a hardware configuration of an electronic device according to one or more embodiments of the present disclosure. Figure 2AAs shown, the electronic device includes at least one of a tuner and demodulator 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface 280. The controller 250 includes a central processing unit (CPU), a video processor, an audio processor, a graphics processor, RAM, ROM, and first to nth interfaces for input / output. The display 260 can be at least one of a liquid crystal display (LCD), an OLED display, a touch display, and a projection display, and can also be a projection device and a projection screen. The tuner and demodulator 210 receives broadcast television signals via wired or wireless reception, and demodulates audio and video signals, such as EPG audio and video data signals, from multiple wireless or wired broadcast television signals. The communicator 220 is a component used to communicate with external devices or servers using various communication protocols. For example, the communicator can include at least one of a Wi-Fi module, a Bluetooth module, a wired Ethernet module, or other network communication protocol chips or near-field communication protocol chips, as well as an infrared receiver. The electronic device can establish transmission and reception of control signals and data signals with the server 203 or the local control device 205 via the communicator 220. The detector 230 is used to collect signals from the external environment or external interactions. The controller 250 and the tuner 210 can be located in different separate devices. That is, the tuner 210 can also be located in an external device of the main device where the controller 250 is located, such as an external set-top box. The user interface 280 can be used to receive control signals from a control device (such as an infrared remote control).
[0047] In some embodiments, the controller 250 controls the operation of the electronic device and responds to user operations through various software control programs stored in the memory. The controller 250 controls the overall operation of the electronic device. The user can enter user commands through the graphical user interface (GUI) displayed on the display 260, and the user input interface receives the user input commands through the graphical user interface (GUI). Alternatively, the user can enter user commands by inputting specific sounds or gestures, and the user input interface recognizes the sounds or gestures through sensors to receive the user input commands.
[0048] In some embodiments, the "user interface" is a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The commonly used form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations displayed in a graphical manner. It can be an interface element such as an icon, window, and control displayed on the display screen of an electronic device, where the control can include at least one of the visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc.
[0049] Figure 2B FIG. 1 is a schematic diagram of software configuration of an electronic device according to one or more embodiments of the present disclosure, such as Figure 2B As shown in the figure, the system is divided into four layers, from top to bottom: the application layer (referred to as the "application layer"), the application framework layer (referred to as the "framework layer"), the Android runtime (Android runtime) and system library layer (referred to as the "system runtime library layer"), and the kernel layer.
[0050] In some embodiments, at least one application program runs in the application layer. These applications can be window programs, system settings programs, clock programs, etc. that come with the operating system, or applications developed by third-party developers. In specific implementations, the applications in the application layer include but are not limited to the above examples.
[0051] In some embodiments, the system runtime layer provides support for the upper layer, namely the framework layer. When the framework layer is used, the Android operating system will run the C / C++ library contained in the system runtime layer to implement the functions to be implemented by the framework layer.
[0052] In some embodiments, the kernel layer is a layer between hardware and software, and includes at least one of the following drivers: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver, etc.
[0053] Figure 2C This is a schematic diagram showing an icon control interface of an application included in a controlled device (mainly a smart playback device, such as a smart TV, a digital cinema system, or an audio and video server, etc.) according to one or more embodiments of the present disclosure, as shown in FIG. Figure 2CAs shown in , the application layer includes at least one application that can display corresponding icon controls on the display, such as: live TV application icon controls, video on demand (VOD) application icon controls, media center application icon controls, application center icon controls, game application icon controls, etc. Live TV applications can provide live TV through different signal sources. Video on demand (VOD) applications can provide videos from different storage sources. Unlike live TV applications, video on demand provides video display from certain storage sources. Media center applications can provide applications for playing various multimedia content. Application center can provide storage for various applications.
[0054] The authorization method for a smart device provided in the embodiment of the present application can be implemented based on the above-mentioned electronic device.
[0055] In order to explain this solution in more detail, the following will be combined with the following examples. Figure 3A To explain, it is understandable that Figure 3A The steps involved may include more steps or fewer steps in actual implementation, and the order of these steps may also be different, so as to implement the authorization method for the smart device applied to the controlled device side provided in the embodiment of the present application.
[0056] Figure 3A A flowchart of a method for authorizing a smart device provided in an embodiment of the present disclosure. Figure 3B This is an interactive diagram of an authorization method for a smart device provided by an embodiment of the present disclosure. This embodiment is applied to a controlled device. The method of this embodiment is executed by an authorization method apparatus for a smart device applied to the controlled device side. The apparatus can be implemented in hardware or software and can be configured in an electronic device. Figure 3A As shown, the authorization method of the smart device specifically includes the following steps:
[0057] S310: Receive a first authorization connection request sent by a master control device.
[0058] Among them, the first authorization connection request includes first device information, first user identification information and a first authorization code. The first authorization code is generated by the controlled device according to the second device information and the first valid authorization period and sent to the master device after receiving the authorization code acquisition instruction sent by the master device. The first valid authorization period is the effective authority period of the master device to control the controlled device, that is, the effective authorization period of the master device to control the controlled device set according to user needs. For example, the first valid authorization period can be 10 days, but is not limited to this. This disclosure does not specifically limit it, and those skilled in the art can set it according to actual conditions.
[0059] The aforementioned master device is a device that controls a controlled device in a scenario with multiple smart devices. The master device may be, for example, a mobile phone, a tablet computer, or a smart central control screen, but is not limited thereto and is not specifically limited in this disclosure. The controlled device is a smart device controlled by the master device in a scenario with multiple smart devices. The smart device may be, for example, a television, a personal computer, an audio and video server, but is not limited thereto and is not specifically limited in this disclosure.
[0060] The above-mentioned first device information refers to the information corresponding to the master control device. The device information can be the identification information of the master control device, which is used to characterize the unique information of the master control device. For example, it can be the name of the master control device, the serial number of the master control device, but it is not limited to this. This disclosure does not specifically limit it, and those skilled in the art can set it according to actual conditions. The first user identification information refers to the information corresponding to the user using the master control device. The first user identification information can be a user name, mobile phone number, email address, etc., but it is not limited to this. This disclosure does not specifically limit it, and those skilled in the art can set it according to actual conditions. The first authorization code includes the device information of the master control device and the valid authorization period. The first authorization code can be an encrypted string of characters, or it can be an encrypted digital string composed of Arabic numerals, but it is not limited to this. This disclosure does not specifically limit it, and those skilled in the art can set it according to actual conditions.
[0061] Specifically, the master device sends a first authorization connection request including first device information, first user identification information, and a first authorization code to the controlled device, and the controlled device receives the first authorization connection request.
[0062] It should be noted that the first authorization connection request from the master device to the controlled device is sent based on the MQTT protocol, but is not limited thereto and is not specifically limited in the present disclosure.
[0063] S320: Perform verification based on the first device information, the first user identification information, and the first authorization code, and after determining that the verification passes, send a first verification success instruction to the main control device.
[0064] The first successful verification instruction indicates that the authorized connection between the master device and the controlled device is successful.
[0065] Specifically, after receiving the first authorization connection request sent by the master device, the controlled device responds to the first authorization connection request, performs verification based on the first device information, the first user identification information and the first authorization code, and after determining that the verification is passed, the controlled device sends a first verification success instruction to the master device, indicating that the authorization connection between the master device and the controlled device is successful. At this time, after receiving the first verification success instruction sent by the controlled device, the master device can control operations on the controlled device.
[0066] In this way, the authorization method for smart devices provided in this embodiment first sends a first authorization connection request to the controlled device through the master device, and the controlled device receives the first authorization connection request sent by the master device, wherein the first authorization connection request includes first device information, first user identification information and a first authorization code. The first authorization code is generated by the controlled device according to the second device information and the first valid authorization period after receiving the authorization code acquisition instruction sent by the master device and sent to the master device. The first valid authorization period is the effective authority period of the master device to control the controlled device. The controlled device performs a check based on the first device information, the first user identification information and the first authorization code. After determining that the check is passed, the controlled device sends a first check success instruction to the master device to indicate that the authorization connection between the master device and the controlled device is successful. In the above process, the first device information, the first user identification information and the first authorization code included in the first authorization connection request are verified to determine whether the first authorization connection request of the master device is passed, thereby avoiding the operation of the trusted device in the prior art of querying in the white list to determine whether the master device is authorized. That is, there is no need to store the authorized master device in the white list, which reduces resource usage, and improves security by decrypting the authorization code to perform authorization connection verification.
[0067] Figure 4A A flowchart of another smart device authorization method provided by an embodiment of the present disclosure. Figure 4B This is an interactive diagram of another smart device authorization method provided by the embodiment of the present disclosure. Optionally, this embodiment is applied to the controlled device side, such as Figure 4A As shown, before executing the first authorization connection request sent by the receiving main control device, the following steps are also included:
[0068] S410: Receive a first connection request sent by a master control device.
[0069] The first connection request includes the second device information, the second user identification information, and the user password. It should be noted that when the master device connects to the controlled device for the first time, before obtaining authorization for the controlled device, it is necessary to connect based on the MQTT protocol. After the connection is successful, it further undergoes explicit authorization in S430-S440 to obtain the first authorization code. This allows the master device to directly authorize the connection based on the authorization code, device information, and user identification information the next time it connects to the controlled device.
[0070] Specifically, before the master device sends the first authorization connection request to the controlled device, the master device sends the first connection request including the second device information, the second user identification information and the user password to the controlled device using the MQTT protocol.
[0071] S420: Perform verification based on the second user identification information and the user password, and after determining that the verification is successful, send a second verification success instruction to the main control device.
[0072] The second verification success instruction indicates that the master device is successfully connected to the controlled device, and sends a first authorization request to the controlled device.
[0073] Specifically, after receiving the first connection request sent by the master device, which includes the second device information, the second user identification information, and the user password, the controlled device performs verification based on the second user identification information and the user password. If the second user identification information and the user password are determined to be correct, the verification is successful, and the controlled device sends a second verification success instruction to the master device, indicating that the master device and the controlled device are successfully connected. At this point, after receiving the second verification success instruction sent by the controlled device, the master device determines that the master device and the controlled device are successfully connected, and sends a first authorization request to the controlled device, thereby performing an explicit authorization process for the controlled device.
[0074] S430 , in response to the first authorization request sent by the master device, perform authorization according to the second device information and the first valid authorization duration, and when it is determined that the authorization is successful, send a first authorization success instruction to the master device.
[0075] The first authorization success instruction indicates that the master device and the controlled device have been successfully authorized, and sends an authorization code acquisition instruction to the controlled device.
[0076] Specifically, after receiving the second verification success instruction sent by the controlled device, the master control device determines that the connection with the controlled device is successful, and the master control device sends a first authorization request to the controlled device. The controlled device receives the first authorization request sent by the master control device, and responds to the first authorization request, performs explicit authorization according to the second device information and the first valid authorization period, and after determining that the authorization is successful, the controlled device sends a first authorization success instruction to the master control device. At this time, the master control device receives the first authorization success instruction sent by the controlled device, and determines that the master control device is successfully authorized to control the controlled device. At this time, the master control device sends an authorization code acquisition instruction to the controlled device.
[0077] S440 : In response to the authorization code acquisition instruction sent by the master device, a first authorization code is generated based on the second device information and the first valid authorization duration, and the first authorization code is sent to the master device.
[0078] Specifically, the controlled device receives the authorization code acquisition instruction sent by the master device, and in response to the authorization code acquisition instruction, generates a first authorization code using an encryption algorithm according to the second device information and the first valid authorization duration, and sends the first authorization code to the master device.
[0079] In this way, the authorization method for smart devices provided in this embodiment, in the above process, first establishes a connection between the master device and the controlled device based on the MQTT protocol. After the connection is successful, the master device is further authorized, and after the authorization is successful, a first authorization code is obtained, so that subsequent users can directly authorize the connection based on the first authorization code, ensuring the security of the MQTT connection, avoiding the operation of querying in the whitelist to determine whether the master device is an authorized trusted device, that is, there is no need to store the authorized master device in the whitelist, reducing resource usage, and improving security by decrypting the authorization code to verify the authorized connection.
[0080] Figure 5A A flowchart of another method for authorizing a smart device provided in an embodiment of the present disclosure is shown below. Figure 5B An interactive diagram of another smart device authorization method provided by an embodiment of the present disclosure; Figure 5A is Figure 4A Based on the first device information, the first user identification information and the first authorization code are verified. After determining that the verification passes, a first verification success instruction is sent to the master device to indicate that the master device and the controlled device have successfully authorized the connection. One implementation method may be:
[0081] S510: Decrypt the first authorization code to obtain second device information and a first valid authorization duration.
[0082] Since the first authorization code is an encrypted string or number, in order to obtain the information contained in the authorization code, the authorization code needs to be decrypted to obtain the second device information and the first valid authorization duration included in the authorization code. The second device information refers to the device information of the master device that sends the authorization code acquisition instruction to the controlled device. This device information can be, for example, the identification information of the master device, which is used to uniquely represent the master device, such as the name of the master device or the serial number of the master device, but is not limited to this. This disclosure does not specifically limit this, and those skilled in the art can set it according to actual circumstances.
[0083] S520: Calculate a first duration according to a first moment when the controlled device generates a first authorization code and a second moment when the controlled device decrypts the first authorization code.
[0084] Among them, the first moment refers to the moment when the master device sends an authorization code acquisition instruction to the controlled device, the controlled device receives the authorization code acquisition instruction, responds to the authorization code acquisition instruction, and generates a first authorization code. The first moment can be determined according to the built-in clock in the controlled device. The second moment refers to the moment when the controlled device receives the first authorization connection request sent by the master device and needs to verify the first authorization connection request, that is, it is necessary to decrypt the first authorization code to obtain the information contained in the first authorization code for further verification.
[0085] Specifically, the first time instant when the controlled device generates the first authorization code and the second time instant when the controlled device decrypts the first authorization code are calculated to obtain the first duration.
[0086] For example, following the above embodiment, it is known that the first valid authorization period is 10 days, that is, 240 hours. If the first moment when the controlled device generates the first authorization code is 10 a.m. on January 1, 2022, and the second moment when the controlled device decrypts the first authorization code is 10 a.m. on January 5, 2022, then the first moment and the second moment are calculated to obtain a first period of 96 hours, but this is not limited to this. The present disclosure does not specifically limit it, and those skilled in the art can make calculations based on actual conditions.
[0087] S530, if the first duration is less than or equal to the first valid authorization duration, and the first device information is consistent with the second device information, and the first user identification information is consistent with the second user identification information, the verification passes, and a first verification success instruction is sent to the main control device.
[0088] Specifically, the first duration calculated through the first moment when the controlled device generates the first authorization code and the second moment when the controlled device decrypts the first authorization code is compared with the first effective authorization duration, the first device information and the second device information are compared, and the first user identification information and the second user identification information are compared. When it is determined that the first duration is less than or equal to the first effective authorization duration, and at the same time the first device information and the second device information are consistent, and the first user identification information and the second user identification information are consistent, it is determined that the first authorization connection request is checked and passed, and a first inspection success instruction is sent to the master control device to indicate that the authorized connection between the master control device and the controlled device is successful. At this time, after receiving the first inspection success instruction sent by the controlled device, the master control device can control operations on the controlled device.
[0089] In this way, the authorization method for smart devices provided by this embodiment avoids the operation of querying in the whitelist to determine whether the master device is an authorized trusted device during the process of verifying the first authorization connection request in the above process. That is, there is no need to store the authorized master device in the whitelist, which reduces resource usage and improves security by decrypting the authorization code to perform authorization connection verification.
[0090] Optionally, based on the above embodiment, in some embodiments of the present disclosure, the method further includes:
[0091] Step A: When the first time period is greater than the first valid authorization time period, a first verification failure instruction is sent to the main control device.
[0092] Specifically, when the controlled device compares the first time length with the first valid authorization time length, when it determines that the first time length is greater than the first valid authorization time length, it considers that the authorization control of the master device over the controlled device has expired at this time, and the controlled device sends a first verification failure instruction to the master device. Accordingly, after receiving the first verification failure instruction sent by the controlled device, the master device determines that the master device cannot control the controlled device at this time.
[0093] Step B: in response to the first update authorization code instruction sent by the master device, update the first authorization code based on the second valid authorization duration to obtain a second authorization code, and send the second authorization code to the master device.
[0094] The first instruction to update the authorization code refers to an instruction for the master device to re-send authorization to the controlled device to obtain the authorization code.
[0095] Specifically, when the master control device determines that the authorization control over the controlled device has expired at this time, it sends a first update authorization code instruction to the controlled device. The controlled device receives and responds to the first update authorization code instruction, explicitly re-authorizes the master control device according to the second valid authorization period, obtains the second authorization code, and sends the second authorization code to the master control device when receiving the authorization code acquisition instruction sent by the controlled device.
[0096] Optionally, for the process of re-authorizing the master device to obtain the second authorization code based on the first update authorization code instruction, refer to S410-S440 in the above embodiment, which will not be described in detail here.
[0097] In this way, in the authorization method for smart devices provided by this embodiment, in the above process, when the main control device receives the first verification failure instruction sent by the controlled device and determines that the authorization code is invalid, that is, the main control device cannot control the controlled device, it is necessary to further re-authorize the main control device to ensure that the main control device can still realize the authorized connection to the controlled device based on the authorization code in subsequent use, thereby improving the user experience.
[0098] Optionally, based on the above embodiment, in some embodiments of the present disclosure, the method further includes:
[0099] Step C: in response to the second update authorization code instruction sent by the master device, update the first authorization code based on the third valid authorization duration to obtain a third authorization code, and send the third authorization code to the master device.
[0100] Among them, the second update authorization code instruction is generated when the first valid authorization period is permanently valid, that is, when it is determined that the valid authorization period of the master device to the controlled device is permanently valid, in order to prevent the master device from being attacked by hackers, so that the hackers can always control the controlled device, the master device sends a second update authorization code instruction, so that the controlled device deletes the permanently valid authorization control of the master device, and re-authorizes the master device based on the third valid authorization period, so as to solve the above problem.
[0101] Specifically, when the master control device determines that the effective authorization period for the controlled device is permanently valid at this time, it sends a second update authorization code instruction to the controlled device. The controlled device receives and responds to the second update authorization code instruction, and explicitly re-authorizes the master control device according to the third effective authorization period to obtain a third authorization code. When receiving the authorization code acquisition instruction sent by the controlled device, the controlled device sends the third authorization code to the master control device.
[0102] Optionally, for the process of re-authorizing the master device to obtain the third authorization code based on the second update authorization code instruction, refer to S410-S440 in the above embodiment, which will not be described in detail here.
[0103] In this way, in the authorization method for smart devices provided by this embodiment, in the above process, when the master device determines that the effective authorization period for the controlled device is permanently valid, in order to prevent the master device from being attacked by hackers, so that the hackers can always control the controlled device, the master device sends a second update authorization code instruction. Furthermore, after receiving the second update authorization code instruction, the controlled device re-authorizes the master device, thereby improving security and enhancing the user experience.
[0104] Figure 6A A flowchart of another smart device authorization method provided in an embodiment of the present disclosure. Figure 6B This is an interactive diagram of another smart device authorization method provided by the embodiment of the present disclosure. This embodiment is applied to the main control device side. The method of this embodiment can be executed by an authorization method device applied to a smart device. The device can be implemented in hardware / or software and can be configured in an electronic device. Figure 6A As shown, the method specifically includes the following steps:
[0105] S610: Send a first authorization connection request to the controlled device.
[0106] Among them, the first authorization connection request enables the controlled device to perform a verification based on the first device information, the first user identification information and the first authorization code, and after determining that the verification is passed, sends a first verification success instruction to the main control device, wherein the first authorization request includes the first device information, the first user identification information and the first authorization code.
[0107] S620: Receive a first verification success instruction sent by the controlled device.
[0108] The first successful verification instruction indicates that the authorized connection between the master device and the controlled device is successful.
[0109] In this embodiment, the above S610-S620 are executed from the main control device. The specific implementation process refers to S310-S320, which will not be described in detail here.
[0110] The authorization method for a smart device provided in this embodiment first sends a first authorization connection request to the controlled device through the master device, and the controlled device receives the first authorization connection request sent by the master device, wherein the first authorization connection request includes first device information, first user identification information and a first authorization code. The first authorization code is generated by the controlled device according to the second device information and the first valid authorization duration after receiving the authorization code acquisition instruction sent by the master device, and sent to the master device. The first valid authorization duration is the effective authority duration of the master device to control the controlled device. The master controlled device performs a check based on the first device information, the first user identification information and the first authorization code. After determining that the check is passed, the master controlled device sends a first check success instruction to the master device to indicate that the authorized connection between the master device and the controlled device is successful. In the above process, the first device information, the first user identification information and the first authorization code included in the first authorization connection request are verified to determine whether the first authorization connection request of the master device is passed, thereby avoiding the operation of the trusted device in the prior art of querying in the white list to determine whether the master device is authorized. That is, there is no need to store the authorized master device in the white list, which reduces resource usage, and improves security by decrypting the authorization code to perform authorization connection verification.
[0111] Figure 7 A flowchart of another smart device authorization method provided in an embodiment of the present disclosure. Figure 7 is Figure 6A Based on the above, the specific process before executing the first authorization connection request to the controlled device is described. Figure 7 As shown, the method specifically includes the following steps:
[0112] S710: Send a first connection request to the controlled device.
[0113] Among them, the first connection request enables the controlled device to perform verification based on the second user identification information and the user password. After determining that the verification is passed, a second verification success instruction is sent to the main control device. The second verification success instruction indicates that the main control device and the controlled device are successfully connected, and a first authorization request is sent to the controlled device. The first connection request includes at least the second device information, the second user identification information and the user password.
[0114] S720 : Respond to the second verification success instruction sent by the controlled device to determine that the connection between the master device and the controlled device is successful, and send a first authorization request to the controlled device.
[0115] S730 : Respond to the first authorization success instruction sent by the controlled device to determine that the authorization between the master device and the controlled device is successful, and send an authorization code acquisition instruction to the controlled device.
[0116] The authorization code acquisition instruction is used to instruct the controlled device to generate a first authorization code based on the second device information and the first valid authorization duration and send the first authorization code to the master device.
[0117] S740: Receive a first authorization code sent by the controlled device.
[0118] In this embodiment, the above S710-S740 are executed from the main control device. The specific implementation process refers to S410-S440, which will not be described in detail here.
[0119] The authorization method for smart devices provided in this embodiment, in the above process, first connects the master device and the controlled device based on the MQTT protocol, and after the connection is successful, further authorizes the master device, and obtains the first authorization code after the authorization is successful, so that subsequent users can directly authorize the connection based on the first authorization code, ensuring the security of the MQTT connection, avoiding the operation of querying in the whitelist to determine whether the master device is an authorized trusted device, that is, there is no need to store the authorized master device in the whitelist, reducing resource usage, and further improving security by decrypting the authorization code.
[0120] Optionally, based on the above embodiment, in some embodiments of the present disclosure, the method further includes:
[0121] Step D, in response to the first verification failure instruction sent by the controlled device, indicating that the first duration is greater than the first valid authorization duration, and sending a first update authorization code instruction to the controlled device to instruct the controlled device to update the first authorization code based on the second valid authorization duration, obtain the second authorization code, and send the second authorization code to the master device.
[0122] Step E: Receive a second authorization code sent by the controlled device.
[0123] In this embodiment, the above steps D to E are executed from the main control device. The specific implementation process refers to steps A to B, which will not be described in detail here.
[0124] In this way, in the authorization method for smart devices provided by this embodiment, in the above process, when the main control device receives the first verification failure instruction sent by the controlled device and determines that the authorization code is invalid, that is, the main control device cannot control the controlled device, it is necessary to further re-authorize the main control device to ensure that the main control device can still realize the authorized connection to the controlled device based on the authorization code in subsequent use, thereby improving the user experience.
[0125] Optionally, based on the above embodiment, in some embodiments of the present disclosure, the method further includes:
[0126] Step F: When it is determined that the first valid authorization duration is permanently valid, a second update authorization code instruction is sent to the controlled device to instruct the controlled device to update the first authorization code based on the third valid authorization duration, obtain a third authorization code, and send the third authorization code to the master device.
[0127] Step G: Receive the third authorization code sent by the controlled device.
[0128] In this embodiment, the above steps F to G are executed from the main control device. The specific implementation process refers to step C and will not be described in detail here.
[0129] In this way, in the authorization method for smart devices provided by this embodiment, in the above process, when the master device determines that the effective authorization period for the controlled device is permanently valid, in order to prevent the master device from being attacked by hackers, so that the hackers can always control the controlled device, the master device sends a second update authorization code instruction. Furthermore, after receiving the second update authorization code instruction, the controlled device re-authorizes the master device, thereby improving security and enhancing the user experience.
[0130] Figure 8 This is a schematic diagram of a method and apparatus for authorizing a smart device according to an embodiment of the present disclosure. Applied to a controlled device, this apparatus is configured in an electronic device and can implement the authorization method for a smart device applied to the controlled device as described in any embodiment of this application. The apparatus specifically includes the following:
[0131] A first authorization connection request receiving module 11 is configured to receive a first authorization connection request sent by a master device, wherein the first authorization connection request includes first device information, first user identification information, and a first authorization code. The first authorization code is generated by the controlled device based on second device information and a first valid authorization duration after receiving an authorization code acquisition instruction sent by the master device, and sent to the master device. The first valid authorization duration is the effective duration of the master device's permission to control the controlled device.
[0132] The verification module 12 is used to perform verification based on the first device information, the first user identification information and the first authorization code, and after determining that the verification is passed, send a first verification success instruction to the main control device to indicate that the main control device and the controlled device have successfully authorized the connection.
[0133] As an optional implementation of the embodiment of the present disclosure, the apparatus further includes: a first connection request receiving module, configured to receive a first connection request sent by the master device, wherein the first connection request includes the second device information, the second user identification information, and the user password;
[0134] The verification module 12 is further configured to perform verification based on the second user identification information and the user password, and after determining that the verification is successful, send a second verification success instruction to the master device to indicate that the master device is successfully connected to the controlled device, and send a first authorization request to the controlled device;
[0135] an authorization module, configured to respond to the first authorization request sent by the master device, perform authorization based on the second device information and the first valid authorization duration, and upon determining that the authorization is successful, send a first authorization success instruction to the master device to indicate that the master device and the controlled device have been successfully authorized, and send the authorization code acquisition instruction to the controlled device;
[0136] The first authorization code generating module is configured to generate the first authorization code in response to the authorization code obtaining instruction sent by the main control device and based on the second device information and the first valid authorization duration, and send the first authorization code to the main control device.
[0137] As an optional implementation of the embodiment of the present disclosure, the verification module 12 is specifically configured to decrypt the first authorization code to obtain the second device information and the first valid authorization duration;
[0138] calculating a first duration according to a first moment when the controlled device generates the first authorization code and a second moment when the controlled device decrypts the first authorization code;
[0139] If the first duration is less than or equal to the first valid authorization duration, and the first device information is consistent with the second device information, and the first user identification information is consistent with the second user identification information, the verification passes and a first verification success instruction is sent to the main control device.
[0140] As an optional implementation of the embodiment of the present disclosure, the device further includes:
[0141] A first updating module is configured to send a first verification failure instruction to the main control device when the first time period is greater than the first valid authorization time period;
[0142] In response to the first update authorization code instruction sent by the master device, the first authorization code is updated based on the second valid authorization duration to obtain a second authorization code, and the second authorization code is sent to the master device.
[0143] As an optional implementation of the embodiment of the present disclosure, the first update module is further used to respond to the second update authorization code instruction sent by the master control device, update the first authorization code based on the third valid authorization period, obtain a third authorization code, and send the third authorization code to the master control device, wherein the second update authorization code instruction is generated when the first valid authorization period is permanently valid.
[0144] The authorization method device for smart devices provided in the embodiments of the present disclosure can execute the authorization method for smart devices applied to the controlled device side provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method. To avoid repetition, they will not be described here.
[0145] Figure 9 This is a schematic diagram of another smart device authorization method apparatus provided by an embodiment of the present disclosure. Applied to a master device, this apparatus is configured in an electronic device and can implement the smart device authorization method applied to the master device side as described in any embodiment of this application. The apparatus specifically includes the following:
[0146] a first authorization connection request sending module 21, configured to send a first authorization connection request to a controlled device, so that the controlled device performs a verification based on the first device information, the first user identification information, and the first authorization code, and after determining that the verification is successful, sends a first verification success instruction to the master device, wherein the first authorization request includes the first device information, the first user identification information, and the first authorization code;
[0147] The first verification success instruction receiving module 22 is configured to receive the first verification success instruction sent by the controlled device to indicate that the authorized connection between the master device and the controlled device is successful.
[0148] As an optional implementation of the embodiment of the present disclosure, the device further includes:
[0149] a first connection request sending module, configured to send a first connection request to the controlled device, so that the controlled device performs verification based on the second user identification information and the user password; after determining that the verification is successful, send a second verification success instruction to the master device to indicate that the master device is successfully connected to the controlled device, and send a first authorization request to the controlled device, wherein the first connection request includes at least the second device information, the second user identification information, and the user password;
[0150] a first authorization request sending module, configured to respond to the second verification success instruction sent by the controlled device to determine that the connection between the master device and the controlled device is successful, and send a first authorization request to the controlled device;
[0151] an authorization code acquisition instruction sending module, configured to respond to the first authorization success instruction sent by the controlled device to determine that the authorization between the master device and the controlled device is successful, and send an authorization code acquisition instruction to the controlled device to instruct the controlled device to generate a first authorization code based on the second device information and the first valid authorization duration and send the first authorization code to the master device;
[0152] The authorization code receiving module is configured to receive the first authorization code sent by the controlled device.
[0153] As an optional implementation of the embodiment of the present disclosure, the device further includes:
[0154] a second updating module, configured to respond to the first verification failure instruction sent by the controlled device to indicate that the first duration is greater than the first valid authorization duration, and send a first update authorization code instruction to the controlled device to instruct the controlled device to update the first authorization code based on the second valid authorization duration, obtain a second authorization code, and send the second authorization code to the master device;
[0155] The authorization code receiving module is further configured to receive the second authorization code sent by the controlled device.
[0156] As an optional implementation of the embodiment of the present disclosure, the second update module is further configured to, when determining that the first valid authorization duration is permanently valid, send a second update authorization code instruction to the controlled device to instruct the controlled device to update the first authorization code based on a third valid authorization duration, obtain a third authorization code, and send the third authorization code to the master device;
[0157] The authorization code receiving module is further configured to receive the third authorization code sent by the controlled device.
[0158] The authorization method apparatus for a smart device provided in the embodiments of the present disclosure can execute the authorization method for a smart device provided in any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method. To avoid repetition, they will not be described here.
[0159] An embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the smart device authorization methods described in the embodiments of the present disclosure.
[0160] Figure 10 Schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 10 As shown, the electronic device includes a processor 1010 and a storage device 1020; the number of processors 1010 in the electronic device can be one or more. Figure 10 In the figure, a processor 1010 is taken as an example; the processor 1010 and the storage device 1020 in the electronic device can be connected via a bus or other means. Figure 10 The bus connection is taken as an example.
[0161] Storage device 1020, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the smart device authorization method in the embodiments of the present disclosure. Processor 1010 executes the software programs, instructions, and modules stored in storage device 1020 to execute various functional applications and data processing of the electronic device, thereby implementing the smart device authorization method provided in the embodiments of the present disclosure.
[0162] The storage device 1020 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal, etc. Furthermore, the storage device 1020 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some instances, the storage device 1020 may further include a memory remotely located relative to the processor 1010, and such remote memory may be connected to the electronic device via a network. Examples of the aforementioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0163] An electronic device provided in this embodiment can be used to execute the authorization method for a smart device provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0164] An embodiment of the present disclosure provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various processes of the authorization method of the above-mentioned smart device and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0165] The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0166] For ease of explanation, the above description has been made in conjunction with specific embodiments. However, the above discussion of some embodiments is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are intended to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A method for authorizing a smart device, characterized in that: Applicable to controlled devices, including: After the controlled device is successfully connected to the master device and the controlled device authorizes the master device to control the controlled device, a first authorization connection request sent by the master device is received, wherein the first authorization connection request includes first device information, first user identification information, and a first authorization code. The first authorization code is generated by the controlled device according to second device information and a first valid authorization duration after receiving an authorization code acquisition instruction sent by the master device and sent to the master device. The first valid authorization duration is the effective duration of the master device's permission to control the controlled device; A check is performed based on the first device information, the first user identification information and the first authorization code. After determining that the check passes, a first check success instruction is sent to the master device to indicate that the master device and the controlled device have successfully authorized a connection.
2. The smart device authorization method according to claim 1, characterized in that: The method further comprises: receiving a first connection request sent by the master device, wherein the first connection request includes the second device information, second user identification information, and a user password; performing verification based on the second user identification information and the user password, and after determining that the verification passes, sending a second verification success instruction to the master device to indicate that the master device is successfully connected to the controlled device, and sending a first authorization request to the controlled device; In response to the first authorization request sent by the master device, performing authorization based on the second device information and the first valid authorization duration, and when determining that the authorization is successful, sending a first authorization success instruction to the master device to indicate that the master device and the controlled device have successfully authorized each other, and sending the authorization code acquisition instruction to the controlled device; In response to the authorization code acquisition instruction sent by the main control device, the first authorization code is generated based on the second device information and the first valid authorization duration and sent to the main control device.
3. The smart device authorization method according to claim 1, characterized in that: The performing verification based on the first device information, the first user identification information, and the first authorization code, and sending a first verification success instruction to the main control device after determining that the verification passes, includes: Decrypting the first authorization code to obtain the second device information and the first valid authorization duration; calculating a first duration according to a first moment when the controlled device generates the first authorization code and a second moment when the controlled device decrypts the first authorization code; If the first duration is less than or equal to the first valid authorization duration, and the first device information is consistent with the second device information, and the first user identification information is consistent with the second user identification information, the verification passes and a first verification success instruction is sent to the main control device.
4. The smart device authorization method according to claim 3, characterized in that: The method further comprises: When the first time period is greater than the first valid authorization time period, sending a first verification failure instruction to the main control device; In response to the first update authorization code instruction sent by the master device, the first authorization code is updated based on the second valid authorization duration to obtain a second authorization code, and the second authorization code is sent to the master device.
5. The smart device authorization method according to claim 1, characterized in that: The method further comprises: In response to a second update authorization code instruction sent by the master control device, the first authorization code is updated based on a third valid authorization duration to obtain a third authorization code, and the third authorization code is sent to the master control device, wherein the second update authorization code instruction is generated when the first valid authorization duration is permanently valid.
6. A method for authorizing a smart device, characterized in that: Applicable to main control equipment, including: After the controlled device is successfully connected to the master device and the controlled device authorizes the master device to control the controlled device, a first authorization connection request is sent to the controlled device, so that the controlled device performs a verification based on the first device information, the first user identification information, and the first authorization code. After determining that the verification is passed, a first verification success instruction is sent to the master device, wherein the first authorization request includes the first device information, the first user identification information, and the first authorization code. The first authorization code is generated by the controlled device according to the second device information and the first valid authorization duration after receiving the authorization code acquisition instruction sent by the master device and sent to the master device. The first valid authorization duration is the effective permission duration of the master device to control the controlled device; The first verification success instruction sent by the controlled device is received to indicate that the authorized connection between the master device and the controlled device is successful.
7. The smart device authorization method according to claim 6, characterized in that: The method further comprises: sending a first connection request to the controlled device, so that the controlled device performs verification based on the second user identification information and the user password; after determining that the verification is successful, sending a second verification success instruction to the master device to indicate that the master device is successfully connected to the controlled device, and sending a first authorization request to the controlled device, wherein the first connection request includes at least the second device information, the second user identification information, and the user password; In response to the second verification success instruction sent by the controlled device, determining that the master device is successfully connected to the controlled device, and sending a first authorization request to the controlled device; In response to the first authorization success instruction sent by the controlled device, determining that the authorization between the master device and the controlled device is successful, and sending an authorization code acquisition instruction to the controlled device to instruct the controlled device to generate a first authorization code based on the second device information and the first valid authorization duration and send the first authorization code to the master device; Receive the first authorization code sent by the controlled device.
8. The smart device authorization method according to claim 7, characterized in that: The method further comprises: In response to a first verification failure instruction sent by the controlled device, indicating that the first duration is greater than the first valid authorization duration, a first update authorization code instruction is sent to the controlled device to instruct the controlled device to update the first authorization code based on a second valid authorization duration, obtain a second authorization code, and send the second authorization code to the master device; Receive the second authorization code sent by the controlled device.
9. The smart device authorization method according to claim 6, characterized in that: The method further comprises: When it is determined that the first valid authorization duration is permanently valid, sending a second update authorization code instruction to the controlled device to instruct the controlled device to update the first authorization code based on the third valid authorization duration, obtain a third authorization code, and send the third authorization code to the master device; Receive the third authorization code sent by the controlled device.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 or the method according to any one of claims 6 to 9 is implemented.
Citation Information
Patent Citations
Television screen projection method and device, cloud server and terminal equipment
CN111836085A
Display device, terminal device and communication connection method
CN113630656A