CN113777939B - Smart home scene setting method and system - Google Patents
Smart home scene setting method and system Download PDFInfo
- Publication number
- CN113777939B CN113777939B CN202111022063.3A CN202111022063A CN113777939B CN 113777939 B CN113777939 B CN 113777939B CN 202111022063 A CN202111022063 A CN 202111022063A CN 113777939 B CN113777939 B CN 113777939B
- Authority
- CN
- China
- Prior art keywords
- scene
- instruction
- gateway
- internet
- executing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 230000009471 action Effects 0.000 claims description 27
- 238000013461 design Methods 0.000 claims description 24
- 230000001960 triggered effect Effects 0.000 claims description 11
- 230000000977 initiatory effect Effects 0.000 claims description 8
- 238000010200 validation analysis Methods 0.000 claims description 5
- 238000012544 monitoring process Methods 0.000 claims description 4
- 230000006870 function Effects 0.000 description 18
- 230000000875 corresponding effect Effects 0.000 description 3
- 238000007726 management method Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005057 refrigeration Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B15/00—Systems controlled by a computer
- G05B15/02—Systems controlled by a computer electric
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/418—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/26—Pc applications
- G05B2219/2642—Domotique, domestic, home control, automation, smart house
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Manufacturing & Machinery (AREA)
- Quality & Reliability (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention discloses an intelligent home scene setting method and system, and relates to the technical field of intelligent home. Comprising the following steps: the mobile terminal sends a first instruction for creating or editing a scene to the intelligent household SaaS platform, the intelligent household SaaS platform forwards the first instruction to the Internet of things platform, the Internet of things platform stores the first instruction and issues the first instruction message, the gateway subscribes to the first instruction message and executes the first instruction message, the gateway returns the result of executing the first instruction to the Internet of things platform, the Internet of things platform returns the result of executing the first instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the first instruction to the mobile terminal; scenes include automatic scenes and non-automatic scenes; the automatic scene is automatically initiated and executed by the gateway; the non-automatic scene is initiated by the mobile terminal, released to the gateway through the internet of things platform, and then executed by the gateway. The intelligent home scene linkage method and the intelligent home scene linkage system realize intelligent home scenes linked by a plurality of gateways, and simultaneously send the created scenes to the relevant gateways for operation.
Description
Technical Field
The invention relates to the technical field of intelligent home, in particular to an intelligent home scene setting method and system.
Background
Because the existing intelligent home scene is constructed around the event and attribute values of the equipment and the equipment, the existing intelligent home scene setting can only be aimed at a single gateway, and because the attribute information of the current equipment and the equipment is stored in the gateway, the gateway can not know the information and the states of other gateways, and therefore, the scene related to a plurality of gateways can not be created.
Therefore, the problem in the prior art is how to design a plurality of intelligent home scenes linked by the gateway, and send the created scenes to the related gateway for running.
Disclosure of Invention
The invention provides the intelligent home scene management method and the intelligent home scene management system aiming at the problem of how to design a plurality of gateway linked intelligent home scenes and simultaneously send the created scenes to the relevant gateways for operation.
In order to solve the technical problems, the invention provides the following technical scheme:
The method is realized by an intelligent home scene setting system, which comprises a mobile terminal, an intelligent home SaaS platform, an Internet of things platform, a gateway and equipment;
The method comprises the following steps:
the method comprises the steps that S1, a mobile terminal sends a first instruction for creating or editing a scene to an intelligent household SaaS platform, the intelligent household SaaS platform forwards the first instruction to an Internet of things platform, the Internet of things platform stores the first instruction and issues a first instruction message, a gateway subscribes the first instruction message and executes the first instruction message, the gateway returns a result of executing the first instruction to the Internet of things platform, the Internet of things platform returns the result of executing the first instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the first instruction to the mobile terminal; the scenes include automatic scenes and non-automatic scenes;
s2, the automatic scene is automatically initiated and executed by the gateway;
And S3, the non-automatic scene is initiated by the mobile terminal, the mobile terminal sends a second instruction for starting the non-automatic scene to the intelligent household SaaS platform, the intelligent household SaaS platform forwards the second instruction to the Internet of things platform, the Internet of things platform executes the second instruction and returns a result of executing the second instruction and a device state after executing the second instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the second instruction and the device state after executing the second instruction to the mobile terminal.
Optionally, the mobile terminal in step S1 sends a first instruction for creating or editing a scene to the smart home SaaS platform, including:
and the mobile terminal sends a first instruction for creating or editing the scene name, the scene custom icon, the scene if item, the scene and the item and scene executing item to the intelligent home SaaS platform.
Optionally, the scene if item includes:
One-touch execution, device conditions, device events, and timed tasks;
The one-key execution comprises the steps that the mobile terminal one-key starts a scene to be created, edited or executed;
the equipment condition is that a function attribute item is set according to the function and attribute of equipment;
The equipment event is an event item set according to the event of equipment;
the timing tasks comprise task names, time points of the tasks and workday and rest day ranges contained in the tasks.
Optionally, the scene and item comprises:
equipment conditions and validation time;
wherein, the equipment condition is that a function attribute item is set according to the function and attribute of the equipment;
The effective time comprises a start time, an end time and a working and rest day range contained in the effective.
Optionally, the scene execution item includes:
Device actions and execution scenarios;
Wherein the device action is an action item set according to the action of the device;
the execution scene comprises that a first scene is associated with a second scene, and the execution of the second scene is triggered when the first scene is executed.
Optionally, the gateway comprises a plurality of gateways;
The gateways belong to one equipment group, the equipment group is managed by the Internet of things platform, and the gateways subscribe to related topics of the equipment group; the plurality of gateways includes a master gateway and a plurality of slave gateways.
Optionally, the automatic scene in step S2 is automatically initiated by the gateway, including:
the main gateway is used for monitoring the triggering condition of the automatic scene.
Optionally, the automatic scenario in step S2 is executed by the gateway and includes:
Executing the auto scene by the primary gateway if the device executing the auto scene is the device controlled by the primary gateway;
If the equipment executing the automatic scene is equipment controlled by different gateways, the main gateway sends the automatic scene control instruction to the internet of things platform, the internet of things platform sends the automatic scene control instruction to the equipment group, and the gateway executing the automatic scene receives the automatic scene control instruction sent by the equipment group and executes the automatic scene control instruction to complete the automatic scene.
Optionally, executing the second instruction by the internet of things platform in the step S3 includes:
and the internet of things platform sends the second instruction to the equipment group, and the gateway executing the second instruction receives the second instruction sent by the equipment group and executes the second instruction to complete the non-automatic scene.
On the other hand, the invention provides an intelligent home scene setting system for realizing an intelligent home scene setting method, which comprises the following steps: the system comprises a mobile terminal, an intelligent home SaaS platform, an Internet of things platform, a gateway and equipment; wherein:
The mobile terminal is used for sending a control instruction to the intelligent home SaaS platform; initiating a non-automatic scene;
The intelligent home SaaS platform is used for forwarding the control instruction to the Internet of things platform; transmitting an execution result and a device state to the mobile terminal;
the internet of things platform is used for storing the control instruction and issuing the message; subscribing the gateway execution result and returning the execution result to the intelligent home SaaS platform;
the gateway is used for subscribing the control instruction through the internet of things platform and executing the control instruction, and returning the result of executing the control instruction to the internet of things platform; the automatic scene is automatically initiated and executed by the gateway; the non-automatic scene is initiated by the mobile terminal, the mobile terminal sends a second instruction for starting the non-automatic scene to the intelligent household SaaS platform, the intelligent household SaaS platform forwards the second instruction to the Internet of things platform, the Internet of things platform executes the second instruction and returns a result of executing the second instruction and a device state after executing the second instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the second instruction and the device state after executing the second instruction to the mobile terminal;
the device is used for changing the state according to the control instruction.
Optionally, the mobile terminal, the smart home SaaS platform, the internet of things platform, the gateway, and the device are further configured to:
the method comprises the steps that S1, a mobile terminal sends a first instruction for creating or editing a scene to an intelligent household SaaS platform, the intelligent household SaaS platform forwards the first instruction to an Internet of things platform, the Internet of things platform stores the first instruction and issues a first instruction message, a gateway subscribes the first instruction message and executes the first instruction message, the gateway returns a result of executing the first instruction to the Internet of things platform, the Internet of things platform returns the result of executing the first instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the first instruction to the mobile terminal; the scenes include automatic scenes and non-automatic scenes;
s2, the automatic scene is automatically initiated and executed by the gateway;
And S3, the non-automatic scene is initiated by the mobile terminal, the mobile terminal sends a second instruction for starting the non-automatic scene to the intelligent household SaaS platform, the intelligent household SaaS platform forwards the second instruction to the Internet of things platform, the Internet of things platform executes the second instruction and returns a result of executing the second instruction and a device state after executing the second instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the second instruction and the device state after executing the second instruction to the mobile terminal.
Optionally, the mobile terminal and the smart home SaaS platform are further configured to:
The mobile terminal in step S1 sends a first instruction for creating or editing a scene to the smart home SaaS platform, including:
and the mobile terminal sends a first instruction for creating or editing the scene name, the scene custom icon, the scene if item, the scene and the item and scene executing item to the intelligent home SaaS platform.
Optionally, the mobile terminal, the smart home SaaS platform, the internet of things platform, the gateway, and the device are further configured to:
the scene if item includes:
One-touch execution, device conditions, device events, and timed tasks;
The one-key execution comprises the steps that the mobile terminal one-key starts a scene to be created, edited or executed;
the equipment condition is that a function attribute item is set according to the function and attribute of equipment;
The equipment event is an event item set according to the event of equipment;
the timing tasks comprise task names, time points of the tasks and workday and rest day ranges contained in the tasks.
Optionally, the mobile terminal, the smart home SaaS platform, the internet of things platform, the gateway, and the device are further configured to:
The scene and item includes:
equipment conditions and validation time;
wherein, the equipment condition is that a function attribute item is set according to the function and attribute of the equipment;
The effective time comprises a start time, an end time and a working and rest day range contained in the effective.
Optionally, the mobile terminal, the smart home SaaS platform, the internet of things platform, the gateway, and the device are further configured to:
The scene execution item includes:
Device actions and execution scenarios;
Wherein the device action is an action item set according to the action of the device;
the execution scene comprises that a first scene is associated with a second scene, and the execution of the second scene is triggered when the first scene is executed.
Optionally, the gateway is further configured to:
the gateway comprises a plurality of gateways;
The gateways belong to one equipment group, the equipment group is managed by the Internet of things platform, and the gateways subscribe to related topics of the equipment group; the plurality of gateways includes a master gateway and a plurality of slave gateways.
Optionally, the internet of things platform and the gateway are further configured to:
The automatic scenario in step S2 is automatically initiated and executed by the gateway comprising:
the main gateway is used for monitoring the triggering condition of the automatic scene.
Optionally, the internet of things platform, gateway and device are further configured to:
the automatic scenario in step S2 is performed by the gateway comprising:
Executing the auto scene by the primary gateway if the device executing the auto scene is the device controlled by the primary gateway;
If the equipment executing the automatic scene is equipment controlled by different gateways, the main gateway sends the automatic scene control instruction to the internet of things platform, the internet of things platform sends the automatic scene control instruction to the equipment group, and the gateway executing the automatic scene receives the automatic scene control instruction sent by the equipment group and executes the automatic scene control instruction to complete the automatic scene.
Optionally, the internet of things platform, gateway and device are further configured to:
the step S3 of executing the second instruction by the platform of internet of things includes:
and the internet of things platform sends the second instruction to the equipment group, and the gateway executing the second instruction receives the second instruction sent by the equipment group and executes the second instruction to complete the non-automatic scene.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
in the scheme, the device source on which the scene depends is expanded, the single gateway device source is expanded into the device sources of a plurality of gateways, meanwhile, the scene is stored in the platform of the Internet of things and is completely managed by the platform, an interface is provided for creating and editing the scene crossing the gateways for the mobile terminal, and the limitation that a plurality of gateways exist in one building but the scene cannot cross the gateways is eliminated. The service range and the control range of the gateway are enhanced and expanded intangibly.
The mobile terminal can acquire all the attributes of all the devices of the single gateway or the plurality of gateways by means of the fact that the devices and the device state data are stored in the internet of things platform, the mobile terminal can be used for constructing intelligent home scenes of the plurality of gateways in linkage, and meanwhile the created scenes are sent to the relevant gateways to operate.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an intelligent home scene setting method provided by an embodiment of the invention;
fig. 2 is a flowchart of an intelligent home scene execution provided in an embodiment of the present invention;
fig. 3 is a block diagram of an intelligent home scene setting system provided by an embodiment of the invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages to be solved more apparent, the following detailed description will be given with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, the embodiment of the invention provides an intelligent home scene setting method, which is implemented by an intelligent home scene setting system, wherein the intelligent home scene setting system comprises a mobile terminal, an intelligent home SaaS platform, an internet of things platform, a gateway and equipment; the method comprises the following steps:
the method comprises the steps that S1, a mobile terminal sends a first instruction for creating or editing a scene to an intelligent household SaaS platform, the intelligent household SaaS platform forwards the first instruction to an Internet of things platform, the Internet of things platform stores the first instruction and issues a first instruction message, a gateway subscribes the first instruction message and executes the first instruction message, the gateway returns a result of executing the first instruction to the Internet of things platform, the Internet of things platform returns a result of executing the first instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns a result of executing the first instruction to the mobile terminal; scenes include automatic scenes and non-automatic scenes.
In a feasible implementation mode, the intelligent scene is a core functional module of the intelligent home, and different user groups can design scenes meeting requirements according to own requirements so as to achieve quick response to user behavior requirements.
Optionally, the gateway comprises a plurality of gateways;
Wherein, a plurality of gateways belong to one equipment group, the equipment group is managed by an Internet of things platform, and the gateways subscribe related topics of the equipment group; the plurality of gateways includes a master gateway and a plurality of slave gateways.
Optionally, the mobile terminal in step S1 sends a first instruction for creating or editing a scene to the smart home SaaS platform, including:
The mobile terminal sends a first instruction for creating or editing the scene name, the scene custom icon, the scene if item, the scene and the item and scene executing item to the intelligent home SaaS platform.
Optionally, the scene item comprises:
one-touch execution, device conditions, device events, and timed tasks.
The one-key execution comprises the steps of creating, editing or executing a function of a scene by the mobile terminal one-key start.
The device condition is to set a function attribute item according to the function and attribute of the device.
The device event is an event item set according to an event of the device.
The timed task includes a task name, a time point of the task, and a workday scope contained by the task.
In one possible implementation, the default scenario is a one-key execution, and the related scenario content can be set only by one-key actuation of the user.
The equipment condition sets corresponding functional attribute items, such as the functional attributes of the switch of the lamp control equipment, the wind speed mode of the air conditioner and the like, according to the attribute of the equipment.
The equipment event sets corresponding event items according to the event of the equipment, such as an anti-collision event of the door magnetic security equipment and the like.
The timed task includes a task name, a time point of the task, a workday scope contained in the task, and the like.
Optionally, the scene and the item comprise:
Equipment conditions and validation time.
Wherein the device condition is to set a function attribute item according to the function and attribute of the device.
The effective time includes a start time, an end time, and a workday range contained in the effective.
Optionally, the scene execution item includes:
Device actions and execution scenarios.
Wherein the device action is an action item set according to the action of the device.
The executing of the scene comprises the steps that the first scene is related to the second scene, and the execution of the second scene is triggered when the first scene is executed.
In a possible embodiment, the device action sets corresponding action items, such as the brightness value of the adjustable light control, the position of the curtain, etc., according to the action of the device.
The execution scene is a scene association scene, and other scenes are opened while the execution of the scene is performed, so that the diversity and the association of the scenes are enriched.
And S2, automatically initiating and executing the automatic scene by the gateway.
Optionally, the automatic scene in step S2 is automatically initiated by the gateway including:
The primary gateway is used to monitor the triggering conditions of the auto scene.
Optionally, the automatic scenario in step S2 is performed by the gateway comprising:
If the device executing the auto scene is a device controlled by the master gateway, the auto scene is executed by the master gateway.
If the equipment for executing the automatic scene is equipment controlled by different gateways, the main gateway sends the automatic scene control instruction to the internet of things platform, the internet of things platform sends the automatic scene control instruction to the equipment group, and the gateway for executing the automatic scene receives the automatic scene control instruction sent by the equipment group and executes the automatic scene control instruction to complete the automatic scene.
In a feasible implementation mode, an automatic scene does not need to be triggered manually by a user, namely, the internet of things platform monitors whether the scene meets the condition of automatic starting in real time, once the condition of automatic starting is met, the internet of things platform can automatically start a scene instruction meeting the condition, then the result is responded to the intelligent home SaaS platform, the intelligent home SaaS platform can send the result to the mobile terminal APP in a pushing mode, and if the mobile terminal APP actively receives the pushing result and refreshes a UI page under the online condition.
And S3, initiating the non-automatic scene by the mobile terminal, sending a second instruction for starting the non-automatic scene to the intelligent household SaaS platform by the mobile terminal, forwarding the second instruction to the Internet of things platform by the intelligent household SaaS platform, executing the second instruction by the Internet of things platform, returning the result of executing the second instruction and the equipment state after executing the second instruction to the intelligent household SaaS platform, and returning the result of executing the second instruction and the equipment state after executing the second instruction to the mobile terminal by the intelligent household SaaS platform.
Optionally, executing the second instruction by the internet of things platform in step S3 includes:
and the internet of things platform sends the second instruction to the equipment group, and the gateway executing the second instruction receives the second instruction sent by the equipment group and executes the second instruction to complete the non-automatic scene.
In a possible implementation manner, as shown in fig. 2, a mobile terminal APP obtains a scene list, clicks a scene item to be started manually, at this time, the APP sends a control scene instruction to an intelligent home SaaS platform through a network request, the intelligent home SaaS platform directly forwards the control scene instruction to an internet of things platform without any processing after receiving the instruction, the internet of things platform responds a result to an intelligent home of the intelligent home SaaS platform through a series of processing, the SaaS platform directly returns the result to the mobile terminal APP after receiving the result response, and the mobile terminal APP refreshes a UI interface according to the result.
The design of the intelligent scene comprises a device model design, a scene model design and a scene analysis design.
The device model design includes: common fields are immobilized, such as id, name and the like; properties define dynamic fields describing properties from multiple dimensions of name, type, unit, etc.; the propery description at the beginning of x is provided for describing constraints and specifications of attributes. The model samples are for example as follows:
{
"id": "device id",
"Name": "device name",
"roomId": 10,
"classify": 1,
"devType" : 1,
"events": [
{
"name": "onOpened",
"display": {
"en": "xxEvent",
"Zh": "xx event"
}
}
],
"properties": [
{
"name": "switch",
"type": 1,
"unit": null,
"display": {
"en": "Switch",
' Zh ' switch '
},
"value": true,
"nullable": false,
"access": 1,
"xCtrlType": 0,
"xNumberRange": null,
"xStringRange": null,
"xEnumRange": null
},
{
"name": "label",
"type": 4,
"unit": null,
"display": {
"en": "Label",
' Zh ' tag '
},
"Value": "air conditioner one",
"nullable": false,
"access": 2,
"xCtrlType": 0,
"xNumberRange": null,
"xStringRange": {
"min": 1,
"max": 6,
"step": null
},
"xEnumRange": null
},
{
"name": "temperature",
"type": 2,
"unit": "°",
"display": {
"en": "Temp",
"Zh": "temperature"
},
"value": 30.0,
"nullable": true,
"access": 3,
"xCtrlType": 1,
"xNumberRange": {
"min": 15.0,
"max": 30.0,
"step": 2,
"precision": 1,
},
"xStringRange": null,
"xEnumRange": null
},
{
"name": "mode",
"type": 3,
"unit": null,
"display": {
"en": "Mode",
"Zh": "mode"
},
"value": 1,
"nullable": false,
"access": 1,
"xCtrlType": 3,
"xNumberRange": null,
"xStringRange": null,
"xEnumRange": [
{
"value": 1,
"display": {
"en": "Cool",
'Zh' means 'refrigeration'
}
},
{
"value": 2,
"display": {
"en": "Hot",
Zh'
}
}
]
}
]
}
The scene model design includes: the scene is triggered by a "plan" or "event" and is subjected to a "conditional" operation, and if the condition is met, a series of device attribute controls are triggered or another scene is triggered. The model describing the combination of "planning", "event", "condition" and "action" is called the scene model. The model protocol is as follows:
{
"id": "scene id",
"Name": "scene 1",
"enable": true,
"schedules": [
{
"Id": "plan id",
"Name": "plan 1",
"enable": true,
"week": [
1,
2,
3
],
"time": "10:00"
}
],
"events": [
{
"Id": "device id",
"name": "onClosed",
"isImplicit": false
},
{
"Id": "device id",
"name": "mode",
"isImplicit": true
}
],
"contition": {
"type": 1, // orExp
"left": {
"type": 2, // propertyExp
"data": {
"Id": "device id",
"property": "mode",
"operator": 0, // equal
"value": 1
}
},
"right": {
"type": 2, // andExp
"left": {
"type": 3, // timeExp
"data": {
"week": [
1,
2,
3
],
"operator": 0, // equal
"value": "22:30:00"
}
},
"right": {
"type": 3, // propertyExp
"data": {
"Id": "device id",
"property": "temperature",
"operator": 5, // lessThan
"value": 20
}
}
}
},
"actions": [
{
"type": 1, // scene
"TargetId": "profile id",
"action": null
},
{
"type": 2, // action
"TargetId": "device id",
"action": {
"op": "replace",
"path": "/mode",
"value": 2
}
}
]
}
The scene parsing design includes: since the condition of the scene is a complex expression tree, the nodes of the tree may be a binary node, and the Visitor mode is used for dynamic analysis when the scene condition is interpreted, and the relevant analysis mode pseudo code is as follows:
Writing abstract Exp
abstract class Exp
{
public ExpType Type { get; set; }
public abstract bool Execute();
}
Writing LogicalExp, propertyExp, timeExp, nullExp
class LogicalExp : Exp
{
public Exp Left { get; set; }
public Exp Right { get; set; }
public override bool Execute()
{
if (this.Type == ExpType.OrExp)
{
return this.Left.Execute() || this.Right.Execute();
}
else
{
return this.Left.Execute() &&this.Right.Execute();
}
}
}
class PropertyExp : Exp
{
public PropertyData Data { get; set; }
public override bool Execute()
{
var sql = this.Data.ToString();
Comparing whether device attributes satisfy/execute sql
return true;
}
public class PropertyData
{
public string id { get; set; }
public string property { get; set; }
public string oprate{ get; set; }
public object value { get; set; }
public override string ToString()
{
return $"select 1 from table where id = '{this.id}' && {this.property} {this.oprate} {this.value}";
}
}
}
class NullExp : Exp
{
public override bool Execute()
{
return true;
}
}
The expression Visitor is written and the json is dubbed to Exp.
A DynamicJson is constructed that contains all the expression attributes.
The json is deserialized to give DynamicJson.
ExpVisitor is written, converting traversal DynamicJson to Exp.
And executing exp to obtain a final result.
class ExpVisitor
{
class DynamicJson
{
public ExpType Type { get; set; }
public DynamicJson Left { get; set; }
public DynamicJson Right { get; set; }
public object Data { get; set; }
}
public Exp Visit(string json)
{
var dyJson = JsonConvert.DeserializeObject(json, typeof(DynamicJson));
return this.Visit(dyJson as DynamicJson);
}
private Exp Visit(DynamicJsondyJson)
{
if (dyJson == null || dyJson.Type == ExpType.None)
{
return new NullExp();
}
if (dyJson.Type == ExpType.OrExp || dyJson.Type == ExpType.AndExp)
{
return this.VisitLogical(dyJson);
}
if (dyJson.Type == ExpType.PropertyExp)
{
return this.VisitProperty(dyJson);
}
throw new NotSupportedException();
}
private LogicalExpVisitLogical(DynamicJsondyJson)
{
var left = this.Visit(dyJson.Left);
var right = this.Visit(dyJson.Right);
return new LogicalExp
{
Type = dyJson.Type,
Left = left,
Right = right
};
}
private PropertyExpVisitProperty(DynamicJsondyJson)
{
var data = dyJson.Data as JToken;
return new PropertyExp
{
Type = dyJson.Type,
Data = data.ToObject<PropertyExp.PropertyData>()
};
}
In the embodiment of the invention, the device source on which the scene depends is expanded, the single gateway device source is expanded into the device sources of a plurality of gateways, meanwhile, the scene is stored in the platform of the Internet of things and is completely managed by the platform, and an interface is provided for creating and editing the scene crossing the gateway for the mobile terminal, so that the limitation that a plurality of gateways exist in one building but the scene cannot cross the gateway is eliminated. The service range and the control range of the gateway are enhanced and expanded intangibly.
The mobile terminal can acquire all the attributes of all the devices of the single gateway or the plurality of gateways by means of the fact that the devices and the device state data are stored in the internet of things platform, the mobile terminal can be used for constructing intelligent home scenes of the plurality of gateways in linkage, and meanwhile the created scenes are sent to the relevant gateways to operate.
As shown in fig. 3, an embodiment of the present invention provides an intelligent home scene setting system for implementing an intelligent home scene setting method, where the intelligent home scene setting system includes: the system comprises a mobile terminal, an intelligent home SaaS platform, an Internet of things platform, a gateway and equipment; wherein:
the mobile terminal 301 is configured to send a control instruction to the smart home SaaS platform; initiating a non-automatic scene;
the smart home SaaS platform 302 is configured to forward a control instruction to the internet of things platform; transmitting the execution result and the equipment state to a mobile terminal;
The internet of things platform 303 is configured to store a control instruction and issue a message; subscribing gateway execution results and returning the execution results to the intelligent home SaaS platform;
The gateway 304 is configured to subscribe to and execute a control instruction through the internet of things platform, and return a result of executing the control instruction to the internet of things platform; the automatic scene is automatically initiated and executed by the gateway; the method comprises the steps that a non-automatic scene is initiated by a mobile terminal, the mobile terminal sends a second instruction for starting the non-automatic scene to an intelligent home SaaS platform, the intelligent home SaaS platform forwards the second instruction to an Internet of things platform, the Internet of things platform executes the second instruction, a result of executing the second instruction and a device state after executing the second instruction are returned to the intelligent home SaaS platform, and the intelligent home SaaS platform returns the result of executing the second instruction and the device state after executing the second instruction to the mobile terminal;
a device 305 for changing states according to control instructions.
Optionally, the mobile terminal 301, the smart home SaaS platform 302, the internet of things platform 303, the gateway 304, and the device 305 are further configured to:
The method comprises the steps that S1, a mobile terminal sends a first instruction for creating or editing a scene to an intelligent household SaaS platform, the intelligent household SaaS platform forwards the first instruction to an Internet of things platform, the Internet of things platform stores the first instruction and issues a first instruction message, a gateway subscribes the first instruction message and executes the first instruction message, the gateway returns a result of executing the first instruction to the Internet of things platform, the Internet of things platform returns a result of executing the first instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns a result of executing the first instruction to the mobile terminal; scenes include automatic scenes and non-automatic scenes;
s2, automatically initiating and executing an automatic scene by the gateway;
And S3, initiating the non-automatic scene by the mobile terminal, sending a second instruction for starting the non-automatic scene to the intelligent household SaaS platform by the mobile terminal, forwarding the second instruction to the Internet of things platform by the intelligent household SaaS platform, executing the second instruction by the Internet of things platform, returning the result of executing the second instruction and the equipment state after executing the second instruction to the intelligent household SaaS platform, and returning the result of executing the second instruction and the equipment state after executing the second instruction to the mobile terminal by the intelligent household SaaS platform.
Optionally, the mobile terminal 301 and the smart home SaaS platform 302 are further configured to:
The mobile terminal in step S1 sends a first instruction for creating or editing a scene to the smart home SaaS platform, including:
The mobile terminal sends a first instruction for creating or editing the scene name, the scene custom icon, the scene if item, the scene and the item and scene executing item to the intelligent home SaaS platform.
Optionally, the mobile terminal 301, the smart home SaaS platform 302, the internet of things platform 303, the gateway 304, and the device 305 are further configured to:
scene if item includes:
One-touch execution, device conditions, device events, and timed tasks;
the one-key execution comprises the steps that the mobile terminal one-key starts the creation, editing or executing functions of the scene;
The equipment condition is that a function attribute item is set according to the function and attribute of equipment;
the device event is an event item set according to the event of the device;
the timed task includes a task name, a time point of the task, and a workday scope contained by the task.
Optionally, the mobile terminal 301, the smart home SaaS platform 302, the internet of things platform 303, the gateway 304, and the device 305 are further configured to:
the scene and item includes:
equipment conditions and validation time;
wherein, the equipment condition is to set a function attribute item according to the function and attribute of the equipment;
The effective time includes a start time, an end time, and a workday range contained in the effective.
Optionally, the mobile terminal 301, the smart home SaaS platform 302, the internet of things platform 303, the gateway 304, and the device 305 are further configured to:
The scene execution items include:
Device actions and execution scenarios;
Wherein the device action is an action item set according to the action of the device;
The executing of the scene comprises the steps that the first scene is related to the second scene, and the execution of the second scene is triggered when the first scene is executed.
Optionally, gateway 304 is further configured to:
The gateway comprises a plurality of gateways;
Wherein, a plurality of gateways belong to one equipment group, the equipment group is managed by an Internet of things platform, and the gateways subscribe related topics of the equipment group; the plurality of gateways includes a master gateway and a plurality of slave gateways.
Optionally, gateway 304 is further configured to:
the automatic scene automatic initiation in step S2 by the gateway comprises:
The primary gateway is used to monitor the triggering conditions of the auto scene.
Optionally, the internet of things platform 303, gateway 304, device 305 are further configured to:
the automatic scenario in step S2 is performed by the gateway comprising:
if the device executing the automatic scene is the device controlled by the main gateway, executing the automatic scene by the main gateway;
If the equipment for executing the automatic scene is equipment controlled by different gateways, the main gateway sends the automatic scene control instruction to the internet of things platform, the internet of things platform sends the automatic scene control instruction to the equipment group, and the gateway for executing the automatic scene receives the automatic scene control instruction sent by the equipment group and executes the automatic scene control instruction to complete the automatic scene.
Optionally, the internet of things platform 303, gateway 304, device 305 are further configured to:
the step S3 of executing the second instruction by the platform of the Internet of things comprises the following steps:
and the internet of things platform sends the second instruction to the equipment group, and the gateway executing the second instruction receives the second instruction sent by the equipment group and executes the second instruction to complete the non-automatic scene.
In the embodiment of the invention, the device source on which the scene depends is expanded, the single gateway device source is expanded into the device sources of a plurality of gateways, meanwhile, the scene is stored in the platform of the Internet of things and is completely managed by the platform, and an interface is provided for creating and editing the scene crossing the gateway for the mobile terminal, so that the limitation that a plurality of gateways exist in one building but the scene cannot cross the gateway is eliminated. The service range and the control range of the gateway are enhanced and expanded intangibly.
The mobile terminal can acquire all the attributes of all the devices of the single gateway or the plurality of gateways by means of the fact that the devices and the device state data are stored in the internet of things platform, the mobile terminal can be used for constructing intelligent home scenes of the plurality of gateways in linkage, and meanwhile the created scenes are sent to the relevant gateways to operate.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.
Claims (7)
1. The intelligent home scene setting method is characterized by being realized by an intelligent home scene setting system, wherein the intelligent home scene setting system comprises a mobile terminal, an intelligent home SaaS platform, an Internet of things platform, a gateway and equipment;
The method comprises the following steps:
the method comprises the steps that S1, a mobile terminal sends a first instruction for creating or editing a scene to an intelligent household SaaS platform, the intelligent household SaaS platform forwards the first instruction to an Internet of things platform, the Internet of things platform stores the first instruction and issues a first instruction message, a gateway subscribes the first instruction message and executes the first instruction message, the gateway returns a result of executing the first instruction to the Internet of things platform, the Internet of things platform returns the result of executing the first instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the first instruction to the mobile terminal; the scenes include automatic scenes and non-automatic scenes;
The design of the scene comprises equipment model design, scene model design and scene analysis design;
wherein the device model design comprises:
Immobilization of common fields;
Describing the attribute from a multi-dimension, the multi-dimension including a name, a type, and a unit;
Constraint and specification are carried out on the description attribute;
the scene model design includes: setting a scene to be triggered by a plan or an event, and triggering equipment attribute control or triggering another scene under the condition that the scene meets the condition through conditional operation;
the scene parsing design includes: dynamically resolving scene conditions by using Visitor modes;
s2, the automatic scene is automatically initiated and executed by the gateway;
S3, the non-automatic scene is initiated by the mobile terminal, the mobile terminal sends a second instruction for starting the non-automatic scene to the intelligent household SaaS platform, the intelligent household SaaS platform forwards the second instruction to the Internet of things platform, the Internet of things platform executes the second instruction and returns a result of executing the second instruction and a device state after executing the second instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the second instruction and the device state after executing the second instruction to the mobile terminal;
the gateway comprises a plurality of gateways;
the gateways belong to one equipment group, the equipment group is managed by the Internet of things platform, and the gateways subscribe to related topics of the equipment group; the plurality of gateways comprises a master gateway and a plurality of slave gateways;
The automatic scene in the step S2 is automatically initiated by the gateway, including:
the main gateway is used for monitoring the triggering condition of the automatic scene;
the automatic scenario in step S2 is performed by the gateway comprising:
Executing the auto scene by the primary gateway if the device executing the auto scene is the device controlled by the primary gateway;
If the equipment executing the automatic scene is equipment controlled by different gateways, the main gateway sends the automatic scene control instruction to the internet of things platform, the internet of things platform sends the automatic scene control instruction to the equipment group, and the gateway executing the automatic scene receives the automatic scene control instruction sent by the equipment group and executes the automatic scene control instruction to complete the automatic scene.
2. The method according to claim 1, wherein the mobile terminal in step S1 sends a first instruction for creating or editing a scene to the smart home SaaS platform, including:
and the mobile terminal sends a first instruction for creating or editing the scene name, the scene custom icon, the scene if item, the scene and the item and scene executing item to the intelligent home SaaS platform.
3. The method of claim 2, wherein the scene-if item comprises:
One-touch execution, device conditions, device events, and timed tasks;
The one-key execution comprises the steps that the mobile terminal one-key starts a scene to be created, edited or executed;
the equipment condition is that a function attribute item is set according to the function and attribute of equipment;
The equipment event is an event item set according to the event of equipment;
the timing tasks comprise task names, time points of the tasks and workday and rest day ranges contained in the tasks.
4. The method of claim 2, wherein the scene and item comprises:
equipment conditions and validation time;
wherein, the equipment condition is that a function attribute item is set according to the function and attribute of the equipment;
The effective time comprises a start time, an end time and a working and rest day range contained in the effective.
5. The method of claim 2, wherein the scene execution item comprises:
Device actions and execution scenarios;
Wherein the device action is an action item set according to the action of the device;
the execution scene comprises that a first scene is associated with a second scene, and the execution of the second scene is triggered when the first scene is executed.
6. The method according to claim 1, wherein the step S3 of the internet of things platform executing the second instruction comprises:
and the internet of things platform sends the second instruction to the equipment group, and the gateway executing the second instruction receives the second instruction sent by the equipment group and executes the second instruction to complete the non-automatic scene.
7. The intelligent home scene setting system is characterized by being used for realizing an intelligent home scene setting method, and comprises a mobile terminal, an intelligent home SaaS platform, an Internet of things platform, a gateway and equipment; wherein:
The mobile terminal is used for sending a control instruction to the intelligent home SaaS platform; initiating a non-automatic scene;
The intelligent home SaaS platform is used for forwarding the control instruction to the Internet of things platform; transmitting an execution result and a device state to the mobile terminal;
the internet of things platform is used for storing the control instruction and issuing the message; subscribing the gateway execution result and returning the execution result to the intelligent home SaaS platform;
the gateway is used for subscribing the control instruction through the internet of things platform and executing the control instruction, and returning the result of executing the control instruction to the internet of things platform; the automatic scene is automatically initiated and executed by the gateway; the non-automatic scene is initiated by the mobile terminal, the mobile terminal sends a second instruction for starting the non-automatic scene to the intelligent household SaaS platform, the intelligent household SaaS platform forwards the second instruction to the Internet of things platform, the Internet of things platform executes the second instruction and returns a result of executing the second instruction and a device state after executing the second instruction to the intelligent household SaaS platform, and the intelligent household SaaS platform returns the result of executing the second instruction and the device state after executing the second instruction to the mobile terminal;
the device is used for changing the state according to the control instruction;
The design of the scene comprises equipment model design, scene model design and scene analysis design;
wherein the device model design comprises:
Immobilization of common fields;
Describing the attribute from a multi-dimension, the multi-dimension including a name, a type, and a unit;
Constraint and specification are carried out on the description attribute;
the scene model design includes: setting a scene to be triggered by a plan or an event, and triggering equipment attribute control or triggering another scene under the condition that the scene meets the condition through conditional operation;
the scene parsing design includes: dynamically resolving scene conditions by using Visitor modes;
the gateway comprises a plurality of gateways;
the gateways belong to one equipment group, the equipment group is managed by the Internet of things platform, and the gateways subscribe to related topics of the equipment group; the plurality of gateways comprises a master gateway and a plurality of slave gateways;
The automatic scene being automatically initiated by the gateway comprising:
the main gateway is used for monitoring the triggering condition of the automatic scene;
the automatic scenario is performed by the gateway comprising:
Executing the auto scene by the primary gateway if the device executing the auto scene is the device controlled by the primary gateway;
If the equipment executing the automatic scene is equipment controlled by different gateways, the main gateway sends the automatic scene control instruction to the internet of things platform, the internet of things platform sends the automatic scene control instruction to the equipment group, and the gateway executing the automatic scene receives the automatic scene control instruction sent by the equipment group and executes the automatic scene control instruction to complete the automatic scene.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111022063.3A CN113777939B (en) | 2021-09-01 | 2021-09-01 | Smart home scene setting method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111022063.3A CN113777939B (en) | 2021-09-01 | 2021-09-01 | Smart home scene setting method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113777939A CN113777939A (en) | 2021-12-10 |
CN113777939B true CN113777939B (en) | 2024-08-13 |
Family
ID=78840653
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111022063.3A Active CN113777939B (en) | 2021-09-01 | 2021-09-01 | Smart home scene setting method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113777939B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115002170B (en) * | 2022-08-05 | 2022-11-22 | 江苏橙智云信息技术有限公司 | Multi-condition linkage instruction execution method based on Internet of things |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107728590A (en) * | 2017-09-29 | 2018-02-23 | 四川长虹电器股份有限公司 | ZigBee intelligent domestic systems and its scene inter-linked controlling method |
CN111913450A (en) * | 2020-08-04 | 2020-11-10 | 青岛海信日立空调系统有限公司 | Control method of intelligent household equipment, intelligent household system and gateway thereof |
CN112272230A (en) * | 2020-10-23 | 2021-01-26 | 四川长虹电器股份有限公司 | Multi-gateway scene linkage control method |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014193166A1 (en) * | 2013-05-28 | 2014-12-04 | 엘지전자 주식회사 | Gateway and control method therefor |
CN104678906A (en) * | 2013-12-02 | 2015-06-03 | 深圳市易居智能科技有限公司 | Internet of things intelligent housing system |
CN113037530B (en) * | 2019-12-25 | 2022-04-19 | 美的集团股份有限公司 | Multi-gateway scene implementation method and system, electronic device and storage medium |
CN111142456A (en) * | 2020-02-26 | 2020-05-12 | 杭州涂鸦信息技术有限公司 | Internet of things automation smart home linkage method and system |
CN112152892A (en) * | 2020-08-12 | 2020-12-29 | 青岛海尔智能家电科技有限公司 | Method for controlling gateway, intelligent gateway and intelligent home system |
-
2021
- 2021-09-01 CN CN202111022063.3A patent/CN113777939B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107728590A (en) * | 2017-09-29 | 2018-02-23 | 四川长虹电器股份有限公司 | ZigBee intelligent domestic systems and its scene inter-linked controlling method |
CN111913450A (en) * | 2020-08-04 | 2020-11-10 | 青岛海信日立空调系统有限公司 | Control method of intelligent household equipment, intelligent household system and gateway thereof |
CN112272230A (en) * | 2020-10-23 | 2021-01-26 | 四川长虹电器股份有限公司 | Multi-gateway scene linkage control method |
Also Published As
Publication number | Publication date |
---|---|
CN113777939A (en) | 2021-12-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109960710B (en) | Data synchronization method and system between databases | |
US11782590B2 (en) | Scene-operation method, electronic device, and non-transitory computer readable medium | |
EP3192217B1 (en) | User-defined scenes for home automation | |
CN107294793B (en) | Replacement method, device and equipment of intelligent household equipment and storage medium | |
US10489221B2 (en) | Method for creating context aware application and user terminal | |
US9306763B2 (en) | Providing a user interface for devices of a home automation system | |
CN111176133A (en) | Method and device for determining smart home scene | |
US20230289198A1 (en) | Configuring application scene | |
CN112272230A (en) | Multi-gateway scene linkage control method | |
CN105515853A (en) | Wireless network node and state update method thereof | |
CN109358512A (en) | A kind of intelligent home furnishing control method, cloud server, system and storage medium | |
CN112202654B (en) | Control instruction processing method, device, equipment and storage medium | |
CN111142456A (en) | Internet of things automation smart home linkage method and system | |
CN109618315A (en) | A kind of control method of lighting apparatus, device, storage medium and intelligent terminal | |
CN112415971A (en) | Method for controlling conference room by one key, computer equipment and readable medium | |
CN113777939B (en) | Smart home scene setting method and system | |
CN108039989A (en) | A kind of method, apparatus of Scene case, storage medium and computer equipment | |
CN111399459A (en) | Intelligent household equipment control method, device, equipment and storage medium | |
CN110794773A (en) | Click-type scene creating method and device | |
CN114285688A (en) | Equipment replacement method, device, gateway, system and medium | |
CN115002099A (en) | Man-machine interactive file processing method and device for realizing IA (Internet of things) based on RPA (resilient packet Access) and AI (Artificial Intelligence) | |
FR3037166A1 (en) | METHODS OF GENERATING CONDITIONAL SOFTWARE CODE MODULE AND METHOD FOR CONTROLLING AT LEAST ONE DOMOTIC INSTALLATION OF A BUILDING | |
CN108509311A (en) | A kind of apparatus monitoring method, device, storage medium and computer equipment | |
KR20150110877A (en) | User based home automation method, apparatus thereof, and supporting method and apparatus therefor | |
KR102530364B1 (en) | Node analysis method and apparauts thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |