Method and device for controlling equipment

Through the correspondence between local scene library and device identification, combined with transition time, wake-up and verification mechanisms, the synchronization control and fault tolerance problems of device linkage in smart home systems are solved, achieving more efficient and secure device control and user experience.

CN120406259APending Publication Date: 2025-08-01HANGZHOU LIFESMART TECH

Patent Information

Application Number
CN202510546543.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In existing smart home systems, terminal devices of different brands and protocols are difficult to achieve precise synchronization control when multiple devices are linked, the system is poor in fault tolerance, and gateway failure will cause paralysis of the whole house scene.

Method used

Through the correspondence between the local scene library and the preset device identifier, the scene identifier is directly sent to the device to be operated, so that it determines and executes scene execution instructions from the local scene library, introduces the transition time for dynamic coordination, uses the broadcast channel to wake up the sleeping device, and checks the execution results through the feedback channel, configures an independent storage area to verify the newly added scene, introduces authentication signatures and sensor information for device authentication and environment perception.

Benefits of technology

It improves the system's fault tolerance, scalability and resource utilization, enhances the accuracy and security of device execution, reduces the risk of system upgrades, and optimizes the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120406259A_ABST
    Figure CN120406259A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of smart home, and discloses a method and device for controlling equipment, and the method comprises the steps: responding to a scene triggering instruction, and determining scene information corresponding to the scene triggering instruction; wherein the scene information comprises a scene identifier, and the scene identifier is used for indicating a target scene; according to a corresponding relationship between a preset scene identifier and a preset device identifier, and the scene identifier, determining a plurality of preset device identifiers corresponding to the scene identifier as a plurality of to-be-operated devices corresponding to the target scene; and sending the scene identifier to each to-be-operated device, so that each to-be-operated device determines a scene execution instruction from a local scene library according to the scene identifier, and executes the scene execution instruction to convert the current state into a first target state corresponding to the target scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart home, and particularly to a method and device for controlling devices. Background Art

[0002] In related technologies, most smart home systems adopt a centralized control architecture, relying on gateways or the cloud for real-time instruction distribution to achieve multi-device linkage.

[0003] However, in the multi-device linkage scenario, it is difficult to achieve precise synchronous control for terminal devices of different brands and protocols, and the system has poor fault tolerance. Moreover, once the gateway fails, the entire house scenario will collapse. Summary of the Invention

[0004] In view of this, the present invention provides a method and device for controlling devices.

[0005] In a first aspect, the present invention provides a method for controlling devices, the method comprising: in response to a scene trigger instruction, determining scene information corresponding to the scene trigger instruction; wherein the scene information includes a scene identifier for indicating a target scene; according to the corresponding relationship between a preset scene identifier and a preset device identifier and the scene identifier, respectively determining a plurality of preset device identifiers corresponding to the scene identifier as a plurality of devices to be operated corresponding to the target scene; and sending the scene identifier to each device to be operated, so that each device to be operated respectively determines a scene execution instruction from a local scene library according to the scene identifier, and executes the scene execution instruction to convert from the current state to a first target state corresponding to the target scene.

[0006] The method for controlling devices provided in this embodiment, in response to a scene trigger instruction, determines scene information corresponding to the scene trigger instruction, and respectively determines a plurality of preset device identifiers corresponding to the scene identifier as a plurality of devices to be operated corresponding to the target scene through the corresponding relationship between the preset scene identifier and the preset device identifier and the scene identifier. Each device to be operated can respectively determine a scene execution instruction from the local scene library, that is, the plurality of devices to be operated do not need to rely on a gateway for unified instruction distribution, and only need to determine a scene execution instruction from the local scene library and execute the scene execution instruction to convert from the current state to a first target state corresponding to the target scene, so that the gateway does not affect other devices to execute scene tasks, thereby improving the fault tolerance of the system.

[0007] In a possible implementation, the scene information further includes: a transition duration; and sending the scene identifier to each device to be operated, so that each device to be operated respectively determines a scene execution instruction from the local scene library according to the scene identifier, and executes the scene execution instruction to convert from the current state to a first target state corresponding to the target scene, includes:

[0008] Send the scene identifier and transition duration to each device to be operated respectively, so that the first device determines the scene execution instruction corresponding to the first device from the local scene library according to the scene identifier, and executes the scene execution instruction corresponding to the first device according to the transition duration, so as to convert from the current state of the first device to the target state corresponding to the target scene. The second device determines the scene execution instruction corresponding to the second device from the local scene library according to the scene identifier, and executes the scene execution instruction corresponding to the second device, so as to convert from the current state of the second device to the first target state corresponding to the target scene.

[0009] The method for controlling devices provided in this embodiment upgrades the control of devices to be operated in a smart home scene from static synchronization to dynamic coordination by introducing a transition duration, avoiding multiple devices starting high-power loads simultaneously, and significantly enhancing the fault tolerance, scalability, and resource utilization rate of the system while improving the user experience.

[0010] In a possible implementation manner, when the device to be operated is in a sleep state, a wake-up signal is sent to the device to be operated through a broadcast channel, so that the device to be operated converts from the sleep state to the wake-up state according to the wake-up signal; when the device to be operated converts from the current state to the target state corresponding to the target scene, the execution result of the device to be operated is received through a feedback channel, and the execution result is verified.

