Equipment control method and device based on scene mode, equipment and storage medium
By identifying the target devices and control commands in concurrent scene modes and resolving conflicts according to priority, the device control method of scene modes is ensured, which solves the problem of device control conflicts in smart home systems when multiple scene modes are running concurrently, and improves the accuracy of device control and the stability of the system.
Patent Information
- Application Number
- CN202511027800.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-18
AI Technical Summary
Existing smart home systems experience device control conflicts when multiple scene modes are triggered concurrently, leading to decreased control accuracy and impacting user experience and system reliability.
By acquiring multiple simultaneously triggered target scene modes and their scene data, the target device and its control commands are identified, conflicting commands are determined, and the primary scene mode is determined based on the priority of the scene modes. The device is then controlled to execute the conflicting commands in the primary scene mode.
It improves the accuracy of equipment control, ensures real-time execution of critical scenarios, avoids equipment control chaos, and enhances system stability and user experience.
Smart Images

Figure CN120979858A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of device control, and particularly to a device control method and device based on a scene mode, an electronic device, and a storage medium. Background Art
[0002] With the booming development of the Internet of Things technology, the smart home system has become a highlight of modern life, which can achieve rich and diverse scene-based controls. With the help of preset scene modes, users can trigger the linkage of multiple smart devices with just one key operation, greatly improving the convenience of life. However, in the actual application process, the embarrassing situation of multiple scene modes being triggered simultaneously often occurs. For example, the leaving-home mode requires turning off all lights, while the security mode needs to turn on the lighting in a specific area. This conflict in device control between scene modes will lead to a decrease in the accuracy of device control, seriously damaging the user experience and posing a severe challenge to the reliability of the smart home system. Summary of the Invention
[0003] The embodiments of the present application provide a device control method based on a scene mode to solve the problem that the device control conflict existing in the existing smart home system when multiple scene modes are triggered concurrently will lead to a decrease in the accuracy of device control.
[0004] Correspondingly, the embodiments of the present application further provide a device control device based on a scene mode, an electronic device, and a storage medium to ensure the implementation and application of the above method.
[0005] To solve the above problems, the embodiments of the present application disclose a device control method based on a scene mode, and the method includes:
[0006] Obtain at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes;
[0007] According to the scene data corresponding to the target scene modes, determine the target device and the target control instructions respectively corresponding to the target device in different target scene modes; the target device includes the same device that needs to be controlled in different target scene modes;
[0008] According to the target control instructions respectively corresponding to the target device in different target scene modes, determine the conflicting instructions of the target device in different target scene modes;
[0009] According to the scene data corresponding to the target scene modes, determine the main scene mode among at least two target scene modes, and control the target device to execute the conflicting instructions corresponding to the target device in the main scene mode.
[0010] Optionally, obtaining at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes includes:
[0011] In response to a trigger signal used to characterize the triggering of a scene mode, the triggering time corresponding to the scene mode is determined;
[0012] Based on the trigger time corresponding to the scene mode, at least two target scene modes that are triggered simultaneously are determined from among the multiple scene modes;
[0013] Obtain the scene data corresponding to the target scene mode.
[0014] Optionally, obtaining scene data corresponding to the target scene mode includes:
[0015] Obtain the scene type label corresponding to the target scene mode;
[0016] The priority of the target scene mode is determined in a first preset mapping table based on the scene type label corresponding to the target scene mode; the first preset mapping table includes a one-to-one mapping relationship between scene type labels and priorities.
[0017] The scene device corresponding to the target scene mode is determined in a second preset mapping table; the second preset mapping table includes a one-to-one mapping relationship between scene modes and scene devices.
[0018] The trigger time, priority, and scene device corresponding to the target scene mode are determined as the scene data corresponding to the target scene mode.
[0019] Optionally, determining the conflicting commands of the target device in different target scenario modes based on the target control commands corresponding to the target device in different target scenario modes includes:
[0020] Obtain the control type corresponding to the target control command under different target scenario modes;
[0021] Based on the control type corresponding to the target control command in different target scenario modes, determine whether there is a conflict between the target control commands corresponding to the target device in different target scenario modes;
[0022] The conflicting control commands of the target device that conflict in different target scenario modes are identified as the conflicting commands.
[0023] Optionally, the scene data corresponding to the target scene mode includes the priority corresponding to the target scene mode. The step of determining the primary scene mode from at least two target scene modes based on the scene data corresponding to the target scene mode, and controlling the target device to execute the conflicting command corresponding to the target device in the primary scene mode, includes:
[0024] Based on the priority corresponding to the target scene mode, a primary scene mode and a secondary scene mode are determined from at least two target scene modes; the priority corresponding to the primary scene mode is higher than the priority corresponding to the secondary scene mode.
[0025] Control the target device to execute the conflict command corresponding to the target device in the main scene mode, and record the conflict command corresponding to the target device in the slave scene mode.
[0026] Optionally, the scene data corresponding to the target scene mode includes the trigger time and the scene device corresponding to the target scene mode. After obtaining at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes, the method further includes:
[0027] Based on the scene devices corresponding to the target scene mode, non-conflicting devices are determined; the non-conflicting devices include different devices that need to be controlled under different target scene modes;
[0028] Obtain the non-conflict control command corresponding to the non-conflict device in the target scene mode;
[0029] Based on the trigger time corresponding to the target scene mode, control the non-conflict device to execute the non-conflict control command.
[0030] Optionally, controlling the target device to execute the conflict command corresponding to the target device in the main scene mode includes:
[0031] Based on the conflict command corresponding to the target device in the main scene mode, determine the control parameters of the target device;
[0032] Based on the control parameters of the target device, control the target device to execute the conflict command corresponding to the target device in the main scene mode.
[0033] Optionally, after controlling the target device to execute the conflict command corresponding to the target device in the main scene mode and recording the conflict command corresponding to the target device in the slave scene mode, the method further includes:
[0034] In response to an end signal used to characterize the end of the main scene mode, determine whether the secondary scene mode is in a pending execution state;
[0035] When the slave scene mode is in the pending execution state, the target device is controlled to execute the conflicting instruction corresponding to the target device in the slave scene mode.
[0036] Optionally, after determining the primary scene mode from at least two target scene modes based on scene data corresponding to the target scene mode, and controlling the target device to execute the conflict command corresponding to the target device in the primary scene mode, the method further includes:
[0037] Obtain the scene device corresponding to the scene mode, the historical state of the scene device before executing the main scene mode, and the real-time state of the scene device after executing the main scene mode;
[0038] Based on the historical state and the real-time state, determine whether the scene device has an interrupted task;
[0039] If the interrupted task exists in the scene device, then obtain the restart conditions for the interrupted task;
[0040] Based on the real-time status and the restart conditions of the interrupted task, the scene device is controlled to restart the interrupted task.
[0041] This application also discloses a device control apparatus based on a scene mode, the apparatus comprising:
[0042] The acquisition module is used to acquire at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes;
[0043] The target control instruction module is used to determine the target device and the target control instructions corresponding to the target device in different target scene modes based on the scene data corresponding to the target scene mode; the target device includes the same device that needs to be controlled in different target scene modes;
[0044] The conflict instruction module is used to determine the conflict instructions that conflict between the target devices in different target scenario modes based on the target control instructions corresponding to the target devices in different target scenario modes.
[0045] The control module is used to determine the main scene mode from at least two target scene modes based on the scene data corresponding to the target scene mode, and control the target device to execute the conflict command corresponding to the target device in the main scene mode.
[0046] This application also discloses an electronic device, including: a processor; and a memory storing executable code thereon, wherein when the executable code is executed, the processor executes any of the scene-mode-based device control methods described in the embodiments of this application.
[0047] This application also discloses one or more machine-readable media storing executable code thereon, which, when executed, causes a processor to perform any of the scene-mode-based device control methods described in this application.
[0048] Compared with the prior art, the embodiments of this application have the following advantages:
[0049] In this embodiment, at least two target scene modes that are triggered simultaneously and scene data corresponding to the target scene modes are obtained; based on the scene data corresponding to the target scene modes, a target device and target control instructions corresponding to the target device in different target scene modes are determined; the target device includes the same device that needs to be controlled in different target scene modes; based on the target control instructions corresponding to the target device in different target scene modes, conflicting instructions of the target device in different target scene modes are determined; based on the scene data corresponding to the target scene modes, a primary scene mode is determined among at least two target scene modes, and the target device is controlled to execute the conflicting instructions corresponding to the target device in the primary scene mode. In this embodiment, by acquiring at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes, the relevant content of multi-scene concurrent triggering is determined. This allows for the identification of potential device control conflicts during multi-scene concurrent triggering, preventing device control errors due to missing information. By determining the same device that needs to be controlled under different target scene modes and the target control commands corresponding to that device under different target scene modes through scene data, conflicting devices (target devices) during multi-scene concurrent triggering can be pre-determined, allowing conflicting commands to be filtered out from the control commands corresponding to the conflicting devices. By identifying the target control commands corresponding to the target devices under different target scene modes, conflicting commands that conflict with each other under different target scene modes can be filtered out, accurately locating the problem of device control conflict and preventing conflicting commands from acting on the target devices simultaneously and causing confusion. In the case of conflicting commands, the main scene mode can be quickly determined in the multi-target scene modes of concurrent triggering based on scene data, and the device can be controlled to execute the conflicting commands under the main scene mode. This ensures that important scenes (main scene modes) are executed in real time, meeting the real-time requirements of important scenes, and thus ensuring that target devices in complex scenes can also be accurately controlled, effectively improving the accuracy of device control. Attached Figure Description
[0050] Figure 1 is a flowchart of the steps of an embodiment of a device control method based on a scenario mode in the present application;
[0051] Figure 2 is a schematic diagram of the architecture of a smart home system in the present application;
[0052] Figure 3 is a block diagram of the structure of an embodiment of a device control apparatus based on a scenario mode in the present application;
[0053] Figure 4 is a schematic diagram of the structure of a device provided in an embodiment of the present application. Detailed implementation manners
[0054] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific implementation manners.
[0055] Users can preset multiple scenario modes through the smart home system. With just one key operation, users can trigger the linkage of multiple smart home devices in a scenario mode, greatly improving the convenience of life. However, in actual applications, the problem of multiple scenario modes being triggered simultaneously may occur. For example, the leaving home mode requires turning off all lights, while the security mode needs to turn on the lighting in a specific area. This conflict in device control between scenario modes will lead to a decrease in the accuracy of device control, seriously damaging the user experience and posing a severe challenge to the reliability of the smart home system.
[0056] In the prior art, generally, a simple mutual exclusion mechanism and time interval judgment are used to solve the problem of device control conflicts when multiple scenarios are triggered concurrently. However, the mutual exclusion mechanism will completely block the execution of other scenario modes, causing some functions of the device to fail, while the time interval judgment may cause important scenarios to be executed late, unable to meet the real-time requirements.
[0057] In the prior art, in addition to the simple mutual exclusion mechanism and time interval judgment, there is also a processing method of instruction nesting. This processing method attempts to nest and arrange the instructions of multiple scenario modes and execute them in a certain order.
[0058] Suppose the user has preset the following three scenario modes:
[0059] Leaving home mode: Turn off all lights, close the curtains, turn off the air conditioner, and activate the security system;
[0060] Energy-saving mode: Turn off all non-essential electrical appliances (such as TVs, stereos, etc.) and dim the lights in the living room;
[0061] Visitor mode: Turn on the living room lights, open the curtains, and pause the security system.
[0062] When a user is away from home, both the away mode and the energy-saving mode are activated. If a visitor calls at the same time, the visitor mode needs to be activated.
[0063] In nested instruction processing, the system executes concurrent scenarios in a fixed order, forming an execution queue based on static priority (i.e., the order in which scenarios are created). For example, if the creation of the visitor mode (an important scenario) occurs after the away mode and energy-saving mode, and the creation of the energy-saving mode occurs after the away mode, the system will first execute the away mode, turning off all lights, curtains, and air conditioning, and activating the security system. Then, it will execute the energy-saving mode, dimming the living room lights and turning off all unnecessary appliances. Finally, it will execute the visitor mode, turning on the living room lights and curtains, and pausing the security system. Clearly, this prevents the important visitor mode from gaining the highest execution priority. Furthermore, later-executed instructions in the queue will overwrite earlier-executed instructions, causing repeated device states (e.g., lights "on-off-on").
[0064] Especially in scenarios involving safety protection, such as conflicts between fire alarm modes and energy-saving modes, incorrect execution order can lead to safety hazards. For example, a fire alarm mode requires all lights to be turned on immediately for rapid evacuation, but if this instruction is incorrectly nested after an energy-saving mode, the system might turn off the lights first to save energy before executing the fire alarm, severely delaying emergency response and creating serious safety risks. Furthermore, non-conflicting instructions often fail due to queue interruptions, leading to decreased reliability and effectiveness of equipment control, and consequently affecting the accuracy of equipment control.
[0065] Clearly, existing solutions for resolving device control conflicts in smart home systems when multiple scenarios are triggered concurrently still suffer from the problem of lacking effective execution strategies when different scenarios have mutually exclusive control commands for the same device. Furthermore, they cannot balance prioritizing important scenarios with ensuring the integrity of execution in other scenarios, and they cannot control devices for diverse user needs and scenario combinations.
[0066] Reference Figure 1 This is a flowchart illustrating the steps of an embodiment of a scene-based device control method according to this application, including the following steps:
[0067] Step 101: Obtain at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes;
[0068] It should be noted that, in the embodiments of this application, a scene-based device control method is implemented through a smart home system, referring to... Figure 2This is a schematic diagram of the architecture of a smart home system according to this application. Specifically, the smart home system includes a priority management component, a conflict detection component, a hierarchical execution component, a state management component, and a user interaction component.
[0069] In this embodiment of the application, the smart home system can identify multiple scene modes triggered simultaneously. At this time, the smart home system will acquire multiple target scene modes that are triggered simultaneously, as well as the scene data corresponding to the target scene modes.
[0070] Specifically, in this embodiment, the priority management component implements related functions through a terminal device (such as a home host, smart central control screen, scene panel, etc.) used to execute scene modes, and supports querying scene data corresponding to each scene mode. Therefore, the priority management component can obtain multiple target scene modes and scene data corresponding to each target scene mode through the home host.
[0071] Step 102: Based on the scene data corresponding to the target scene mode, determine the target device and the target control instructions corresponding to the target device in different target scene modes; the target device includes the same device that needs to be controlled in different target scene modes;
[0072] In this embodiment of the application, the conflict detection component can determine the device that needs to be controlled for each scene mode based on the scene data corresponding to each scene mode. By using the scene data corresponding to the target scene mode, it can be identified whether there is the same device that needs to be controlled between any two target scene modes, i.e., the target device. In order to identify whether there is a conflict in the execution actions of the target device in different target scene modes, it is also necessary to determine the target control instructions corresponding to the target device in different target scene modes.
[0073] Step 103: Based on the target control commands corresponding to the target device in different target scene modes, determine the conflicting commands of the target device in different target scene modes;
[0074] In this embodiment of the application, when a target device is identified between any two target scene modes, it is necessary to further identify whether the instructions corresponding to the target device in different target scene modes conflict. Specifically, based on the target control instructions corresponding to the target device in different target scene modes, conflicting instructions of the target device in different target scene modes can be obtained.
[0075] Step 104: Based on the scene data corresponding to the target scene mode, determine the main scene mode among at least two target scene modes, and control the target device to execute the conflict command corresponding to the target device in the main scene mode.
[0076] Because there are conflicting control commands for target devices in different target scenario modes, it is necessary to control the target device to execute the conflicting commands in different target scenario modes in sequence.
[0077] In the existing processing method of instruction nesting, it is also possible to control the target device to execute conflicting instructions in different target scenario modes in sequence. However, this will cause the execution order of important scenarios to be delayed, and it is impossible to ensure that important scenarios are executed in a delayed manner, thus making it difficult to meet the real-time requirements of important scenarios.
[0078] Therefore, in this embodiment of the application, it is necessary to determine the most important main scene mode among multiple target scene modes based on the scene data corresponding to each target scene mode, and control the target device to execute the conflicting instructions corresponding to the target device in the main scene mode. This can avoid the problem of important scenes being delayed in execution and also meet the real-time requirements of important scenes.
[0079] In this embodiment, by acquiring at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes, the relevant content of multi-scene concurrent triggering is determined. This allows for the identification of potential device control conflicts during multi-scene concurrent triggering, preventing device control errors due to missing information. By determining the same device that needs to be controlled under different target scene modes and the target control commands corresponding to that device under different target scene modes through scene data, conflicting devices (target devices) during multi-scene concurrent triggering can be pre-determined, allowing conflicting commands to be filtered out from the control commands corresponding to the conflicting devices. By identifying the target control commands corresponding to the target devices under different target scene modes, conflicting commands that conflict with each other under different target scene modes can be filtered out, accurately locating the problem of device control conflict and preventing conflicting commands from acting on the target devices simultaneously and causing confusion. In the case of conflicting commands, the main scene mode can be quickly determined in the multi-target scene modes of concurrent triggering based on scene data, and the device can be controlled to execute the conflicting commands under the main scene mode. This ensures that important scenes (main scene modes) are executed in real time, meeting the real-time requirements of important scenes, and thus ensuring that target devices in complex scenes can also be accurately controlled, effectively improving the accuracy of device control.
[0080] In one embodiment of this application, obtaining at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes includes:
[0081] In response to a trigger signal used to characterize the triggering of a scene mode, the triggering time corresponding to the scene mode is determined;
[0082] Based on the trigger time corresponding to the scene mode, at least two target scene modes that are triggered simultaneously are determined from among the multiple scene modes;
[0083] Obtain the scene data corresponding to the target scene mode.
[0084] In this embodiment of the application, the home host can determine the trigger time corresponding to each scene mode based on the trigger signal triggered by each scene mode. According to the trigger time corresponding to each scene mode, at least two target scene modes that are triggered simultaneously can be determined among multiple triggered scene modes. Specifically, considering network latency, it is necessary to determine the trigger time difference between any two scene modes based on their trigger times, and determine whether the two scene modes are triggered simultaneously based on the time difference.
[0085] For example, a 2-second time window can be set. If multiple scene modes are triggered within this time window, then these scene modes can be identified as the target scene modes that are triggered simultaneously.
[0086] In this embodiment of the application, after determining the target scene mode, it is also necessary to query the scene data corresponding to each target scene mode from the priority management component to provide a basis for the identification of conflicting instructions.
[0087] This application embodiment can clarify the scope of the simultaneously triggered scenarios (i.e., the target scenario modes) by acquiring at least two target scenario modes that are triggered simultaneously, so as to accurately pinpoint the source of potential conflicts. By acquiring the scenario data corresponding to the target scenario modes, it can provide specific basis for identifying potential device control conflicts when multiple scenarios are triggered concurrently, and avoid device control errors due to missing information.
[0088] In one embodiment of this application, obtaining scene data corresponding to the target scene mode includes:
[0089] Obtain the scene type label corresponding to the target scene mode;
[0090] The priority of the target scene mode is determined in a first preset mapping table based on the scene type label corresponding to the target scene mode; the first preset mapping table includes a one-to-one mapping relationship between scene type labels and priorities.
[0091] The scene device corresponding to the target scene mode is determined in a second preset mapping table; the second preset mapping table includes a one-to-one mapping relationship between scene modes and scene devices.
[0092] The trigger time, priority, and scene device corresponding to the target scene mode are determined as the scene data corresponding to the target scene mode.
[0093] In this embodiment of the application, the terminal device executing the scene will maintain a scene database locally in the priority management component for dynamic updating and querying of scene data.
[0094] Specifically, the scene database includes a first preset mapping table and a second preset mapping table. The first preset mapping table includes a one-to-one mapping relationship between scene type tags and priorities, while the second preset mapping table includes a one-to-one mapping relationship between scene modes and scene devices. Regarding scene type tags, these are the scene type tags selected by the user when setting each scene mode. Based on the first preset mapping table, priorities can be automatically associated with that scene mode.
[0095] For example, scene type tags can include security alarm tags, energy-saving tags, entertainment tags, and general tags. The priority of each scene type tag can be set as follows: security alarm tag = level 3 (highest priority), energy-saving tag = level 2, entertainment tag = level 1, and general tag = level 0 (lowest priority). It should be noted that when a user needs to adjust the priority of a scene mode, they can do so by adjusting the scene type tag corresponding to that scene mode; this will automatically adjust its priority.
[0096] In this embodiment, users can adjust priority settings, issue conflict warnings, and manage groups in the scene settings interface through user interaction components. It supports dynamic adjustment of the priority corresponding to scene modes and can be flexibly configured according to user needs and actual usage scenarios to adapt to different smart home environments. This makes it more convenient for users to add scene modes or adjust priority rules and reduces the maintenance cost of the system.
[0097] It should be noted that when a user lowers the priority of a security alarm tag, the user will be prompted that this operation may pose a security risk.
[0098] First, the scene type tag corresponding to the target scene mode needs to be obtained. For this scene type tag, its associated priority can be determined in the first preset mapping table, and this priority is set as the priority corresponding to the target scene mode. Subsequently, based on the second preset mapping table, the scene device corresponding to each target scene mode can be determined.
[0099] In this embodiment of the application, in addition to the priority and scene device corresponding to each scene mode being stored as scene data in the priority management component, the home host will also synchronize the scene data stored in the priority management component to the server so that after determining the target scene mode, its corresponding priority and scene device can be determined as the scene data corresponding to the target scene mode.
[0100] To facilitate the execution of subsequent non-conflicting instructions, the trigger time corresponding to the target scene mode also needs to be determined as the scene data corresponding to the target scene mode. Here, the trigger time is also included as part of the scene data, which refers to the data that needs to be used in the subsequent device control process, not the scene data stored in the priority management component.
[0101] This application embodiment obtains scene type tags, accurately matches the priority and scene device corresponding to the target scene mode with the help of a first preset mapping table and a second preset mapping table, and integrates the trigger time to form scene data. This avoids errors caused by manually setting priorities and associating devices, ensuring the accuracy and consistency of scene data (priority, device, trigger time). Through the linkage between tags and priorities, priority adjustment operations are simplified, and the system's response efficiency to user needs is improved. The availability and security of scene data are ensured through local maintenance and server synchronization, providing complete and reliable data support for conflict judgment and instruction execution in subsequent multi-scene concurrency. This effectively reduces device control conflicts and execution errors caused by data errors or missing data, and improves the stability and efficiency of the system in handling multi-scene concurrency.
[0102] In one embodiment of this application, determining conflicting commands of the target device in different target scene modes based on the target control commands corresponding to the target device in different target scene modes includes:
[0103] Obtain the control type corresponding to the target control command under different target scenario modes;
[0104] Based on the control type corresponding to the target control command in different target scenario modes, determine whether there is a conflict between the target control commands corresponding to the target device in different target scenario modes;
[0105] The conflicting control commands of the target device that conflict in different target scenario modes are identified as the conflicting commands.
[0106] In this embodiment of the application, in order to identify whether the target control commands corresponding to the target device conflict in different target scenario modes, the conflict detection component needs to determine whether the execution actions of the target device are the same in different target scenario modes. Specifically, the execution action here refers to the control type corresponding to the target control command, not the specific control parameters or operation degree.
[0107] For example, for the target device of light, the target control command in the away mode is to turn off the light, and the corresponding control type is light brightness control. In the visitor mode, the target control command is to turn on the light, and the corresponding control type is light on / off control. In the cinema mode, the target control command is to adjust the light color to warm yellow, and the corresponding control type is light color control.
[0108] Specifically, based on whether the control types corresponding to the target control commands are the same, it can be determined whether there is a conflict between the target control commands. At this time, the target control commands that conflict with each other in different target scenario modes can be identified as conflict commands. That is, the target control commands that belong to the same control type for the target device in different scenario modes can be identified as conflict commands.
[0109] In one example, both the Away Mode and the Guest Mode are target scene modes. In this case, there is a target device (light) for these two target scene modes, and the control type of the target control command for the target device in these two target scene modes is light switch control. In this case, turning off the light and turning on the light can both be identified as conflict commands.
[0110] In another example, both the Away Mode and the Cinema Mode are target scene modes. In this case, there is a target device (light) for these two target scene modes. However, the control types corresponding to the target control commands of the target device are different in these two target scene modes. Therefore, it is not necessary to identify turning off the lights and adjusting the light color to warm yellow as conflicting commands.
[0111] This application's embodiments identify conflicting commands from the target device in different target scenario modes by determining whether the control types are the same. This solves the problem of accurately identifying control command conflicts that the target device may face when multiple scenarios are running concurrently. By using the control type as the core basis for conflict judgment, rather than specific parameters or the degree of operation, the scope of conflict can be defined in essence, avoiding the situation where the conflict boundary is blurred due to parameter differences. By identifying commands of the same control type as conflicting commands, a clear processing object is provided for the subsequent priority execution mechanism, ensuring that the system will not cause device operation chaos due to command conflicts when multiple scenarios are running concurrently (such as anomalies when a light receives both turn-off and turn-on commands at the same time). This improves the smart home system's adaptability to complex scenarios and control stability, ensuring the consistency between the user's expectations of the device's operating status and the actual effect.
[0112] In one embodiment of this application, the scene data corresponding to the target scene mode includes the priority corresponding to the target scene mode. The step of determining a primary scene mode from at least two target scene modes based on the scene data corresponding to the target scene mode, and controlling the target device to execute the conflicting command corresponding to the target device in the primary scene mode, includes:
[0113] Based on the priority corresponding to the target scene mode, a primary scene mode and a secondary scene mode are determined from at least two target scene modes; the priority corresponding to the primary scene mode is higher than the priority corresponding to the secondary scene mode.
[0114] Control the target device to execute the conflict command corresponding to the target device in the main scene mode, and record the conflict command corresponding to the target device in the slave scene mode.
[0115] In determining the primary scene mode, the main basis is the priority of the target scene mode. Priority determines the importance of the scene mode; simply put, the higher the priority, the more important the scene mode. Therefore, in this embodiment, based on the priority of the target scene modes, the target scene mode with the highest priority among at least two target scene modes can be determined as the primary scene mode, and the remaining target scene modes can be determined as secondary scene modes. In this case, the priority of the primary scene mode will be higher than the priorities of all secondary scene modes.
[0116] For conflicting commands of the target device in the main scene mode and the slave scene mode, the smart home system will prioritize controlling the target device to execute the conflicting commands in the main scene mode, and record the conflicting commands of the target device in the slave scene mode. Specifically, these can be marked as "to be restored" or "masked" to indicate that the smart home system does not need to control the target device to execute low-priority commands (conflicting commands of the target device in the slave scene mode).
[0117] In this embodiment of the application, a hierarchical execution component is used to make decisions based on priority, controlling the target device to execute device instructions with higher priority, while retaining other non-conflicting device instructions.
[0118] This application's embodiments clearly distinguish between master and slave scene modes based on priority. This ensures that in the event of multiple concurrent scenarios, instructions from high-priority scenarios (such as security alarm scenarios) are executed first. This not only avoids security risks caused by scene conflicts but also prevents interference from instructions from low-priority scenarios (such as entertainment scenarios) from affecting the fulfillment of core user needs. This execution logic based on importance aligns with users' expectations of scene priority, ensuring the effectiveness of important scenarios. Furthermore, by recording conflicting instructions from slave scene modes, it avoids device chaos caused by simultaneous execution of conflicting instructions (such as the contradiction of needing to both turn off and turn on the same light), and provides a data foundation for subsequent scene switching or restoration. This enhances the system's ability to support scene continuity, thereby strengthening the orderly control of devices and the consistency of user experience in complex scenarios within the smart home system. Additionally, the system can intelligently coordinate the execution order of each target scene mode based on priority, ensuring the integrity of high-priority scenarios (master scene modes) while completing operations in other low-priority scenarios (slave scene modes) as much as possible.
[0119] In one embodiment of this application, the scene data corresponding to the target scene mode includes the trigger time and the scene device corresponding to the target scene mode. After acquiring at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes, the method further includes:
[0120] Based on the scene devices corresponding to the target scene mode, non-conflicting devices are determined; the non-conflicting devices include different devices that need to be controlled under different target scene modes;
[0121] Obtain the non-conflict control command corresponding to the non-conflict device in the target scene mode;
[0122] Based on the trigger time corresponding to the target scene mode, control the non-conflict device to execute the non-conflict control command.
[0123] In this application embodiment, in addition to determining the conflicting devices (target devices) based on the scene devices to be controlled under different target scene modes, it is also necessary to determine the non-conflicting devices, that is, the different devices to be controlled under different target scene modes. This can be simply understood as the devices to be controlled under different target scene modes having no overlap.
[0124] For non-conflicting devices, it is also necessary to obtain the corresponding non-conflicting control commands in the target scene mode. Since the non-conflicting control commands do not need to distinguish between the master scene mode and the slave scene mode, the non-conflicting devices can be controlled to execute the non-conflicting control commands directly according to the trigger time corresponding to the target scene mode.
[0125] For example, the timestamp of the scene mode being executed received by the home host can be used as the trigger time of the scene mode. The scene mode whose trigger time comes first will be executed first. The smart home system can then directly control the corresponding non-conflicting devices to execute non-conflicting control commands according to the execution order of the scene modes.
[0126] In handling concurrent scenarios, this application's embodiments identify non-conflicting devices (devices that do not overlap in different scenarios) and directly execute their corresponding non-conflicting control commands based on the trigger time. This avoids incomplete scenario functionality caused by focusing only on conflicting devices and missing commands for non-conflicting devices. It also simplifies the process by eliminating the priority judgment step for non-conflicting devices, reducing system resource waste. Furthermore, executing commands in the order of trigger time conforms to user operation logic, ensuring timely and reasonable control. Ultimately, the control of conflicting and non-conflicting devices complements each other, improving the system's stability and adaptability in handling concurrent scenarios.
[0127] In one embodiment of this application, there may also be non-conflicting instructions for conflicting devices. That is, target control instructions that do not belong to the same control type for the target device under different scenario modes are determined as non-conflicting instructions. The processing method for non-conflicting instructions is the same as the processing method for non-conflicting control instructions for non-conflicting devices, which determines the execution order according to the trigger time corresponding to the scenario mode.
[0128] In one embodiment of this application, controlling the target device to execute the conflict command corresponding to the target device in the main scene mode includes:
[0129] Based on the conflict command corresponding to the target device in the main scene mode, determine the control parameters of the target device;
[0130] Based on the control parameters of the target device, control the target device to execute the conflict command corresponding to the target device in the main scene mode.
[0131] In this embodiment of the application, in order to control the target device to execute the conflict command corresponding to it in the main scene mode, since the conflict command usually only specifies the control direction of the device and does not contain specific control parameters for the target device, it is necessary to determine the control parameters of the target device according to each conflict command, and directly control the target device to execute the conflict command corresponding to it in the main scene mode according to the control parameters.
[0132] Specifically, control parameters are extracted from the conflicting instructions corresponding to the main scene mode. These parameters are the specific basis for the device's execution, such as setting the air conditioner temperature to 26℃ and adjusting the light brightness to 70%. Then, these parameters are transmitted to the target device, which adjusts its own state according to the parameters, thereby accurately completing the execution of the conflicting instructions and ensuring that the control requirements of the main scene mode are accurately achieved.
[0133] This application extracts specific control parameters from conflicting instructions, providing clear execution standards for the device and avoiding execution deviations caused by ambiguous instructions (such as the uncertainty of air conditioner operation when "temperature adjustment" is not specified). This ensures that the control intent of the main scene mode is accurately realized. Furthermore, by directly controlling the device execution based on parameters, the instruction conversion process is simplified, and errors that may occur in intermediate processing are reduced. This allows the device to quickly respond to the needs of high-priority scenarios, improving the reliability and accuracy of the smart home system in conflict handling and ensuring that the user experience of the main scene mode meets expectations.
[0134] In one embodiment of this application, after controlling the target device to execute the conflict command corresponding to the target device in the main scene mode and recording the conflict command corresponding to the target device in the slave scene mode, the method further includes:
[0135] In response to an end signal used to characterize the end of the main scene mode, determine whether the secondary scene mode is in a pending execution state;
[0136] When the slave scene mode is in the pending execution state, the target device is controlled to execute the conflicting instruction corresponding to the target device in the slave scene mode.
[0137] Once the system controls the target device to execute its conflicting instructions in the main scene mode, since the conflicting instructions of the target device in the slave scene mode will still conflict with the conflicting instructions in the main scene mode, simply put, if the target device has already executed the conflicting instructions in the main scene mode, it will not execute its conflicting instructions in the slave scene mode.
[0138] In this embodiment of the application, when the smart home system receives an end signal that indicates the end of the main scene mode, it means that the user has ended the main scene mode, that is, the scene requirement corresponding to the current main scene mode no longer exists, and the target device does not need to continue to maintain the running state of the main scene mode. Therefore, executing the secondary scene mode at this time will not affect the main scene mode. In order to determine whether the secondary scene mode still needs to be executed, it is necessary to further determine whether the secondary scene mode is in the pending execution state.
[0139] Specifically, when the scenario mode is in the pending execution state, it indicates that the user has not yet ended the scenario mode. That is, the scenario requirements corresponding to the current scenario mode are still valid, and the target device needs to respond to the control requirements of the scenario mode. Therefore, the target device can be controlled to execute the conflicting instructions corresponding to the scenario mode.
[0140] It should be noted that if there are multiple slave scenario modes, the high-priority scenarios to be executed are further divided among the multiple slave scenario modes according to their priority. The specific process is the same as the aforementioned method of dividing the main scenario mode and slave scenario mode among multiple target scenario modes according to their priority, and will not be repeated here.
[0141] This application embodiment triggers corresponding instructions by responding to the end signal of the main scene and judging the pending state of the secondary scene. After the main scene ends, it can confirm whether the secondary scene is still in the pending state. This can not only execute conflicting instructions in a timely manner when the secondary scene needs to be valid, avoiding delays in the secondary scene function caused by the main scene being occupied, but also prevent the execution of invalid instructions after the secondary scene has ended, reducing device idling and resource waste. Overall, it improves the adaptability of the smart home system to dynamic scene changes, making device control more in line with the user's real-time needs and enhancing the smoothness and rationality of the user experience.
[0142] When a scene mode is not in a pending state, it means that the user has ended the scene mode and the scene requirement corresponding to the current scene mode has become invalid. At this time, there is no need to control the target device to execute its conflicting instructions in the scene mode, thereby avoiding invalid operations and improving the operating efficiency and resource utilization of the smart home system.
[0143] In one embodiment of this application, after determining a primary scene mode from at least two target scene modes based on scene data corresponding to the target scene mode, and controlling the target device to execute the conflict command corresponding to the target device in the primary scene mode, the method further includes:
[0144] Obtain the scene device corresponding to the scene mode, the historical state of the scene device before executing the main scene mode, and the real-time state of the scene device after executing the main scene mode;
[0145] Based on the historical state and the real-time state, determine whether the scene device has an interrupted task;
[0146] If the interrupted task exists in the scene device, then obtain the restart conditions for the interrupted task;
[0147] Based on the real-time status and the restart conditions of the interrupted task, the scene device is controlled to restart the interrupted task.
[0148] In this embodiment of the application, before executing any scene mode, the historical state of all related devices is recorded. All related devices refer to all devices involved in all scene modes. Based on the second preset mapping table, it can be determined that the historical state refers to the current state of the device before the scene mode is executed. In order to accurately compare the changes in the device state before and after the execution of the scene mode, and thus determine whether a task has been interrupted, it is also necessary to obtain the real-time state of the scene device after the current scene mode is executed.
[0149] Specifically, after the main scene mode is executed, it is necessary to obtain the scene devices in each scene mode, as well as the historical and real-time states of the scene devices before and after the execution of the main scene mode. Based on the historical and real-time states of each scene device, it can be analyzed whether the scene device has any interrupted tasks due to the execution of the scene mode.
[0150] The status management component records the device's status information and interrupted tasks, supporting rollback or recovery (reboot) after the scene mode is deactivated.
[0151] If an interrupted task exists in a certain scene device, it is necessary to confirm the restart conditions of the interrupted task and determine whether the current scene device supports the restart conditions of the interrupted task based on the real-time status of the scene device. If it does support the restart conditions, control the scene device to restart the interrupted task.
[0152] Interrupted tasks refer to actions that a device will perform for a period of time, such as the cleaning task of a robot vacuum cleaner or the washing task of a washing machine. Users can set corresponding restart conditions for these tasks. Specifically, the restart conditions include whether the task needs to be restarted and certain requirements for restarting.
[0153] This application addresses the situation where tasks may fail to resume after a device task is interrupted during main scene mode execution. By comparing the device's state before and after main scene execution, the interrupted task is accurately identified, preventing tasks from being missed due to scene conflicts. Simultaneously, by combining user-preset restart conditions with the device's real-time status, the task is automatically restarted when the conditions are met. This ensures task continuity (e.g., a robot vacuum cleaner continues cleaning after the main scene ends and when idle) while respecting user-defined settings (e.g., users select certain tasks that do not require restarting), reducing the need for manual intervention. This logic not only solves the technical pain point of task interruption during multi-scene switching but also improves the intelligence and user-friendliness of smart home systems, ensuring that device operation better meets users' actual needs.
[0154] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the following two examples illustrate the concepts:
[0155] Example 1: Conflict between Away Mode and Security Alarm
[0156] Scene mode trigger: When a user triggers the "away from home" mode (turns off lights and closes curtains), a security alarm is then triggered (lights are turned on).
[0157] Execution process: The home control unit detects conflicting commands for the lights (turning off the away mode and turning on the security alarm). At this time, the security alarm is determined to be the main scene mode. The light-on command in the main scene mode is executed first, and the curtain-closing command in the secondary scene mode is executed next. The light-off command in the away mode is marked as "pending recovery". The lights will be turned off again after the security alarm is cleared.
[0158] Example 2: Conflict between energy-saving mode and guest mode
[0159] Scene mode trigger: Energy saving mode is running (living room lights are off), and the user temporarily triggers visitor mode (living room lights are on).
[0160] Execution process: The home host system detects a conflict with the living room lights and determines that the guest mode is the main scene mode. The light-on command in the main scene mode is executed first, and other commands in the scene mode (such as turning off the bedroom air conditioner) are executed next. The light-off command in the energy-saving mode is marked as "pending recovery". The energy-saving state is restored after the guest mode ends.
[0161] The above examples clearly demonstrate that the embodiments of this application implement conflict handling when multiple scenarios are triggered concurrently, ensuring the integrity of high-priority scenarios while also taking into account the functional requirements of low-priority scenarios.
[0162] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0163] Based on the above embodiments, this embodiment also provides a scene-based device control device, which can be applied to terminal devices, servers and other electronic devices.
[0164] Reference Figure 3 The diagram illustrates a structural block diagram of an embodiment of a scene-mode-based device control apparatus according to this application, which may specifically include the following modules:
[0165] The acquisition module 301 is used to acquire at least two target scene modes that are triggered simultaneously and scene data corresponding to the target scene modes;
[0166] The target control instruction module 302 is used to determine the target device and the target control instructions corresponding to the target device in different target scene modes based on the scene data corresponding to the target scene mode; the target device includes the same device that needs to be controlled in different target scene modes;
[0167] The conflict instruction module 303 is used to determine the conflict instructions that conflict between the target devices in different target scene modes based on the target control instructions corresponding to the target devices in different target scene modes.
[0168] The control module 304 is used to determine the main scene mode from at least two target scene modes based on the scene data corresponding to the target scene mode, and control the target device to execute the conflict command corresponding to the target device in the main scene mode.
[0169] Optionally, the acquisition module includes:
[0170] The trigger time submodule is used to determine the trigger time corresponding to the scene mode in response to a trigger signal that characterizes the triggering of the scene mode;
[0171] The target scene mode submodule is used to determine at least two target scene modes that are triggered simultaneously from among multiple scene modes, based on the trigger time corresponding to the scene mode.
[0172] The scene data submodule is used to acquire scene data corresponding to the target scene mode.
[0173] Optionally, the scene data submodule includes:
[0174] The scene type label unit is used to obtain the scene type label corresponding to the target scene mode;
[0175] The first preset mapping table unit is used to determine the priority corresponding to the target scene mode according to the scene type label corresponding to the target scene mode in the first preset mapping table; the first preset mapping table includes a one-to-one mapping relationship between scene type labels and priorities.
[0176] The second preset mapping table unit is used to determine the scene device corresponding to the target scene mode in the second preset mapping table; the second preset mapping table includes a one-to-one mapping relationship between scene modes and scene devices.
[0177] The scene data determination unit is used to determine the trigger time, the priority, and the scene device corresponding to the target scene mode as the scene data corresponding to the target scene mode.
[0178] Optionally, the conflict instruction module includes:
[0179] The control type submodule is used to obtain the control type corresponding to the target control command under different target scenario modes;
[0180] The conflict determination submodule is used to determine whether there is a conflict between the target control commands corresponding to the target device in different target scenario modes, based on the control types corresponding to the target control commands in different target scenario modes.
[0181] The conflict instruction determination submodule is used to determine the conflict instructions as the conflict instructions that conflict with the target device in different target scenario modes.
[0182] Optionally, the scene data corresponding to the target scene mode includes the priority corresponding to the target scene mode, and the control module includes:
[0183] The priority submodule is used to determine a primary scene mode and a secondary scene mode from at least two target scene modes based on the priority corresponding to the target scene mode; the priority corresponding to the primary scene mode is higher than the priority corresponding to the secondary scene mode.
[0184] The conflict instruction execution submodule is used to control the target device to execute the conflict instructions corresponding to the target device in the main scene mode, and to record the conflict instructions corresponding to the target device in the slave scene mode.
[0185] Optionally, the scene data corresponding to the target scene mode includes the trigger time and the scene device corresponding to the target scene mode, and the device further includes:
[0186] The non-conflict device module is used to determine non-conflict devices based on the scene devices corresponding to the target scene mode; the non-conflict devices include different devices that need to be controlled under different target scene modes;
[0187] The non-conflict control command acquisition module is used to acquire the non-conflict control command corresponding to the non-conflict device in the target scene mode;
[0188] The non-conflict control instruction execution module is used to control the non-conflict device to execute the non-conflict control instruction according to the trigger time corresponding to the target scene mode.
[0189] Optionally, the conflict instruction execution submodule includes:
[0190] The control parameter determination unit is used to determine the control parameters of the target device according to the conflict command corresponding to the target device in the main scene mode.
[0191] An execution unit is configured to control the target device to execute the conflicting instructions corresponding to the target device in the main scene mode, based on the control parameters of the target device.
[0192] Optionally, the device further includes:
[0193] The termination module is used to determine whether the slave scene mode is in a pending execution state in response to an termination signal that indicates the end of the main scene mode;
[0194] The module to be executed is used to control the target device to execute the conflicting instructions corresponding to the target device in the slave scene mode when the slave scene mode is in the slave scene mode.
[0195] Optionally, the device further includes:
[0196] The status acquisition module is used to acquire the scene device corresponding to the scene mode, the historical status of the scene device before executing the main scene mode, and the real-time status of the scene device after executing the main scene mode.
[0197] The interruption task determination module is used to determine whether there is an interruption task for the scene device based on the historical state and the real-time state.
[0198] The restart condition acquisition module is used to acquire the restart condition of the interrupted task if the interrupted task exists in the scene device.
[0199] The restart module is used to control the scene device to restart the interrupted task based on the real-time status and the restart conditions of the interrupted task.
[0200] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions for the method steps in this application.
[0201] This application provides one or more machine-readable media storing instructions that, when executed by one or more processors, cause an electronic device to perform one or more of the methods described in the above embodiments. In this application, the electronic device includes various types of devices such as terminal devices and servers (clusters).
[0202] The embodiments of this disclosure can be implemented as an apparatus configured as desired using any suitable hardware, firmware, software, or any combination thereof, including electronic devices such as terminal devices, servers (clusters), etc. Figure 4An exemplary apparatus 400 is schematically shown that can be used to implement the various embodiments described in this application.
[0203] In one embodiment, Figure 4 An exemplary device 400 is shown, which includes one or more processors 402, a control module (chipset) 404 coupled to at least one of the processors 402, a memory 406 coupled to the control module 404, a non-volatile memory (NVM) / storage device 408 coupled to the control module 404, one or more input / output devices 410 coupled to the control module 404, and a network interface 412 coupled to the control module 404.
[0204] Processor 402 may include one or more single-core or multi-core processors, and processor 402 may include any combination of general-purpose processors or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, device 400 can serve as a terminal device, server (cluster), or other device as described in the embodiments of this application.
[0205] In some embodiments, the apparatus 400 may include one or more computer-readable media (e.g., memory 406 or NVM / storage device 408) having instructions 414 and one or more processors 402 that are combined with the one or more computer-readable media and configured to execute the instructions 414 to implement the module and thus perform the actions described in this disclosure.
[0206] In one embodiment, the control module 404 may include any suitable interface controller to provide any suitable interface to at least one of the processors 402 and / or any suitable device or component communicating with the control module 404.
[0207] The control module 404 may include a memory controller module to provide an interface to the memory 406. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0208] Memory 406 may be used, for example, to load and store data and / or instructions 414 for device 400. In one embodiment, memory 406 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, memory 406 may include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).
[0209] In one embodiment, the control module 404 may include one or more input / output controllers to provide an interface to the NVM / storage device 408 and (one or more) input / output devices 410.
[0210] For example, NVM / storage device 408 may be used to store data and / or instructions 414. NVM / storage device 408 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable (one or more) non-volatile storage devices (e.g., one or more hard disk drives (HDDs), one or more optical disc drives (CDs), and / or one or more digital universal optical disc (DVD) drives).
[0211] NVM / storage device 408 may include storage resources that are physically part of a device on which device 400 is mounted, or that can be accessed by the device but do not necessarily have to be part of the device. For example, NVM / storage device 408 may be accessed via a network via one or more input / output devices 410.
[0212] One or more input / output devices 410 may provide an interface for device 400 to communicate with any other suitable device. Input / output devices 410 may include communication components, audio components, sensor components, etc. Network interface 412 may provide an interface for device 400 to communicate via one or more networks. Device 400 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, such as accessing wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, etc., or combinations thereof.
[0213] In one embodiment, at least one of the processors 402 may be logically packaged with one or more controllers (e.g., memory controller modules) of the control module 404. In one embodiment, at least one of the processors 402 may be logically packaged with one or more controllers of the control module 404 to form a system-in-package (SiP). In one embodiment, at least one of the processors 402 may be integrated with the logic of one or more controllers of the control module 404 on the same die. In one embodiment, at least one of the processors 402 may be integrated with the logic of one or more controllers of the control module 404 on the same die to form a system-on-a-chip (SoC).
[0214] In various embodiments, device 400 may be, but is not limited to, a server, desktop computing device, or mobile computing device (e.g., laptop, handheld computing device, tablet, netbook, etc.). In various embodiments, device 400 may have more or fewer components and / or different architectures. For example, in some embodiments, device 400 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touchscreen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0215] The detection device can use a main control chip as a processor or control module, and sensor data, position information, etc. can be stored in a memory or NVM / storage device. The sensor group can be used as an input / output device, and the communication interface can include a network interface.
[0216] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0217] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0218] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable scenario-based device control terminal device to produce a machine, such that the instructions, which execute via the computer or other programmable scenario-based device control terminal device processor, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0219] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable, scenario-modal-based device control terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0220] These computer program instructions can also be loaded onto a computer or other programmable, scenario-based device control terminal, causing a series of operational steps to be executed on the computer or other programmable terminal to produce a computer-implemented process. Thus, the instructions executing on the computer or other programmable terminal provide the means for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0221] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0222] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0223] The above provides a detailed description of a scene-based device control method and apparatus, an electronic device, and a storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A device control method based on scene patterns, characterized in that, The method includes: Acquire at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes; Based on the scene data corresponding to the target scene mode, determine the target device and the target control instructions corresponding to the target device in different target scene modes; the target device includes the same device that needs to be controlled in different target scene modes; Based on the target control commands corresponding to the target device in different target scenario modes, determine the conflicting commands of the target device in different target scenario modes; Based on the scene data corresponding to the target scene mode, a primary scene mode is determined from at least two target scene modes, and the target device is controlled to execute the conflict command corresponding to the target device in the primary scene mode.
2. The method according to claim 1, characterized in that, The acquisition of at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes includes: In response to a trigger signal used to characterize the triggering of a scene mode, the triggering time corresponding to the scene mode is determined; Based on the trigger time corresponding to the scene mode, at least two target scene modes that are triggered simultaneously are determined from among the multiple scene modes; Obtain the scene data corresponding to the target scene mode.
3. The method according to claim 2, characterized in that, Obtaining scene data corresponding to the target scene mode includes: Obtain the scene type label corresponding to the target scene mode; The priority of the target scene mode is determined in a first preset mapping table based on the scene type label corresponding to the target scene mode; the first preset mapping table includes a one-to-one mapping relationship between scene type labels and priorities. The scene device corresponding to the target scene mode is determined in a second preset mapping table; the second preset mapping table includes a one-to-one mapping relationship between scene modes and scene devices. The trigger time, priority, and scene device corresponding to the target scene mode are determined as the scene data corresponding to the target scene mode.
4. The method according to claim 1, characterized in that, The step of determining conflicting commands of the target device in different target scenario modes based on the target control commands corresponding to the target device in different target scenario modes includes: Obtain the control type corresponding to the target control command under different target scenario modes; Based on the control type corresponding to the target control command in different target scenario modes, determine whether there is a conflict between the target control commands corresponding to the target device in different target scenario modes; The conflicting control commands of the target device that conflict in different target scenario modes are identified as the conflicting commands.
5. The method according to claim 1, characterized in that, The scene data corresponding to the target scene mode includes the priority corresponding to the target scene mode. The step of determining the primary scene mode from at least two target scene modes based on the scene data corresponding to the target scene mode, and controlling the target device to execute the conflicting command corresponding to the target device in the primary scene mode, includes: Based on the priority corresponding to the target scene mode, a primary scene mode and a secondary scene mode are determined from at least two target scene modes; the priority corresponding to the primary scene mode is higher than the priority corresponding to the secondary scene mode. Control the target device to execute the conflict command corresponding to the target device in the main scene mode, and record the conflict command corresponding to the target device in the slave scene mode.
6. The method according to claim 1, characterized in that, The scene data corresponding to the target scene mode includes the trigger time and the scene device corresponding to the target scene mode. After acquiring at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes, the method further includes: Based on the scene devices corresponding to the target scene mode, non-conflicting devices are determined; the non-conflicting devices include different devices that need to be controlled under different target scene modes; Obtain the non-conflict control command corresponding to the non-conflict device in the target scene mode; Based on the trigger time corresponding to the target scene mode, control the non-conflict device to execute the non-conflict control command.
7. The method according to claim 5, characterized in that, The step of controlling the target device to execute the conflict command corresponding to the target device in the main scene mode includes: Based on the conflict command corresponding to the target device in the main scene mode, determine the control parameters of the target device; Based on the control parameters of the target device, control the target device to execute the conflict command corresponding to the target device in the main scene mode.
8. The method according to claim 5, characterized in that, After controlling the target device to execute the conflict command corresponding to the target device in the main scene mode and recording the conflict command corresponding to the target device in the slave scene mode, the method further includes: In response to an end signal used to characterize the end of the main scene mode, determine whether the secondary scene mode is in a pending execution state; When the slave scene mode is in the pending execution state, the target device is controlled to execute the conflicting instruction corresponding to the target device in the slave scene mode.
9. The method according to claim 1, characterized in that, After determining the primary scene mode from at least two target scene modes based on scene data corresponding to the target scene mode, and controlling the target device to execute the conflict command corresponding to the target device in the primary scene mode, the method further includes: Obtain the scene device corresponding to the scene mode, the historical state of the scene device before executing the main scene mode, and the real-time state of the scene device after executing the main scene mode; Based on the historical state and the real-time state, determine whether the scene device has an interrupted task; If the interrupted task exists in the scene device, then obtain the restart conditions for the interrupted task; Based on the real-time status and the restart conditions of the interrupted task, the scene device is controlled to restart the interrupted task.
10. A device control apparatus based on scene patterns, characterized in that, The device includes: The acquisition module is used to acquire at least two target scene modes that are triggered simultaneously and the scene data corresponding to the target scene modes; The target control instruction module is used to determine the target device and the target control instructions corresponding to the target device in different target scene modes based on the scene data corresponding to the target scene mode; the target device includes the same device that needs to be controlled in different target scene modes; The conflict instruction module is used to determine the conflict instructions that conflict between the target devices in different target scenario modes based on the target control instructions corresponding to the target devices in different target scenario modes. The control module is used to determine the main scene mode from at least two target scene modes based on the scene data corresponding to the target scene mode, and control the target device to execute the conflict command corresponding to the target device in the main scene mode.
11. An electronic device, characterized in that, include: processor; and A memory having executable code stored thereon, which, when executed, causes the processor to perform the scene-mode-based device control method as described in any one of claims 1-9.
12. One or more machine-readable media having executable code stored thereon, which, when executed, causes a processor to perform the scene-mode-based device control method as described in any one of claims 1-9.