Scene device control method and device, storage medium and electronic device

By finding and processing conflicting command pairs in the smart home system and determining their selectability, the problem of easy device control conflicts is solved, and the reliability of device control and user experience are improved.

CN115903617BActive Publication Date: 2025-09-30HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211641669.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2025-09-30
Estimated Expiration
2042-12-20

AI Technical Summary

Technical Problem

In the smart home scene device control method, device control is prone to conflicts, resulting in low reliability.

Method used

By searching for conflicting instruction pairs in the preset scene and the currently executed scene, it is determined whether the instruction identifier of each instruction is an optional instruction, and the preset scene is triggered when the permissible triggering conditions are met to avoid device control conflicts.

Benefits of technology

The reliability of device control is improved, the occurrence of device control conflicts is reduced, and the user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115903617B_ABST
    Figure CN115903617B_ABST
Patent Text Reader

Abstract

The present application discloses a scene device control method and device, a storage medium and an electronic device, relating to the field of smart home / intelligent home technology, wherein the above method includes: when a preset scene trigger condition is met, searching for a conflicting instruction pair from the preset scene and the currently executing scene, the conflicting instruction pair including a control instruction in the preset scene and a control instruction in the currently executing scene, which control a device operation executed by the same smart device and has a conflict; when a group of conflicting instruction pairs are found, determining the instruction identifier of each control instruction in each conflicting instruction pair respectively, the instruction identifier being used to identify whether the corresponding control instruction is an optional instruction in the scene; when it is determined based on the instruction identifier of each control instruction in each conflicting instruction pair that each conflicting instruction pair meets the triggering condition, triggering the preset scene, the triggering condition including that at least one control instruction in the conflicting instruction pair is an optional instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home / smart home, and specifically, to a scene device control method and device, a storage medium and an electronic device. Background Art

[0002] With the continuous improvement of the automation and intelligence level of smart home systems, the way to control smart home devices has evolved from users actively controlling individual smart home devices through apps (Applications) to smart home systems automatically triggering smart home scenarios based on user needs and actively providing personalized services to users.

[0003] In actual smart home applications, cloud platforms typically automatically trigger smart home scenarios based on preset trigger conditions, proactively providing services to users. However, when the cloud platform triggers multiple smart home scenarios within a short period of time, device control conflicts are likely to occur. These conflicts can lead to confusion in device control and reduce device control reliability.

[0004] It can be seen that the scene device control method in the related art has the problem of low reliability of device control due to the easy occurrence of conflicts in device control. Summary of the Invention

[0005] The embodiments of the present application provide a scene device control method and device, a storage medium, and an electronic device to at least solve the problem of low reliability of device control due to the easy occurrence of device control conflicts in the scene device control method in the related art.

[0006] According to one aspect of an embodiment of the present application, a scene device control method is provided, comprising: when a trigger condition of a preset scene is met, searching for a conflicting instruction pair from the preset scene and a currently executed scene, wherein the conflicting instruction pair includes a control instruction in the preset scene and a control instruction in the currently executed scene, which control device operations performed by the same smart device and which conflict with each other; when a group of the conflicting instruction pairs are found, determining the instruction identifier of each control instruction in each of the conflicting instruction pairs, respectively, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scene; when it is determined according to the instruction identifier of each control instruction in each of the conflicting instruction pairs that each of the conflicting instruction pairs meets an allowable triggering condition, triggering the preset scene, wherein the allowable triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction.

[0007] According to another aspect of an embodiment of the present application, a scene device control device is also provided, including: a search unit, for searching for conflicting instruction pairs from the preset scene and the currently executed scene when the trigger condition of the preset scene is met, wherein the conflicting instruction pair includes a control instruction in the preset scene and a control instruction in the currently executed scene that conflict with the device operation performed by the same smart device; a first determination unit, for determining the instruction identifier of each control instruction in each of the conflicting instruction pairs when a group of the conflicting instruction pairs is found, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scene; a triggering unit, for triggering the preset scene when it is determined according to the instruction identifier of each control instruction in each of the conflicting instruction pairs that each of the conflicting instruction pairs meets the triggering condition, wherein the triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction.

[0008] In an exemplary embodiment, the search unit includes: an execution module, which is used to traverse the scene list when the trigger condition of the preset scene is met, and use the traversed scene as the current scene to perform the following instruction matching operation, wherein the scene list is used to record the currently executing scene: searching for control instructions in the current scene that match each preset control instruction in the preset scene respectively, wherein the control instruction that matches each preset control instruction is the same control instruction in the current scene as the smart device controlled by each preset control instruction; when a control instruction that matches a candidate control instruction in the preset scene is found in the current scene, and there is a conflict between the device operation performed by the smart device controlled by the candidate control instruction and the device operation performed by the smart device controlled by the control instruction matching the candidate control instruction, the candidate control instruction and the control instruction that matches the candidate control instruction are determined as a conflicting instruction pair.

[0009] In an exemplary embodiment, the device further includes: an execution unit for, after determining the instruction identifier of each control instruction in each conflicting instruction pair respectively, performing the following instruction identification operation on each conflicting instruction pair as a current conflicting instruction pair, wherein the first control instruction in the current conflicting instruction pair belongs to the preset scene, and the second control instruction in the current conflicting instruction pair belongs to the target scene currently being executed: when the first control instruction is an optional instruction and the second control instruction is an optional instruction, determining that the current conflicting instruction pair meets the permissible triggering condition, wherein, when the preset scene is triggered, the first control instruction is executed; when the first control instruction is an optional instruction and the second control instruction is not an optional instruction, determining that the current conflicting instruction pair meets the permissible triggering condition, wherein, when the preset scene is triggered, the first control instruction is not executed; when the first control instruction is not an optional instruction and the second control instruction is an optional instruction, determining that the current conflicting instruction pair meets the permissible triggering condition, wherein, when the preset scene is triggered, the first control instruction is executed.

[0010] In an exemplary embodiment, the device also includes: a second determination unit, used to determine the scene level of the preset scene and the scene level of the target scene when neither the first control instruction nor the second control instruction is an optional instruction; a third determination unit, used to determine that the current conflicting instruction pair satisfies the allowable trigger condition when the scene level of the preset scene is higher than the scene level of the target scene, wherein the allowable trigger condition also includes: the scene level of the preset scene in the conflicting instruction pair is higher than the scene level of the currently executing scene.

[0011] In an exemplary embodiment, the device further includes: a stopping unit for stopping triggering the preset scene if the scene level of the preset scene is not higher than the scene level of the target scene after determining the scene level of the preset scene and the scene level of the target scene.

[0012] In an exemplary embodiment, the search unit includes: a first search module, which is used to search for a reference scene in the currently executing scene whose scene level is higher than or equal to the preset scene when the trigger condition of the preset scene is met; and a second search module, which is used to search for the conflicting instruction pair from the preset scene and the group of reference scenes when a group of reference scenes is found.

[0013] In an exemplary embodiment, the device further includes: an acquisition unit for acquiring detection data reported by at least one smart device after triggering the preset scene, wherein the detection data is used to represent the object state of the target object; and an ending unit for ending the preset scene when it is determined that the ending condition of the preset scene is met based on the object state of the target object.

[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned scene device control method when running.

[0015] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the scene device control method through the computer program.

[0016] In an embodiment of the present application, a method is adopted in which conflicting instruction pairs between the scene to be triggered and the scene being executed are determined, and whether the instruction identifier corresponding to each conflicting instruction pair in the scene is an optional instruction is determined to determine whether the triggering of the scene to be triggered is allowed. When the triggering condition of the preset scene is met, conflicting instruction pairs are searched from the preset scene and the currently executing scene, wherein the conflicting instruction pairs include a control instruction in the preset scene and a control instruction in the currently executing scene that conflict with the device operation executed by the same smart device; when a group of conflicting instruction pairs is found, the instruction identifier of each control instruction in each conflicting instruction pair is determined, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scene; and when the conflicting instruction pairs are determined according to the conditions of each control instruction in each conflicting instruction pair, the conflicting instruction pair is searched from the preset scene and the currently executing scene. When the instruction identifier of the command determines that each conflicting instruction pair meets the triggering condition, the preset scene is triggered, wherein the triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction. When the scene triggering condition is met, the conflicting instruction pair of the scene to be triggered and the scene being executed is determined, and it is determined whether the instruction identifier corresponding to each conflicting instruction pair in the scene is an optional instruction. If at least one of them is an optional instruction, it means that the conflicting instruction pair can not be executed at the same time, and the triggering of the scene to be triggered will not cause a device control conflict. The triggering of the scene to be triggered is allowed, which can achieve the purpose of reducing the conflict of device control and achieve the technical effect of improving the reliability of device control, thereby solving the problem of low reliability of device control due to the easy occurrence of conflicts in device control in the scene device control method in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0019] Figure 1 Schematic diagram of a hardware environment for a scene device control method according to an embodiment of the present application;

[0020] Figure 2 is a flowchart of an optional scene device control method according to an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of a smart home device control method according to an embodiment of the present application;

[0022] Figure 4 is a flowchart of another optional scene device control method according to an embodiment of the present application;

[0023] Figure 5 is a structural block diagram of an optional scene device control device according to an embodiment of the present application;

[0024] Figure 6 This is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] According to one aspect of the embodiment of the present application, a scene device control method is provided. The scene device control method is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above scene device control method can be applied to Figure 1 In the hardware environment shown in FIG. 1 , which is composed of a terminal device 102 and a server 104. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as control services, etc.) for the terminal or the client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. A data matching service can be configured on the server or independently of the server to provide data matching services for the server 104.

[0028] The aforementioned network may include, but is not limited to, at least one of the following: a wired network and a wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth. The terminal device 102 may be, but is not limited to, a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing machine, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, smart curtains, smart audio and video, a smart socket, a smart speaker, a smart fresh air device, smart kitchen and bathroom equipment, smart bathroom equipment, smart lighting equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purifier, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0029] The scene device control method of the embodiment of the present application can be executed by the server 104, or by the terminal device 102, or jointly by the server 104 and the terminal device 102. The scene device control method of the embodiment of the present application can also be executed by the client installed on the terminal device 102.

[0030] Taking the cloud platform (an example of the server 104) as an example to execute the scene device control method in this embodiment, Figure 2 is a flow chart of an optional scene device control method according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:

[0031] Step S202: When the trigger condition of the preset scene is met, a conflicting instruction pair is searched from the preset scene and the currently executing scene, wherein the conflicting instruction pair includes a control instruction in the preset scene and a control instruction in the currently executing scene that conflict with the device operation executed by the same smart device.

[0032] The scene device control method of this embodiment can be applied to the scenario of controlling smart devices. The smart device here can be capable of interacting with other devices through a preset communication method, thereby being able to perform corresponding device operations based on the control instructions obtained. Among them, the smart device can be a smart home device, such as a smart lighting device, a smart speaker, a smart air conditioner, etc., or other types of smart devices, which are not limited in this embodiment.

[0033] Taking smart home devices as an example, in the actual application of smart home, such as Figure 3 As shown in the figure, smart home devices can be controlled in the following two ways: small loop, the smart terminal controls the smart home devices through the home smart gateway in the home domain network; large loop, first, the smart terminal sends the application instructions to the cloud platform (the cloud platform in the smart home system) through the mobile Internet; then, the cloud platform forwards the application instructions to the connected home smart gateway through the mobile Internet, thereby realizing the control of the smart home devices.

[0034] In related technologies, there are two ways to determine the target smart home devices and functions that users want to operate based on their needs:

[0035] Method 1: The user actively sends a control command, which clearly specifies the smart home device and specific function to be operated. After receiving the command, the cloud platform can directly analyze the target smart home device and function.

[0036] Method 2: The user's control command doesn't explicitly specify the desired smart home device or function, or the user doesn't actively send the command. Instead, the cloud platform infers the user's needs based on pre-set logic. In this case, the cloud platform needs to analyze the user's needs based on the device model to identify the smart home device and its specific functions that can provide the user's desired service. Therefore, the control methods for smart home devices in related technologies suffer from a low level of automation and intelligence.

[0037] In order to at least partially solve the above problems, a device control method based on smart home scenarios can be adopted. Smart home scenarios can be pre-configured. Smart home scenarios can be automatically triggered based on the information detected by the detection device (for example, user status, device status, environmental status, etc.) and combined with other information (for example, time and other factors), and actively provide services to users without the need for active user participation. Therefore, the degree of automation and intelligence of device control can be improved.

[0038] Smart home scenarios can be designed for specific occasions or user needs within a home environment, such as sleeping or reading. Each smart home scenario contains several device control instructions. When a smart home scenario is triggered, these instructions are issued to the corresponding smart home devices. As shown in Table 1, the definition of a smart home scenario can include the scenario name, trigger conditions (i.e., automatic trigger conditions), and device control instructions.

[0039] Table 1

[0040]

[0041] The triggering conditions of a smart home scene describe the conditions required to automatically trigger the smart home scene, and may include but are not limited to at least one of the following: user status, environmental factors, time, etc. The device control instructions in a smart home scene include device control instructions for one or more smart home devices corresponding to the smart home scene.

[0042] Smart home application scenarios are typically automatically triggered by the cloud platform based on user status, device status, time, and environmental factors. However, when the cloud platform triggers multiple smart home scenarios within a short period of time, device control conflicts are likely to occur. For example, if a reading scenario requires lights to be on while a sleeping scenario requires them to be off, this conflict can lead to device control confusion and severely impact the user experience.