[0011] The method for controlling devices provided in this embodiment sends a wake-up signal through a broadcast channel. Even if the sleeping device turns off the main communication module, it still needs to keep the low-power wake-up receiver online. And, the execution result is actively reported through the feedback channel, enabling the computer device to verify the execution result, so as to accurately verify the accuracy of the device to be operated.

[0012] In a possible implementation manner, the device to be operated includes a first storage area and a second storage area. The first storage area stores historical scenes and a first scene, and the second storage area stores new scenes corresponding to the historical scenes; and the method further includes: when the device to be operated executes a scene execution instruction based on a new scene, detecting whether the new scene meets a preset condition; where the preset condition is used to indicate that the verification of the new scene fails; if the new scene meets the preset condition, execute the scene execution instruction based on the historical scene.

[0013] The method for controlling devices provided in this embodiment enables users or developers to freely push new scenes to the second storage area by configuring the second storage area, without frequently modifying the basic scene library, reducing the system upgrade risk. And if the execution of the new scene fails, it can seamlessly switch to the historical scene in the first storage area, avoiding the scene interruption and inability to execute, and reducing the user experience.

[0014] In a possible implementation, the scenario information further includes: authentication signature information; and the method further includes: sending the authentication signature information to each device to be operated respectively, so that the device to be operated performs authentication based on the authentication signature information and generates an authentication result; wherein, when the authentication result indicates that the verification of the device to be operated is successful, the device to be operated executes the scenario execution instruction.

[0015] For the method of the control device provided in this embodiment, before executing the instruction, the device can reverse-verify the signature of the gateway to avoid an illegal gateway impersonating a legitimate controller. Moreover, different devices store independent public keys or certificate chains to ensure that only the device to be operated with successful verification can decrypt and execute the instruction, thereby improving the security of the device to be operated when it is executed.

[0016] In a possible implementation, the scenario information further includes sensor information; and sending the scenario identifier to each device to be operated respectively, so that each device to be operated respectively determines the scenario execution instruction from the local scenario library according to the scenario identifier and executes the scenario execution instruction to convert from the current state to the first target state corresponding to the target scenario, including: sending the scenario identifier and the sensor information to each device to be operated respectively, so that each device to be operated respectively determines the scenario execution instruction from the local scenario library according to the scenario identifier and adjusts the adjustment parameter corresponding to the scenario execution instruction based on the sensor information to convert from the current state to the second target state.

[0017] For the method of the control device provided in this embodiment, the introduction of sensor information enables the device to dynamically sense environmental changes. For example, in the "theater mode", if the ambient light sensor detects a change in the natural light intensity, the device can automatically adjust the brightness of the projector and the opening and closing degree of the curtain, rather than mechanically executing the preset parameters, to ensure that the picture quality always meets the standards. The closed-loop feedback mechanism solves the problem of the effect distortion caused by environmental variables in the traditional scenario mode. Moreover, by calibrating the execution parameters with the sensor data, the differences between devices can be eliminated. For example, in the "sleep mode", if the air conditioner device finds that the actual room temperature deviates greatly from the target value through the temperature sensor, it can dynamically adjust the cooling / heating power, rather than relying on fixed gears, to avoid the user being woken up by excessive temperature difference.

[0018] In a second aspect, the present invention provides a device for controlling a device. A first determination module is configured to determine scene information corresponding to a scene trigger instruction in response to the scene trigger instruction; wherein the scene information includes a scene identifier, and the scene identifier is used to indicate a target scene. A second determination module is configured to respectively determine a plurality of preset device identifiers corresponding to the scene identifier as a plurality of devices to be operated corresponding to the target scene according to the corresponding relationship between the preset scene identifier and the preset device identifier and the scene identifier. A sending and execution module is configured to respectively send the scene identifier to each device to be operated, so that each device to be operated respectively determines a scene execution instruction from a local scene library according to the scene identifier, and executes the scene execution instruction to convert from the current state to a first target state corresponding to the target scene.

[0019] In a third aspect, the present invention 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 execute the method for controlling a device according to the first aspect or any corresponding embodiment thereof.

[0020] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the method for controlling a device according to the first aspect or any corresponding embodiment thereof.

[0021] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the method for controlling a device according to the first aspect or any corresponding embodiment thereof. Description of the Drawings

[0022] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0023] Figure 1 is a schematic flowchart of the method for controlling a device according to an embodiment of the present invention;

[0024] Figure 2 is a structural block diagram of the device for controlling a device according to an embodiment of the present invention;

[0025] Figure 3 is a schematic hardware structure diagram of the computer device according to an embodiment of the present invention. Detailed Embodiments

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0027] According to an embodiment of the present invention, an embodiment of a method for controlling a device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0028] In this embodiment, a method for controlling a device is provided, which can be used in computer devices such as computers and gateway servers. Figure 1 It is a schematic flowchart of the method for controlling a device according to an embodiment of the present invention, as Figure 1 shown, and the process includes the following steps:

[0029] Step S101, in response to a scene trigger instruction, determine the scene information corresponding to the scene trigger instruction; wherein, the scene information includes a scene identifier, and the scene identifier is used to indicate a target scene.

[0030] The scene trigger instruction can be an instruction manually triggered by a user (such as clicking an APP button, voice command) or automatically triggered by a computer device (such as a timing task, sensor event), and is used to start a preset scene.

