Smart home internet of things device control method, apparatus, device, and medium
By introducing a target family tag into the access token, the smart application verifies permissions and queries the target family's device list, solving the problem of inaccurate device control in multi-family scenarios and achieving precise control and privacy protection of target family devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU LIFESMART TECH
- Filing Date
- 2023-07-12
- Publication Date
- 2026-06-23
AI Technical Summary
When a user ID is associated with multiple households, existing technology cannot correctly distinguish and control the smart home IoT devices in different households, resulting in the control device being unable to accurately control the smart home devices in each household.
By incorporating a target home tag into the access token, the smart application verifies the permission information, obtains the access token information associated with the target home tag, queries the target home device list from the preset device list, and sends it to the control device to achieve control over the target home devices.
This ensures that the control device only controls the devices corresponding to the target household tag, avoiding the leakage of user privacy and enabling accurate control of various household devices in multi-household scenarios.
Smart Images

Figure CN116938546B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, specifically to control methods, devices, equipment, and media for smart home IoT devices. Background Technology
[0002] With the development of Internet of Things (IoT) technology, more and more families are introducing smart home IoT devices to make life more convenient. Furthermore, with the development and improvement of intelligent voice services, more and more users will use control devices with intelligent voice services (such as smart speakers) to control smart home IoT devices in their homes via voice commands.
[0003] For control devices that require user authorization before voice control of smart home IoT devices, the Open Authorization (OAuth2) mechanism is often used. Specifically, when the smart application verifies and approves the user's ID and password based on the user's input authorization request, it sends an access token to the control device. Upon receiving the access token, the control device calls the smart application's DiscoverDevices interface, which returns a list of smart home IoT devices from a specific IoT vendor that the access token can access. This allows the control device to then control the IoT devices from that vendor via voice commands.
[0004] However, in the above solutions, the smart home IoT device list returned by the smart application to the control device mostly includes all smart home IoT devices belonging to that IoT vendor under the user ID corresponding to the access token. When a user ID is associated with multiple households, and at least two households have smart home IoT devices from the same IoT vendor, the control device cannot effectively distinguish between smart home IoT devices in different households under the same user ID. It will often simultaneously control smart home IoT devices in multiple households based on the user's voice commands, leading to incorrect control of smart home IoT devices in different households under the same user ID. Therefore, how to correctly control smart home IoT devices in each household when one user ID is associated with multiple households has become an urgent problem to be solved. Summary of the Invention
[0005] In view of this, this application provides a control method, device, equipment and medium for smart home IoT devices to solve the problem of how to correctly control smart home IoT devices in each household when a user identifier is associated with multiple households.
[0006] In a first aspect, this application provides a control method for a smart home IoT device, the method being executed by a smart application, the method comprising:
[0007] Receive the access token sent by the control device and verify the permission information in the access token; the access token includes the target family tag; the target family tag is one of multiple family tags associated with the target user identifier of the control device;
[0008] When the permission information is verified, the target access token information associated with the target family tag is obtained;
[0009] Based on the target access token information, query the target home device list corresponding to the target home tag from the preset smart home IoT device list; the preset smart home IoT device list includes multiple home device lists corresponding to the target user identifier, and the target home device list is one of the multiple home device lists;
[0010] Send a list of target home devices to the control device so that the control device can control the smart home IoT devices in the target home device list based on the user's voice.
[0011] In the above technical solution, when the smart application receives an access token sent by the control device, it first verifies the permission information in the access token. If the permission information verification is successful, it obtains the target access token information associated with the target home tag in the access token. Since the target home tag is one of multiple home tags associated with the user identifier corresponding to the control device, and the preset smart home IoT device list includes multiple home device lists corresponding to the user identifier, the target home device list retrieved from the preset smart home IoT device list based on the target access token information associated with one of the multiple home tags associated with the user identifier will only correspond to that target home tag. Therefore, when the target home device list is sent to the control device, the control device will only receive the home device list corresponding to one of the multiple home tags associated with the user identifier, rather than a list including all smart home IoT devices associated with the user identifier. The control device can then control only the smart home IoT devices under the home corresponding to the target home tag based on the user's voice, enabling the control device to correctly control smart home IoT devices in one or more homes when one user identifier is associated with multiple homes.
[0012] In some optional embodiments, the target access token information includes a target home identifier, a target user identifier, and a target home tag. Based on the target access token information, a list of target home devices corresponding to the target home tag is queried from a preset smart home IoT device list, including:
[0013] Obtain the target user identifier from the target access token information, and the target family identifier corresponding to the target family tag;
[0014] From the preset list of smart home IoT devices, query the list of multiple home devices corresponding to the target user identifier;
[0015] From the list of multiple home devices corresponding to the target user identifier, query the list of target home devices corresponding to the target home identifier.
[0016] In the above technical solution, a mapping relationship is added between the target family identifier and the target family tag. When it is necessary to query the list of target family devices corresponding to the target family identifier, the target family identifier and the target user identifier corresponding to the target family tag are first obtained from the target access token information. Then, the list of multiple family devices corresponding to the target user identifier is queried. This achieves the lookup of the target device list corresponding to the target family identifier by using the target family tag as an intermediary, avoiding the direct use of the target family identifier and preventing the leakage of the user's family identifier. This also prevents the use of the user's family identifier to control smart home IoT devices in the home, thereby protecting the user's privacy.
[0017] In some optional embodiments, when the permission information verification is successful, the target access token information associated with the target family tag is obtained, including:
[0018] From at least one pre-stored access token, query the access token information that includes the target family tag, and determine the access token information that includes the target family tag as the target access token information.
[0019] In the above technical solution, the target access token information, including the target family tag, is queried from at least one pre-stored access token information. This facilitates the subsequent querying of a target family device list corresponding to the target family tag from multiple family device lists associated with the target user identifier based on the target access token information, so as to achieve the purpose of the control device correctly controlling the smart home IoT devices in each family.
[0020] In some optional embodiments, before receiving the access token sent by the control device and verifying the permission information in the access token, the method further includes:
[0021] Receive authorization requests from users and verify the target user identifier in the authorization request;
[0022] Once the target user identifier is verified, query the target home identifier and control device associated with the target user identifier.
[0023] When the target user identifier is found to be associated with the target family identifier, an access token including the target family tag is generated based on the target family identifier.
[0024] An access token, including the target family tag, is sent to the control device, which then uses the access token to communicate with the smart application.
[0025] In the above technical solution, when the target user identifier in the user's authorization request is verified, the system queries the target home identifier associated with the target user identifier and the control device. Upon finding the target home identifier associated with the target user identifier, an access token including a target home tag is generated based on the target home identifier, and then sent to the control device. This improves the authorization process for the control device, ensuring that the access token returned to the control device can include the target home tag, avoiding the traditional situation where only an access token excluding the target home tag is returned. This facilitates subsequent communication between the control device and the smart application using the access token, enabling the control device to correctly control the smart home IoT devices within each home when a single user identifier is associated with multiple homes.
[0026] In some optional embodiments, when a target family identifier associated with a user identifier is found, an access token including a target family tag is generated based on the target family identifier, including:
[0027] From at least one pre-stored access token, query the access token information containing the target family identifier;
[0028] When the first access token information containing the target family identifier is found, delete the original access token in the first access token information and generate a first universal unique identifier.
[0029] The target family tag in the first access token information is added to the first universal unique identifier to obtain an access token including the target family tag, and the access token including the target family tag is stored in the first access token information.
[0030] In the above technical solution, when the first access token information containing the target family identifier is found, it means that the family indicated by the target family identifier has already been recorded. Re-authorization of the control device is then performed. At this point, the old, expired record is cleared, i.e., the original access token in the first access token information is deleted. A first universally unique identifier is then generated, and the target family label from the first access token information is added to a second universally unique identifier, resulting in an access token that includes the target family label. For the re-authorization of the control device, a new access token is generated without destroying the target family label in the first access token information. This ensures that the re-authorized access token can still control smart home IoT devices in only one existing home of the user indicated by the target family identifier.
[0031] In some optional embodiments, the method further includes:
[0032] If no access token information containing the target family identifier is found, a second access token information including the target family identifier is created.
[0033] Generate a second universal unique identifier and a target family label corresponding to the target family identifier;
[0034] Add the target family tag to the second universal unique identifier to obtain an access token including the target family tag, and store the access token including the target family tag and the target family tag in the second access token information.
[0035] In the above technical solution, when no access token information storing the target home identifier is found, it means that the home indicated by the target home identifier has not yet been recorded, and the authorization for the control device is new. Therefore, a second access token information including the target home identifier is first created. Then, the target home tag corresponding to the newly generated target home identifier is added to the newly generated second universally unique identifier, resulting in an access token including the target home tag. The target home tag and the access token including the target home tag are stored in the second access token information for easy retrieval later, enabling the control device to correctly control the smart home IoT devices in the home.
[0036] In some optional embodiments, the authorization request includes control device attribute information and a first timestamp; when the target user identifier is verified, the target home identifier associated with the target user identifier and the control device are queried, including:
[0037] From at least one pre-stored home tag record, query the target home tag record that contains control device attribute information and the target user identifier;
[0038] When a target family tag record containing control device attribute information and target user identifier is found, verify whether the time difference between the second timestamp information and the first timestamp information recorded in the target family record is within a preset threshold range.
[0039] When the time difference between the second timestamp information and the first timestamp information is within a preset threshold range, the family identifier recorded in the target family tagging record is determined as the target family identifier associated with the target user identifier;
[0040] Based on the authorization request, determine the control device associated with the target user identifier.
[0041] In the above technical solution, when the target user identifier is verified, and a target family tag record containing control device attribute information and the target user identifier is found from at least one pre-stored family tag record, the time difference between the second timestamp information and the first timestamp information recorded in the target family record is verified to be within a preset threshold range. When the time difference between the second timestamp information and the first timestamp information is within the preset threshold range, the family identifier recorded in the target family tag record is determined as the target family identifier associated with the user identifier, thereby determining the control device indicated by the control device attribute information as the control device associated with the target user identifier. Determining the target family identifier associated with the target user identifier based on whether the time difference between the second timestamp information and the first timestamp information is within the preset threshold range can prevent users from forgetting previously set family tag records, which could lead to the forgotten family identifier affecting subsequent access tokens, and thus affecting the control device's control behavior of smart home IoT devices based on access tokens, avoiding situations where the control of smart home IoT devices does not meet user expectations.
[0042] Secondly, this application provides a control device for a smart home Internet of Things (IoT) device, the device comprising:
[0043] The receiving module is used to receive the access token sent by the control device and verify the permission information in the access token; the access token includes a target family tag; the target family tag is one of multiple family tags associated with the target user identifier of the control device;
[0044] The acquisition module is used to acquire the target access token information associated with the target family tag when the permission information verification is successful.
[0045] The query module is used to query the target home device list corresponding to the target home tag from the preset smart home IoT device list based on the target access token information. The preset smart home IoT device list includes multiple home device lists corresponding to the target user identifier, and the target home device list is one of the multiple home device lists.
[0046] The sending module is used to send a list of target home devices to the control device, so that the control device can control the smart home IoT devices in the target home device list based on the user's voice.
[0047] Thirdly, this application provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the control method of the above-mentioned smart home Internet of Things device.
[0048] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the control method for the aforementioned smart home IoT device. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0050] Figure 1 This is a schematic diagram of the structure of a control system for a smart home IoT device according to an embodiment of this application;
[0051] Figure 2 This is a flowchart illustrating a control method for a smart home IoT device according to an embodiment of this application;
[0052] Figure 3 This is a flowchart illustrating another method for controlling a smart home IoT device according to an embodiment of this application.
[0053] Figure 4 This is a flowchart illustrating another control method for a smart home IoT device according to an embodiment of this application;
[0054] Figure 5 This is a structural block diagram of a control device for a smart home IoT device according to an embodiment of this application;
[0055] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] It should be understood that the term "instruction" mentioned in the embodiments of this application can be a direct instruction, an indirect instruction, or an indication of a relationship. For example, A instructing B can mean that A directly instructs B, such as B being able to obtain information through A; it can also mean that A indirectly instructs B, such as A instructing C, so B can obtain information through C; or it can mean that there is a relationship between A and B.
[0058] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.
[0059] In the embodiments of this application, "predefined" can be achieved by pre-storing corresponding codes, tables or other means that can be used to indicate relevant information in the device (e.g., including terminal devices and network devices). This application does not limit the specific implementation method.
[0060] Figure 1 This is a schematic diagram of the control system of a smart home IoT device according to an embodiment of this application. The control system of the smart home IoT device includes a processing device 110 that executes a smart application and multiple households belonging to the same user (shown as household 1 to household n in the figure). Each household includes a control device 120 and at least one smart home IoT device 130. At least two households contain smart home IoT devices belonging to the same IoT manufacturer (represented by gray ovals in the figure). Each household has a corresponding household tag.
[0061] The specific number of control devices 120 is not limited in this embodiment. Control device 120 can be any product that provides intelligent voice services and controls smart home IoT devices; this embodiment uses a smart speaker as an example. Control device 120 is used to control smart home IoT devices 130 in a specific home based on user voice commands.
[0062] Processing device 110 executes a smart application to receive an access token sent by control device 120 and verify the permission information in the access token. The access token includes a target home tag. The target home tag is one of multiple home tags associated with the target user identifier of the control device. When the permission information is verified, the target access token information associated with the target home tag is obtained. Based on the target access token information, the target home tag's corresponding target home device list is queried from a preset smart home IoT device list. The preset smart home IoT device list includes multiple home device lists corresponding to the target user identifier, and the target home device list is one of the multiple home device lists. The target home device list is sent to the control device so that the control device can control the smart home IoT devices in the target home device list based on the user's voice.
[0063] Optionally, after receiving the authorization request input by the user through the smart application, the processing device 110 verifies the target user identifier in the authorization request; when the target user identifier is verified, it queries the target family identifier associated with the target user identifier and the control device 120; when the target family identifier associated with the target user identifier is found, it generates an access token including the target family label based on the target family identifier; and sends the access token including the target family label to the control device 120 for subsequent communication between the control device 120 and the smart application.
[0064] Optionally, the processing device 110 can be a smart terminal such as a mobile phone, computer, tablet or smartwatch, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0065] Optionally, the processing device 110 and the control device 120 are connected via a transmission network (such as a wireless communication network), and the control device 120 and the smart home IoT device 130 are also connected via a transmission network.
[0066] Optionally, the control system of the smart home IoT device may also include a management device for managing the system (such as managing the connection status between each module and the server), and the management device is connected to the server via a communication network. Optionally, the communication network is a wired network or a wireless network.
[0067] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any other network, including but not limited to any combination of local area networks (LANs), metropolitan area networks (MANs), wide area networks (WANs), mobile, wired or wireless networks, private networks, or virtual private networks (VPNs). In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Sockets Layer (SSL), Transport Layer Security (TLS), VPNs, and Internet Protocol (IP) security can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0068] The control method for the smart home IoT device of this application is described below. First... Figure 2 This application discloses a control method for a smart home IoT device, which is executed by a smart application. The smart application can be configured by, for example,... Figure 1 The processing device 110 shown performs the operation. For example... Figure 2 The control method for the smart home IoT device shown may include the following steps:
[0069] Step 201: Receive the access token sent by the control device and verify the permission information in the access token.
[0070] The access token includes a target family tag, which is one of multiple family tags associated with the target user's identifier for the control device. Permission information indicates the IoT vendors the control device can access. The control device calls the DiscoverDevices interface of the smart application based on the access token. The smart application then receives the access token from the control device and verifies the permission information in the access token based on the OAuth2 protocol to determine the control device's access permissions. It should be noted that this embodiment uses a smart speaker as an example of the control device.
[0071] Step 202: When the permission information is verified, obtain the target access token information associated with the target family tag.
[0072] When the permission information is verified, the smart application will query the database for the target access token information associated with the target family tag identified from the access token, based on the correspondence between the family tag and the access token information.
[0073] Step 203: Based on the target access token information, query the list of target home devices corresponding to the target home tag from the preset smart home IoT device list.
[0074] The preset smart home IoT device list includes multiple lists of home devices corresponding to the target user identifier, with the target home device list being one of these lists. The smart application retrieves the home device list corresponding to the target home tag from the preset smart home IoT device list based on the target home tag information in the target access token information, thus obtaining the target home list.
[0075] Step 204: Send the target home device list to the control device so that the control device can control the smart home IoT devices in the target home device list based on the user's voice.
[0076] The smart application sends a list of target home devices corresponding to the target home tag to the control device through the DiscoverDevices interface. This allows the control device to control only the smart home IoT devices included in the target home device list based on the user's voice commands.
[0077] In this embodiment, when the smart application receives an access token sent by the control device, it first verifies the permission information in the access token. If the permission information verification is successful, it obtains the target access token information associated with the target home tag in the access token. Since the target home tag is one of multiple home tags associated with the user identifier corresponding to the control device, and the preset smart home IoT device list includes multiple home device lists corresponding to the user identifier, the target home device list retrieved from the preset smart home IoT device list based on the target access token information associated with one of the multiple home tags associated with the user identifier will only correspond to that target home tag. Therefore, when the target home device list is sent to the control device, the control device will only receive the home device list corresponding to one of the multiple home tags associated with the user identifier, rather than a list including all smart home IoT devices associated with the user identifier. The control device can then control only the smart home IoT devices under the home corresponding to the target home tag based on the user's voice, enabling the control device to correctly control smart home IoT devices in one or more homes when one user identifier is associated with multiple homes.
[0078] Before receiving an access token from a control device and verifying the permission information within it, authorizing the control device to be assigned an access token is an unavoidable process for the control device to control smart home IoT devices. To facilitate subsequent communication between the control device and smart applications using the access token, and to obtain a list of target home devices corresponding to a target home tag based on the access token—ensuring correct control of smart home IoT devices within each home when a single user identifier is associated with multiple homes—the authorization process of the control device needs to be improved. Figure 3 This application provides another method for controlling a smart home IoT device. This method is executed by a smart application, which can be configured by, for example... Figure 1 The processing device 110 shown performs the operation. For example... Figure 3 The control method for the smart home IoT device shown may include the following steps:
[0079] Step 301: Receive the authorization request input by the user and verify the target user identifier in the authorization request.
[0080] The target user identifier can be the user account used to log in to the smart application. This user account can be a purely numeric identification code (ID) or an ID that includes numbers, uppercase and lowercase English letters, symbols, and / or Chinese characters. The authorization request in this embodiment uses an OAuth2 authorization request as an example. Before authorizing the control device, the user selects the IoT vendor of the smart home IoT device they want to control in the smart application and initiates OAuth2 authorization. The user then fills in the target user identifier and password set under that IoT vendor in the smart application. The smart application receives the authorization request entered by the user and verifies the target user identifier based on the password to verify its correctness.
[0081] Step 302: When the target user identifier is verified, query the target family identifier and control device associated with the target user identifier.
[0082] Before initiating OAuth2 authorization, if a user wants to control a smart home IoT device belonging to a specific IoT vendor within a household under their name using a designated control device, they will first enter the control device's attribute information, the household identifier of the household they wish to control, and their own user identifier into the smart application. The smart application will then associate and store the user identifier, the control device's attribute information, and the household identifier. Subsequently, when the target user identifier is successfully verified, the smart application can query the target household identifier and control device associated with the target user identifier.
[0083] Optionally, when the target user identity verification fails, the smart application returns a message indicating verification failure to remind the user to re-initiate OAuth2 authorization.
[0084] Optionally, to prevent users from forgetting the selected home and control device, the authorization request includes control device attribute information and first timestamp information. Step 302, when the target user identifier is verified, queries the target home identifier and control device associated with the target user identifier, which may include the following steps 3021 to 3024:
[0085] Step 3021: From at least one pre-stored home tag record, query the target home tag record that contains control device attribute information and target user identifier.
[0086] The control device attribute information can be the brand of the control device or the machine model, etc. This application embodiment does not impose specific limitations; this embodiment uses the brand of the control device as an example. When different users input the control device attribute information, the family identifier of a specific household to be controlled by the control device, and the user identifier to which this family identifier belongs in the smart application, the smart application will generate a timestamp to record the time when the user inputs the family identifier, user identifier, and control device attribute information. The application will then organize the user-input family identifier, user identifier, control device attribute information, and the generated timestamp into a family tag record that corresponds one-to-one with the user identifier and store it. The content recorded in each family tag record is as follows:
[0087] smart_speaker_brand:String;
[0088] user_id: String;
[0089] want_use_home_id:String;
[0090] created_ts:Long, where String and Long represent the data storage type, smart_specifier_brand represents the brand of the control device, user_id represents the user identifier, want_use_home_id represents the home identifier, and created_ts represents the timestamp information.
[0091] When a target user identifier is successfully verified, the smart application can retrieve the target home tag record containing control device attribute information and the target user identifier from at least one pre-stored home tag record.
[0092] It should be noted that, in this embodiment of the application, in order to ensure that the control device can correctly control the smart home IoT devices in each household when a user identifier is associated with multiple households, only one household tag record can be stored by the smart application for a user identifier, and only one household identifier can be recorded in a household tag record. This ensures that each access token including a household tag corresponds to only one household tag, thereby enabling the control device holding the access token to control only the smart home IoT devices in the household device list corresponding to one household tag.
[0093] Understandably, when a user wants to change their home identifier, they need to re-enter the control device attribute information, their own user identifier, and the new home identifier in the smart application. When the smart application receives the re-entered control device attribute information, their own user identifier, and the new home identifier, it will overwrite the original home identifier in the corresponding home record table with the new home identifier. The process for changing the control device attribute information is similar to changing the home identifier, and will not be elaborated here.
[0094] Optionally, to facilitate user operation, the smart application can display a target list to the user when the user enters control device attribute information, their own user ID, and family ID. The target list includes the user ID that the user has previously entered, as well as the control device attribute information and family ID entered along with that user ID. This allows the user to directly select the desired control device attribute information and family ID from the target list, eliminating the need to re-enter them each time, thus simplifying the user operation.
[0095] Step 3022: When a target family tag record containing control device attribute information and target user identifier is found, verify whether the time difference between the second timestamp information and the first timestamp information recorded in the target family record is within a preset threshold range.
[0096] In this embodiment, the first timestamp information indicates the time when the authorization request was initiated, and the second timestamp information indicates the creation time of the target household tag record. The preset threshold range can be set by the user; this embodiment uses 24 hours as an example. When the smart application can query a target household tag record containing control device attribute information and a target user identifier from at least one pre-stored household tag record, it means that the user has a need for a certain control device to control only the smart home IoT devices in that household. At this time, the smart application will read the second timestamp information from the target household tag record and then calculate the time difference between the second timestamp information and the first timestamp information. If the time difference is within the preset threshold range, it will proceed to step 3023. If the time difference is not within the preset threshold range, it will proceed to the traditional OAuth2 authorization mechanism (which will be introduced later).
[0097] Step 3023: When the time difference between the second timestamp information and the first timestamp information is within a preset threshold range, the family identifier recorded in the target family tag record is determined as the target family identifier associated with the target user identifier.
[0098] Step 3024: Based on the authorization request, determine the control device associated with the target user identifier.
[0099] The authorization request entered by the user often includes the control device that is expected to be authorized. Therefore, when the smart application receives the authorization request, it can identify the control device that is expected to be authorized in the authorization request as the control device associated with the target user's identifier.
[0100] When the target user identifier is verified, and a target family tag record containing control device attribute information and the target user identifier is found from at least one pre-stored family tag record, the time difference between the second timestamp information and the first timestamp information recorded in the target family record is verified to be within a preset threshold range. If the time difference is within the preset threshold range, the family identifier recorded in the target family tag record is determined as the target family identifier associated with the user identifier, thereby determining the control device indicated by the control device attribute information as the control device associated with the target user identifier. Determining the target family identifier associated with the target user identifier based on whether the time difference between the second and first timestamp information is within the preset threshold range prevents users from forgetting previously set family tag records, which could lead to the forgotten family identifier affecting subsequent access tokens and consequently affecting the control device's control behavior of smart home IoT devices based on the access token. This avoids situations where the control of smart home IoT devices does not meet user expectations.
[0101] Step 303: When the target user identifier is found to be associated with the target family identifier, an access token including the target family tag is generated based on the target family identifier.
[0102] When a target user identifier is found to be associated with a target family identifier, the smart application will add the target family tag corresponding to the target family identifier to the access token, thereby obtaining an access token that includes the target family tag.
[0103] Optionally, step 303, when the target user identifier is found to be associated with the target family identifier, generates an access token including the target family tag based on the target family identifier, which may include the following steps:
[0104] Step 3031: Query the access token information containing the target family identifier from at least one pre-stored access token information.
[0105] The access token information includes a home identifier, user identifier, home tag, control device attribute information, and the access token itself. Therefore, the smart application compares the home identifier from all pre-stored access token information with the target home identifier to find access token information containing the target home identifier. The contents of each pre-stored access token information are shown below:
[0106] smart_speaker_brand:String;
[0107] user_id: String;
[0108] home_id: String;
[0109] alias_home_id:String;
[0110] `access_token`: String; where String represents the data storage type, `smart_speaker_brand` represents the brand of the control device, `user_id` represents the user identifier, `home_id` represents the family identifier (which is essentially the same as `want_use_home_id` in the family tag record), `created_ts` represents the timestamp information, and `alias_home_id` represents the family tag. This family tag is a unique ID randomly generated by the smart application and corresponds to the family identifier, used to protect the user's family privacy. The length of the family tag is not specifically limited in this embodiment, but the preferred length is 21 characters. `access_token` represents the access token authorized to the control device. The access token can be a UUID or a UUID that includes the family tag. Taking a 21-character length for the family tag as an example, when the access token includes the family tag, the access token length is 57 characters; when the access token is only a UUID, the access token length is 36 characters.
[0111] Step 303A1: When the first access token information containing the target family identifier is found, delete the original access token in the first access token information and generate a first universal unique identifier.
[0112] When the first access token information containing the target family identifier is found, it means that the family indicated by the target family identifier has already been recorded. The current authorization request is a reauthorization of the control device, which requires clearing the old and expired records and generating a new access token. The smart application will delete the original access token in the first access token information and generate a 36-character UUID.
[0113] Step 303A2: Add the target family tag in the first access token information to the first universal unique identifier to obtain an access token including the target family tag, and store the access token including the target family tag in the first access token information.
[0114] The smart application obtains an access token including the target family tag from the newly generated UUID of the target family tag in the first access token information, and stores the access token including the target family tag in the first access token information.
[0115] When the first access token information containing the target family identifier is found, it means that the family indicated by the target family identifier has already been recorded. Re-authorization of the control device is then required. At this point, the old, expired record is cleared, meaning the original access token in the first access token information is deleted. A first universally unique identifier is then generated, and the target family label from the first access token information is added to a second universally unique identifier, resulting in an access token that includes the target family label. For the re-authorization of the control device, a new access token is generated without destroying the target family label in the first access token information. This ensures that the re-authorized access token can still control smart home IoT devices in a specific existing home of the user indicated by the target family identifier.
[0116] Step 303B1: If no access token information for the target family identifier is found, create a second access token information that includes the target family identifier.
[0117] If no access token information storing the target family identifier is found, it means that the family indicated by the target family identifier has not been recorded yet, and the control device is a new authorization. At this time, the smart application will create a second access token information that includes the target family identifier, the target user identifier, and the control device attribute information.
[0118] Step 303B2: Generate a second universal unique identifier and a target family label corresponding to the target family identifier.
[0119] The smart application generates a unique target family tag that has not appeared in any of the pre-stored access token information, as well as a UUID that has not appeared in any of the pre-stored access token information.
[0120] Step 303B3: Add the target family label to the second universal unique identifier to obtain an access token including the target family label, and store the access token including the target family label and the target family label in the second access token information.
[0121] The generated target family tag is then added to the generated UUID to obtain an access token including the target family tag, and the target family tag and the access token including the target family tag are stored in the second access token information.
[0122] If no access token information storing the target home identifier is found, it means that the home indicated by the target home identifier has not yet been recorded, and this is a new authorization for the control device. First, a second access token information including the target home identifier is created. Then, the target home tag corresponding to the newly generated target home identifier is added to the newly generated second universally unique identifier, resulting in an access token including the target home tag. The target home tag and the access token including the target home tag are stored in the second access token information for easy retrieval later, ensuring the control device can correctly control the smart home IoT devices in the home.
[0123] Step 304: Send an access token, including the target home tag, to the control device for subsequent communication between the control device and the smart application using the access token.
[0124] The smart application sends an access token, including the target home tag, to the control device that requests authorization in the authorization request. The control device stores the access token, which includes the target home tag, and calls the access token to communicate with the smart application when it needs to control smart home IoT devices, thereby enabling precise control of smart home IoT devices in a specific home.
[0125] Optionally, if the smart application fails to find a target home tag record containing control device attribute information and a target user identifier from at least one pre-stored home tag record, or if the time difference between the second timestamp and the first timestamp is not within a preset threshold range, the smart application will enter the traditional OAuth2 authorization mechanism. That is, the smart application will first verify the target user identifier in the authorization request entered by the user. When the target user identifier is verified, a 36-character Universally Unique Identifier (UUID) will be generated as an access token and returned to the control device requesting authorization. This prevents users from forgetting previously set home tag records, which could affect subsequent access tokens and consequently the control device's control behavior of smart home IoT devices based on the access token, thus avoiding situations where the control of smart home IoT devices does not meet user expectations. Furthermore, it ensures that the control device can be properly authorized, guaranteeing that the user can control smart home IoT devices in the home using the control device.
[0126] Understandably, when the access token is only a 36-character UUID, the smart application, based on the traditional OAuth2 authorization mechanism, will return to the control device all smart home IoT devices belonging to a certain IoT vendor under the target user's identifier when the control device calls the DiscoverDevices interface. (This IoT vendor is the manufacturer of the smart home IoT devices that the user selected before authorizing the control device.)
[0127] The traditional OAuth2 authorization mechanism only verifies the user identifier in the authorization request entered by the user, and cannot distinguish between different households associated with the same user identifier. As a result, when a user has multiple control devices of the same brand, such as control device 1 and control device 2, if the user authorizes control device 1 first, the access token obtained by control device 1 will become invalid when the user authorizes control device 2 the next time (that is, the access token of control device 1 will be cleared). This means that the user cannot use multiple control devices of the same brand in multiple households at the same time.
[0128] However, in this embodiment, when the control device receives an access token containing the target home tag from the smart application, it stores the access token for later communication with the smart application. This means that the control device can communicate with the smart application immediately upon authorization, or it can communicate with the smart application after a certain period of time (during which the user does not re-authorize the control device by entering an authorization request into the smart application). Therefore, when a user has multiple control devices from the same manufacturer, each placed in a different home, and each control device's stored access token contains a different home tag, after authorization for each control device, each control device can communicate with the smart application at the same time (e.g., 9:00 AM on [date]) before the user re-authorizes, to obtain the home device list corresponding to the home tag in its access token. This allows control of smart home IoT devices in different home tags' lists to be performed simultaneously. This avoids the traditional situation where multiple control devices from the same manufacturer are used by the same user. If a user wants to use control devices from the same manufacturer placed in different homes to control smart home IoT devices, they can only authorize one of the multiple control devices from the same manufacturer for that user.
[0129] In other words, the control method for another smart home IoT device provided in this application embodiment, when verifying the target user identifier in the authorization request input by the user, first queries the target family identifier associated with the target user identifier. If a first access token containing the target family identifier is found in at least one pre-stored access token, the original access token in the first access token is deleted, and a new access token including the target family tag is generated. If no access token containing the target family identifier is found, a second access token including the target family identifier is generated, and the generated target family tag and the access token including the target family tag are stored in the second access token. This means that the processing of the user's authorization request is no longer simply verifying the user identifier as in the traditional OAuth2 authorization mechanism, but instead processes different family identifiers associated with the user identifier. This allows the user's authorization behavior to the control device to be distinguished by the family identifier, thereby returning access tokens containing different family tags to the control device. This avoids the situation where the same user can only authorize multiple control devices belonging to the same brand under their jurisdiction. This allows users to use multiple control devices belonging to the same brand in multiple homes simultaneously.
[0130] In one application scenario, taking a smart speaker as the control device and an IoT vendor's app and a smart speaker app as examples, user U uses smart speaker A of brand M in home A. Before initiating OAuth2 authorization on the smart speaker app, user U needs to create a home tag record using the IoT vendor N's app. The tag indicates which home the user wants to authorize to use the smart voice service. The created record is: {smart_speaker_brand:"Brand M",user_id:"User U",want_use_home_id:"Home A",created_ts:timestamp of creation}.
[0131] User U selects IoT vendor N on the smart speaker APP of brand M and initiates OAuth2 user authorization;
[0132] User U enters the user account and password of IoT manufacturer N on the smart speaker APP of brand M;
[0133] After IoT vendor N's APP verifies that the user account input is correct, it queries at least one pre-stored family tag record for user U's family tag record (the time difference between the timestamp information in user U's family tag record and the timestamp information when user U initiates OAuth2 user authorization on the smart speaker APP is within 24 hours). If it finds that the tag "want_use_home_id="family A" is set, and it checks that there is no access token information with user_id="user U", smart_speaker_brand="brand M" and home_id="family A" in all pre-stored access token information, then it generates an access token information with user_id "user U". A new alias_home_id1 is generated, along with a new access token containing alias_home_id1. Then, the access token information {smart_speaker_brand:"Brand M",home_id:"Family A",alias_home_id:alias_home_id1,access_token:access token containing alias_home_id1} is added to the access token information. Finally, the access token information for user U's family A is {smart_speaker_brand:"Brand M",home_id:"Family A",user_id:"User U",alias_home_id:alias_home_id1,access_token:access token containing alias_home_id1}. Finally, the access token containing alias_home_id1 is returned to smart speaker A.
[0134] Then, when user U uses smart speaker B of brand M in home B, user U needs to create a home tag record using the IoT vendor N's app before initiating OAuth2 authorization on the smart speaker app. The tag indicates which home user U wants to authorize the use of smart voice services in. The created tag is: {smart_speaker_brand:"Brand M",user_id:"User U",want_use_home_id:"Home B",created_ts:timestamp of creation}. At this time, user U's home tag record for home B will overwrite the original home tag record for user U's home A.
[0135] User U selects IoT vendor N on the smart speaker APP of brand M and initiates OAuth2 user authorization;
[0136] User U enters the user account and password of IoT manufacturer N on the smart speaker APP of brand M;
[0137] After verifying that the user account is entered correctly, the IoT vendor N's APP queries at least one pre-stored family tag record for user U's family tag record (the time difference between the timestamp information in user U's family tag record and the timestamp information when user U initiates OAuth2 user authorization on the smart speaker APP is within 24 hours). If it finds that the tag "want_use_home_id="family B" is set, it checks whether there is an access token information corresponding to user U's family B's family tag record in all pre-stored access token information. If an access token contains user_id="User U", smart_speaker_brand="Brand M", and home_id="Home B", it is considered that User U is reauthorizing the smart speaker B in Home B. (The access token information is: {smart_speaker_brand:"Brand M", home_id:"Home A", user_id:"User U", alias_home_id:alias_home_id2, access_token: access token1 containing alias_home_id1}). The access token information or the original access token1 will be deleted, a new UUID will be generated, and the alias_home_id2 recorded in the access token information will be added to the newly generated UUID, resulting in access token2 containing alias_home_id2. Then, access token2 containing alias_home_id2 will be... token2 is recorded in the access token information, and a new access token information is obtained: {smart_speaker_brand:"Brand M",home_id:"Family A",user_id:"User U",alias_home_id:alias_home_id2,access_token:access token2 containing alias_home_id1}, and then the access token2 containing alias_home_id2 is returned to smart speaker B.
[0138] Furthermore, when user U authorizes smart speaker B, the home tag record's want_use_home_id="Home A" is replaced with want_use_home_id="Home B" beforehand. This allows IoT vendor N's app to distinguish between user U's authorization behavior for smart speaker A (brand M) in home A and user U's authorization behavior for smart speaker B in home B. This avoids the traditional situation where if user U uses smart speaker B (brand M) in home B, the access token previously authorized for smart speaker A will be cleared. This allows user U to use both smart speaker A and smart speaker B simultaneously in both home A and home B.
[0139] In this embodiment, when the target user identifier in the user's authorization request is verified, the target home identifier associated with the target user identifier and the control device are queried. Upon finding the target home identifier associated with the target user identifier, an access token including a target home tag is generated based on the target home identifier, and then this access token is sent to the control device. This improves the authorization process for the control device, ensuring that the access token returned to the control device can include the target home tag, avoiding the traditional situation where only an access token excluding the target home tag is returned during the authorization process. This facilitates subsequent communication between the control device and the smart application using the access token, enabling the control device to correctly control the smart home IoT devices within each home when a single user identifier is associated with multiple homes.
[0140] To protect family privacy while ensuring that a single user identifier can be associated with multiple households, and to enable control devices to correctly control smart home IoT devices within each household, the following proposals are put forward: Figure 4 This illustrates another method for controlling smart home IoT devices, which is executed by a smart application, such as... Figure 1 The processing device 110 shown performs the operation. For example... Figure 4 The control method for the smart home IoT device shown may include the following steps:
[0141] Step 401: Receive the authorization request input by the user and verify the target user identifier in the authorization request.
[0142] See details Figure 3 Step 301 of the illustrated embodiment will not be repeated here.
[0143] Step 402: When the target user identifier is verified, query the target home identifier and control device associated with the target user identifier.
[0144] See details Figure 3Step 302 of the illustrated embodiment will not be described again here.
[0145] Step 403: When the target user identifier is found to be associated with the target family identifier, an access token including the target family tag is generated based on the target family identifier.
[0146] See details Figure 3 Step 303 of the illustrated embodiment will not be described again here.
[0147] Step 404: Send an access token, including the target home tag, to the control device for subsequent communication between the control device and the smart application using the access token.
[0148] See details Figure 3 Step 304 of the illustrated embodiment will not be repeated here.
[0149] Step 405: Receive the access token sent by the control device and verify the permission information in the access token.
[0150] See details Figure 2 Step 201 in the illustrated embodiment will not be repeated here.
[0151] It should be noted that the family tag is a unique identification code (ID) randomly generated by the smart application from the pre-stored access token information, corresponding to the family identifier in the pre-stored access token information, in order to protect the user's family privacy. The length of the family tag is not specifically limited in this embodiment, but a preferred length is 21 characters.
[0152] Step 406: When the permission information is verified, obtain the target access token information associated with the target family tag.
[0153] See details Figure 2 Step 202 in the illustrated embodiment will not be repeated here.
[0154] Optionally, step 406, when the permission information is verified, obtaining the target access token information associated with the target family tag may include querying the access token information including the target family tag from at least one pre-stored access token information, and determining the access token information including the target family tag as the target access token information.
[0155] When verifying the permission information of the access token, the smart application compares the family tag in each pre-stored access token with the target family tag identified from the access token until it finds a family tag that matches the target family tag. Then, the access token information containing that family tag is identified as the target access token information associated with the target family tag.
[0156] The system retrieves target access token information, including the target home tag, from at least one pre-stored access token information. This facilitates the subsequent retrieval of a target home device list corresponding to the target home tag from multiple home device lists associated with the target user identifier based on the target access token information. This enables the control device to correctly control smart home IoT devices within each home.
[0157] Step 407: Based on the target access token information, query the list of target home devices corresponding to the target home tag from the preset smart home IoT device list.
[0158] See details Figure 2 Step 203 in the illustrated embodiment will not be repeated here.
[0159] Optionally, the target access token information includes the target home identifier, the target user identifier, and the target home tag. Step 407, based on the target access token information, queries the list of target home devices corresponding to the target home tag from the preset smart home IoT device list, which may include the following steps 4071 to 4073:
[0160] Step 4071: Obtain the target user identifier and the target family identifier corresponding to the target family tag from the target access token information.
[0161] The target access token information includes the target user identifier, control device attribute information, target home identifier, target home tag, and access token. The recording format of each piece of information is the same as... Figure 3 In the illustrated embodiment, each pre-stored access token information record has a consistent format. The smart application reads the target user identifier and the target family identifier from the target access token information, thereby obtaining the target user identifier and the target family identifier corresponding to the target family tag.
[0162] Step 4072: From the preset smart home IoT device list, query the list of multiple home devices corresponding to the target user identifier.
[0163] The pre-set smart home IoT device list uses user identifiers as a basis, recording the smart home IoT devices belonging to various IoT vendors under each user identifier. Then, under each user identifier, using household identifiers as a basis, it records the smart home IoT devices belonging to various IoT vendors within each household corresponding to different household identifiers under each user identifier. The smart application can then find the sub-table with the user identifier set to the target user identifier from the pre-set smart home IoT device list. This sub-table records the list of multiple household devices under the target user identifier.
[0164] Step 4073: From the list of multiple home devices corresponding to the target user identifier, query the list of target home devices corresponding to the target home identifier.
[0165] The smart application compares the family identifier of each family device list corresponding to the target user identifier with the target family identifier, and identifies the family device list whose family identifier matches the target family identifier as the target family device list corresponding to the target family identifier.
[0166] By adding a mapping relationship between target family identifiers and target family tags, when it is necessary to query the list of target family devices corresponding to a target family identifier, the target family identifier and target user identifier corresponding to the target family tag are first obtained from the target access token information. Then, the list of multiple family devices corresponding to the target user identifier is queried. This achieves the lookup of the target family identifier's corresponding target device list by using the target family tag as an intermediary, avoiding the direct use of the target family identifier and preventing the leakage of the user's family identifier. This, in turn, prevents the use of the user's family identifier to control smart home IoT devices in the home, thereby protecting the user's privacy.
[0167] Step 408: Send the target home device list to the control device so that the control device can control the smart home IoT devices in the target home device list based on the user's voice.
[0168] See details Figure 2 Step 204 of the illustrated embodiment will not be repeated here.
[0169] Continuing with the above application scenario, user U uses smart speaker A (brand M) in home A. When smart speaker A receives an access token containing alias_home_id1 returned by the smart application, it stores this access token. Then, when user U wants to use smart speaker A to control smart home IoT devices manufactured by IoT vendor N in home A, smart speaker A calls IoT vendor N's app's DiscoverDevices interface to obtain a list of available home devices. IoT vendor N's app parses the alias_home_id1 from the access token, finds the target access token information where alias_home_id = "alias_home_id1" from all pre-stored access token information, and then finds the home_id corresponding to this access token as "home A". It then only returns the list of home devices for home A. Because smart speaker A only obtains the device list of home A, it can only control smart home IoT devices manufactured by IoT vendor N in home A.
[0170] The workflow for user U using brand M smart speaker B in home B is the same as the workflow for user U using brand M smart speaker A in home A, and will not be repeated here.
[0171] Optionally, when the access token sent by the control device does not include the target home tag, the smart application will enter the traditional OAuth2-based authorization mechanism workflow. Specifically, when the smart application verifies the permission information in the access token, it will query the preset smart home IoT device list to find all smart home IoT devices associated with the target user identifier, and compile all smart home IoT devices associated with the target user identifier into a list and return it to the control device.
[0172] In this embodiment, after receiving an authorization request from the user and sending an access token including a target home tag to the control device, the system can receive the access token sent by the control device. After verifying the permission information in the access token, it queries at least one pre-stored access token, which includes the target home tag, for target access token information. Through the mapping relationship between the target home identifier and the target home tag, it obtains the target home identifier and the target user identifier corresponding to the target home tag from the target access token information. Then, it queries a list of multiple home devices corresponding to the target user identifier. This allows the system to use the target home tag as an intermediary to find the target device list corresponding to the target home identifier, avoiding direct use of the target home identifier and preventing the leakage of the user's home identifier. Furthermore, it prevents the control device from using the user's home identifier to control smart home IoT devices in the home, thus protecting the user's privacy. Then, the system queries the list of target home devices corresponding to the target home identifier from the list of multiple home devices corresponding to the target user identifier, and returns the list of target home devices to the control device. This allows the control device to control only the smart home IoT devices in the list of target home devices corresponding to the target home identifier based on the user's voice. This enables the control device to correctly control the smart home IoT devices in one or several homes when one user identifier is associated with multiple homes.
[0173] This embodiment also provides a control device for a smart home IoT device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0174] This embodiment provides a control device for smart home IoT devices, such as... Figure 5 As shown, it includes:
[0175] The receiving module 510 is used to receive the access token sent by the control device and verify the permission information in the access token; the access token includes a target family tag; the target family tag is one of multiple family tags associated with the target user identifier of the control device;
[0176] The acquisition module 520 is used to acquire the target access token information associated with the target family tag when the permission information verification is successful.
[0177] The query module 530 is used to query the target home device list corresponding to the target home tag from the preset smart home IoT device list based on the target access token information; the preset smart home IoT device list includes multiple home device lists corresponding to the target user identifier, and the target home device list is one of the multiple home device lists.
[0178] The sending module 540 is used to send a list of target home devices to the control device, so that the control device can control the smart home IoT devices in the target home device list based on the user's voice.
[0179] In some optional embodiments, the query module 530 includes:
[0180] The acquisition unit is used to acquire the target user identifier and the target family identifier corresponding to the target family tag from the target access token information.
[0181] The first query unit is used to query a list of multiple home devices corresponding to a target user identifier from a preset list of smart home IoT devices;
[0182] The first query unit is also used to query the target home device list corresponding to the target home identifier from multiple home device lists corresponding to the target user identifier.
[0183] In some optional embodiments, the acquisition module 520 includes:
[0184] The second query unit is used to query access token information including the target family tag from at least one pre-stored access token information, and determine the access token information including the target family tag as the target access token information.
[0185] In some optional embodiments, the control device for the smart home IoT device further includes:
[0186] The receiving module is also used to receive authorization requests input by the user and verify the target user identifier in the authorization request;
[0187] The query module is also used to query the target user identifier associated with the target family identifier and the control device when the target user identifier is verified.
[0188] The generation module is used to generate an access token including the target family tag based on the target family identifier when the target family identifier associated with the target user identifier is found.
[0189] The sending module is also used to send an access token, including the target home tag, to the control device, which then uses the access token to communicate with the smart application.
[0190] In some alternative embodiments, the generation module includes:
[0191] The third query unit is used to query access token information containing a target family identifier from at least one pre-stored access token information.
[0192] The deletion unit is used to delete the original access token in the first access token information when the first access token information containing the target family identifier is found, and generate a first universal unique identifier.
[0193] The adding unit is used to add the target family label from the first access token information to the first universal unique identifier to obtain an access token including the target family label, and to store the access token including the target family label in the first access token information.
[0194] In some optional embodiments, the control device for the smart home IoT device also includes
[0195] The generation module is also used to generate a second universal unique identifier and a target family label corresponding to the target family identifier;
[0196] The module is also used to add the target family label to the second universal unique identifier, obtain an access token including the target family label, and store the access token including the target family label and the target family label in the second access token information.
[0197] In some optional embodiments, the authorization request includes control device attribute information and a first timestamp, and the query module includes:
[0198] The fourth query unit is used to query a target home tag record containing control device attribute information and a target user identifier from at least one pre-stored home tag record;
[0199] The verification unit is used to verify, when a target family tag record containing control device attribute information and target user identifier is found, whether the time difference between the second timestamp information and the first timestamp information recorded in the target family record is within a preset threshold range.
[0200] The determining unit is used to determine the family identifier recorded in the target family tagging record as the target family identifier associated with the target user identifier when the time difference between the second timestamp information and the first timestamp information is within a preset threshold range.
[0201] The determining unit is also used to determine the control device associated with the target user identifier based on the authorization request.
[0202] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0203] In this embodiment, the control device for the smart home IoT device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0204] This application also provides a computer device having the above-described features. Figure 6 The XXX device shown.
[0205] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of this application, such as... Figure 6 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.
[0206] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0207] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0208] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0209] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0210] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0211] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.
[0212] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A control method for a smart home IoT device, characterized in that, The method is executed by a smart application, and the method includes: The system receives an access token sent by a control device and verifies the permission information in the access token; the access token includes a target family tag; the target family tag is one of multiple family tags associated with the target user identifier of the control device; When the permission information is verified, the target access token information associated with the target family tag is obtained; Based on the target access token information, query the target home device list corresponding to the target home tag from the preset smart home IoT device list; the preset smart home IoT device list includes multiple home device lists corresponding to the target user identifier, and the target home device list is one of the multiple home device lists. The target home device list is sent to the control device, so that the control device can control the smart home IoT devices in the target home device list based on the user's voice. Before receiving an access token sent by the control device and verifying the permission information in the access token, the method further includes: Receive an authorization request input by the user and verify the target user identifier in the authorization request; When the target user identifier is verified, query the target home identifier and control device associated with the target user identifier; When the target user identifier is found to be associated with the target family identifier, an access token including the target family tag is generated based on the target family identifier. An access token including the target family tag is sent to the control device, which then uses the access token to communicate with the smart application. When a target family identifier associated with a user identifier is found, an access token including a target family tag is generated based on the target family identifier, including: From at least one pre-stored access token, query for access token information containing the target family identifier; When the first access token information containing the target family identifier is found, the original access token in the first access token information is deleted, and a first universal unique identifier is generated. The target family tag in the first access token information is added to the first universal unique identifier to obtain the access token including the target family tag, and the access token including the target family tag is stored in the first access token information; The method further includes: If no access token information for the target family identifier is found, a second access token information including the target family identifier is created. Generate a second universally unique identifier and a target family label corresponding to the target family identifier; The target family tag is added to the second universal unique identifier to obtain the access token including the target family tag, and the access token including the target family tag and the target family tag are stored in the second access token information.
2. The method according to claim 1, characterized in that, The target access token information includes a target home identifier, a target user identifier, and a target home tag. The step of querying the target home device list corresponding to the target home tag from a preset smart home IoT device list based on the target access token information includes: Obtain the target user identifier from the target access token information, and the target family identifier corresponding to the target family tag; From the preset list of smart home IoT devices, query the list of multiple home devices corresponding to the target user identifier; From the list of multiple home devices corresponding to the target user identifier, query the list of target home devices corresponding to the target home identifier.
3. The method according to claim 2, characterized in that, When the permission information is verified, the step of obtaining the target access token information associated with the target family tag includes: From at least one pre-stored access token information, query access token information that includes the target family tag, and determine the access token information that includes the target family tag as the target access token information.
4. The method according to claim 1, characterized in that, The authorization request includes control device attribute information and a first timestamp; when the target user identifier is verified, the target user identifier associated with the target family identifier and the control device are queried, including: From at least one pre-stored family tag record, query for a target family tag record that contains the control device attribute information and the target user identifier; When a target family tag record containing the control device attribute information and the target user identifier is found, verify whether the time difference between the second timestamp information and the first timestamp information recorded in the target family tag record is within a preset threshold range. When the time difference between the second timestamp information and the first timestamp information is within a preset threshold range, the family identifier recorded in the target family tag record is determined as the target family identifier associated with the target user identifier; Based on the authorization request, determine the control device associated with the target user identifier.
5. A control device for a smart home Internet of Things (IoT) device, characterized in that, The device is executed by a smart application, and the device includes: The receiving module is used to receive an access token sent by the control device and verify the permission information in the access token; the access token includes a target family tag; the target family tag is one of multiple family tags associated with the target user identifier of the control device; The acquisition module is used to acquire the target access token information associated with the target family tag when the permission information is verified. The query module is used to query the target home device list corresponding to the target home tag from the preset smart home IoT device list based on the target access token information; the preset smart home IoT device list includes multiple home device lists corresponding to the target user identifier, and the target home device list is one of the multiple home device lists; A sending module is used to send the target home device list to the control device, so that the control device can control the smart home IoT devices in the target home device list based on user voice. The control device for the smart home IoT device also includes: The receiving module is also configured to receive an authorization request input by the user and verify the target user identifier in the authorization request; The query module is also used to query the target family identifier and control device associated with the target user identifier when the target user identifier is verified. The generation module is used to generate an access token including a target family tag based on the target family identifier when the target family identifier associated with the target user identifier is found. The sending module is also used to send an access token including the target family tag to the control device, so that the control device can subsequently use the access token to communicate with the smart application; The generation module includes: The third query unit is used to query access token information containing the target family identifier from at least one pre-stored access token information. The deletion unit is used to delete the original access token in the first access token information and generate a first universal unique identifier when the first access token information containing the target family identifier is found. An adding unit is used to add the target family tag in the first access token information to the first universal unique identifier to obtain the access token including the target family tag, and to store the access token including the target family tag in the first access token information; The control device for the smart home IoT device also includes: The generation module is also used to generate a second universal unique identifier and a target family label corresponding to the target family identifier; The addition module is further configured to add the target family label to the second universal unique identifier to obtain the access token including the target family label, and store the access token including the target family label and the target family label in the second access token information of the target family identifier.
6. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the control method for the smart home IoT device according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the control method for the smart home Internet of Things device according to any one of claims 1 to 4.