[0043] In order to at least partially solve the above technical problems, in this embodiment, an instruction identifier is added to the device control instruction in the scene to identify whether the control instruction is an optional instruction in the scene (that is, whether the device control instruction can be executed when the scene is executed. If it can be executed, it is an optional instruction. If it must be executed, it is not an optional instruction, that is, a mandatory instruction); when a new scene needs to be triggered, by determining the device control instruction that conflicts with the new scene to be triggered and the scene being executed, and determining whether to allow the new scene to be triggered based on whether the instruction identifier of the conflicting device control instruction is an optional instruction, the device control conflict introduced by the automatic triggering of the scene can be avoided, thereby improving the user experience.

[0044] For example, a "mandatory / optional" flag may be added to each device control instruction included in the scene, as shown in Table 2, to indicate whether the control instruction is optional or mandatory for the corresponding smart home scene.

[0045] Table 2

[0046]

[0047] Taking the sleeping scene as an example, "turn off bedroom lighting" is a required option, while "play sleep-aid music" is an optional option.

[0048] In this embodiment, a group of scenes (for example, smart home scenes) can be configured for a specified object or object group (for example, a user's home), and each scene has a corresponding trigger condition. When the trigger condition of the preset scene is met, it can be determined whether there is a currently executed scene in a group of scenes. If not, the preset scene can be triggered directly. If it exists, based on the device control instructions in the device scene and the device control instructions of the currently executed scene, conflicting instruction pairs can be found from the preset scenes and the currently executed scenes. Whether the trigger condition of the preset scene is met can be determined by the cloud platform or by the relevant smart device. After the relevant smart device determines that the trigger condition of the preset scene is met, it can be reported to the cloud platform. The conflicting instruction pair contains two device control instructions, one of which belongs to the preset scene and the other belongs to a scene that is currently being executed, and the two device control instructions control the same smart device, and there is a conflict in the device operations that control the smart device.

[0049] For example, see Table 2. When user A enters the bedroom and begins reading, the cloud platform determines that the trigger conditions for the "reading" scene are met based on the status data of user A reported by the smart device. The cloud platform can determine whether any of the currently executing scenes involve the bedroom lighting and background music system of the "reading" scene, and whether the operations for controlling the lighting equipment or background music system conflict with the operations for controlling the lighting equipment or background music system in the "reading" scene. If a device control instruction in a currently executing scene conflicts with a device control instruction in the "reading" scene, the two constitute a conflicting instruction pair.

[0050] Step S204 : when a group of conflicting instruction pairs are found, the instruction identifier of each control instruction in each conflicting instruction pair is determined respectively, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scene.

[0051] For a set of conflicting instruction pairs found, the instruction identifier of each control instruction in each conflicting instruction pair can be determined separately. As mentioned above, the instruction identifier of a control instruction can be used to indicate whether the control instruction is an optional instruction for the smart home scene to which it belongs. The instruction identifier can be pre-set, and it can be a corresponding text, identifier, or other form.

[0052] For example, the "Required / Optional" in Table 2 is a command identifier. If a control command's command identifier is "Required," it is not an optional command for the corresponding scene. If a control command's command identifier is "Optional," it is an optional command for the corresponding scene. Taking the sleep scene as an example, "Turn off bedroom lighting" is a required option and is not an optional command for the sleep scene, while "Play sleep-inducing music" is an optional option and is an optional command for the sleep scene.

[0053] Step S206 : triggering a preset scenario when it is determined based on the instruction identifier of each control instruction in each conflicting instruction pair that each conflicting instruction pair satisfies a triggering condition, wherein the triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction.

[0054] To ensure that a new scene to be triggered can be triggered even when a conflicting instruction pair exists, triggering conditions can be pre-set. These conditions can include one or more conditions. For example, at least one of the control instructions in the conflicting instruction pair can be an optional instruction. Other conditions can also be included. For example, when both control instructions in the conflicting instruction pair are not optional instructions, other conditions that allow the new scene to be triggered can be included. These conditions include conditions associated with the scene level, conditions associated with the object that sets or triggers the scene, etc. This embodiment does not limit these conditions.

[0055] If, based on the instruction identifier of each control instruction in each conflicting instruction pair, it is determined that at least one of the control instructions in each conflicting instruction pair is an optional instruction, triggering of the preset scenario is permitted. If, in a conflicting instruction pair, both control instructions are not optional instructions, it can be determined whether the conflicting instruction pair satisfies other conditions in the triggering permission conditions. If the triggering permission conditions do not include the other conditions, triggering of the preset scenario is not permitted. Here, the other conditions and the fact that at least one control instruction in the conflicting instruction pair is an optional instruction can be parallel conditions, that is, satisfying any one of them will determine that triggering of the scenario is permitted.

[0056] For example, the "reading" scene and the "cooking" scene both involve the background music system. When the currently executing scene is the reading scene and the new scene to be triggered is the cooking scene, the background music system is playing the user's favorite music. In the cooking scene to be triggered, the control instruction content of the background music system is to play cheerful music. Through query, it can be determined that playing the user's favorite music is an optional instruction in the currently executing reading scene, and playing cheerful music is also an optional instruction in the cooking scene to be triggered. If the triggering condition that at least one of the two control instructions in the conflicting instruction pair is an optional instruction is met, it is determined that the cooking scene is allowed to be triggered.

[0057] Through the above steps S202 to S206, when the trigger condition of the preset scene is met, conflicting instruction pairs are searched from the preset scene and the currently executing scene, wherein the conflicting instruction pairs include a control instruction in the preset scene and a control instruction in the currently executing scene, which are in conflict with the device operations performed by the same smart device; when a group of conflicting instruction pairs are found, the instruction identifier of each control instruction in each conflicting instruction pair is determined respectively, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scene where it is located; when it is determined according to the instruction identifier of each control instruction in each conflicting instruction pair that each conflicting instruction pair meets the triggering condition, the preset scene is triggered, wherein the triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction, thereby solving the problem of low reliability of device control due to the easy occurrence of conflicts in device control in the scene device control method in the related art, thereby improving the reliability of device control.

[0058] In an exemplary embodiment, in order to facilitate the determination of the currently executing scene, the currently executing scene can be recorded in a scene list. The currently executing scene can be recorded in the scene list in the form of a scene identifier. Through the scene identifier, the complete scene information can be matched from the scene configuration information shown in Table 2. The scene list can also record the currently executing scene in the form of complete scene information. Correspondingly, when the trigger condition of the preset scene is met, the conflicting instruction pair is searched from the preset scene and the currently executing scene, including:

[0059] S11: When the triggering conditions of the preset scene are met, the scene list is traversed and the traversed scene is used as the current scene to perform the following instruction matching operations:

[0060] Searching for control instructions in the current scene that match each preset control instruction in the preset scene, respectively, wherein the control instruction that matches each preset control instruction is the same control instruction as the smart device controlled by each preset control instruction in the current scene;

[0061] When a control instruction that matches a candidate control instruction in a preset scene is found in the current scene, and there is a conflict between the device operation performed by the smart device controlled by the candidate control instruction and the device operation performed by the smart device controlled by the control instruction that matches the candidate control instruction, the candidate control instruction and the control instruction that matches the candidate control instruction are determined as a conflicting instruction pair.

[0062] When the trigger conditions of the preset scene are met, the cloud platform can traverse the scene list and perform instruction matching operations on each traversed scene as the current scene. The smart devices controlled by each control instruction in the preset scene are matched with the smart devices controlled by each control instruction in the current scene, and the control instructions that match each preset control instruction in the preset scene are determined, that is, the control instructions that are the same as the smart devices controlled by each preset control instruction in the current scene. For example, the device control instruction "turn on the lighting equipment in the user's room" in the "Reading" scene and the device control instruction "turn off the room lighting equipment" in the "Sleeping" scene both control lighting equipment, and the two are matching control instructions.

[0063] If a preset control instruction has a matching control instruction, it can be selected as a candidate control instruction to further determine whether there is a device control conflict between the control instruction and the matching control instruction. If the device operation of the smart device controlled by the candidate control instruction conflicts with the device operation controlled by the matching control instruction, the candidate control instruction and the matching control instruction are determined to be a conflicting instruction pair.

[0064] By searching for each currently executed scene in the scene list in sequence, it is possible to determine the control instruction pairs that have device control conflicts between the preset scene and each currently executed scene, thereby obtaining the above-mentioned set of conflicting instruction pairs.

[0065] For example, the cloud platform can also maintain a scene list that stores currently executing scenes, as well as the device control instructions and identifiers issued for each scene. Suppose that no one is home, and the away scene is in progress. Then, users A and B return home, and user A goes into the bedroom to read. Later, user B goes into the bedroom to sleep. The following describes the control process for the "Reading" and "Sleeping" scenes involved.

[0066] When user A enters the bedroom and begins reading, the cloud platform determines that the trigger conditions for the "Reading" scene have been met based on the status data reported by the smart device. The cloud platform then searches the scene list and, if it finds no bedroom lighting or background music system that involves the "Reading" scene in the currently executing scene, it executes the "Reading" scene, sends control commands to the bedroom lighting and background music system, and adds the "Reading" scene to the scene list.

[0067] While user A is reading, user B enters the bedroom to prepare for bed. Based on the status data reported by user B's smart device, the cloud platform determines that the trigger conditions for the "Sleep" scene are met. The cloud platform traverses the scene list and finds that both the "Reading" and "Sleep" scenes involve bedroom lighting and background music. This means that the two scenes have two conflicting instruction pairs.

[0068] Through this embodiment, the currently executing scene is recorded through a scene list, and by first searching for control instructions that control the same smart device, and then searching for conflicting instruction pairs based on whether there is a conflict in the device operations that control the same device, the convenience and comprehensiveness of searching for conflicting instruction pairs can be improved.

[0069] In an exemplary embodiment, after respectively determining the instruction identifier of each control instruction in each conflicting instruction pair, the method further includes:

[0070] S21, performing the following instruction recognition operation on each conflicting instruction pair as a current conflicting instruction pair, wherein the first control instruction in the current conflicting instruction pair belongs to a preset scenario, and the second control instruction in the current conflicting instruction pair belongs to a target scenario currently being executed:

[0071] In a case where the first control instruction is an optional instruction and the second control instruction is an optional instruction, determining whether the current conflicting instruction pair meets a triggering condition, wherein the first control instruction is executed when the preset scenario is triggered;

[0072] If the first control instruction is an optional instruction and the second control instruction is not an optional instruction, determining whether the current conflicting instruction pair meets a triggering condition, wherein the first control instruction is not executed when the preset scenario is triggered;

[0073] When the first control instruction is not an optional instruction and the second control instruction is an optional instruction, it is determined that the current conflicting instruction pair meets the triggering condition, wherein when the preset scenario is triggered, the first control instruction is executed.

[0074] After determining the instruction identifier of each control instruction in each conflicting instruction pair, an instruction identification operation is performed on each conflicting instruction pair as the current conflicting instruction pair to identify whether the conflicting instruction pair meets the triggering conditions. Here, the instruction identifier can be used to indicate whether the corresponding control instruction must be executed in the scenario to which it belongs. Based on the instruction identifier of a device control execution, it can be determined whether the control execution is an optional instruction or not. For the current conflicting instruction pair, the control instruction belonging to the preset scenario is the first control instruction, and the control instruction belonging to the target scenario currently being executed is the second control instruction.

[0075] If both the first control and the second control instructions are optional instructions, it is determined that the current conflicting instruction pair meets the triggering condition. In this case, if the preset scene is finally triggered, the first control instruction will be executed. At this time, the executed second control instruction will no longer be executed. For example, the scene to be triggered is the "sleep" scene (for example, the "sleep" scene triggered by user B), and the scene currently being executed includes the "reading" scene (for example, the "reading" scene triggered by user A). See Table 2. Both the "sleep" scene and the "reading" scene contain device control instructions for controlling the background music system, and there is an operation conflict. When processing the operation conflict of the background music system, through query, it is found that "the background music system plays the user's favorite music" and "the background music system plays sleep-inducing music" are optional instructions for their respective scenes. This conflicting instruction pair meets the triggering condition. If the "sleep" scene is finally triggered, the device control instruction "the background music system plays sleep-inducing music" will be executed.

[0076] If the first control instruction is an optional instruction and the second control instruction is not an optional instruction, it is determined that the current conflicting instruction pair meets the triggering condition. In this case, if the preset scene is finally triggered, the first control instruction will not be executed. For example, the scene to be triggered is the "movie watching" scene, and the scene currently being executed includes the "reading" scene. As shown in Table 2, the "movie watching" scene and the "reading" scene both contain device control instructions for controlling lighting devices. The device control instruction for controlling the lighting devices in the "movie watching" scene, "turn off the lighting devices in the user's room", is an optional instruction. The device control instruction for controlling the lighting devices in the "reading" scene, "turn on the lighting devices in the user's room", is not an optional instruction. This conflicting instruction pair meets the triggering condition. If the "movie watching" scene is finally triggered, the device control instruction "turn off the lighting devices in the user's room" will not be executed.

[0077] If the first control instruction is not an optional instruction and the second control instruction is an optional instruction, it is determined that the current conflicting instruction pair meets the triggering condition. In this case, if the preset scene is finally triggered, the first control instruction will be executed. For example, the scene to be triggered is the "reading" scene, and the scene currently being executed includes the "movie watching" scene. As shown in Table 2, the "reading" scene and the "movie watching" scene both contain device control instructions for controlling lighting devices. The device control instruction for controlling the lighting devices in the "reading" scene, "turn on the lighting devices in the user's room," is not an optional instruction. The device control instruction for controlling the lighting devices in the "movie watching" scene, "turn off the lighting devices in the user's room," is an optional instruction. This conflicting instruction pair meets the triggering condition. If the "reading" scene is finally triggered, the device control instruction "turn on the lighting devices in the user's room" will be executed.

[0078] Through this embodiment, whether the control instruction in the conflicting instruction pair belonging to the to-be-triggered scene is executed when the to-be-triggered scene is triggered is determined based on whether the control instruction in the conflicting instruction pair is an optional instruction, thereby improving the reliability of scene device control.

[0079] In an exemplary embodiment, the method further includes:

[0080] S31, when neither the first control instruction nor the second control instruction is an optional instruction, determining a scene level of a preset scene and a scene level of a target scene;

[0081] S32, when the scene level of the preset scene is higher than the scene level of the target scene, determine that the current conflict instruction pair meets the triggering condition, wherein the triggering condition also includes: the scene level of the preset scene in the conflict instruction pair is higher than the scene level of the currently executing scene.

[0082] If neither of the two control instructions in a conflicting instruction pair is an optional instruction for the scene to which they belong, it can be directly determined that the conflicting instruction pair does not meet the triggering conditions. That is, the triggering conditions do not include other conditions. To increase the flexibility of scene control, different scene levels can be configured. When neither of the two control instructions in the conflicting instruction pair is an optional instruction for the scene to which they belong, the triggering condition is further determined based on the scene level. That is, the triggering condition also includes: the scene level of the preset scene in the conflicting instruction pair is higher than the scene level of the currently executing scene.

[0083] For example, as shown in Table 3, a new scenario "level" can be added to distinguish the importance of scenarios in family life. It can be divided into two levels: basic and ordinary, with "basic" being the higher level. Among them, "basic" level scenarios are related to users' basic life needs, such as leaving home, sleeping, and bathing, while "ordinary" level scenarios are related to users' non-basic life needs, such as reading, fitness, and watching movies.

[0084] Table 3

[0085]

[0086] For the current conflicting command pair, if the scene level of the preset scene is higher than the scene level of the target scene, it can be determined that the current conflicting command pair meets the triggering permission condition. In this case, it can be considered that the preset scene is triggerable based on the current conflicting command pair. If the preset scene is triggerable based on all conflicting command pairs, the preset scene can be triggered.

[0087] For example, the scene to be triggered is the "sleep" scene (for example, the "sleep" scene triggered by user B), and the scene currently being executed includes the "reading" scene (for example, the "reading" scene triggered by user A). See Table 4. Both the "sleep" scene and the "reading" scene contain device control instructions for controlling lighting equipment, and there is an operation conflict.

[0088] Table 4

[0089]

[0090] The query reveals that both "Turn on bedroom lighting" and "Turn off bedroom lighting" are required for their respective scenarios. The levels of the "Reading" and "Sleeping" scenarios are then compared. Since the "Sleeping" scenario's level (basic level) is higher than the "Reading" scenario's level (normal level), the "Sleeping" scenario is determined to be triggerable (i.e., the triggering conditions are met). When the "Sleeping" scenario is finally triggered, the "Turn off bedroom lighting" action is executed.

[0091] Based on the conflict determination results of the control commands of various devices, the cloud platform finally determines to trigger the "sleep" scene and executes the "sleep" scene. That is, it executes the operations of "turning off the bedroom lighting equipment" and "playing sleep-aid music on the background music system", sends control commands to the bedroom lighting equipment and background music system respectively, and adds the "sleep" scene and the two control commands actually issued to the scene list.

[0092] Through this embodiment, when it is identified that neither of the two control instructions in the conflicting instruction pair is an optional instruction, whether to allow triggering the to-be-triggered scene is allowed is determined based on the scene level, which can improve the flexibility of scene triggering.

[0093] In an exemplary embodiment, after determining the scene level of the preset scene and the scene level of the target scene, the method further includes:

[0094] S41 : When the scene level of the preset scene is not higher than the scene level of the target scene, stop triggering the preset scene.

[0095] If the scene level of the preset scene is compared with the scene level of the target scene and it is determined that the scene level of the preset scene is the same as the scene level of the target scene, or the scene level of the preset scene is lower than the scene level of the target scene, then triggering the preset scene will cause the device control instructions in the currently executing scene of the same or higher level to fail to execute normally, which may affect the user's experience of scene control. In this case, the triggering of the preset scene can be stopped, that is, the preset scene is not triggered.

[0096] Optionally, when the scene level of the preset scene is not higher than the scene level of the target scene, a prompt message may be sent to the designated terminal device to prompt whether to allow the preset scene to be triggered. Whether to trigger the preset scene may be determined based on whether the scene trigger indication information returned by the designated terminal device can be obtained and the scene trigger indication in the obtained scene trigger indication information. If the scene trigger indication information is received and the scene trigger indication information indicates that the preset scene is allowed to be triggered, the preset scene may be triggered. If the scene trigger indication information is received and the scene trigger indication information indicates that the preset scene is not allowed to be triggered, or if the scene trigger indication information returned by the designated terminal device is not received within a preset time, the preset scene will not be triggered.

[0097] It should be noted that if any conflicting command pair is determined not to meet the triggering conditions, the preset scene may be directly determined not to be triggered, and the command recognition operation for subsequent conflicting command pairs will not be performed. For example, if there are five conflicting command pairs between the to-be-triggered scene and the currently executing scene, if the second conflicting command pair is determined not to meet the triggering conditions, the command recognition operation will not be performed for the next three conflicting command pairs.

[0098] Optionally, in order to improve the sales volume of instruction matching operation execution, it is possible to determine whether each conflicting instruction pair meets the triggering conditions according to the scenario to which the currently executed control instruction belongs in a set of conflicting instruction pairs, wherein the conflicting instruction pairs containing two control instructions that belong to the same scenario to which the currently executed control instruction belongs are executed one after another.

[0099] Through this embodiment, the two control instructions in the conflicting instruction pair are not optional instructions for the scenes they belong to, and the level of the scene to be triggered is not higher than the level of the scene currently being executed. Stopping the triggering of the scene to be triggered can improve the reliability of scene device control; at the same time, it can reduce the consumption of computing resources.

[0100] In an exemplary embodiment, when a trigger condition of a preset scenario is met, searching for conflicting instruction pairs from the preset scenario and the currently executed scenario includes:

[0101] S51, when the trigger condition of the preset scene is met, searching for a reference scene in the currently executing scene whose scene level is higher than or equal to the preset scene;

[0102] S52 : When a group of reference scenes is found, searching for conflicting instruction pairs from the preset scenes and the group of reference scenes.

[0103] In this embodiment, whether to trigger a preset scene can be determined based on the scene level of the preset scene and the scene level of the currently executing scene. For example, if the triggering condition of the preset scene is met, a scene with a scene level higher than or equal to the preset scene is searched in the currently executing scene; if a scene with a scene level higher than or equal to the preset scene is found, triggering of the preset scene is stopped; if no scene with a scene level higher than or equal to the preset scene is found, the preset scene is triggered.

[0104] Optionally, it is also possible to determine whether to trigger a preset scene based on the scene level combined with the instruction identifier of the control instruction. When the triggering condition of the preset scene is met, you can first search for a reference scene with a scene level higher than or equal to the preset scene in the currently executing scene. If no reference scene with a scene level higher than or equal to the preset scene is found, you can directly trigger the preset scene. If a group of reference scenes is found, you can search for conflicting instruction pairs between the preset scene and each reference scene in the group of reference scenes respectively. The method of searching for conflicting instruction pairs is similar to that in the aforementioned embodiment and will not be repeated here.

[0105] Through this embodiment, by first searching for a currently executing scene whose scene level is higher than or the same as the scene to be triggered, and then searching for the conflicting instruction pair after finding the scene, the flexibility of scene triggering can be improved. Compared with first searching for the conflicting instruction pair and then determining whether to trigger the scene to be triggered based on the scene level, the sales of scene triggering can be improved.

[0106] In an exemplary embodiment, after triggering the preset scenario, the method further includes:

[0107] S61, acquiring detection data reported by at least one smart device, wherein the detection data is used to represent an object state of a target object;

[0108] S62: When it is determined according to the object state of the target object that the end condition of the preset scene is satisfied, end the preset scene.

[0109] In this embodiment, each scenario can also be configured with a corresponding end condition. That is, when a scenario's end condition is met, the scenario automatically ends. For example, as shown in Table 5, a new "exit condition" (i.e., end condition) can be added to the scenario to describe the conditions required to end the scenario. When the "exit condition" is met, the scenario will no longer be executed.

[0110] Table 5

[0111]

[0112] Exemplarily, the scenarios configured by the scenario configuration information may be as shown in Table 6.

[0113] Table 6

[0114]

[0115] When users A and B return home, smart devices (door locks, cameras, etc.) detect that someone is at home and report it to the cloud platform. The cloud platform determines that the exit conditions for the "Leaving Home" scene are met and removes the scene from the scene list.

[0116] After the preset scene is triggered, detection data indicating the object state of the target object reported by at least one smart device can be obtained. The target object can be a user, and the object state can be reading, sleeping, away from home, etc. In addition, it can also be used to indicate the environmental state within the detection area of ​​the smart device. If the end condition (i.e., exit condition) of the preset scene is determined to be satisfied based on the object state of the target object, the preset scene can be ended (i.e., exited). Here, in addition to the object state of the target object, the end condition of the preset scene can also be a condition related to the environmental state, time, etc. When the preset scene is ended, the corresponding smart device can be controlled in the opposite direction to the device operation indicated by the device control instruction in the preset scene.

[0117] Optionally, if when a preset scene is triggered, some control instructions in the currently executing scene are stopped due to a device control conflict with the control instructions in the preset scene, the preset scene can be ended and the stopped control instructions can be re-executed if the end condition of the preset scene is met.

[0118] According to this embodiment, by configuring the exit conditions of the scene, the scene is automatically exited when the exit conditions of the scene are met, thereby improving the flexibility of scene control.

[0119] The following describes the scene device control method in this embodiment with reference to an optional example. In this optional example, the server is a cloud platform (which can be a cloud platform in a smart home scenario), the scenario is a smart home scenario, the instruction is marked with a "required / optional" mark, and the scenario levels include basic and normal.

[0120] Regarding the automatic triggering strategy in smart home scenarios, this optional example provides a control conflict solution for smart home scenarios, defines different levels for smart home scenarios, and also adds "required / optional" identification for the device control instructions contained in the scenarios; when a new scene needs to be triggered, by comparing the levels and device control instruction identifications of the new scene and the existing scene, it is determined whether to trigger the new scene, as well as how to handle conflicts for each group of control instructions. This takes into account both the importance of the smart home scene itself and the necessity of the device control instructions contained in the scene, and can effectively solve the device control conflict problem during the automatic triggering of the smart home scene, thereby improving the user experience.

[0121] like Figure 4 As shown, the process of the scene device control method in this optional example may include the following steps:

[0122] Step 0: Predefine the scene level and exit conditions, add "mandatory / optional" marks to the device control instructions in the scene, and maintain the scene list on the cloud platform.

[0123] Step 1: The cloud platform determines whether the triggering conditions of the new scenario Sn are met.

[0124] In step 2, the cloud platform traverses the scene list and checks whether there is a target device (hereinafter referred to as the "target device") controlled by a control instruction in the currently executing scene (i.e., the existing scene) that is the same as the target device controlled by a control instruction in the new scene Sn. If not, jump to step 5; otherwise, proceed to step 3.

[0125] Step 3: For situations where the control instructions of the existing scene and the new scene Sn control the same device, determine whether there is a conflict between the control instructions of the existing scene and the new scene Sn for the target device. If not, jump to step 5; otherwise, proceed to step 4.

[0126] Step 4: If there is a conflict between the control instructions of the existing scene and the new scene Sn for the same device, handle it according to the following rules:

[0127] In step 4-1, if there is a conflict between a single device control instruction Oc of a single existing scene Sc and a device control instruction On of a new scene Sn, the "mandatory / optional" flags of the two instructions in their respective scenes are compared.

[0128] If Oc and On are both required for their respective scenarios, it is necessary to further compare the scene levels of scene Sc and the new scene Sn. If the level of the new scene Sn is higher, it is determined that the new scene Sn can be triggered, and the control instruction On is issued, and step 5 is executed; otherwise, it is determined that the new scene Sn is not triggered, and jump to step 6.

[0129] If Oc and On are both optional for their respective scenarios, it is determined that the new scenario Sn can be triggered and the control instruction On is issued, and step 5 is executed; otherwise, it is determined that the new scenario Sn can be triggered and the required control instructions in Oc and On are issued, and step 5 is executed.

[0130] In step 4-2, if there are k existing scenarios Sm (m = 1, 2, 3, ..., k), and each scenario has a single device control instruction Om (m = 1, 2, 3, ..., k) that conflicts with a device control instruction Oj (i = 1, 2, 3, ..., k) of the new scenario Sn, then the conflict is determined according to step 4-1 for each existing scenario and the new scenario Sn. If each conflict is determined to trigger the new scenario Sn, the new scenario Sn is ultimately determined to be triggered, and step 5 is executed. Otherwise, the new scenario Sn is determined not to be triggered, and the process proceeds to step 6.

[0131] In step 4-3, if there is a conflict between the p device control instructions Om (m = 1, 2, 3, ..., p) of a single existing scene Sc and the p device control instructions Oj (i = 1, 2, 3, ..., p) of Sn, then a determination is made according to step 4-1 for each set of conflicting control instructions. If all conflicting control instructions are determined to trigger the new scene Sn, then the new scene Sn is ultimately determined to be triggered, and step 5 is executed. Otherwise, the new scene Sn is determined not to be triggered, and the process jumps to step 6.

[0132] In step 5, the cloud platform triggers the new scene Sn, issues the control instructions determined to be executed in the new scene Sn, and writes the new scene Sn and the control instructions actually issued into the scene list.

[0133] Step 6: The cloud platform does not trigger the new scene Sn, and the process ends.

[0134] Through this embodiment, smart home scenes and the device control instructions contained in each scene are defined as different levels according to their importance; when a new scene needs to be triggered, by comparing the levels of the conflicting device control instructions (i.e., optional, mandatory) and the levels of the new scene and the existing scene, it is determined whether to trigger the new scene and how to handle each set of conflicting instructions. This can effectively resolve the device control conflicts introduced by automatically triggering scenes and improve the user experience.

[0135] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory, Read-Only Memory) / RAM (Random Access Memory, Random Access Memory), a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0137] According to another aspect of an embodiment of the present application, a scene device control apparatus for implementing the above-mentioned scene device control method is also provided. The scene device control apparatus can be applied to a smart device. Figure 5 This is a structural block diagram of an optional scene device control device according to an embodiment of the present application, such as Figure 5 As shown, the device may include:

[0138] A searching unit 502 is configured to search for conflicting instruction pairs from the preset scenario and the currently executing scenario when a trigger condition of the preset scenario is satisfied, wherein the conflicting instruction pair includes a control instruction from the preset scenario and a control instruction from the currently executing scenario that conflict with device operations executed by the same smart device;

[0139] A first determining unit 504, connected to the searching unit 502, is configured to, when a set of conflicting instruction pairs is found, determine the instruction identifier of each control instruction in each conflicting instruction pair, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scenario;

[0140] The trigger unit 506 is connected to the first determination unit 504 and is used to trigger a preset scenario when it is determined based on the instruction identifier of each control instruction in each conflicting instruction pair that each conflicting instruction pair meets the triggering condition, wherein the triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction.

[0141] It should be noted that the searching unit 502 in this embodiment can be used to execute the above step S202, the first determining unit 504 in this embodiment can be used to execute the above step S204, and the triggering unit 506 in this embodiment can be used to execute the above step S206.

[0142] Through the above module, when the trigger condition of the preset scene is met, conflicting instruction pairs are searched from the preset scene and the currently executed scene, wherein the conflicting instruction pairs include a control instruction in the preset scene and a control instruction in the currently executed scene that conflict with the device operation executed by the same smart device; when a group of conflicting instruction pairs are found, the instruction identifier of each control instruction in each conflicting instruction pair is determined respectively, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scene where it is located; when it is determined according to the instruction identifier of each control instruction in each conflicting instruction pair that each conflicting instruction pair meets the triggering condition, the preset scene is triggered, wherein the triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction, thereby solving the problem of low reliability of device control caused by the susceptibility of device control to conflict in the scene device control method in the related art and improving the reliability of device control.

[0143] In an exemplary embodiment, the search unit includes:

[0144] The execution module is used to traverse the scene list when the trigger conditions of the preset scene are met, and perform the following instruction matching operations on the traversed scene as the current scene, where the scene list is used to record the currently executing scene:

[0145] Searching for control instructions in the current scene that match each preset control instruction in the preset scene, respectively, wherein the control instruction that matches each preset control instruction is the same control instruction as the smart device controlled by each preset control instruction in the current scene;

[0146] When a control instruction that matches a candidate control instruction in a preset scene is found in the current scene, and there is a conflict between the device operation performed by the smart device controlled by the candidate control instruction and the device operation performed by the smart device controlled by the control instruction that matches the candidate control instruction, the candidate control instruction and the control instruction that matches the candidate control instruction are determined as a conflicting instruction pair.

[0147] In an exemplary embodiment, the apparatus further comprises:

[0148] an execution unit, configured to, after respectively determining an instruction identifier of each control instruction in each conflicting instruction pair, perform the following instruction identification operation on each conflicting instruction pair as a current conflicting instruction pair, wherein the first control instruction in the current conflicting instruction pair belongs to a preset scenario, and the second control instruction in the current conflicting instruction pair belongs to a target scenario currently being executed:

[0149] In a case where the first control instruction is an optional instruction and the second control instruction is an optional instruction, determining whether the current conflicting instruction pair meets a triggering condition, wherein the first control instruction is executed when the preset scenario is triggered;