[0031] The scene information can indicate the information of the scene corresponding to the scene trigger instruction. For example: the scene trigger instruction can indicate a movie-watching mode, and the scene information can indicate the information of the scene of the movie-watching mode.

[0032] The scene identifier can indicate the authentication information corresponding to the scene information. Among them, the scene identifier can be the unique authentication identifier corresponding to the scene information. For example: when the scene identifier is ID8, the scene information can be M8.

[0033] Specifically in implementation, listen for user input or system events (such as timer expiration, sensor threshold trigger). Extract the scene identifier from the scene trigger instruction.

[0034] Step S102, according to the correspondence between the preset scene identifier and the preset device identifier and the scene identifier, respectively determine the multiple preset device identifiers corresponding to the scene identifier as the multiple devices to be operated corresponding to the target scene.

[0035] The corresponding relationship between the preset scene identifier and the preset device identifier can refer to a relationship that is preset in advance.

[0036] As an example, a mapping table that can be pre-configured can be defined to list the devices associated with each preset scene identifier. Among them, the device list can include one or more preset device identifiers.

[0037] Specifically, the corresponding relationship between the target scene and the device to be operated can be read from the pre-configured mapping table. According to the scene identifier determined in step S101, the associated device identifier list is queried from the mapping table.

[0038] For example: the target scene is a movie-watching scene, and the corresponding devices to be operated can include, but are not limited to, seats, air conditioners, and lights.

[0039] In a possible implementation, it can be checked whether the device to be operated is online and whether it supports the scene function, and invalid devices are filtered. The valid device identifiers are sorted into a list as the input for subsequent operations.

[0040] Step S103: Send the scene identifier to each device to be operated respectively, so that each device to be operated respectively determines the scene execution instruction from the local scene library according to the scene identifier, and executes the scene execution instruction to convert from the current state to the first target state corresponding to the target scene.

[0041] The local scene library can be a scene rule library stored inside the device to be operated, and specifically can include the corresponding relationship between the scene identifier and the execution instruction. The first target state can be the final state that the device should reach after executing the instruction (such as the lights being turned off and the curtains being closed).

[0042] In specific implementation, the scene identifier can be sent to all devices to be operated through a communication protocol (such as MQTT, CoAP). The device to be operated queries the local scene library according to the scene identifier to obtain the corresponding execution instruction. The device to be operated parses the instruction and converts it into a hardware-executable command (such as controlling a relay through GPIO). The device to be operated executes the instruction and switches from the current state to the first target state.

[0043] In a possible implementation, a priority can be set for each device to be operated, and the device to be operated with a higher priority can be executed first.

[0044] As an example, the gateway can be embedded with a time-sharing execution mark to avoid network congestion and ensure that critical devices respond first (such as security devices executing before lights).

[0045] The method for controlling a device provided in this embodiment responds to a scene trigger instruction, determines the scene information corresponding to the scene trigger instruction, and determines the multiple preset device identifiers corresponding to the scene identifier as the multiple devices to be operated corresponding to the target scene respectively through the corresponding relationship between the preset scene identifier and the preset device identifier and the scene identifier. Each device to be operated can respectively determine the scene execution instruction from the local scene library, that is, the multiple devices to be operated do not need to rely on the gateway to uniformly distribute instructions, and only need to determine the scene execution instruction from the local scene library and execute the scene execution instruction to convert from the current state to the first target state corresponding to the target scene, so that the gateway will not affect other devices to execute scene tasks, thereby improving the fault tolerance of the system.

[0046] In a possible implementation manner, the scene information further includes: a transition duration; and the above step S103 includes:

[0047] Send the scene identifier and the transition duration to each device to be operated respectively, so that the first device determines the scene execution instruction corresponding to the first device from the local scene library according to the scene identifier, and executes the scene execution instruction corresponding to the first device according to the transition duration, so as to convert from the current state of the first device to the target state corresponding to the target scene, and the second device determines the scene execution instruction corresponding to the second device from the local scene library according to the scene identifier, and executes the scene execution instruction corresponding to the second device, so as to convert from the current state of the second device to the first target state corresponding to the target scene.

[0048] The first device may indicate a device that supports the transition duration. The second device may indicate a device that does not support the transition duration.

[0049] The transition duration (DelayTime) is a parameter used to control the time gradual change process of the first device to execute the scene execution instruction. Its core function is to achieve the smooth coordination of multi-device actions and the optimization of the user experience. The transition duration can indicate the time interval required for the first device to switch from the current state to the first target state (for example, it takes 2 seconds for the light to gradually change from 100% brightness to 30%). The gateway carries the global transition time (such as Delay = 200ms) when triggering the scene, and all devices to be operated adjust their own action speeds according to this reference value. The device to be operated evenly distributes the action steps within the transition time according to its own hardware capabilities (for example, to avoid sudden changes in brightness / color temperature, such as setting a 200ms transition when switching from cold light to warm light to make the vision more natural). The second device (such as an old-fashioned relay switch) can ignore the transition duration and execute immediately.

[0050] As an example, a device that supports a transition duration (the first device): The smart curtain motor can receive the MorningMode identifier and extract instructions from the local library: from 0% opening / closing degree → 50% opening / closing degree (simulating the sunrise effect). The transition duration application can be a uniform operation for 10 seconds to avoid discomfort caused by sudden light changes.

[0051] After receiving the instruction, the smart bedside lamp changes from the current color temperature of 2700K → 6500K (cool white light), and the brightness changes from 0% → 30%.

[0052] Devices that do not support transition duration (the second device): The smart speaker can receive the MorningMode identifier and extract instructions from the local library: immediately play a preset bird chirping sound effect (such as "Forest Dawn"). The aromatherapy machine: After receiving the instruction, it directly switches to the "citrus fragrance type" and turns on the spray, without a concentration gradient logic.

[0053] As an example, a device that supports a transition duration (the first device): The smart curtain can, after receiving the instruction, close completely (0% → 100%) from the current opening / closing degree within 5 seconds to avoid mechanical structure impact.

[0054] The smart atmosphere light can linearly decay within 5 seconds after receiving the instruction, from the current brightness → off (brightness 100% → 0%).

[0055] Among the devices that do not support transition duration (the second device), the smart door lock can directly enter the armed state (lock + infrared sensor activation) after receiving the instruction, without a delayed response. The smart camera can immediately start the 360° cruise mode after receiving the instruction and push the real-time video to the user's mobile phone, without any action delay.

[0056] The method for controlling a device provided in this embodiment upgrades the control of the device to be operated in the smart home scenario from static synchronization to dynamic coordination by introducing a transition duration, avoids multiple devices starting high-power loads simultaneously, and significantly enhances the fault tolerance, scalability, and resource utilization rate of the system while improving the user experience.

[0057] In a possible implementation manner, the above method further includes:

[0058] Step S201, when the device to be operated is in the sleep state, send a wake-up signal to the device to be operated through the broadcast channel, so that the device to be operated can be converted from the sleep state to the wake-up state according to the wake-up signal.

[0059] The sleep mode can be a standby mode for the device to reduce power consumption. In this mode, the device may turn off some communication modules or reduce the response frequency. When the device to be operated is in the sleep state, the gateway can send a wake-up signal through the broadcast channel to trigger the device to be operated to resume from the sleep mode to the wake-up state where it can execute instructions. Among them, the wake-up signal can be generated by the gateway after receiving the scene trigger instruction.

[0060] Step S202: When the device to be operated transitions from the current state to the target state corresponding to the target scene, receive the execution result of the device to be operated through the feedback channel and verify the execution result.

[0061] After the device to be operated finishes executing the scene execution instruction, it can report the execution result.

[0062] As an example, the device to be operated (such as a door lock) can report its status (such as Locked = OK) through TCP / MQTT, and the gateway verifies the execution result. Then it determines whether the door lock is locked accurately.

[0063] For example: When the user is on the way home from work, they remotely trigger the "go home mode" through the mobile APP in advance, hoping that the indoor temperature has been adjusted to a comfortable range (such as 25°C) when they arrive home. The gateway receives the scene trigger instruction: The user remotely triggers the "go home mode" through the mobile APP on the way home, and the gateway receives this scene trigger instruction. Wake up the air conditioner device (corresponding to step S201): The air conditioner device may be in the sleep state to save energy, for example, reducing the operating frequency of the compressor or turning off some sensors. The gateway sends a wake-up signal to the air conditioner device through the broadcast channel. After receiving the wake-up signal, the air conditioner device transitions from the sleep state to the wake-up state and activates the relevant functional modules. The gateway sends an instruction to the awakened air conditioner device to "set the temperature to 25°C". The air conditioner device executes the instruction and reports the result (corresponding to step S202): After receiving the instruction, the air conditioner device starts the compressor, adjusts the wind speed, etc., and begins to adjust the indoor temperature. During or after the execution process, the air conditioner device reports the execution result to the gateway through the feedback channel, for example, reporting a message such as "Current temperature: 25°C, target temperature reached". After receiving the execution result reported by the air conditioner device, the gateway performs verification. It checks whether the reported temperature data is consistent with the instruction requirements and whether the air conditioner device is in a stable operating state. If the verification passes, it indicates that the air conditioner device has executed the instruction accurately.

[0064] For another example: In the evening, when the user enters the living room and triggers the "movie-watching mode", they hope that the living room lights will automatically dim to create a suitable atmosphere for watching movies. The gateway receives the scene trigger instruction: After the user enters the living room, they may issue a voice command or trigger a sensor in the living room (such as a PIR sensor), and the gateway receives the scene trigger instruction for the "movie-watching mode". The lighting devices in the living room may be in a sleep state to reduce power consumption. For example, some LED lamp beads are turned off or the response speed of the dimming circuit is reduced. The gateway sends a wake-up signal to the lighting devices through the broadcast channel. After receiving the wake-up signal, the lighting devices switch from the sleep state to the wake-up state and are ready to receive the dimming instruction. The gateway sends an instruction of "adjust the brightness to 30%" to the awakened lighting devices. The lighting devices execute the instruction and report the result (corresponding to step S202): After receiving the instruction, the lighting devices adjust the circuit parameters to reduce the brightness of the LED lamp beads. After the execution is completed, the lighting devices report the execution result to the gateway through the feedback channel. For example, they report a message of "current brightness: 30%". After receiving the execution result reported by the lighting devices, the gateway performs verification. It checks whether the reported brightness data meets the instruction requirements and whether the lighting devices are operating stably at the specified brightness. If the verification passes, it means that the lighting devices have accurately executed the instruction; if the verification fails, the gateway may send the instruction again or prompt the user to check the lighting devices.