[0150] If the first control instruction is an optional instruction and the second control instruction is not an optional instruction, determining whether the current conflicting instruction pair meets a triggering condition, wherein the first control instruction is not executed when the preset scenario is triggered;

[0151] When the first control instruction is not an optional instruction and the second control instruction is an optional instruction, it is determined that the current conflicting instruction pair meets the triggering condition, wherein when the preset scenario is triggered, the first control instruction is executed.

[0152] In an exemplary embodiment, the apparatus further comprises:

[0153] a second determining unit, configured to determine a scene level of the preset scene and a scene level of the target scene when neither the first control instruction nor the second control instruction is an optional instruction;

[0154] The third determination unit is used to determine whether the current conflict instruction pair meets the triggering condition when the scene level of the preset scene is higher than the scene level of the target scene, wherein the triggering condition also includes: the scene level of the preset scene in the conflict instruction pair is higher than the scene level of the currently executing scene.

[0155] In an exemplary embodiment, the apparatus further comprises:

[0156] The stopping unit is configured to, after determining the scene level of the preset scene and the scene level of the target scene, stop triggering the preset scene if the scene level of the preset scene is not higher than the scene level of the target scene.

[0157] In an exemplary embodiment, the search unit includes:

[0158] A first search module is configured to search for a reference scene in a currently executing scene whose scene level is higher than or equal to the preset scene when a trigger condition of the preset scene is met;

[0159] The second search module is configured to search for conflicting instruction pairs from the preset scene and the set of reference scenes when a set of reference scenes is found.

[0160] In an exemplary embodiment, the apparatus further comprises:

[0161] an acquiring unit, configured to acquire detection data reported by at least one smart device after a preset scenario is triggered, wherein the detection data is used to represent an object state of a target object;

[0162] The ending unit is configured to end the preset scene when it is determined according to the object state of the target object that the ending condition of the preset scene is satisfied.

[0163] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. Figure 1 The hardware environment shown can be implemented through software or hardware, wherein the hardware environment includes a network environment.

[0164] According to another aspect of the embodiments of the present application, a storage medium is further provided, which can be located on a smart device. Optionally, in this embodiment, the storage medium can be used to execute the program code of any of the above-mentioned scene device control methods in the embodiments of the present application.

[0165] Optionally, in this embodiment, the above-mentioned storage medium may be located on at least one network device among the multiple network devices in the network shown in the above-mentioned embodiment.

[0166] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0167] S1, when a trigger condition of a preset scenario is met, searching for conflicting instruction pairs from the preset scenario and the currently executing scenario, wherein the conflicting instruction pairs include a control instruction in the preset scenario and a control instruction in the currently executing scenario, which control conflicting device operations executed by the same smart device;

[0168] S2, when a set of conflicting instruction pairs is found, determining the instruction identifier of each control instruction in each conflicting instruction pair, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scenario;

[0169] S3. When it is determined based on the instruction identifier of each control instruction in each conflicting instruction pair that each conflicting instruction pair satisfies an allowable triggering condition, triggering a preset scenario, wherein the allowable triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction.

[0170] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.

[0171] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0172] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned scene device control method is also provided. The electronic device may be a server, a terminal, or a combination thereof.

[0173] Figure 6 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 6 As shown, it includes a processor 602, a communication interface 604, a memory 606 and a communication bus 608, wherein the processor 602, the communication interface 604 and the memory 606 complete communication with each other through the communication bus 608, wherein,

[0174] Memory 606, for storing computer programs;

[0175] The processor 602 is configured to implement the following steps when executing the computer program stored in the memory 606:

[0176] S1, when a trigger condition of a preset scenario is met, searching for conflicting instruction pairs from the preset scenario and the currently executing scenario, wherein the conflicting instruction pairs include a control instruction in the preset scenario and a control instruction in the currently executing scenario, which control conflicting device operations executed by the same smart device;

[0177] S2, when a set of conflicting instruction pairs is found, determining the instruction identifier of each control instruction in each conflicting instruction pair, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scenario;

[0178] S3. When it is determined based on the instruction identifier of each control instruction in each conflicting instruction pair that each conflicting instruction pair satisfies an allowable triggering condition, triggering a preset scenario, wherein the allowable triggering condition includes that at least one control instruction in the conflicting instruction pair is an optional instruction.

[0179] Optionally, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The communication interface is used for communication between the electronic device and other devices.

[0180] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the aforementioned processor.

[0181] As an example, the memory 606 may include, but is not limited to, the search unit 502, the first determination unit 504, and the trigger unit 506 in the scene device control apparatus. In addition, it may also include, but is not limited to, other module units in the scene device control apparatus, which will not be repeated in this example.

[0182] The above-mentioned processor can be a general-purpose processor, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0183] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0184] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only. The device for implementing the above-mentioned scene device control method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 6 It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 6 Different configurations shown.

[0185] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0186] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0187] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application.

[0188] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0189] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, and can be electrical or other forms.

[0190] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the purpose of the solution provided in this embodiment.

[0191] In addition, the functional units in the various embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or at least two units may be integrated into a single unit. The above-mentioned integrated units may be implemented in the form of hardware or software functional units.

[0192] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A scene device control method, characterized in that: include: When a trigger condition of a preset scenario is met, searching for a conflicting instruction pair from the preset scenario and the currently executing scenario, wherein the conflicting instruction pair includes a control instruction in the preset scenario and a control instruction in the currently executing scenario, which control conflicting device operations executed by the same smart device; When a set of conflicting instruction pairs is found, determining the instruction identifier of each control instruction in each conflicting instruction pair, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scenario; When it is determined based on the instruction identifier of each control instruction in each conflicting instruction pair that each conflicting instruction pair satisfies the triggering condition, the preset scene is triggered, wherein the triggering condition includes at least one of the following: at least one control instruction in the conflicting instruction pair is an optional instruction; both control instructions in the conflicting instruction pair are not optional instructions for the scene to which they belong, and the scene level of the preset scene in the conflicting instruction pair is higher than the scene level of the currently executing scene.

2. The method according to claim 1, characterized in that When the trigger condition of the preset scenario is met, searching for conflicting instruction pairs from the preset scenario and the currently executed scenario includes: When the trigger condition of the preset scene is met, the scene list is traversed and the traversed scene is used as the current scene to perform the following instruction matching operation, wherein the scene list is used to record the currently executing scene: Searching for control instructions in the current scene that match each preset control instruction in the preset scene, respectively, wherein the control instruction that matches each preset control instruction is the same control instruction in the current scene as the smart device controlled by each preset control instruction; When a control instruction matching a candidate control instruction in the preset scene is found in the current scene, and there is a conflict between the device operation performed by the smart device controlled by the candidate control instruction and the device operation performed by the smart device controlled by the control instruction matching the candidate control instruction, the candidate control instruction and the control instruction matching the candidate control instruction are determined as a conflicting instruction pair.

3. The method according to claim 1, characterized in that After respectively determining the instruction identifier of each control instruction in each of the conflicting instruction pairs, the method further includes: The following instruction identification operation is performed on each of the conflicting instruction pairs as a current conflicting instruction pair, wherein the first control instruction in the current conflicting instruction pair belongs to the preset scenario, and the second control instruction in the current conflicting instruction pair belongs to the target scenario currently being executed: If the first control instruction is an optional instruction and the second control instruction is an optional instruction, determining that the current conflicting instruction pair meets the triggering permission condition, wherein, if the preset scenario is triggered, the first control instruction is executed; If the first control instruction is an optional instruction and the second control instruction is not an optional instruction, determining that the current conflicting instruction pair meets the triggering permission condition, wherein, if the preset scenario is triggered, the first control instruction is not executed; When the first control instruction is not an optional instruction and the second control instruction is an optional instruction, it is determined that the current conflicting instruction pair meets the triggering permission condition, wherein when the preset scenario is triggered, the first control instruction is executed.

4. The method according to claim 3, characterized in that The method further comprises: In a case where neither the first control instruction nor the second control instruction is an optional instruction, determining a scene level of the preset scene and a scene level of the target scene; In a case where the scene level of the preset scene is higher than the scene level of the target scene, it is determined that the current conflicting instruction pair meets the triggering permission condition.

5. The method according to claim 4, characterized in that After determining the scene level of the preset scene and the scene level of the target scene, the method further includes: When the scene level of the preset scene is not higher than the scene level of the target scene, the triggering of the preset scene is stopped.

6. The method according to claim 1, characterized in that When the trigger condition of the preset scenario is met, searching for conflicting instruction pairs from the preset scenario and the currently executed scenario includes: When the trigger condition of the preset scene is met, searching for a reference scene in the currently executing scene, the scene level of which is higher than or equal to the preset scene; In the case of finding a group of reference scenes, the conflicting instruction pair is searched from the preset scene and the group of reference scenes.

7. The method according to any one of claims 1 to 6, characterized in that After triggering the preset scenario, the method further includes: Acquire detection data reported by at least one smart device, wherein the detection data is used to represent an object state of a target object; When it is determined according to the object state of the target object that an end condition of the preset scene is satisfied, the preset scene is ended.

8. A scene device control device, characterized in that: include: a searching unit, configured to search for a conflicting instruction pair from the preset scene and the currently executed scene when a trigger condition of the preset scene is satisfied, wherein the conflicting instruction pair includes a control instruction in the preset scene and a control instruction in the currently executed scene, which control conflicting device operations executed by the same smart device; a first determining unit, configured to, when a set of conflicting instruction pairs is found, respectively determine an instruction identifier of each control instruction in each of the conflicting instruction pairs, wherein the instruction identifier is used to identify whether the corresponding control instruction is an optional instruction in the scenario in which it is located; A triggering unit, configured to trigger the preset scenario when it is determined, based on the instruction identifier of each control instruction in each of the conflicting instruction pairs, that each of the conflicting instruction pairs satisfies an allowable triggering condition, wherein the allowable triggering condition includes at least one of the following: at least one control instruction in the conflicting instruction pair is an optional instruction; both control instructions in the conflicting instruction pair are not optional instructions for the scenario to which they belong, and the scenario level of the preset scenario in the conflicting instruction pair is higher than the scenario level of the currently executing scenario.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.