[0065] The method for controlling a device provided in this embodiment sends a wake-up signal through the broadcast channel. Even if the sleep device turns off the main communication module, it still needs to keep the low-power wake-up receiver online. And, the execution result is actively reported through the feedback channel, enabling the computer device to verify the execution result, so that the accuracy of the operation of the device to be operated can be accurately verified.

[0066] In a possible implementation, the device to be operated includes a first storage area and a second storage area. The first storage area stores historical scenes and a first scene, and the second storage area stores new scenes corresponding to the historical scenes; and the method further includes:

[0067] Step S301, when the device to be operated executes a scene execution instruction based on a new scene, detect whether the new scene meets a preset condition; where the preset condition is used to indicate that the verification of the new scene fails.

[0068] The first storage area can indicate the storage area inside the device to be operated for storing specific types of scene data, which stores historical scenes (regular scenes that have been executed in the past or preset by the user) and a first scene (which may be a basic scene selected by the current user or the default to be executed). The second storage area can indicate another independent storage area in the device to be operated, which is specifically used for storing new scene data associated with the historical scenes. New scenes are usually formed by modifying, expanding, or adding functions to the historical scenes.

[0069] The new scenario can be a scenario obtained by updating the historical scenario, adding new rules or functions. It may contain new device control logics, parameter settings, etc., aiming to meet the more personalized or specific needs of users. The historical scenario can be a conventional scenario that the device has executed in the past or set by the user in advance, with a certain degree of stability and generality, such as common "going home mode" and "sleep mode".

[0070] When the device to be operated receives a scenario execution instruction and is ready to execute the instruction based on the new scenario stored in the second storage area, the device will automatically start a detection mechanism to check whether this new scenario meets the preset verification failure conditions.

[0071] As an example, assume that the historical scenario is "sleep mode", and the corresponding new scenario is "sleep mode (enhanced version)", in which a new rule is added that when entering the sleep mode, the air purifier in the living room is turned on and the wind speed is set to high gear. However, the current air purifier in the living room is in a faulty state and cannot be started normally. At this time, the rule in the new scenario that requires starting a faulty device constitutes a device status conflict, meeting the situation of abnormal device status in the preset conditions, and the new scenario verification fails.

[0072] As an example, the historical scenario is "movie watching mode", and the new scenario "movie watching mode (luxury version)" sets the brightness of the projector to 1500 lumens. However, the projector's instruction manual clearly stipulates that its brightness parameter range should be between 500 - 1200 lumens. Obviously, the brightness setting of the projector in the new scenario exceeds the range allowed by the device, meeting the situation of parameter exceeding the range in the preset conditions, and the new scenario verification fails.

[0073] As an example, the historical scenario is "leaving home mode", and the new scenario "leaving home mode (intelligent version)" stipulates that all lights should be turned off when leaving home, but at the same time it is set to turn on the kitchen lights again after 5 minutes. This kind of setting with contradictory logic before and after belongs to a logic error, meeting the situation of logic error in the preset conditions, and the new scenario verification fails.

[0074] Step S302, if the new scenario meets the preset conditions, execute the scenario execution instruction based on the historical scenario.

[0075] If during the detection process in step S301, it is found that the new scenario meets the preset verification failure conditions, that is, the new scenario verification fails, then the device to be operated will abandon using the new scenario to execute the scenario execution instruction and instead use the historical scenario stored in the first storage area to execute the instruction.

[0076] As an example, continuing with the above example of "Sleep Mode (Enhanced Version)", when the device detects a malfunction in the living room air purifier and the new scenario fails the device status conflict check, the device will automatically switch to the historical scenario "Sleep Mode" to execute the instructions. At this time, the device will only perform operations such as closing the curtains and dimming the bedroom lights according to the rules of the historical scenario, and will not attempt to start the malfunctioning air purifier.

[0077] As an example, for the example of "Movie Watching Mode (Deluxe Version)", when the device detects that the brightness parameter of the projector is out of range and the new scenario check fails, the device will use the historical scenario "Movie Watching Mode" to execute the instructions. The device will adjust the projector according to the parameters set in the historical scenario, such as a brightness of 800 lumens, to ensure that the device operates within the normal parameter range.

[0078] As an example, in the example of "Away Mode (Intelligent Version)", when the device detects a logic error and the new scenario check fails, the device will execute the instructions of the historical scenario "Away Mode". The device will directly turn off all lights and will not perform operations with logical contradictions such as turning on the kitchen lights again after 5 minutes.

[0079] In a possible implementation, the gateway can specify the execution partition by version number. For example:

[0080] (ID = 5.2 or ID = 5.3). Among them, when ID = 5.2, it is the first storage area, and when ID = 5.3, it can be the second storage area.

[0081] Among them, ID = 5.2: When the gateway specifies ID = 5.2, it means to load and execute the scenario from the first storage area. The first storage area usually stores historical scenarios and the first scenarios, which are verified, stable, and usually regular scenarios preset by users. ID = 5.3: When the gateway specifies ID = 5.3, it means to load and execute the scenario from the second storage area. The second storage area usually stores new scenarios associated with historical scenarios, which may be newly added, modified, or new functional scenarios that users want to test.

[0082] As an example, the user hopes to execute a verified and stable scenario, such as "Sleep Mode". The user specifies to use ID = 5.2 through the smart home application or voice assistant. After receiving the instruction of ID = 5.2, the gateway loads the "Sleep Mode" scenario from the first storage area. The gateway executes the "Sleep Mode" scenario, turning off unnecessary lights, adjusting the indoor temperature, etc.

[0083] As an example, a user hopes to test a newly added scenario, such as "Sleep Mode (Enhanced Version)", which adds the startup of an air purifier on the basis of the original. The user specifies the use of ID = 5.3 through a smart home application or a voice assistant. After receiving the instruction of ID = 5.3, the gateway loads the "Sleep Mode (Enhanced Version)" scenario from the second storage area. The gateway executes the "Sleep Mode (Enhanced Version)" scenario, attempts to start the air purifier and adjust its wind speed. If the verification of the newly added scenario fails (for example, the air purifier malfunctions), the gateway falls back to ID = 5.2 according to the previous logic and executes the standard "Sleep Mode".

[0084] The method for controlling a device provided in this embodiment enables a user or a developer to freely push newly added scenarios to the second storage area by configuring the second storage area, without frequently modifying the basic scenario library, reducing the system upgrade risk. And if the execution of a newly added scenario fails, it can seamlessly switch to the historical scenarios in the first storage area, avoiding the interruption of the scenario and the inability to execute, and reducing the user experience.

[0085] In a possible implementation manner, the scenario information further includes: authentication signature information; and the above method further includes: sending the authentication signature information to each device to be operated respectively, so that the device to be operated performs authentication according to the authentication signature information and generates an authentication result; wherein, when the authentication result indicates that the verification of the device to be operated is successful, the device to be operated executes the scenario execution instruction.

[0086] The authentication signature information can indicate encrypted data used to verify the legality and integrity of the information source. When preparing to identify a scenario, the gateway extracts the authentication signature information from the scenario information and sends the authentication signature information to each device to be operated that needs to execute the scenario respectively through a specific communication protocol (such as Wi-Fi, ZigBee, Bluetooth, etc.).

[0087] After receiving the authentication signature information sent by the gateway, the device to be operated verifies the authentication signature information by using a pre-stored key (paired with the key used by the gateway to generate the signature information) and a corresponding decryption algorithm. The verification process mainly checks whether the authentication signature information is consistent with the result calculated locally by the device and whether the information is tampered with during the transmission process. After the verification is completed, the device generates an authentication result, which can be represented by a Boolean value (True / False) or a specific status code to indicate whether the verification is successful or failed.

[0088] The device to be operated can feedback the generated authentication result to the gateway (some devices may directly determine whether to execute the instruction according to the verification result), and the gateway or the device itself makes a judgment based on the authentication result. Only when the authentication result indicates that the verification of the device to be operated is successful, will the device execute the scenario execution instruction and complete the corresponding scenario operation. If the verification fails, the device will reject the execution of the instruction and may feedback the information of verification failure to the gateway.

[0089] For example: In a smart home system, the user triggers the "go home mode" through the mobile phone APP. After receiving the instruction, the gateway generates scenario information including controlling multiple devices (such as smart door locks, living room lights, smart curtains, etc.), and at the same time generates the corresponding authentication signature information. Then, the gateway sends the authentication signature information to devices such as smart door locks, living room lights, and smart curtains respectively through the Wi-Fi protocol. For example, the data packet sent by the gateway to the smart door lock contains the authentication signature information "Auth_Sign_Lock = xxx" ("xxx" is the signature data obtained through encryption calculation). After receiving the authentication signature information "Auth_Sign_Lock = xxx" sent by the gateway, the smart door lock uses the key stored in itself and the corresponding decryption algorithm to verify the signature information. Assuming that the verification result calculated inside the door lock matches the received signature information and the information has not been tampered with, the generated authentication result is successful verification (for example, returning the status code "0" indicates success); if the calculation result does not match or the information is tampered with, the generated authentication result is verification failure (for example, returning the status code "1" indicates failure).

[0090] The method for controlling a device provided in this embodiment can reverse verify the signature of the gateway before the device executes the instruction, avoiding an illegal gateway impersonating a legitimate controller. Moreover, different devices store independent public keys or certificate chains, ensuring that only the device to be operated with successful verification can decrypt and execute the instruction, thereby improving the security of the execution of the device to be operated.

[0091] In a possible implementation manner, the scenario information further includes sensor information; and the above step S103 includes: sending the scenario identifier and the sensor information to each device to be operated respectively, so that each device to be operated determines the scenario execution instruction from the local scenario library according to the scenario identifier respectively, and adjusts the adjustment parameters corresponding to the scenario execution instruction based on the sensor information to convert from the current state to the second target state.

[0092] The sensor information can indicate the data collected by various sensors, and specifically can indicate the real-time state of the environment where the device is located, such as temperature, humidity, light intensity, human activity state, etc. The sensor information is an important basis for the device to adjust the scenario execution parameters.

[0093] When the gateway determines that a certain scenario needs to be executed, it extracts the scenario identifier and sensor information from the scenario information, and then sends this information to each device to be operated that needs to execute this scenario through an appropriate communication protocol (such as ZigBee, Wi-Fi, Bluetooth, etc.). After receiving the scenario identifier sent by the gateway, the device to be operated will perform a matching search in its local scenario library, find the scenario entry corresponding to this scenario identifier, and extract the scenario execution instructions corresponding to this scenario from it. After obtaining the scenario execution instructions, the device to be operated will combine the received sensor information to adjust the initial parameters in the instructions to obtain the adjusted parameters. Then, the device performs operations according to the adjusted parameters, gradually transforming itself from the current state to the desired second target state.

[0094] For example: In a smart home system, the user triggers the "Comfortable Sleep Mode" through the mobile phone APP. After receiving the instruction, the gateway determines that the scenario identifier of this scenario is "Sleep_Mode_001", and at the same time obtains the sensor information of the current environment, such as the bedroom temperature is 28°C, the humidity is 60%, the light intensity is 500 lux, and the human activity sensor detects that someone is about to rest. The gateway sends this information to devices such as the smart air conditioner, smart humidifier, and smart lighting system through the Wi-Fi protocol. For example, the data sent to the smart air conditioner includes the scenario identifier "Sleep_Mode_001" and temperature and humidity information; the data sent to the smart lighting system includes the scenario identifier and light intensity information.

[0095] After receiving the scenario identifier "Sleep_Mode_001", the smart air conditioner searches for the corresponding scenario entry in its local scenario library. In the entry, the scenario execution instructions of the smart air conditioner in the "Comfortable Sleep Mode" are stored, such as "Set the air conditioner to the cooling mode, the target temperature is 26°C, and the wind speed is low".

[0096] Similarly, according to the scenario identifier "Sleep_Mode_001", the smart lighting system finds the corresponding scenario in its local scenario library and extracts the execution instructions, such as "Adjust the light brightness to 10%, adjust the color temperature to 2700K, and gradually dim within 30 seconds".

[0097] The intelligent air conditioner can adjust parameters and execute: The intelligent air conditioner is currently in the off state (current state). According to the initial execution instruction extracted from the local scene library, the target temperature should be set to 26°C. However, considering the received sensor information, the current bedroom temperature is 28°C and the humidity is 60%. The air conditioner equipment may, according to a preset algorithm, taking into account that the human perception of temperature is different when the humidity is high, adjust the target temperature from 26°C to 25°C (adjust parameters), while maintaining the cooling mode and low fan speed. Then, the air conditioner turns on and gradually reduces the indoor temperature to 25°C, with the fan speed remaining at low, completing the conversion from the off state to the target operating state (second target state).

[0098] The intelligent lighting system can adjust parameters and execute: The intelligent lighting system is currently in the normal lighting state, with a brightness of 100% and a color temperature of 5000K (current state). According to the scene execution instruction, the initial goal is to adjust the light brightness to 10% and the color temperature to 2700K, and gradually dim within 30 seconds. However, considering the current light intensity detected by the light intensity sensor is 500 lux, the device may judge that the current ambient light is relatively bright, and directly reducing the brightness to 10% may be too abrupt. Therefore, the device adjusts the starting value of the brightness adjustment from 100% to 80% (adjust parameters), and then slowly reduces it from 80% to 10% over 30 seconds, while adjusting the color temperature to 2700K, achieving the conversion from the current lighting state to a soft lighting state suitable for sleep (second target state).

[0099] The method for controlling devices provided in this embodiment enables the device to dynamically sense environmental changes by introducing sensor information. For example, in the "theater mode", if the ambient light sensor detects a change in the natural light intensity, the device can automatically adjust the projector brightness and the opening / closing degree of the curtains, rather than mechanically executing the preset parameters, ensuring that the picture quality always meets the standards. The closed-loop feedback mechanism solves the problem of distorted effects caused by environmental variables in traditional scene modes. Moreover, by calibrating the execution parameters with sensor data, the differences between devices can be eliminated. For example, in the "sleep mode" of the air conditioner equipment, if it is found through the temperature sensor that the actual room temperature deviates significantly from the target value, the cooling / heating power can be dynamically adjusted, rather than relying on fixed gears, to prevent users from being woken up by excessive temperature differences.

[0100] In this embodiment, a device for controlling devices is also provided. This device is used to implement the above-mentioned embodiment and preferred implementation manners, and those that have been described will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0101] This embodiment provides a device for controlling devices, such asFigure 2 As shown in the figure, it includes: a first determination module 201, configured to determine scenario information corresponding to a scenario trigger instruction in response to the scenario trigger instruction; wherein the scenario information includes a scenario identifier, and the scenario identifier is used to indicate a target scenario; a second determination module 202, configured to respectively determine multiple preset device identifiers corresponding to the scenario identifier as multiple devices to be operated corresponding to the target scenario according to the correspondence between the preset scenario identifier and the preset device identifier and the scenario identifier; a sending and execution module 203, configured to send the scenario identifier to each device to be operated respectively, so that each device to be operated respectively determines a scenario execution instruction from a local scenario library according to the scenario identifier, and executes the scenario execution instruction to convert from the current state to a first target state corresponding to the target scenario.

[0102] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding above-mentioned embodiments, and will not be repeated here.

[0103] The device of the control device in this embodiment is presented in the form of functional units. Here, the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0104] An embodiment of the present invention further provides a computer device having the device of the control device as described above Figure 2 as shown.

[0105] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of a computer device provided by an optional embodiment of the present invention. As shown in Figure 3 the figure, the computer device includes: one or more processors 10, a memory 20, and an interface for connecting each component, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 3 In

[0106] The processor 10 may be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above-mentioned programmable logic device may be a complex programmable logic device, a field-programmable gate array, a generic array logic, or any combination thereof.

[0107] Among them, the memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiments.

[0108] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may further include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories may be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0109] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 may further include a combination of the above types of memories.

[0110] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0111] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention may be implemented in hardware, firmware, or may be implemented as computer code recorded on a storage medium, or may be implemented as computer code originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium may be a magnetic disk, an optical disc, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium may further include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0112] A part of the present invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the present invention through the operations of the computer. Those skilled in the art should understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0113] Although the embodiments of the present invention 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 the present invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for controlling a device, characterized in that, The method includes: In response to a scene trigger instruction, determining scene information corresponding to the scene trigger instruction; wherein, the scene information includes a scene identifier, and the scene identifier is used to indicate a target scene; According to the corresponding relationship between a preset scene identifier and a preset device identifier and the scene identifier, respectively determining a plurality of preset device identifiers corresponding to the scene identifier as a plurality of devices to be operated corresponding to the target scene; Sending the scene identifier to each device to be operated respectively, so that each device to be operated respectively determines a scene execution instruction from a local scene library according to the scene identifier, and executes the scene execution instruction to convert from a current state to a first target state corresponding to the target scene.

2. The method for a control device according to claim 1, wherein, The scene information further includes: a transition duration; and the sending the scene identifier to each device to be operated respectively, so that each device to be operated respectively determines a scene execution instruction from a local scene library according to the scene identifier, and executes the scene execution instruction to convert from a current state to a first target state corresponding to the target scene includes: Sending the scene identifier and the transition duration to each device to be operated respectively, so that a first device determines a scene execution instruction corresponding to the first device from a local scene library according to the scene identifier, and executes the scene execution instruction corresponding to the first device according to the transition duration to convert from a current state of the first device to a target state corresponding to the target scene, and a second device determines a scene execution instruction corresponding to the second device from a local scene library according to the scene identifier, and executes the scene execution instruction corresponding to the second device to convert from a current state of the second device to a first target state corresponding to the target scene.

3. The method of a control device according to claim 1, characterized in that, The method further includes: When the device to be operated is in a sleep state, sending a wake-up signal to the device to be operated through a broadcast channel, so that the device to be operated converts from the sleep state to a wake-up state according to the wake-up signal; When the device to be operated converts from a current state to a target state corresponding to the target scene, receiving an execution result of the device to be operated through a feedback channel, and verifying the execution result.

4. The method of the control device according to claim 1, characterized in that, The device to be operated includes a first storage area and a second storage area, the first storage area stores historical scenes and a first scene, and the second storage area stores new scenes corresponding to the historical scenes; And the method further includes: When the device to be operated executes the scene execution instruction based on the new scene, detecting whether the new scene meets a preset condition; wherein, the preset condition is used to indicate that the verification of the new scene fails; If the new scene meets the preset condition, executing the scene execution instruction based on the historical scene.

5. The method for a control device according to claim 1, characterized in that, The scene information further includes: authentication signature information; and the method further includes: Sending the authentication signature information to each device to be operated respectively, so that the device to be operated performs authentication according to the authentication signature information to generate an authentication result; wherein, when the authentication result indicates that the verification of the device to be operated is successful, the device to be operated executes the scene execution instruction.

6. The method for a control device according to claim 1, characterized in that, The scene information further includes sensor information; and sending the scene identifier to each device to be operated respectively, so that each device to be operated determines a scene execution instruction from the local scene library according to the scene identifier respectively, and executes the scene execution instruction to convert from the current state to the first target state corresponding to the target scene, including: Sending the scene identifier and the sensor information to each device to be operated respectively, so that each device to be operated determines a scene execution instruction from the local scene library according to the scene identifier respectively, and adjusts the adjustment parameter corresponding to the scene execution instruction based on the sensor information to convert from the current state to the second target state.

7. A device for controlling a device, characterized in that, The device includes: A first determination module, configured to determine the scene information corresponding to the scene trigger instruction in response to the scene trigger instruction; wherein, the scene information includes a scene identifier, and the scene identifier is used to indicate the target scene; A second determination module, configured to respectively determine the multiple preset device identifiers corresponding to the scene identifier as the multiple devices to be operated corresponding to the target scene according to the corresponding relationship between the preset scene identifier and the preset device identifier and the scene identifier; A sending and execution module, configured to send the scene identifier to each device to be operated respectively, so that each device to be operated determines a scene execution instruction from the local scene library according to the scene identifier respectively, and executes the scene execution instruction to convert from the current state to the first target state corresponding to the target scene.

8. A computer device, characterized in that, including: A memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the method of the control device according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause a computer to execute the method of the control device according to any one of claims 1 to 6.

10. A computer program product, characterized in that, including computer instructions, and the computer instructions are used to cause a computer to execute the method of the control device according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Control method of smart home equipment and smart home equipment

    CN118625684A

  • Distributed smart home control method, device and system

    CN119689881A

Cited By

  • Equipment control method and device, storage medium and electronic device

    CN121441665A