Movatterモバイル変換


[0]ホーム

URL:


CN111614524A - A method, device and system for linkage control of multi-intelligent devices - Google Patents

A method, device and system for linkage control of multi-intelligent devices
Download PDF

Info

Publication number
CN111614524A
CN111614524ACN201910142363.1ACN201910142363ACN111614524ACN 111614524 ACN111614524 ACN 111614524ACN 201910142363 ACN201910142363 ACN 201910142363ACN 111614524 ACN111614524 ACN 111614524A
Authority
CN
China
Prior art keywords
electronic device
event
rule
execution
conditional
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.)
Pending
Application number
CN201910142363.1A
Other languages
Chinese (zh)
Inventor
聂鹏程
易立
邱振庭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co LtdfiledCriticalHuawei Technologies Co Ltd
Priority to CN201910142363.1ApriorityCriticalpatent/CN111614524A/en
Priority to PCT/CN2020/075982prioritypatent/WO2020173375A1/en
Publication of CN111614524ApublicationCriticalpatent/CN111614524A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

一种多智能设备联动控制的方法、设备及系统,涉及通信技术领域,可以在多智能设备的联动控制中,摆脱了对控制设备的依赖,有利于减少联动的时延,提升联动效率,该方法具体包括:第一电子设备获取第一规则,第一规则指示当第二电子设备发生第一事件时,第一电子设备执行第一功能;第一电子设备根据第一规则,向第二电子设备发送针对第一事件的订阅消息;第一电子设备接收第二电子设备发送的第一事件的通知消息;响应于接收到的第一事件的通知消息,第一电子设备根据第一规则执行第一功能。

Figure 201910142363

A method, device and system for linkage control of multi-smart devices, which relate to the field of communication technology, can get rid of dependence on control devices in the linkage control of multi-smart devices, help reduce linkage delay, and improve linkage efficiency. The method specifically includes: the first electronic device acquires a first rule, the first rule instructs that when a first event occurs in the second electronic device, the first electronic device performs a first function; the first electronic device reports to the second electronic device according to the first rule The device sends a subscription message for the first event; the first electronic device receives the notification message of the first event sent by the second electronic device; in response to the received notification message of the first event, the first electronic device executes the first event according to the first rule. a function.

Figure 201910142363

Description

Translated fromChinese
一种多智能设备联动控制的方法、设备及系统A method, device and system for linkage control of multi-intelligent devices

技术领域technical field

本申请涉及通信技术领域,尤其涉及一种多智能设备联动控制的方法、设备及系统。The present application relates to the field of communication technologies, and in particular, to a method, device and system for linkage control of multiple intelligent devices.

背景技术Background technique

智能家居(smart home,或home automation)通过物联网技术将家中的各种电子设备(如音视频设备、照明系统、窗帘控制、空调控制、安防系统、数字影院系统、影音服务器、影柜系统、网络家电等)连接到一起,提供家电控制、照明控制、电话远程控制、室内外遥控、防盗报警、环境监测、暖通控制、红外转发以及可编程定时控制等多种功能。Smart home (smart home, or home automation) integrates various electronic devices in the home (such as audio and video equipment, lighting system, curtain control, air conditioning control, security system, digital theater system, audio and video server, video cabinet system, etc.) through the Internet of Things technology. Network appliances, etc.) are connected together to provide various functions such as home appliance control, lighting control, telephone remote control, indoor and outdoor remote control, anti-theft alarm, environmental monitoring, HVAC control, infrared forwarding and programmable timing control.

在智能家居系统中,各个电子设备基于IFTTT(if this then that的缩写)规则进行设备与设备之间的联动和控制。其中,this可认为是触发条件,that可认为是设备的执行操作或执行事件。例如:如果智能门锁识别出门口的人通过了生物认证(触发条件),则门自动打开(执行事件)。又例如:如果门开了,且室内温度高于28摄氏度(触发条件),则空调自动启动(执行事件)。In a smart home system, each electronic device performs linkage and control between devices based on IFTTT (abbreviation for if this then that) rules. Among them, this can be regarded as a trigger condition, and that can be regarded as an execution operation or execution event of the device. For example: if the smart door lock recognizes that the person at the door has passed biometric authentication (trigger condition), the door opens automatically (execution event). Another example: if the door is opened, and the indoor temperature is higher than 28 degrees Celsius (trigger condition), the air conditioner is automatically started (execution event).

目前,在设备和设备的联动过程中,基本都是由控制设备收集触发条件,然后基于触发条件向需要联动的设备发送执行命令。例如:控制设备需要从一些设备(可称为条件设备)处获取某个IFTTT规则中所有的触发条件,然后,向另一些设备(可成为执行设备)发送操作指令,以指示这些执行设备执行相应的操作。At present, in the process of linkage between devices, the control device basically collects trigger conditions, and then sends execution commands to the devices that need linkage based on the trigger conditions. For example, the control device needs to obtain all the triggering conditions in an IFTTT rule from some devices (which can be called conditional devices), and then send operation instructions to other devices (which can become execution devices) to instruct these execution devices to execute the corresponding operation.

显然,在现有的联动技术中,条件设备和执行设备之间的联动过于依赖控制设备。通常,网络中存在多条IFTTT规则,若每条IFTTT规则中的联动都要经过同一个控制设备进行中转和控制,会造成联动时延大,效率低,用户体验较差。此外,若控制设备断开连接,则该网络中的所有IFTTT规则的联动都会失败。可见,条件设备和执行设备之间的联动效率和稳定性都有待提高。Obviously, in the existing linkage technology, the linkage between the condition device and the execution device relies too much on the control device. Usually, there are multiple IFTTT rules in the network. If the linkage in each IFTTT rule is relayed and controlled by the same control device, the linkage delay will be large, the efficiency will be low, and the user experience will be poor. In addition, if the control device is disconnected, the linkage of all IFTTT rules in the network will fail. It can be seen that the linkage efficiency and stability between the condition equipment and the execution equipment need to be improved.

发明内容SUMMARY OF THE INVENTION

本申请提供的一种多智能设备联动控制的方法、设备及系统,可以在多电子设备的联动控制中,摆脱了对控制设备的依赖,有利于减少联动的时延,提升联动效率。The method, device and system for linkage control of multi-smart devices provided by the present application can get rid of the dependence on control devices in the linkage control of multiple electronic devices, which is beneficial to reduce linkage delay and improve linkage efficiency.

第一方面、本申请提供的一种多电子设备联动控制的方法,包括:A first aspect, a method for linkage control of multiple electronic devices provided by this application includes:

第一电子设备获取第一规则,第一规则指示当第二电子设备发生第一事件时,第一电子设备执行第一功能;第一电子设备根据第一规则,向第二电子设备发送针对第一事件的订阅消息;第一电子设备接收第二电子设备发送的第一事件的通知消息;响应于接收到的第一事件的通知消息,第一电子设备根据第一规则执行第一功能。The first electronic device acquires the first rule, and the first rule indicates that when the first event occurs in the second electronic device, the first electronic device performs the first function; the first electronic device sends a message to the second electronic device according to the first rule A subscription message for an event; the first electronic device receives a notification message of the first event sent by the second electronic device; in response to the received notification message of the first event, the first electronic device executes the first function according to the first rule.

其中,第一电子设备为执行设备,第一功能为第一规则中的执行事件。第二电子设备为条件设备,第一事件为第一规则中第二电子设备对应的触发事件或触发条件。The first electronic device is an execution device, and the first function is an execution event in the first rule. The second electronic device is a condition device, and the first event is a trigger event or trigger condition corresponding to the second electronic device in the first rule.

在本申请中,由执行设备直接获取第一规则,并向条件设备订阅触发事件,多触发事件发生时,执行设备直接执行相应的执行事件。可见,在执行设备和条件设备的联动过程中,没有依赖其他的控制设备,可以提升联动的效率。In the present application, the execution device directly acquires the first rule, and subscribes the trigger event to the condition device. When multiple trigger events occur, the execution device directly executes the corresponding execution event. It can be seen that in the process of the linkage between the execution device and the conditional device, there is no dependence on other control devices, which can improve the efficiency of the linkage.

一种可能的实现方式中,该方法还包括:第一电子设备获取第二规则,第二规则指示当第三电子设备发生第二事件,且第四电子设备发送第三事件时,则第一电子设备执行第二功能;第一电子设备根据第二规则,向第三电子设备发送针对第二事件的订阅消息;第一电子设备接收到第三电子设备发送的第二事件的通知消息;第一电子设备获取第四电子设备是否发生第三事件;响应于获取到第四电子设备发生第三事件,第一电子设备根据第二规则执行第二功能。In a possible implementation manner, the method further includes: the first electronic device obtains a second rule, and the second rule indicates that when a second event occurs on the third electronic device and the fourth electronic device sends the third event, the first electronic device sends the third event. The electronic device performs the second function; the first electronic device sends a subscription message for the second event to the third electronic device according to the second rule; the first electronic device receives the notification message of the second event sent by the third electronic device; An electronic device acquires whether a third event occurs in the fourth electronic device; in response to acquiring that the third event occurs in the fourth electronic device, the first electronic device executes the second function according to the second rule.

其中,第一电子设备为执行设备,第二功能为第二规则中的执行事件。第三电子设备和第四电子设备为条件设备。第二事件为第二规则中第三电子设备对应的触发事件或触发条件。第三事件为第二规则中第四电子设备对应的触发事件或触发条件。The first electronic device is an execution device, and the second function is an execution event in the second rule. The third electronic device and the fourth electronic device are conditional devices. The second event is a trigger event or trigger condition corresponding to the third electronic device in the second rule. The third event is a trigger event or trigger condition corresponding to the fourth electronic device in the second rule.

在本申请中,由执行设备提前获取IFTTT规则,在IFTTT规则中的条件设备发生触发事件后,可以直接通过本地网络通知执行设备,而执行设备也可以通过本地网络直接查询其他条件设备的触发事件。当所有条件设备的触发条件都满足IFTTT规则时,执行设备可以执行相应事件,即完成联动。可见,从某个条件设备的触发条件发生,到执行设备执行相应事件的整个过程中,都是在本地网络中完成的。这样,即便是本地网络中有电子设备与互联网断开,本申请仍然可以完成本地网络的多个电子设备的联动,提高了联动的成功率,提升了联动系统的稳定性。并且,由于联动过程中,本地网络的多个电子设备直接进行通信,而不再通过互联网,有利于降低通信的时延,提升联动的效率。再有,避免将本地网络中各个电子设备的状态,以及IFTTT规则的执行情况上传到互联网,有利于规避安全风险。In this application, the execution device obtains the IFTTT rule in advance. After the conditional device in the IFTTT rule triggers an event, it can directly notify the execution device through the local network, and the execution device can also directly query the trigger event of other conditional devices through the local network. . When the triggering conditions of all condition devices meet the IFTTT rules, the execution device can execute the corresponding event, that is, the linkage is completed. It can be seen that the entire process from the occurrence of a trigger condition of a certain conditional device to the execution of the corresponding event by the execution device is completed in the local network. In this way, even if an electronic device in the local network is disconnected from the Internet, the present application can still complete the linkage of multiple electronic devices in the local network, which improves the success rate of linkage and improves the stability of the linkage system. In addition, during the linkage process, multiple electronic devices in the local network communicate directly instead of going through the Internet, which is beneficial to reduce the delay of communication and improve the efficiency of linkage. Furthermore, avoiding uploading the status of each electronic device in the local network and the implementation of the IFTTT rules to the Internet is beneficial to avoid security risks.

此外,在本申请实施例提供的方法中,是由IFTTT规则中的执行设备,与IFTTT规则中其他的条件设备进行直接通信,没有通过其他的中间设备进行中转和控制,即没有通过与本条IFTTT规则无关的其他设备(例如:网关)进行中转和控制。换言之,本申请实施例提供的方法,使得本地网络的多个电子设备联动时摆脱了对控制设备的依赖,有利于减少联动的时延,提升联动效率。In addition, in the method provided by the embodiment of the present application, the execution device in the IFTTT rule directly communicates with other conditional devices in the IFTTT rule, and no transfer and control are performed through other intermediate devices, that is, there is no communication with this IFTTT rule. Other devices (eg gateways) not related to the rules are relayed and controlled. In other words, the method provided by the embodiment of the present application makes the multiple electronic devices in the local network get rid of the dependence on the control device when they are linked, which is beneficial to reduce the delay of linkage and improve the efficiency of linkage.

一种可能的实现方式中,响应于获取到第四电子设备发生第三事件,第一电子设备根据第二规则执行第二功能,具体为:响应于第一电子设备接收第四电子设备发送的已发生第三事件的通知消息,第一电子设备根据第二规则执行第二功能。由此,本申请提供了一种其他条件设备主动向执行设备发送触发事件是否发生的通知消息的方法。In a possible implementation manner, in response to acquiring that a third event occurs in the fourth electronic device, the first electronic device executes the second function according to the second rule, specifically: in response to the first electronic device receiving the data sent by the fourth electronic device. A notification message that a third event has occurred, and the first electronic device executes the second function according to the second rule. Therefore, the present application provides a method in which a device under other conditions actively sends a notification message of whether a trigger event occurs to an execution device.

一种可能的实现方式中,在第一电子设备接收第四电子设备发送的已发生第三事件的通知消息之前,该方法还包括:响应于接收到第三电子设备发送的第二事件的通知消息,第一电子设备向第四电子设备发送查询第三事件是否发生的消息。由此,本申请提供了一种执行设备向其他条件设备查询触发事件是否发生的通知消息的方法。In a possible implementation manner, before the first electronic device receives the notification message sent by the fourth electronic device that the third event has occurred, the method further includes: in response to receiving the notification of the second event sent by the third electronic device message, the first electronic device sends a message for querying whether the third event occurs to the fourth electronic device. Thus, the present application provides a method for an execution device to query other conditional devices for a notification message whether a trigger event occurs.

一种可能的实现方式中,在第一电子设备获取第二规则之后,方法还包括:第一电子设备根据第二规则,获取第三电子设备的地址和第四电子设备的地址。In a possible implementation manner, after the first electronic device acquires the second rule, the method further includes: the first electronic device acquires the address of the third electronic device and the address of the fourth electronic device according to the second rule.

一种可能的实现方式中,第二规则包括第三电子设备的标识和第四电子设备的标识;第一电子设备根据第二规则,获取第三电子设备的地址和第四电子设备的地址,具体包括:第一电子设备组播或广播第一消息,第一消息包括第三电子设备的标识和第四电子设备的标识;第一电子设备接收第三电子设备返回的第三电子设备的地址;电子设备接收第四电子设备返回的第四电子设备的地址。In a possible implementation manner, the second rule includes the identifier of the third electronic device and the identifier of the fourth electronic device; the first electronic device obtains the address of the third electronic device and the address of the fourth electronic device according to the second rule, Specifically: the first electronic device multicasts or broadcasts a first message, where the first message includes the identifier of the third electronic device and the identifier of the fourth electronic device; the first electronic device receives the address of the third electronic device returned by the third electronic device ; The electronic device receives the address of the fourth electronic device returned by the fourth electronic device.

本申请提供一种执行设备获取各个条件设备网络地址的方法。The present application provides a method for an execution device to obtain a network address of each conditional device.

一种可能的实现方式中,在第一电子设备获取第二规则之后,方法还包括:第一电子设备检测第二规则的合法性和/或完整性。In a possible implementation manner, after the first electronic device acquires the second rule, the method further includes: the first electronic device detects the legitimacy and/or integrity of the second rule.

一种可能的实现方式中,第一电子设备获取第二规则包括:第一电子设备从服务器或第五电子设备获取第二规则。In a possible implementation manner, acquiring the second rule by the first electronic device includes: acquiring the second rule by the first electronic device from the server or the fifth electronic device.

第二方面、本申请提供的一种多电子设备联动控制的方法,该方法包括:A second aspect, a method for linkage control of multiple electronic devices provided by this application, the method includes:

第一电子设备获取第一规则,第一规则指示当第一电子设备发生第一事件,且第二电子设备发生第二事件时,第三电子设备执行第一功能;第一电子设备接收到第二电子设备发送的第二事件已发生的通知消息;响应于接收到的第二事件已发生的通知消息,第一电子设备检测第一事件是否发生;若检测到第一事件已发生,则第一电子设备向第三电子设备发送执行指令,执行指令指示第三电子设备执行第一功能。The first electronic device acquires the first rule, and the first rule indicates that when the first event occurs in the first electronic device and the second event occurs in the second electronic device, the third electronic device performs the first function; the first electronic device receives the first function. The second electronic device sends a notification message that the second event has occurred; in response to the received notification message that the second event has occurred, the first electronic device detects whether the first event has occurred; if it detects that the first event has occurred, the first electronic device An electronic device sends an execution instruction to the third electronic device, and the execution instruction instructs the third electronic device to execute the first function.

其中,第一电子设备和第二电子设备为第一规则中的条件设备,第一事件为第一电子设备对应的触发事件或触发条件。第二事件为第二电子设备对应的触发事件或触发条件。第三电子设备为执行设备,第一功能为第一规则中第三电子设备对应的执行事件。The first electronic device and the second electronic device are conditional devices in the first rule, and the first event is a trigger event or trigger condition corresponding to the first electronic device. The second event is a trigger event or trigger condition corresponding to the second electronic device. The third electronic device is an execution device, and the first function is an execution event corresponding to the third electronic device in the first rule.

本申请中,由条件设备提前获取IFTTT规则,并发现该IFTTT规则中的其他电子设备,例如执行设备。在IFTTT规则中的某个或某些条件设备发生触发事件后,可以直接通过本地网络通知其他条件设备。其他条件设备在确定满足IFTTT规则后,指示执行设备执行相应事件,即完成联动,提升了联动效率。In this application, the conditional device acquires the IFTTT rules in advance, and discovers other electronic devices in the IFTTT rules, such as execution devices. After a trigger event occurs in one or some conditional devices in the IFTTT rule, other conditional devices can be notified directly through the local network. After determining that the device meets the IFTTT rules, the device in other conditions instructs the execution device to execute the corresponding event, that is, the linkage is completed, which improves the linkage efficiency.

第三方面、本申请提供的一种多电子设备联动控制的方法,该方法包括:A third aspect, a method for linkage control of multiple electronic devices provided by this application, the method includes:

第一电子设备获取第一规则,第一规则指示当第一电子设备发生第一事件,且第二电子设备发生第二事件时,第三电子设备执行第一功能;第一电子设备检测到已发生第一事件;响应于检测到已发生第一事件,第一电子设备向第二电子设备发送查询第二事件是否发生的消息;第一电子设备接收到第二电子设备发送的第二事件已发生的通知消息;响应于接收到的第二事件已发生的通知消息,第一电子设备向第三电子设备发送执行指令,执行指令指示第三电子设备执行第一功能。The first electronic device acquires a first rule, and the first rule indicates that when a first event occurs in the first electronic device and a second event occurs in the second electronic device, the third electronic device performs the first function; the first electronic device detects that the The first event occurs; in response to detecting that the first event has occurred, the first electronic device sends a message to the second electronic device to inquire whether the second event has occurred; the first electronic device receives the second event sent by the second electronic device. Occurred notification message; in response to the received notification message that the second event has occurred, the first electronic device sends an execution instruction to the third electronic device, and the execution instruction instructs the third electronic device to execute the first function.

其中,第一电子设备和第二电子设备为第一规则中的条件设备,第一事件为第一电子设备对应的触发事件或触发条件。第二事件为第二电子设备对应的触发事件或触发条件。第三电子设备为执行设备,第一功能为第一规则中第三电子设备对应的执行事件。The first electronic device and the second electronic device are conditional devices in the first rule, and the first event is a trigger event or trigger condition corresponding to the first electronic device. The second event is a trigger event or trigger condition corresponding to the second electronic device. The third electronic device is an execution device, and the first function is an execution event corresponding to the third electronic device in the first rule.

本申请中,由执行设备和部分条件设备提前获取IFTTT规则,并发现该IFTTT规则中的其他电子设备,例如:其他条件设备。当获取IFTTT规则的某个条件设备发生触发事件后,可以查询其他条件设备的触发事件,或者可以通知执行设备,由执行设备条件设备去查询其他条件设备的触发事件。最后,当确定所有条件设备的触发条件均发生后,执行设备执行相应事件,即完成联动,提升联动效率。In this application, the execution device and some conditional devices acquire the IFTTT rules in advance, and discover other electronic devices in the IFTTT rules, such as other conditional devices. When a trigger event occurs on a condition device that has acquired the IFTTT rule, the trigger event of other condition devices can be queried, or the execution device can be notified, and the execution device condition device can query the trigger events of other condition devices. Finally, when it is determined that the triggering conditions of all the conditional devices have occurred, the execution device executes the corresponding event, that is, the linkage is completed and the linkage efficiency is improved.

第四方面、本申请提供的一种多电子设备联动控制的系统,包括第一电子设备和第二电子设备;第一电子设备,用于获取第一规则,第一规则指示当第二电子设备发生第一事件时,第一电子设备执行第一功能;根据第一规则,向第二电子设备发送针对第一事件的订阅消息;第二电子设备,用于当检测到已发生第一事件时,向第一电子设备发送第一事件的通知消息;第一电子设备,还用于响应于接收到的第一事件的通知消息,根据第一规则执行第一功能。In a fourth aspect, a system for linkage control of multiple electronic devices provided by the present application includes a first electronic device and a second electronic device; the first electronic device is used to obtain a first rule, and the first rule indicates when the second electronic device When the first event occurs, the first electronic device performs the first function; according to the first rule, sends a subscription message for the first event to the second electronic device; the second electronic device is used to detect that the first event has occurred , sending a notification message of the first event to the first electronic device; the first electronic device is further configured to perform the first function according to the first rule in response to the received notification message of the first event.

一种可能的实现方式中,该系统还包括第三电子设备和第四电子设备,第一电子设备,还用于获取第二规则,第二规则指示当第三电子设备发生第二事件,且第四电子设备发送第三事件时,则第一电子设备执行第二功能;根据第二规则,向第三电子设备发送针对第二事件的订阅消息;第三电子设备,用于当检测到已发生第二事件时,向第一电子设备发送第二事件已发生的通知消息;第一电子设备,还用于确定第四电子设备是否发生第三事件;响应于确定第四电子设备发生第三事件,根据第二规则执行第二功能。In a possible implementation manner, the system further includes a third electronic device and a fourth electronic device, the first electronic device is further configured to acquire a second rule, the second rule indicates that when a second event occurs in the third electronic device, and When the fourth electronic device sends the third event, the first electronic device performs the second function; according to the second rule, sends a subscription message for the second event to the third electronic device; When the second event occurs, send a notification message that the second event has occurred to the first electronic device; the first electronic device is also used to determine whether the third event occurs in the fourth electronic device; in response to determining that the fourth electronic device occurs the third event event to perform the second function according to the second rule.

第五方面、本申请提供的一种第一电子设备,包括:处理器和存储器,存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当计算机指令被第一电子设备执行时,使得第一电子设备执行如下操作:A fifth aspect, a first electronic device provided by the present application includes: a processor and a memory, the memory is coupled to the processor, and the memory is used to store computer program codes, and the computer program codes include computer instructions, when the computer instructions are executed by the first electronic device. When the device is executed, the first electronic device is caused to perform the following operations:

获取第一规则,第一规则指示当第二电子设备发生第一事件时,第一电子设备执行第一功能;根据第一规则,向第二电子设备发送针对第一事件的订阅消息;接收第二电子设备发送的第一事件的通知消息;响应于接收到的第一事件的通知消息,根据第一规则执行第一功能。Acquire a first rule, the first rule indicates that when a first event occurs in the second electronic device, the first electronic device executes the first function; according to the first rule, send a subscription message for the first event to the second electronic device; receive the first Second, the notification message of the first event sent by the electronic device; in response to the received notification message of the first event, the first function is executed according to the first rule.

一种可能的实现方式中,该第一电子设备还获取第二规则,第二规则指示当第三电子设备发生第二事件,且第四电子设备发送第三事件时,则第一电子设备执行第二功能;根据第二规则,向第三电子设备发送针对第二事件的订阅消息;接收到第三电子设备发送的第二事件的通知消息;获取第四电子设备是否发生第三事件;响应于获取到第四电子设备发生第三事件,根据第二规则执行第二功能。In a possible implementation manner, the first electronic device also acquires a second rule, and the second rule indicates that when a second event occurs in the third electronic device and the fourth electronic device sends the third event, the first electronic device executes the second function; send a subscription message for the second event to the third electronic device according to the second rule; receive a notification message of the second event sent by the third electronic device; obtain whether the third event occurs in the fourth electronic device; respond After it is acquired that a third event occurs in the fourth electronic device, the second function is performed according to the second rule.

一种可能的实现方式中,响应于获取到第四电子设备发生第三事件,根据第二规则执行第二功能,具体为:响应于接收第四电子设备发送的已发生第三事件的通知消息,根据第二规则执行第二功能。In a possible implementation manner, in response to acquiring the occurrence of the third event in the fourth electronic device, executing the second function according to the second rule, specifically: in response to receiving a notification message sent by the fourth electronic device that the third event has occurred , and perform the second function according to the second rule.

一种可能的实现方式中,当计算机指令被第一电子设备执行时,还使得第一电子设备执行如下操作:In a possible implementation manner, when the computer instruction is executed by the first electronic device, the first electronic device is also caused to perform the following operations:

响应于接收到第三电子设备发送的第二事件的通知消息,第一电子设备向第四电子设备发送查询第三事件是否发生的消息。In response to receiving the notification message of the second event sent by the third electronic device, the first electronic device sends a message for querying whether the third event occurs to the fourth electronic device.

一种可能的实现方式中,当计算机指令被第一电子设备执行时,还使得第一电子设备执行如下操作:根据第二规则,获取第三电子设备的地址和第四电子设备的地址。In a possible implementation manner, when the computer instruction is executed by the first electronic device, the first electronic device is further caused to perform the following operation: obtain the address of the third electronic device and the address of the fourth electronic device according to the second rule.

一种可能的实现方式中,第二规则包括第三电子设备的标识和第四电子设备的标识;根据第二规则,获取第三电子设备的地址和第四电子设备的地址,具体包括:组播或广播第一消息,第一消息包括第三电子设备的标识和第四电子设备的标识;接收第三电子设备返回的第三电子设备的地址;电子设备接收第四电子设备返回的第四电子设备的地址。In a possible implementation manner, the second rule includes the identifier of the third electronic device and the identifier of the fourth electronic device; according to the second rule, the address of the third electronic device and the address of the fourth electronic device are obtained, specifically including: broadcast or broadcast the first message, the first message includes the identifier of the third electronic device and the identifier of the fourth electronic device; the address of the third electronic device returned by the third electronic device is received; the electronic device receives the fourth electronic device returned by the fourth electronic device The address of the electronic device.

一种可能的实现方式中,当计算机指令被第一电子设备执行时,还使得第一电子设备执行如下操作:检测第二规则的合法性和/或完整性。In a possible implementation manner, when the computer instruction is executed by the first electronic device, the first electronic device is further caused to perform the following operation: check the validity and/or integrity of the second rule.

一种可能的实现方式中,获取第二规则具体为:从服务器或第五电子设备获取第二规则。In a possible implementation manner, acquiring the second rule is specifically: acquiring the second rule from the server or the fifth electronic device.

第六方面、本申请提供的一种第一电子设备,包括:处理器和存储器,存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当计算机指令被第一电子设备执行时,使得第一电子设备执行如下操作:A sixth aspect, a first electronic device provided by the present application includes: a processor and a memory, the memory is coupled to the processor, and the memory is used to store computer program codes, and the computer program codes include computer instructions, when the computer instructions are executed by the first electronic device. When the device is executed, the first electronic device is caused to perform the following operations:

获取第一规则,第一规则指示当第一电子设备发生第一事件,且第二电子设备发生第二事件时,第三电子设备执行第一功能;接收到第二电子设备发送的第二事件已发生的通知消息;响应于接收到的第二事件已发生的通知消息,检测第一事件是否发生;若检测到第一事件已发生,则向第三电子设备发送执行指令,执行指令指示第三电子设备执行第一功能。Acquire a first rule, the first rule indicates that when a first event occurs on the first electronic device and a second event occurs on the second electronic device, the third electronic device executes the first function; the second event sent by the second electronic device is received The notification message that has occurred; in response to the received notification message that the second event has occurred, detect whether the first event has occurred; if it is detected that the first event has occurred, send an execution instruction to the third electronic device, and the execution instruction indicates the first event. The three electronic devices perform the first function.

第七方面,本申请提供的一种第一电子设备,包括:处理器和存储器,存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当计算机指令被第一电子设备执行时,使得第一电子设备执行如下操作:In a seventh aspect, a first electronic device provided by the present application includes: a processor and a memory, the memory is coupled to the processor, and the memory is used to store computer program codes, and the computer program codes include computer instructions, and when the computer instructions are executed by the first electronic device When the device is executed, the first electronic device is caused to perform the following operations:

获取第一规则,第一规则指示当第一电子设备发生第一事件,且第二电子设备发生第二事件时,第三电子设备执行第一功能;检测到已发生第一事件;响应于检测到已发生第一事件,向第二电子设备发送查询第二事件是否发生的消息;接收到第二电子设备发送的第二事件已发生的通知消息;响应于接收到的第二事件已发生的通知消息,向第三电子设备发送执行指令,执行指令指示第三电子设备执行第一功能。acquiring a first rule, the first rule indicating that when a first event occurs in the first electronic device and a second event occurs in the second electronic device, the third electronic device performs a first function; detecting that the first event has occurred; in response to detecting When the first event has occurred, send a message to the second electronic device to inquire whether the second event has occurred; receive a notification message sent by the second electronic device that the second event has occurred; in response to the received second event has occurred The notification message sends an execution instruction to the third electronic device, and the execution instruction instructs the third electronic device to execute the first function.

第八方面、一种计算机存储介质,包括计算机指令,当计算机指令在终端上运行时,使得终端执行如第一方面至第三方面及其中任一种可能的实现方式中所述的方法。In an eighth aspect, a computer storage medium includes computer instructions, which, when the computer instructions are executed on a terminal, cause the terminal to execute the method described in the first aspect to the third aspect and any one of the possible implementation manners.

第九方面、一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第一方面至第三方面中及其中任一种可能的实现方式中所述的方法。In a ninth aspect, a computer program product, when the computer program product is run on a computer, causes the computer to perform the method as described in the first aspect to the third aspect and any one of the possible implementations.

附图说明Description of drawings

图1为本申请实施例提供的一种多电子设备联动控制的系统的结构示意图;1 is a schematic structural diagram of a system for linkage control of multiple electronic devices provided by an embodiment of the present application;

图2A为本申请实施例提供的一种电子设备的硬件结构示意图;2A is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the application;

图2B为本申请实施例提供的一种电子设备的软件结构示意图;FIG. 2B is a schematic diagram of a software structure of an electronic device provided by an embodiment of the present application;

图3A为本申请实施例提供的一种电子设备的界面示意图;3A is a schematic interface diagram of an electronic device provided by an embodiment of the present application;

图3B为本申请实施例提供的又一种电子设备的界面示意图;3B is a schematic interface diagram of another electronic device provided by an embodiment of the present application;

图3C为本申请实施例提供的又一种电子设备的界面示意图;3C is a schematic interface diagram of another electronic device provided by an embodiment of the present application;

图3D为本申请实施例提供的又一种电子设备的界面示意图;3D is a schematic interface diagram of another electronic device provided by an embodiment of the present application;

图3E为本申请实施例提供的又一种电子设备的界面示意图;3E is a schematic interface diagram of another electronic device provided by an embodiment of the present application;

图3F为本申请实施例提供的又一种电子设备的界面示意图;3F is a schematic interface diagram of another electronic device provided by an embodiment of the present application;

图3G为本申请实施例提供的又一种电子设备的界面示意图;3G is a schematic interface diagram of another electronic device provided by an embodiment of the present application;

图3H为本申请实施例提供的又一种电子设备的界面示意图;3H is a schematic interface diagram of another electronic device provided by an embodiment of the present application;

图3I为本申请实施例提供的又一种电子设备的界面示意图;3I is a schematic interface diagram of another electronic device provided by an embodiment of the present application;

图4A为本申请实施例提供的一种多电子设备联动控制的方法的流程示意图;4A is a schematic flowchart of a method for linkage control of multiple electronic devices provided by an embodiment of the present application;

图4B为本申请实施例提供的又一种多电子设备联动控制的方法的流程示意图;4B is a schematic flowchart of another method for linkage control of multiple electronic devices provided by an embodiment of the present application;

图5A为本申请实施例提供的又一种多电子设备联动控制的方法的流程示意图;5A is a schematic flowchart of another method for linkage control of multiple electronic devices provided by an embodiment of the present application;

图5B为本申请实施例提供的又一种多电子设备联动控制的方法的流程示意图;5B is a schematic flowchart of another method for linkage control of multiple electronic devices provided by an embodiment of the present application;

图6A为本申请实施例提供的又一种多电子设备联动控制的方法的流程示意图;6A is a schematic flowchart of another method for linkage control of multiple electronic devices provided by an embodiment of the present application;

图6B为本申请实施例提供的又一种多电子设备联动控制的方法的流程示意图;6B is a schematic flowchart of another method for linkage control of multiple electronic devices provided by an embodiment of the present application;

图7为本申请实施例提供的又一种电子设备的结构示意图;FIG. 7 is a schematic structural diagram of another electronic device provided by an embodiment of the present application;

图8为本申请实施例提供的又一种电子设备的结构示意图。FIG. 8 is a schematic structural diagram of another electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/ 或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, unless otherwise stated, “/” means or means, for example, A/B can mean A or B; “and/or” in this document is only a description of the associated object The association relationship of , indicates that there can be three kinds of relationships, for example, A and/or B, can indicate: the existence of A alone, the existence of A and B at the same time, and the existence of B alone.

以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

IFTTT规则:if this then that的缩写,其宗旨为Put the internet to workfor you(让互联网为你服务)。可以简单理解为,如果触发了某一事件,则执行设置好的另一事件。也即,若满足了IFTTT规则中触发条件,则执行IFTTT规则中对应的操作。IFTTT rules: short for if this then that, its purpose is Put the internet to work for you. It can be simply understood that if a certain event is triggered, another set event is executed. That is, if the trigger condition in the IFTTT rule is satisfied, the corresponding operation in the IFTTT rule is executed.

上述触发条件,也可以称之为触发事件,如果IFTTT规则中A设备执行了某个或某些操作,或者A设备检测的参数满足某个或某些条件,则B设备执行对应的操作,则A设备可以称为条件设备,B设备可以称为执行设备。其中,IFTTT规则中,条件设备的数量可以是一个或多个,执行设备的数量可以是一个或多个,本申请实施例不做限定。The above trigger conditions can also be called trigger events. If device A performs one or some operations in the IFTTT rule, or the parameters detected by device A meet one or some conditions, then device B performs the corresponding operation, then The A device may be referred to as the condition device, and the B device may be referred to as the execution device. Wherein, in the IFTTT rule, the number of conditional devices may be one or more, and the number of execution devices may be one or more, which is not limited in this embodiment of the present application.

例如:一条IFTTT规则为:如果A设备执行了某个或某些操作(或者A设备检测的参数满足某个或某些条件),并且,C设备执行了某个或某些操作(或者C设备检测的参数满足某个或某些条件),则B设备执行对应的操作。在该条IFTTT规则中,A设备和C设备均为条件设备,B设备为执行设备。For example, an IFTTT rule is: if device A performs one or some operations (or the parameters detected by device A meet one or some conditions), and device C performs one or some operations (or device C If the detected parameter satisfies a certain or certain conditions), the B device performs the corresponding operation. In this IFTTT rule, device A and device C are both conditional devices, and device B is the execution device.

又例如:另一条IFTTT规则为:如果A设备执行了某个或某些操作(或者A设备检测的参数满足某个或某些条件),则B设备执行相应的操作,且D设备执行相应的操作。在该条IFTTT规则中,A设备条件设备,B设备和D设备为执行设备。Another example: Another IFTTT rule is: if device A performs one or some operations (or the parameters detected by device A meet one or some conditions), device B performs the corresponding operation, and device D performs the corresponding operation. operate. In this IFTTT rule, A device conditional device, B device and D device are execution devices.

需要说明的是,在一些实施例中,IFTTT规则中也可以没有条件设备,那么执行设备可以根据例如本地的时间,自动执行相应的操作。It should be noted that, in some embodiments, there may be no conditional device in the IFTTT rule, and then the execution device may automatically execute corresponding operations according to, for example, local time.

在现有技术中,基于IFTTT规则的多个电子设备联动过程都是基于集中式控制的方案。例如:当条件设备的触发事件发生后,会将触发事件通过互联网传递到控制设备,由控制设备进行逻辑判断后,再通过互联网向执行设备发送执行命令,而后执行设备执行相应操作。由于多个电子设备需要通过互联网进行通信,联动过程必然会受到互联网的连接状态的影响,造成时延长且不稳定的情况。此外,多个电子设备可以为用户的家居设备,将家居设备的状态以及IFTTT规则的执行情况上传到互联网,信息一旦泄露,存在极大的安全风险。In the prior art, the linkage process of multiple electronic devices based on IFTTT rules is based on a centralized control scheme. For example: when the trigger event of the conditional device occurs, the trigger event will be transmitted to the control device through the Internet. After the control device makes a logical judgment, an execution command is sent to the execution device through the Internet, and then the execution device executes the corresponding operation. Since multiple electronic devices need to communicate through the Internet, the linkage process will inevitably be affected by the connection status of the Internet, resulting in prolonged and unstable situations. In addition, multiple electronic devices can be the user's home device, and the status of the home device and the implementation of the IFTTT rules can be uploaded to the Internet. Once the information is leaked, there is a great security risk.

为此,本申请实施例提供的一种控制方法,可用于至少两个电子设备之间的联动控制。在这至少两个电子设备之间的联动过程中,各个电子设备之间可以通过本地连接直接进行通信,完成联动。也就是说,在这至少两个电子设备完成的联动过程中,不再采用现有技术中的集中式控制的方法,即,不再需要通过控制设备进行中转。To this end, a control method provided by an embodiment of the present application can be used for linkage control between at least two electronic devices. During the linkage process between the at least two electronic devices, each electronic device can communicate directly through a local connection to complete the linkage. That is to say, in the linkage process completed by the at least two electronic devices, the centralized control method in the prior art is no longer used, that is, the transfer through the control device is no longer required.

这样,一方面,可以避免互联网的连接状态对多个电子设备之间的联动造成的影响,也可以避免将多个电子设备的信息上传互联网而带来的安全风险。另一方面,也有利于消除因控制设备的中转带来的时延,以及因控制设备的断开连接,造成联动失败的情况,提升了电子设备之间联动的效率和稳定性。In this way, on the one hand, the influence of the connection state of the Internet on the linkage between multiple electronic devices can be avoided, and the security risk caused by uploading the information of multiple electronic devices to the Internet can also be avoided. On the other hand, it is also beneficial to eliminate the delay caused by the transfer of the control equipment, and the failure of the linkage caused by the disconnection of the control equipment, and improve the efficiency and stability of the linkage between electronic devices.

如图1所示,为本申请实施例提供的一种多个电子设备联动的系统,该系统包括:电子设备10(电子设备A),服务器11以及本地网络的一个或多个电子设备12(电子设备B)。As shown in FIG. 1 , a system for linkage of multiple electronic devices provided in an embodiment of the present application includes: an electronic device 10 (electronic device A), a server 11 and one or more electronic devices 12 (electronic device A) of a local network. Electronic equipment B).

其中,电子设备10(电子设备A),用于提供该系统与用户的交互界面,以便用户设置 IFTTT规则。在一些实施例中,电子设备10(电子设备A)将设置好的IFTTT规则通过服务器11下发到本地网络中的电子设备12(电子设备B)。在另一些实施例中,电子设备10(电子设备A)也可以与本地网络的电子设备12(电子设备B)建立本地连接,那么,电子设备10 (电子设备A)也可以通过本地连接,将设置好的IFTTT规则发送给电子设备12(电子设备 B),本申请实施例对此不做限定。Among them, the electronic device 10 (electronic device A) is used to provide an interactive interface between the system and the user, so that the user can set the IFTTT rules. In some embodiments, the electronic device 10 (electronic device A) delivers the set IFTTT rules to the electronic device 12 (electronic device B) in the local network through the server 11 . In other embodiments, the electronic device 10 (electronic device A) can also establish a local connection with the electronic device 12 (electronic device B) in the local network, then the electronic device 10 (electronic device A) can also connect to the local network through the local connection. The set IFTTT rule is sent to the electronic device 12 (electronic device B), which is not limited in this embodiment of the present application.

而后,本地网络的电子设备12(电子设备B)可以基于获取到的IFTTT规则,进行本地网络的多个电子设备12(电子设备B)之间的联动。Then, the electronic device 12 (electronic device B) of the local network can perform linkage among multiple electronic devices 12 (electronic device B) of the local network based on the acquired IFTTT rule.

示例性的,电子设备10(电子设备A)在具体的实现中,可以为手机、平板电脑、个人计算机(Personal Computer,PC)、个人数字助理(personal digital assistant,PDA)、智能手表、上网本、可穿戴电子设备、增强现实技术(Augmented Reality,AR)设备、智能音响等。Exemplarily, in a specific implementation, the electronic device 10 (electronic device A) may be a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a smart watch, a netbook, Wearable electronic devices, Augmented Reality (AR) devices, smart speakers, etc.

其中,电子设备10(电子设备A)可以通过有线、WIFI、移动数据网或者其他连接方式与服务器11建立连接。Wherein, the electronic device 10 (electronic device A) can establish a connection with the server 11 through wired, WIFI, mobile data network or other connection methods.

本申请实施例中的电子设备10(电子设备A)的结构可以参考图2A所示的电子设备100 的结构,以及图2B所示的电子设备100的软件结构示意图。For the structure of the electronic device 10 (electronic device A) in this embodiment of the present application, reference may be made to the structure of the electronic device 100 shown in FIG. 2A and the schematic diagram of the software structure of the electronic device 100 shown in FIG. 2B .

示例性的,电子设备12(电子设备B)在具体的实现中,可以是智能家居的硬件设备,可以包括移动终端、家用电器以及传感器设备等。例如:电子设备12(电子设备B)可以是智能手机、智能电视、智能灯、智能插座、空气净化器、加湿器、智能油烟机、智能台灯、智能音箱、智能门锁、智能插线板、智能电磁炉、智能摄像头等。再例如:电子设备12(电子设备B)还可以是烟雾传感器(用于检测房间内是否有燃气泄漏)、人体感应器(用于感应是否有人体通过)、温度传感器(用于检测房间或物品的温度值)、湿度传感器(用于检测房间的湿度值)、门窗感应器(用于感知门窗是否开启或关闭)、PM2.5空气传感器(用于检测房间PM2.5的含值)等。Exemplarily, in a specific implementation, the electronic device 12 (electronic device B) may be a hardware device of a smart home, and may include a mobile terminal, a household appliance, a sensor device, and the like. For example, the electronic device 12 (electronic device B) can be a smart phone, smart TV, smart light, smart socket, air purifier, humidifier, smart range hood, smart desk lamp, smart speaker, smart door lock, smart power strip, Smart induction cooker, smart camera, etc. Another example: the electronic device 12 (electronic device B) can also be a smoke sensor (for detecting whether there is gas leakage in a room), a human body sensor (for detecting whether a human body passes through), a temperature sensor (for detecting a room or an item) temperature value), humidity sensor (used to detect the humidity value of the room), door and window sensor (used to sense whether doors and windows are open or closed), PM2.5 air sensor (used to detect the value of PM2.5 in the room), etc.

其中,本地网络中的电子设备12(电子设备B)可以通过有线、WIFI、移动数据网或者其他连接方式与服务器11建立连接,或者通过局域网中的路由器与服务器11建立连接。其中,服务器11可以为家居云,IoT(Internet of Things,物联网)等的服务器或者服务器集群,可以将家居中的各种电子电气设备连接起来,统一管理、远程监控和资源共享等,实现了高效、便利的生活环境。需要注意的是,本地网络中全部的电子设备12(电子设备B)可以都与服务器11建立连接,也可以由其中一部分电子设备12(电子设备B)(需要获取IFTTT规则的电子设备12(电子设备B))与服务器11建立连接,本申请实施例不做具体限定。The electronic device 12 (electronic device B) in the local network can establish a connection with the server 11 through wired, WIFI, mobile data network or other connection methods, or establish a connection with the server 11 through a router in a local area network. Among them, the server 11 can be a home cloud, IoT (Internet of Things, Internet of Things) server or server cluster, which can connect various electrical and electronic equipment in the home, unified management, remote monitoring and resource sharing, etc., to achieve Efficient and convenient living environment. It should be noted that all the electronic devices 12 (electronic device B) in the local network may establish a connection with the server 11, or a part of the electronic devices 12 (electronic device B) (the electronic device 12 (electronic device B) that needs to obtain the IFTTT rules The device B)) establishes a connection with the server 11, which is not specifically limited in this embodiment of the present application.

本地网络中的电子设备12(电子设备B)之间,可以通过有线或无线的方式建立连接,使得电子设备12(电子设备B)之间可以直接进行通信。其中,无线连接方式例如可以为蓝牙、ZigBee(紫蜂)、WiFi等任一种或任几种方式。本申请实施例对本地网络中电子设备12(电子设备B)之间的连接方式不做限定。A connection can be established between the electronic devices 12 (electronic device B) in the local network in a wired or wireless manner, so that the electronic devices 12 (electronic device B) can communicate directly. Wherein, the wireless connection manner may be, for example, any one or any of several manners such as Bluetooth, ZigBee (ZigBee), and WiFi. The embodiment of the present application does not limit the connection mode between the electronic devices 12 (electronic device B) in the local network.

本申请实施例的电子设备12(电子设备B)的结构可以参考图2A所示的电子设备100 的结构,以及图2B所示的电子设备100的软件结构示意图。需要说明的是,电子设备12(电子设备B)可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。For the structure of the electronic device 12 (electronic device B) in this embodiment of the present application, reference may be made to the structure of the electronic device 100 shown in FIG. 2A and the schematic diagram of the software structure of the electronic device 100 shown in FIG. 2B . It should be noted that the electronic device 12 (electronic device B) may include more or less components than shown, or some components may be combined, or some components may be separated, or different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

例如:电子设备12(电子设备B)为智能门锁时,电子设备12(电子设备B)可以包括有处理器110、内部存储器121、指纹传感器180H、无线通信模块160(例如可以是WLAN 通信模块)、电池142、电开关等部件。For example: when the electronic device 12 (electronic device B) is a smart door lock, the electronic device 12 (electronic device B) may include aprocessor 110, an internal memory 121, a fingerprint sensor 180H, a wireless communication module 160 (for example, a WLAN communication module) ), battery 142, electrical switches and other components.

再例如:电子设备12(电子设备B)为智能音箱时,电子设备12(电子设备B)可以包括有处理器110、内部存储器121、拾音器(例如麦克风170C)、无线通信模块160(例如可以包括WLAN通信模块、蓝牙通信模块等)、电源管理模块141、充电管理模块140、电池 142、USB接口130、指示器192等部件。For another example: when the electronic device 12 (electronic device B) is a smart speaker, the electronic device 12 (electronic device B) may include aprocessor 110, an internal memory 121, a pickup (eg, amicrophone 170C), a wireless communication module 160 (eg, may include WLAN communication module, Bluetooth communication module, etc.), power management module 141, chargingmanagement module 140, battery 142, USB interface 130, indicator 192 and other components.

又例如:电子设备12(电子设备B)为空调时,电子设备12(电子设备B)可以包括有处理器110、内部存储器121、无线通信模块160(例如可以包括WLAN通信模块、红外信号模块等)、电源管理模块141、充电管理模块140、制冷系统、通风系统、电气控制系统和箱体系统等部件。For another example: when the electronic device 12 (electronic device B) is an air conditioner, the electronic device 12 (electronic device B) may include aprocessor 110, an internal memory 121, a wireless communication module 160 (for example, may include a WLAN communication module, an infrared signal module, etc. ), power management module 141, chargingmanagement module 140, refrigeration system, ventilation system, electrical control system, box system and other components.

以下,给出电子设备100的硬件结构示意图以及说明,电子设备100的软件结构示意图以及说明。Below, a schematic diagram and description of the hardware structure of the electronic device 100 and a schematic diagram and description of the software structure of the electronic device 100 are given.

图2A示出了电子设备100的结构示意图。FIG. 2A shows a schematic structural diagram of the electronic device 100 .

电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器 180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include aprocessor 110, anexternal memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, acharge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 ,mobile communication module 150,wireless communication module 160,audio module 170, speaker 170A,receiver 170B,microphone 170C,headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (SIM)card interface 195 and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L,bone conduction sensor 180M, etc.

可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。Theprocessor 110 may include one or more processing units, for example, theprocessor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor ( image signal processor, ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and/or neural-network processing unit (NPU), etc. . Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110 中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in theprocessor 110 for storing instructions and data. In some embodiments, the memory in theprocessor 110 is a cache memory. This memory may hold instructions or data that have just been used or recycled by theprocessor 110 . If theprocessor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of theprocessor 110 is reduced, thereby increasing the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface, MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, theprocessor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) interface /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and/or Universal serial bus (universal serial bus, USB) interface, etc.

I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头 193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, theprocessor 110 may contain multiple sets of I2C buses. Theprocessor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, theprocessor 110 may couple the touch sensor 180K through the I2C interface, so that theprocessor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the electronic device 100 .

I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, theprocessor 110 may contain multiple sets of I2S buses. Theprocessor 110 may be coupled with theaudio module 170 through an I2S bus to implement communication between theprocessor 110 and theaudio module 170 . In some embodiments, theaudio module 170 can transmit audio signals to thewireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.

PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals. In some embodiments, theaudio module 170 and thewireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, theaudio module 170 can also transmit audio signals to thewireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect theprocessor 110 with thewireless communication module 160 . For example, theprocessor 110 communicates with the Bluetooth module in thewireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, theaudio module 170 can transmit audio signals to thewireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.

MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(displayserial interface, DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100 的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect theprocessor 110 with peripheral devices such as the display screen 194 and the camera 193 . MIPI interfaces include a camera serial interface (camera serial interface, CSI), a display serial interface (displayserial interface, DSI), and the like. In some embodiments, theprocessor 110 communicates with the camera 193 through a CSI interface to implement the photographing function of the electronic device 100 . Theprocessor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the electronic device 100 .

GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S 接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface may be used to connect theprocessor 110 with the camera 193, the display screen 194, thewireless communication module 160, theaudio module 170, the sensor module 180, and the like. The GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.

USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices.

可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.

充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。Thecharging management module 140 is used to receive charging input from the charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, thecharging management module 140 may receive charging input from the wired charger through the USB interface 130 . In some wireless charging embodiments, thecharging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While thecharging management module 140 charges the battery 142 , it can also supply power to the electronic device through the power management module 141 .

电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块 141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , thecharging management module 140 and theprocessor 110 . The power management module 141 receives input from the battery 142 and/or thecharge management module 140, and supplies power to theprocessor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and thewireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in theprocessor 110 . In other embodiments, the power management module 141 and thecharging management module 140 may also be provided in the same device.

电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, themobile communication module 150, thewireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.

天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.

移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。Themobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 . Themobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. Themobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. Themobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of themobile communication module 150 may be provided in theprocessor 110 . In some embodiments, at least part of the functional modules of themobile communication module 150 may be provided in the same device as at least part of the modules of theprocessor 110 .

调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the speaker 170A, thereceiver 170B, etc.), or displays images or videos through the display screen 194 . In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be independent of theprocessor 110, and may be provided in the same device as themobile communication module 150 or other functional modules.

无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。Thewireless communication module 160 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems applied on the electronic device 100 . (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. Thewireless communication module 160 may be one or more devices integrating at least one communication processing module. Thewireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to theprocessor 110 . Thewireless communication module 160 can also receive the signal to be sent from theprocessor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .

在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution, LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system, GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统 (quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems, SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled with themobile communication module 150, and the antenna 2 is coupled with thewireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code Wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM , and/or IR technology, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou satellite navigation system (BDS), a quasi-zenith satellite system (quasi- zenith satellite system, QZSS) and/or satellite based augmentation system (satellite based augmentation systems, SBAS).

电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.

显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode 的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed, Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). , AMOLED), flexible light-emitting diodes (flex light-emitting diodes, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.

电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.

ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193 . For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193 .

摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体 (complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object is projected through the lens to generate an optical image onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.

视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组 (moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.

NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process the input information, and can continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备 100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。Theexternal memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with theprocessor 110 through theexternal memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.

内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。Internal memory 121 may be used to store computer executable program code, which includes instructions. Theprocessor 110 executes various functional applications and data processing of the electronic device 100 by executing the instructions stored in the internal memory 121 . The internal memory 121 may include a storage program area and a storage data area. The storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like. The storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like. In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.

电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 may implement audio functions through anaudio module 170, a speaker 170A, areceiver 170B, amicrophone 170C, anearphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.

音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110 中。Theaudio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal.Audio module 170 may also be used to encode and decode audio signals. In some embodiments, theaudio module 170 may be provided in theprocessor 110 , or some functional modules of theaudio module 170 may be provided in theprocessor 110 .

扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。Speaker 170A, also referred to as a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.

受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。Thereceiver 170B, also referred to as "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a call or a voice message, the voice can be answered by placing thereceiver 170B close to the human ear. Themicrophone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching themicrophone 170C through a human mouth, and input the sound signal into themicrophone 170C. The electronic device 100 may be provided with at least onemicrophone 170C. In other embodiments, the electronic device 100 may be provided with twomicrophones 170C, which can implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further be provided with three, four ormore microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions. Theearphone jack 170D is used to connect wired earphones. Theearphone port 170D may be the USB port 130 or a 3.5mm open mobile terminal platform (OMTP) standard port, a cellular telecommunications industry association of the USA (CTIA) standard port.

压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be provided on the display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, and the like. The capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.

陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100 抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 . In some embodiments, the angular velocity of electronic device 100 about three axes (ie, x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the shaking angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and allows the lens to counteract the shaking of the electronic device 100 through reverse motion to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenarios.

气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C 测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D 检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.

加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.

距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。Distance sensor 180F for measuring distance. The electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100 使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The electronic device 100 emits infrared light to the outside through the light emitting diode. Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 . The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.

环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器 180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.

指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.

温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J 检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备 100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142 的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect the temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch panel". The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.

骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。Thebone conduction sensor 180M can acquire vibration signals. In some embodiments, thebone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice. Thebone conduction sensor 180M can also contact the pulse of the human body and receive the blood pressure beating signal. In some embodiments, thebone conduction sensor 180M can also be disposed in the earphone, combined with the bone conduction earphone. Theaudio module 170 can analyze the voice signal based on the vibration signal of the vocal vibration bone block obtained by thebone conduction sensor 180M, so as to realize the voice function. The application processor can analyze the heart rate information based on the blood pressure beat signal obtained by thebone conduction sensor 180M, and realize the function of heart rate detection.

按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .

马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 191 can generate vibrating cues. The motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 . Different application scenarios (for example: time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.

SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。 SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。TheSIM card interface 195 is used to connect a SIM card. The SIM card can be contacted and separated from the electronic device 100 by inserting into theSIM card interface 195 or pulling out from theSIM card interface 195 . The electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. TheSIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the sameSIM card interface 195 at the same time. The types of the plurality of cards may be the same or different. TheSIM card interface 195 can also be compatible with different types of SIM cards. TheSIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication. In some embodiments, the electronic device 100 employs an eSIM, ie: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .

电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 as an example.

图2B是本发明实施例的电子设备100的软件结构框图。FIG. 2B is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present invention.

分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and system libraries, and a kernel layer.

应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.

如图2B所示,应用程序层可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序包。As shown in Fig. 2B, the application layer may include application packages such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

在本申请的一些实施例中,应用程序层可以包括第一应用,第一应用可以为智能家居应用,用户可以使用该应用对智能家居的设备进行设置和管理。例如:用户可以使用第一应用,设置IFTTT规则,家庭网络中的多个第二电子设备可以基于用户设置的IFTTT规则进行联动,为用户提供智能的家居生活。In some embodiments of the present application, the application layer may include a first application, and the first application may be a smart home application, and a user may use the application to set and manage devices of the smart home. For example, the user can use the first application to set IFTTT rules, and multiple second electronic devices in the home network can be linked based on the IFTTT rules set by the user to provide users with smart home life.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for the applications of the application layer. The application framework layer includes some predefined functions.

如图2B所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 2B, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.

内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.

视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.

电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.).

资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.

通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.

Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.

应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.

系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL) and so on.

表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.

媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.

内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.

下面结合附图对本申请实施例提供的技术方案进行详细说明。The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

首先,在多个电子设备12(电子设备B)基于IFTTT规则进行联动之前,电子设备10(电子设备A)先接收用户对IFTTT规则的设置。First, before the multiple electronic devices 12 (electronic device B) perform linkage based on the IFTTT rule, the electronic device 10 (electronic device A) first receives the user's setting of the IFTTT rule.

示例性的,可以在电子设备10(电子设备A)的浏览器中输入与服务器11相关联的网址,登录IFTTT规则的设置页面。或者,也可以使用第一应用(例如智能家居APP等)登录IFTTT规则的设置网址。又或者,还可以在本地使用第一应用(例如智能家居APP等)的用户界面对IFTTT规则进行设置等,本申请实施例对此不做限定。Exemplarily, the web address associated with the server 11 may be entered in the browser of the electronic device 10 (electronic device A) to log in to the setting page of the IFTTT rule. Alternatively, the first application (such as a smart home APP, etc.) can also be used to log in to the setting URL of the IFTTT rule. Alternatively, the user interface of the first application (such as a smart home APP, etc.) may also be used locally to set the IFTTT rules, etc., which is not limited in this embodiment of the present application.

以手机为例,图3A至图3I,为本申请实施例提供的IFTTT规则的设置过程涉及到一些界面示意图。Taking a mobile phone as an example, FIG. 3A to FIG. 3I are schematic diagrams of some interfaces involved in the setting process of the IFTTT rule provided by the embodiment of the present application.

如图3A中所示,为手机的桌面301的示意图。桌面301显示有状态栏、时间和天气控件、应用程序图标(例如智能家居APP的图标302),以及dock栏等。其中,状态栏可以包括运营商的名称(例如中国移动)、时间、WiFi图标、信号强度和当前的剩余电量等。As shown in FIG. 3A , it is a schematic diagram of thedesktop 301 of the mobile phone. Thedesktop 301 displays a status bar, time and weather controls, application icons (eg, theicon 302 of a smart home APP), a dock bar, and the like. Wherein, the status bar may include the name of the operator (for example, China Mobile), time, WiFi icon, signal strength and current remaining power, and the like.

当手机检测到用户点击桌面301中的智能家居的图标302后,手机进入如图3B所示的智能家居APP的主界面303。When the mobile phone detects that the user clicks thesmart home icon 302 on thedesktop 301, the mobile phone enters themain interface 303 of the smart home APP as shown in FIG. 3B.

其中,智能家居APP可用于发现和连接到家庭网络的电子设备,还可以基于这些电子设备打造实用的生活场景,提供人性化的信息提示和交互等。Among them, the smart home APP can be used to discover and connect electronic devices to the home network, and can also create practical life scenarios based on these electronic devices, and provide user-friendly information prompts and interactions.

示例性的,手机可以通过智能家居APP,设置一些手动的生活场景,即需要用户手动开启某些生活场景,基于预先设置好的规则,与该生活场景相关电子设备执行相应的操作。手动开启的生活场景例如有:“回家”、“离家”、“阅读”、“睡眠”等。其中,相关的设置可参考现有技术,这里不再赘述。Exemplarily, the mobile phone can set some manual life scenes through the smart home APP, that is, the user needs to manually activate some life scenes, and based on the preset rules, the electronic devices related to the life scenes perform corresponding operations. Examples of life scenarios that are manually turned on include: "going home", "leaving home", "reading", "sleep", and so on. The relevant settings may refer to the prior art, which will not be repeated here.

例如:若用户在智能家居APP的主界面303上,点击控件304中的“回家”,那么,基于预先设置好的规则,窗户窗帘开启通风换气,电视机打开自己设置的频道或节目等。For example: if the user clicks "go home" in thecontrol 304 on themain interface 303 of the smart home APP, then, based on the preset rules, the windows and curtains are opened for ventilation, and the TV is turned on the channel or program set by himself, etc. .

示例性的,手机还可以通过智能家居APP,基于时间设置不同的生活场景。即,当到达某个预定时间后,基于预先设置好的规则,与该预定时间相关的电子设备开始自动执行相应的操作。其中,相关的设置可参考现有技术,这里不再赘述。Exemplarily, the mobile phone can also set different life scenarios based on time through the smart home APP. That is, when a certain predetermined time is reached, based on preset rules, the electronic device related to the predetermined time starts to automatically perform corresponding operations. The relevant settings may refer to the prior art, which will not be repeated here.

例如:当时间到达早上6:30,基于预先设置好的规则,卧室灯开启,智能音箱播放音乐,豆浆机煮好豆浆等。For example: when the time reaches 6:30 in the morning, based on the pre-set rules, the bedroom lights are turned on, the smart speaker plays music, the soymilk machine cooks soymilk, etc.

示例性的,手机还可以通过智能家居APP,基于本地网络中电子设备12(电子设备B) 设置不同的生活场景。即,当某个或某些电子设备12(电子设备B)的工作状态满足预设条件时,自动触发其他电子设备12(电子设备B)执行相应的操作。Exemplarily, the mobile phone can also set different life scenarios based on the electronic device 12 (electronic device B) in the local network through the smart home APP. That is, when the working state of one or some electronic devices 12 (electronic device B) satisfies a preset condition, other electronic devices 12 (electronic device B) are automatically triggered to perform corresponding operations.

例如:如果智能门锁识别出门口的人为合法的,则智能门锁自动开锁。又例如:如果门开了,且室内温度高于28摄氏度,则空调自动启动。For example: if the smart door lock recognizes that the person at the door is legal, the smart door lock will automatically unlock. Another example: if the door is opened and the indoor temperature is higher than 28 degrees Celsius, the air conditioner will automatically start.

下面对手机基于本地网络中电子设备12(电子设备B)设置不同的生活场景的过程进行说明。The following describes the process of setting different life scenarios on the mobile phone based on the electronic device 12 (electronic device B) in the local network.

请参见图3B,在智能家居APP的主界面303上,检测到用户点击“添加”控件305,手机弹出设置添加设备和添加场景的菜单,如图3C所示的界面306中的菜单307。响应于用户选择菜单307中的添加场景,手机显示设置IFTTT规则的界面,如图3D所示的界面308。该界面308中左侧的添加控件309,可用于添加条件设备以及设置触发条件。右侧的添加控件310,可用于添加执行设备以及设置执行操作。Referring to FIG. 3B, on themain interface 303 of the smart home APP, it is detected that the user clicks on the “Add”control 305, and the mobile phone pops up a menu for setting an added device and adding a scene, as shown in themenu 307 in theinterface 306 shown in FIG. 3C. In response to the user selecting the add scene in themenu 307, the mobile phone displays an interface for setting the IFTTT rules, such as theinterface 308 shown in FIG. 3D. The addingcontrol 309 on the left side of theinterface 308 can be used to add conditional devices and set triggering conditions. Theadd control 310 on the right can be used to add execution devices and set execution operations.

需要说明的是,用户进入设置IFTTT规则的界面的方式可以有很多,且设置IFTTT规则的界面的具体形式和具体内容也可以有多种,本申请实施例对此均不做限定。It should be noted that there may be many ways for the user to enter the interface for setting IFTTT rules, and there may also be various specific forms and specific contents of the interface for setting IFTTT rules, which are not limited in this embodiment of the present application.

在如图3D所示的界面308上,检测到用户点击添加控件309,手机显示如图3E所示的界面311,该界面311为对IFTTT规则中的条件设备和触发条件进行设置的界面。在该界面311上,用户可以选择条件设备,在选择条件设备后,手机会弹出设置该条件设备的触发条件的窗口或菜单等。On theinterface 308 shown in FIG. 3D, it is detected that the user clicks on theadd control 309, and the mobile phone displays theinterface 311 shown in FIG. 3E, which is an interface for setting the conditional devices and trigger conditions in the IFTTT rule. On theinterface 311, the user can select a conditional device, and after selecting the conditional device, the mobile phone will pop up a window or menu for setting the triggering condition of the conditional device.

例如:如图3E所示的界面311,在检测到用户选择“智能门锁”后,弹出菜单312,用户可以进一步设置该条件设备的触发条件。例如:触发条件为智能门锁处于开锁状态。For example, in theinterface 311 shown in FIG. 3E, after detecting that the user selects "smart door lock", amenu 312 will pop up, and the user can further set the trigger condition of the conditional device. For example: the trigger condition is that the smart door lock is in the unlocked state.

又例如:如图3F所示的界面313,在检测到用户选择“温度传感器”后,弹出菜单314,用户可以进一步设置该条件设备的触发条件。例如:触发条件为温度传感器的温度值大于或等于28度。For another example, in the interface 313 shown in FIG. 3F, after detecting that the user selects “temperature sensor”, amenu 314 is popped up, and the user can further set the trigger condition of the conditional device. For example: the trigger condition is that the temperature value of the temperature sensor is greater than or equal to 28 degrees.

需要说明的是,当条件设备的类型不同时,条件设备所具有触发条件的类型也不同。例如:触发条件可以是条件设备的工作状态,如开启或关闭;触发条件还可以是条件设备的检测值或者检测值的范围;触发条件还可以是条件设备的检测结果,例如:人体感应器感应到人体通过,或者烟雾传感器检测到燃气泄漏事件等。因此,当条件设备类型不同时,相对应的设置触发条件的界面也会不同,本申请实施例对此不作限定。It should be noted that, when the types of conditional devices are different, the types of trigger conditions of the conditional devices are also different. For example: the trigger condition can be the working state of the condition device, such as on or off; the trigger condition can also be the detection value or the range of the detection value of the condition device; the trigger condition can also be the detection result of the condition device, for example: human body sensor sensing until the human body passes through, or the smoke sensor detects a gas leakage event, etc. Therefore, when the conditional device types are different, the corresponding interface for setting the trigger condition is also different, which is not limited in this embodiment of the present application.

还需要说明的是,用户设置的条件设备的数量可以为一个或多个,每个条件设备所对应的触发条件也可以为一个或多个,本申请实施例对此不作限定。在设置完条件设备和触发条件后,用户可以通过点击“保存”按钮,保存设置。用户也可以直接对已经添加的条件设备和触发条件进行修改和删除,不再一一赘述。It should also be noted that the number of condition devices set by the user may be one or more, and the trigger condition corresponding to each condition device may also be one or more, which is not limited in this embodiment of the present application. After setting the condition device and trigger condition, the user can save the setting by clicking the "Save" button. The user can also directly modify and delete the added conditional devices and triggering conditions, which will not be repeated.

下面可以对IFTTT规则中的执行设备以及执行操作进行设置。如图3G所示,检测到用户点击界面315上的添加控件310,手机显示如图3H所示的界面316,用户可以通过界面316 选择执行设备以及设置执行设备的操作。例如:选择执行设备为“智能空调”,执行的操作(也可称之为执行事件)为开启智能空调,且将智能空调的温度值设置在24度。The execution device and execution operation in the IFTTT rule can be set as follows. As shown in FIG. 3G , it is detected that the user clicks theadd control 310 on theinterface 315 , and the mobile phone displays theinterface 316 as shown in FIG. 3H . For example, select the execution device as "smart air conditioner", execute the operation (also referred to as an execution event) to turn on the smart air conditioner, and set the temperature value of the smart air conditioner to 24 degrees.

需要说明的是,执行设备的数量可以为一个或多个,每个执行设备对应的执行操作也可以为一个或多个。It should be noted that the number of execution devices may be one or more, and the execution operations corresponding to each execution device may also be one or more.

再有,执行设备可以与条件设备为相同的设备,也可以为不同的设备。例如:规则1为“如果智能门锁识别出门口的人为合法的,则智能门锁自动开锁”,在规则1中,条件设备和执行设备均为智能门锁。又例如:规则2为“如果门开了,且室内温度高于28摄氏度,则空调自动启动”,在规则2中,条件设备为门和温度传感器,执行设备为空调。Furthermore, the execution device and the condition device may be the same device or different devices. For example: Rule 1 is "If the smart door lock recognizes that the person at the door is legal, the smart door lock will automatically unlock." In rule 1, both the conditional device and the execution device are smart door locks. Another example: Rule 2 is "If the door is opened and the indoor temperature is higher than 28 degrees Celsius, the air conditioner will automatically start." In Rule 2, the condition device is the door and the temperature sensor, and the execution device is the air conditioner.

在设置完执行设备和执行事件后,用户可以通过点击“保存”按钮,保存设置,可以显示如图3I所示的界面318。用户也可以直接对已经添加的执行设备和执行事件进行修改和删除,不再一一赘述。After setting the execution device and execution event, the user can save the settings by clicking the "Save" button, and theinterface 318 shown in FIG. 3I can be displayed. The user can also directly modify and delete the added execution devices and execution events, which will not be described in detail.

还需要说明的是,用户可以先设置条件设备和触发条件,再设置执行设备和执行事件,也可以先设置执行设备和执行事件,在设置条件设备和触发条件。还可以设置一部分条件设备和触发条件后,再设置执行设备和执行事件,然后再设置另外的条件设备和触发条件等。也就是说,本申请实施例对设置的顺序不作限定。It should also be noted that the user can first set the condition device and trigger condition, and then set the execution device and execution event, or set the execution device and execution event first, and then set the condition device and trigger condition. It is also possible to set some conditional devices and triggering conditions, then set up execution devices and execution events, and then set other conditional devices and triggering conditions. That is to say, the order of setting is not limited in this embodiment of the present application.

可以理解的是,用户也可以通过语音的方式(例如:当电子设备A为智能音箱时,用户可以与智能音箱的语音对话),或者特定手势等其他方式对IFTTT规则进行设置,本申请实施例对用户设置IFTTT规则的具体方式不做限定。It can be understood that the user can also set the IFTTT rules by means of voice (for example: when the electronic device A is a smart speaker, the user can have a voice dialogue with the smart speaker), or other methods such as specific gestures. The specific manner in which the user sets the IFTTT rule is not limited.

在电子设备10(电子设备A)设置好IFTTT规则(包括新增、修改和删除IFTTT规则)后,需要将设置好的IFTTT规则发送给本地网络中的电子设备12(电子设备B),而后本地网络中的电子设备12(电子设备B)基于该IFTTT规则进行本地联动。After the electronic device 10 (electronic device A) has set the IFTTT rules (including adding, modifying and deleting IFTTT rules), the set IFTTT rules need to be sent to the electronic device 12 (electronic device B) in the local network, and then the local The electronic device 12 (electronic device B) in the network performs local linkage based on the IFTTT rule.

可以理解的是,本地网络中的电子设备12(电子设备B)在不同的IFTTT规则中有不同角色。也就是说,某个电子设备12(电子设备B)在一些IFTTT规则中为条件设备,在另一些IFTTT规则为执行设备。It is understood that the electronic device 12 (electronic device B) in the local network has different roles in different IFTTT rules. That is, a certain electronic device 12 (electronic device B) is a conditional device in some IFTTT rules and an execution device in other IFTTT rules.

例如:规则1为“如果智能门锁识别出门口的人为合法的,则智能门锁自动开锁”,在规则1中,条件设备和执行设备均为智能门锁。又例如:规则2为“如果智能门锁开锁了,且室内温度高于28摄氏度,则空调自动启动”,在规则2中,条件设备为智能门锁和温度传感器,执行设备为空调。可见,智能门锁在规则1中为条件设备和执行设备,在规则2中为条件设备。For example: Rule 1 is "If the smart door lock recognizes that the person at the door is legal, the smart door lock will automatically unlock." In rule 1, both the conditional device and the execution device are smart door locks. Another example: Rule 2 is "If the smart door lock is unlocked and the indoor temperature is higher than 28 degrees Celsius, the air conditioner will automatically start." In rule 2, the condition device is the smart door lock and temperature sensor, and the execution device is the air conditioner. It can be seen that the smart door lock is a conditional device and an execution device in rule 1, and a conditional device in rule 2.

需要说明的是,在同一条IFTTT规则中,条件设备和执行设备的数量都可以是一个或多个,本申请实施例不做限定。例如:在上述规则1中,条件设备为1个,执行设备为1个。在上述规则2中,条件设备为2个,执行设备为1个。再例如:规则3为“如果门开了,且室内温度高于28摄氏度,则窗户自动关闭,且空调自动启动”,在规则3中,条件设备为门和温度传感器,执行设备为窗户和空调。在规则3中,条件设备为2个,执行设备为2个。It should be noted that, in the same IFTTT rule, the number of condition devices and execution devices may be one or more, which is not limited in this embodiment of the present application. For example: in the above rule 1, there is one condition device and one execution device. In the above rule 2, there are two conditional devices and one execution device. Another example: Rule 3 is "If the door is opened and the indoor temperature is higher than 28 degrees Celsius, the window will automatically close and the air conditioner will automatically start." In Rule 3, the conditional devices are doors and temperature sensors, and the execution devices are windows and air conditioners . In rule 3, there are 2 conditional devices and 2 execution devices.

为了便于说明,针对某一条IFTTT规则,将本地网络中的电子设备12(电子设备B)在该条IFTTT规则的角色,划分为条件设备和执行设备,对本申请实施例提供的本地网络中多个电子设备的联动的方法进行示例性说明。需要说明的是,这里条件设备和执行设备的划分不构成对电子设备12(电子设备B)的具体限定。For the convenience of description, for a certain IFTTT rule, the role of the electronic device 12 (electronic device B) in the local network in the IFTTT rule is divided into conditional devices and execution devices. The method of linkage of electronic devices is exemplified. It should be noted that the division of the condition device and the execution device here does not constitute a specific limitation on the electronic device 12 (electronic device B).

需要说明的是,在同一条IFTTT规则中,条件设备和执行设备可以相同,也可以不同。换言之,存在某一个电子设备在一条IFTTT规则中,既是条件设备,又是执行设备。例如:在上述规则1中,条件设备和执行设备均为智能门锁。在这种情况中,本文介绍的多个电子设备联动的方法中,当涉及到某个电子设备在同一条IFTTT规则中,具有两个角色(条件设备和执行设备)时,且该两个角色之间需要进行数据传输时,可理解为该电子设备可以直接调用本地数据来获取相应信息,不再另行说明。It should be noted that, in the same IFTTT rule, the conditional device and the execution device may be the same or different. In other words, there is a certain electronic device that is both a conditional device and an execution device in an IFTTT rule. For example: in the above rule 1, both the condition device and the execution device are smart door locks. In this case, in the method for the linkage of multiple electronic devices introduced in this article, when a certain electronic device has two roles (conditional device and execution device) in the same IFTTT rule, and the two roles When data transmission is required between them, it can be understood that the electronic device can directly call local data to obtain corresponding information, and no further explanation is required.

可选的,在本申请提供的一种多个电子设备联动的方法中,可以由执行设备提前获取 IFTTT规则,并发现该IFTTT规则中的其他电子设备,即条件设备。在IFTTT规则中的某个或某些条件设备发生触发事件后,可以直接通过本地网络通知执行设备。执行设备在收到通知消息后,也可以通过本地网络直接查询其他条件设备的触发事件。当确定所有条件设备的触发事件均发生时,执行设备可以执行相应事件(即执行事件,也可以理解为执行设备执行相应的功能),即完成联动。Optionally, in a method for interlocking multiple electronic devices provided by the present application, the executing device may acquire the IFTTT rule in advance, and discover other electronic devices in the IFTTT rule, that is, conditional devices. After a trigger event occurs on one or some conditional devices in the IFTTT rules, the execution device can be notified directly through the local network. After the execution device receives the notification message, it can also directly query the trigger events of other conditional devices through the local network. When it is determined that the trigger events of all the conditional devices have occurred, the execution device can execute the corresponding event (ie, the execution event can also be understood as the execution device executing the corresponding function), that is, the linkage is completed.

如图4A所示,为本申请实施例提供的一种本地网络中多个电子设备联动的方法示意图。在方法中,可以由执行设备获取IFTTT规则,而条件设备可以不获取IFTTT规则。该方法具体包括:As shown in FIG. 4A , it is a schematic diagram of a method for linking multiple electronic devices in a local network according to an embodiment of the present application. In the method, the IFTTT rules may be acquired by the execution device, and the IFTTT rules may not be acquired by the conditional device. Specifically, the method includes:

S401、第一执行设备获取IFTTT规则。S401. The first execution device acquires an IFTTT rule.

其中,在IFTTT规则中,可以将多个条件设备的触发事件用各种逻辑操作(例如:逻辑与操作,或者逻辑或操作)进行自由组合。当这多个条件设备的触发事件均满足时,会触发执行设备执行相应的操作,即触发执行设备的执行事件。例如:IFTTT规则可以包括规则的标识、条件(condition)信息和执行(action)信息。其中,在本地网络中可以存在多条IFTTT 规则,故规则的标识可用于区分本地网络中的各条IFTTT规则。条件信息可以包括:设备标识、设备类型(type)、属性值、操作符、数值等。可以理解的是,条件信息中的设备标识为条件设备的标识,设备类型为条件设备的类型,属性值为条件设备的参数(例如:条件设备为温度传感器时,属性值可以为温度),操作符为逻辑操作(例如:大于、小于等),数值为该属性值对应的数值大小(例如:26摄氏度),执行信息中可以包括:设备标识、设备类型以及执行的具体操作等。例如:IFTTT规则可以设置为,温度传感器检测到的温度值为大于26摄氏度,则空调开启。Among them, in the IFTTT rule, the trigger events of multiple conditional devices can be freely combined with various logical operations (for example: logical AND operation, or logical OR operation). When the trigger events of the multiple condition devices are all satisfied, the execution device is triggered to perform a corresponding operation, that is, an execution event of the execution device is triggered. For example, an IFTTT rule may include an identifier of the rule, condition (condition) information and execution (action) information. Among them, there may be multiple IFTTT rules in the local network, so the identifier of the rule can be used to distinguish each IFTTT rule in the local network. The condition information may include: device identification, device type (type), attribute value, operator, value, and the like. It can be understood that the device identifier in the condition information is the identifier of the condition device, the device type is the type of the condition device, and the attribute value is the parameter of the condition device (for example, when the condition device is a temperature sensor, the attribute value can be temperature), the operation The symbol is a logical operation (for example: greater than, less than, etc.), the value is the numerical value corresponding to the attribute value (for example: 26 degrees Celsius), and the execution information may include: device identification, device type, and specific operations to be performed, etc. For example, the IFTTT rule can be set so that if the temperature value detected by the temperature sensor is greater than 26 degrees Celsius, the air conditioner is turned on.

在本申请的一些实施例中,电子设备10(电子设备A)可以在接收到用户设置IFTTT规则(包括新增、修改和删除IFTTT规则)后,就主动推送给本地网络中的执行设备或者通过服务器11主动推送给执行设备。在本申请的又一些实施例中,本地网络中的执行设备也可以向电子设备10(电子设备A)或者服务器11请求IFTTT规则,电子设备10(电子设备A)或者服务器11将相应的IFTTT规则发送给执行设备,本申请实施例对此不做限定。In some embodiments of the present application, the electronic device 10 (electronic device A) may actively push the IFTTT rules (including adding, modifying and deleting IFTTT rules) set by the user to the execution device in the local network or through The server 11 actively pushes to the execution device. In still other embodiments of the present application, the executing device in the local network may also request the electronic device 10 (electronic device A) or the server 11 for IFTTT rules, and the electronic device 10 (electronic device A) or the server 11 will send the corresponding IFTTT rules It is sent to the execution device, which is not limited in this embodiment of the present application.

S402、第一执行设备对获取到的IFTTT规则进行合法性检查。S402. The first execution device checks the validity of the acquired IFTTT rule.

示例性的,第一执行设备可以对获取到的IFTTT规则进行解析,确定该IFTTT规则的完整性和正确性进行检查,以确保可以根据该获取到的IFTTT规则进行条件设备和执行设备的联动。Exemplarily, the first execution device may parse the acquired IFTTT rule, determine the integrity and correctness of the IFTTT rule, and check to ensure that the conditional device and the execution device can be linked according to the acquired IFTTT rule.

例如:对IFTTT规则的完整性检测可以包括:检测该IFTTT规则中是否包含有条件信息,以及条件信息是否完整,例如:条件设备的信息、条件设备的属性值、条件设备操作符、属性值对应的数值是否完整等。检测该IFTTT规则中是否包含执行信息,以及执行信息是否完整。For example, the integrity detection of an IFTTT rule may include: detecting whether the IFTTT rule contains conditional information, and whether the conditional information is complete, such as: conditional device information, attribute value of conditional device, conditional device operator, attribute value corresponding Is the value complete, etc. Check whether the IFTTT rule contains execution information and whether the execution information is complete.

又例如:对IFTTT规则的正确性检测还可以包括:对IFTTT规则进行合法性校验,确定该IFTTT规则是否没有被篡改过等。For another example, the correctness detection of the IFTTT rule may further include: verifying the validity of the IFTTT rule to determine whether the IFTTT rule has not been tampered with, and the like.

S403、第一执行设备根据IFTTT规则,请求发现IFTTT规则中的第一条件设备和第二条件设备。S403. The first execution device requests to discover the first conditional device and the second conditional device in the IFTTT rule according to the IFTTT rule.

示例性的,第一执行设备从IFTTT规则中获取相关的条件设备的标识,以及其他的执行设备的标识,并在本地网络中进行组播或广播,请求发现该IFTTT规则中的条件设备以及其他执行设备。即,第一执行设备在本地网络中组播或广播的消息中,可以携带有IFTTT规则中的条件设备的标识和执行设备的标识。Exemplarily, the first execution device obtains the identification of the relevant conditional equipment from the IFTTT rule, as well as the identification of other execution equipment, and performs multicast or broadcast in the local network, and requests to discover the conditional equipment in the IFTTT rule and other identifications. Execute the device. That is, the message multicast or broadcast by the first execution device in the local network may carry the identifier of the conditional device and the identifier of the execution device in the IFTTT rule.

例如:假设IFTTT规则为:如果第一条件设备的第一事件和第二条件设备的第二事件同时发生,则第一执行设备执行第三事件。其中,第一事件为第一条件设备的触发事件,第二事件为第二条件设备的触发事件。第三事件为第一执行设备的执行事件。那么,第一执行设备可以将第一条件设备的标识、第二条件设备的标识进行组播或广播。For example, it is assumed that the IFTTT rule is: if the first event of the first conditional device and the second event of the second conditional device occur simultaneously, the first execution device executes the third event. The first event is a triggering event of the first conditional device, and the second event is a triggering event of the second conditional device. The third event is an execution event of the first execution device. Then, the first execution device may multicast or broadcast the identifier of the first conditional device and the identifier of the second conditional device.

一些实施例中,第一执行设备可以将第一条件设备的标识和第二条件设备的标识分别进行组播或广播,即,一条组播或广播消息仅包括第一条件设备的标识,另一条组播或广播消息中仅包含第二条件设备的标识。另一些实施例中,第一执行设备也可以将第一条件设备的标识和第二条件设备的标识同时进行组播或广播,即,一条组播或广播消息中包括第一条件设备的标识和第二条件设备的标识。本申请实施例对此不做限定。In some embodiments, the first execution device may multicast or broadcast the identification of the first conditional device and the identification of the second conditional device respectively, that is, one multicast or broadcast message only includes the identification of the first conditional device, and the other The multicast or broadcast message only contains the identifier of the second condition device. In other embodiments, the first execution device may also multicast or broadcast the identifier of the first conditional device and the identifier of the second conditional device simultaneously, that is, a multicast or broadcast message includes the identifier of the first conditional device and the identifier of the second conditional device. The identification of the second condition device. This embodiment of the present application does not limit this.

又例如:IFTTT规则为:如果智能门锁开锁,且室内温度传感器的温度大于28度,则智能空调开启且温度设置在24度。其中,第一条件设备为智能门锁,第一事件为开锁。第二条件设备为温度传感器,第二事件为温度值大于28度。第一执行设备为智能空调,第三事件为开启智能空调且温度设置在24度。那么,智能空调获取该IFTTT规则后,确定出该IFTTT规则中的条件设备为智能门锁和温度传感器。智能空调可以在家庭网络中广播智能门锁的标识和温度传感器的标识。Another example: the IFTTT rule is: if the smart door lock is unlocked and the temperature of the indoor temperature sensor is greater than 28 degrees, the smart air conditioner is turned on and the temperature is set at 24 degrees. Wherein, the first condition device is a smart door lock, and the first event is unlocking. The second condition device is a temperature sensor, and the second event is that the temperature value is greater than 28 degrees. The first execution device is an intelligent air conditioner, and the third event is to turn on the intelligent air conditioner and set the temperature at 24 degrees. Then, after acquiring the IFTTT rule, the smart air conditioner determines that the conditional devices in the IFTTT rule are the smart door lock and the temperature sensor. The smart air conditioner can broadcast the ID of the smart door lock and the ID of the temperature sensor in the home network.

S404、第一条件设备和第二条件设备分别向第一执行设备回复各自的地址。S404, the first conditional device and the second conditional device respectively reply their respective addresses to the first execution device.

步骤S404具体包括:第一条件设备向第一执行设备回复自身的地址(步骤S404a),以及第二条件设备向第一执行设备回复自身的地址(步骤S404b)。Step S404 specifically includes: the first conditional device replies its own address to the first execution device (step S404a), and the second conditional device returns its own address to the first execution device (step S404b).

示例性的,本地网络中的除第一执行设备外的其他电子设备在接收到组播或广播消息后,将组播或广播消息中的设备标识与自身的标识进行比对。若比对成功,则表示该电子设备是该IFTTT规则中的条件设备或执行设备,并向第一执行设备回复各自的地址,例如IP地址, MAC地址等,以便后续第一执行设备可以根据该地址向其发送联动相关的消息。若比对失败,则表示该电子设备不是该IFTTT规则中的条件设备和执行设备,则该电子设备可以忽略接收到的组播或广播消息。Exemplarily, after receiving the multicast or broadcast message, other electronic devices in the local network other than the first execution device compare the device identifier in the multicast or broadcast message with its own identifier. If the comparison is successful, it means that the electronic device is a conditional device or an execution device in the IFTTT rule, and replies to the first execution device with their respective addresses, such as IP address, MAC address, etc., so that the first execution device can follow the address to send linkage-related messages to it. If the comparison fails, it means that the electronic device is not a conditional device and an execution device in the IFTTT rule, and the electronic device can ignore the received multicast or broadcast message.

例如:仍然假设IFTTT规则为:如果第一条件设备的第一事件和第二条件设备的第二事件同时发生,则第一执行设备执行第三事件。那么,第一条件设备在接收到第一执行设备发送的组播或广播消息后,确定其中包含第一条件设备的标识,则确定第一条件设备是该IFTTT 规则中的条件设备,那么向第一执行设备发送第一条件设备的地址,以便后续第一执行设备可以根据第一条件设备的地址发送相应的消息。类似的,第二条件设备也向第一执行设备发送第二条件设备的地址,不再赘述。For example, it is still assumed that the IFTTT rule is: if the first event of the first conditional device and the second event of the second conditional device occur simultaneously, the first execution device executes the third event. Then, after receiving the multicast or broadcast message sent by the first execution device, the first conditional device determines that the identifier of the first conditional device is included, and determines that the first conditional device is the conditional device in the IFTTT rule, and then sends the first conditional device to the first conditional device. An execution device sends the address of the first conditional device, so that the first execution device can subsequently send a corresponding message according to the address of the first conditional device. Similarly, the second condition device also sends the address of the second condition device to the first execution device, and details are not repeated here.

又例如:IFTTT规则仍然为:如果智能门锁开锁,且室内温度传感器的温度大于28度,则智能空调开启且温度设置在24度。Another example: the IFTTT rule is still: if the smart door lock is unlocked and the temperature of the indoor temperature sensor is greater than 28 degrees, the smart air conditioner is turned on and the temperature is set at 24 degrees.

接着,智能门锁和温度传感器在接收智能空调发送的广播消息后,确认该广播消息中包含有自身的标识,确定与该IFTTT规则相关,则分别向智能空调返回自身的网络地址,即智能门锁的网络地址和温度传感器的网络地址。家庭网络中的其他设备,例如:空气净化器、智能门窗等,在接收到该广播消息后,确定自身与该IFTTT规则无关,则可以直接忽略智能空调发送的该广播消息。Next, after receiving the broadcast message sent by the smart air conditioner, the smart door lock and the temperature sensor confirm that the broadcast message contains their own identity, and determine that it is related to the IFTTT rule, and then return their own network addresses to the smart air conditioner, that is, the smart door. The network address of the lock and the network address of the temperature sensor. Other devices in the home network, such as air purifiers, smart doors and windows, etc., after receiving the broadcast message, determine that they have nothing to do with the IFTTT rule, and can directly ignore the broadcast message sent by the smart air conditioner.

S405、第一执行设备向第一条件设备订阅第一事件(图4A中步骤S405a示出),向第二条件设备订阅第二事件(图4A中步骤S405b示出)。S405: The first execution device subscribes to the first event from the first conditional device (shown in step S405a in FIG. 4A ), and subscribes to the second event from the second conditional device (shown in step S405b in FIG. 4A ).

示例性的,由于第一执行设备获取到了IFTTT规则,且获取到该IFTTT规则中相关条件设备的地址,那么第一执行设备可以向各个条件设备发送订阅消息,用于订阅各个条件设备的触发事件,即各个条件设备的触发事件一旦发生,则会通知第一执行设备。Exemplarily, since the first execution device obtains the IFTTT rule and obtains the address of the relevant conditional device in the IFTTT rule, the first execution device can send a subscription message to each conditional device for subscribing to the trigger event of each conditional device. , that is, once the trigger event of each condition device occurs, the first execution device will be notified.

例如:第一执行设备向第一条件设备发送的订阅消息中,可以包含有第一事件的具体内容。这样,当第一条件设备根据该订阅消息,确定第一事件发生时,可以通知第一执行设备。类似的,第一执行设备向第二条件设备发送的订阅消息中,可以包括有第二事件的具体内容。这样,当第二条件设备根据该订阅消息,确定第二事件发生时,可以通知第一执行设备。图中以步骤S405a和S405b分别示出。For example, the subscription message sent by the first execution device to the first condition device may contain specific content of the first event. In this way, when the first condition device determines that the first event occurs according to the subscription message, it can notify the first execution device. Similarly, the subscription message sent by the first execution device to the second condition device may include specific content of the second event. In this way, when the second condition device determines that the second event occurs according to the subscription message, it can notify the first execution device. The figure shows steps S405a and S405b respectively.

又例如:IFTTT规则仍然为:如果智能门锁开锁,且室内温度传感器的温度大于28度,则智能空调开启且温度设置在24度。Another example: the IFTTT rule is still: if the smart door lock is unlocked and the temperature of the indoor temperature sensor is greater than 28 degrees, the smart air conditioner is turned on and the temperature is set at 24 degrees.

接着,智能空调在接收到智能门锁和温度传感器发送的各自的网络地址后,智能空调分别向智能门锁订阅事件1,向温度传感器订阅事件2。其中,事件1为智能门锁开锁。事件2 为室内温度传感器的温度大于28度。后续,当智能门锁发生事件1(即智能门锁开锁时),会通知智能空调。然后,智能空调向温度传感器查询是否发生事件2(即温度是否大于28度)。温度传感器确定温度大于28度后,告知智能空调。于是,智能空调可以确定打开智能空调,并将温度设置到24度。Next, after the smart air conditioner receives the respective network addresses sent by the smart door lock and the temperature sensor, the smart air conditioner subscribes event 1 to the smart door lock and event 2 to the temperature sensor respectively. Among them, event 1 is the unlocking of the smart door lock. Event 2 is that the temperature of the indoor temperature sensor is greater than 28 degrees. Subsequently, when event 1 occurs in the smart door lock (that is, when the smart door lock is unlocked), the smart air conditioner will be notified. Then, the smart air conditioner queries the temperature sensor whether event 2 occurs (ie, whether the temperature is greater than 28 degrees). After the temperature sensor determines that the temperature is greater than 28 degrees, it informs the smart air conditioner. Therefore, the smart air conditioner can determine to turn on the smart air conditioner and set the temperature to 24 degrees.

在本申请的一些实施例中,条件设备在接收到执行设备的订阅消息后,可以每间隔一段时间向执行设备上报是否发生触发事件或是否满足触发条件的消息。而执行设备可以根据该消息确定是否满足相应的IFTTT规则,满足时执行相应的执行事件。例如:当第一条件设备接收到第一执行设备的订阅消息后,可以每间隔一段时间后,向第一执行设备上报第一事件是否发生的消息。同理,当第二条件设备接收到第一执行设备的订阅消息后,可以每间隔一段时间后,向第一执行设备上报第二事件是否发生的消息。而第一执行设备可以根据第一条件设备和第二条件设备上报的消息确定是否满足IFTTT规则,若满足,则直接执行第一事件。In some embodiments of the present application, after receiving the subscription message from the execution device, the condition device may report to the execution device at intervals a message whether a trigger event occurs or whether a trigger condition is satisfied. The execution device can determine whether the corresponding IFTTT rule is satisfied according to the message, and execute the corresponding execution event when satisfied. For example, after the first condition device receives the subscription message of the first execution device, it may report whether the first event occurs to the first execution device at intervals of a certain period of time. Similarly, after the second condition device receives the subscription message from the first execution device, it may report to the first execution device a message whether the second event occurs after a period of time. The first execution device may determine whether the IFTTT rule is satisfied according to the messages reported by the first condition device and the second condition device, and if it is satisfied, directly execute the first event.

在本申请的另一些实施例中,条件设备在接收到执行设备的订阅消息后,也可以在检测到相应的触发事件后,向执行设备发送通知消息。例如:第一条件设备也可以在检测到第一事件后,向第一执行设备发送第一事件已发生的通知消息。类似,第二条件设备也可以在检测到第二事件后,向第一执行设备发送第一事件已发生的通知消息。In other embodiments of the present application, after receiving the subscription message from the executing device, the conditional device may also send a notification message to the executing device after detecting a corresponding trigger event. For example, the first condition device may also send a notification message that the first event has occurred to the first execution device after detecting the first event. Similarly, the second condition device may also send a notification message that the first event has occurred to the first execution device after detecting the second event.

以下步骤S406至S409则是以条件设备检测到相应的触发事件后,向执行设备发送通知消息为例进行说明的。The following steps S406 to S409 are described by taking as an example that the conditional device sends a notification message to the execution device after detecting the corresponding trigger event.

S406、当第一条件设备的第一事件发生时,第一条件设备向第一执行设备发送第一事件的通知消息。S406. When the first event of the first condition device occurs, the first condition device sends a notification message of the first event to the first execution device.

其中,第一条件设备发生第一事件包括:第一条件设备执行了某个操作,例如:智能门锁开锁。或者,第一条件设备的工作状态发生变化,例如:智能空调从关闭状态改变到开启状态。或者,第一条件设备的检测值满足某个条件,例如:温度传感器检测到的温度值大于或等于28度。又例如:人体感应器感应到有人体通过等。也就是说,第一事件的具体内容可以根据第一条件设备具有的功能相应变化,本申请实施例对第一事件的具体内容不做限定。Wherein, the occurrence of the first event by the first conditional device includes: the first conditional device performs a certain operation, for example, unlocking the smart door lock. Or, the working state of the device under the first condition changes, for example, the smart air conditioner changes from an off state to an on state. Or, the detection value of the first condition device satisfies a certain condition, for example, the temperature value detected by the temperature sensor is greater than or equal to 28 degrees. Another example: the human body sensor senses that there is a human body passing through, etc. That is to say, the specific content of the first event may be correspondingly changed according to the function of the first condition device, and the embodiment of the present application does not limit the specific content of the first event.

第一条件设备发生第一事件后,可以向第一执行设备发送通知消息,用于通知第一条件设备已发生第一事件。After the first event occurs in the first condition device, a notification message may be sent to the first execution device for notifying the first condition device that the first event has occurred.

示例性的,该通知消息可以是一个特定格式或特定内容的消息,第一执行设备在接收到该通知消息后,可以根据该通知消息的发送者(第一条件设备)确定第一事件已发生。再示例性的,该通知消息也可以携带第一条件设备的标识,那么,第一执行设备在接收到该通知消息后,可以根据该第一条件设备的标识确定第一事件已发生。又示例性的,该通知消息也可以携带第一事件的标识或者第一事件的内容,那么,第一执行设备在接收到该通知消息后,可以根据第一事件的标识或者第一事件的内容确定第一事件已发生。本申请实施例中对通知消息的具体形式和内容不做限定。Exemplarily, the notification message may be a message of a specific format or specific content, and after receiving the notification message, the first execution device may determine that the first event has occurred according to the sender (first condition device) of the notification message. . For another example, the notification message may also carry the identifier of the first conditional device. Then, after receiving the notification message, the first execution device may determine that the first event has occurred according to the identifier of the first conditional device. As another example, the notification message may also carry the identifier of the first event or the content of the first event. Then, after receiving the notification message, the first execution device may, according to the identifier of the first event or the content of the first event, Determine that the first event has occurred. The specific form and content of the notification message are not limited in the embodiments of the present application.

S407、第一执行设备向第二条件设备发送查询消息,用于查询第二事件是否发生。S407: The first execution device sends a query message to the second condition device, for querying whether the second event occurs.

其中,第二事件的内容可参考步骤S406中关于第一事件的描述,这里不再赘述。For the content of the second event, reference may be made to the description of the first event in step S406, and details are not repeated here.

在一些实施例中,若第一执行设备接收到第一事件的通知消息,但未接收到第二事件的通知消息,第一执行设备可以向第二条件设备查询第二事件是否发生。In some embodiments, if the first execution device receives the notification message of the first event but does not receive the notification message of the second event, the first execution device may query the second condition device whether the second event occurs.

在又一些实施例中,若第一执行设备接收到第一事件的通知消息,同时也接收到第二事件的通知消息,则第一执行设备可以根据第一事件和第二事件确定是否满足IFTTT规则,而后执行步骤S409。In still other embodiments, if the first execution device receives the notification message of the first event and also receives the notification message of the second event, the first execution device may determine whether the IFTTT is satisfied according to the first event and the second event rule, and then step S409 is executed.

S408、第二条件设备将查询结果返回给第一执行设备。S408. The second condition device returns the query result to the first execution device.

第二条件设备在接收到第一执行设备的查询消息后,可以判断是否发生第二事件,并将查询结果返回给第一执行设备。After receiving the query message from the first execution device, the second condition device may determine whether the second event occurs, and return the query result to the first execution device.

S409、第一执行设备根据第一事件的通知消息和第二事件的查询结果,确定执行第三事件。S409: The first execution device determines to execute the third event according to the notification message of the first event and the query result of the second event.

其中,第三事件为第一执行设备的执行事件,该执行事件可以是一个动作或者一系列的动作。即,当触发第一执行设备执行第一事件的条件满足时,第一执行设备同时执行或者顺序第一事件中一系列的动作。该执行事件还可以设置延迟,即,当触发第一执行设备执行第一事件的条件满足时,第一执行设备可以在预设的延迟时间后开始执行第一事件。本申请实施例对此不做限定。The third event is an execution event of the first execution device, and the execution event may be an action or a series of actions. That is, when the condition for triggering the first execution device to execute the first event is satisfied, the first execution device simultaneously executes or sequentially executes a series of actions in the first event. A delay may also be set for the execution event, that is, when a condition for triggering the first execution device to execute the first event is satisfied, the first execution device may start executing the first event after a preset delay time. This embodiment of the present application does not limit this.

示例性的,第一执行设备根据第一事件的通知消息和第二事件的查询结果,进行逻辑判断。若判断结果与IFTTT规则中的触发条件相符,则第一执行设备执行第三事件。若不相符,则第一执行设备确定不执行第三事件。Exemplarily, the first execution device makes a logical judgment according to the notification message of the first event and the query result of the second event. If the judgment result matches the trigger condition in the IFTTT rule, the first execution device executes the third event. If not, the first execution device determines not to execute the third event.

在另一些示例中,第一事件的通知消息具有时效性。也就是说,第一事件的通知消息在预设的时间段内是有效的。若超过预设时间段,则该通知消息为无效,即该通知消息不能用于说明第一事件已发生,则第一执行设备还需要向第一条件设备查询第一事件是否发生。具体实现中,可以由条件设备在通知消息中携带时间信息,执行设备根据该时间信息确定是否该通知消息是否有效。也可以由执行设备根据接收到通知消息的时间,自行确定该通知消息是否有效,本申请实施例不做限定。其中,查询过程与第一执行设备向第二条件设备查询第二事件是否发生的过程类似,不再赘述。In other examples, the notification message of the first event is time-sensitive. That is, the notification message of the first event is valid within a preset time period. If the preset time period is exceeded, the notification message is invalid, that is, the notification message cannot be used to indicate that the first event has occurred, and the first execution device also needs to query the first condition device whether the first event has occurred. In specific implementation, the condition device may carry time information in the notification message, and the execution device determines whether the notification message is valid according to the time information. The execution device may also determine whether the notification message is valid by itself according to the time when the notification message is received, which is not limited in this embodiment of the present application. The query process is similar to the process in which the first execution device queries the second condition device whether the second event occurs, and will not be repeated here.

综上,本申请实施例提供的多电子设备联动的方法中,由执行设备提前获取IFTTT规则,并发现该IFTTT规则中的其他电子设备。在IFTTT规则中的条件设备发生触发事件后,可以直接通过本地网络通知执行设备,而执行设备也可以通过本地网络直接查询其他条件设备的触发事件。当所有条件设备的触发条件都满足IFTTT规则时,执行设备可以执行相应事件,即完成联动。可见,从某个条件设备的触发条件发生,到执行设备执行相应事件的整个过程中,都是在本地网络中完成的。这样,即便是本地网络中有电子设备与互联网断开,本申请仍然可以完成本地网络的多个电子设备的联动,提高了联动的成功率,提升了联动系统的稳定性。并且,由于联动过程中,本地网络的多个电子设备直接进行通信,而不再通过互联网,有利于降低通信的时延,提升联动的效率。再有,避免将本地网络中各个电子设备的状态,以及IFTTT规则的执行情况上传到互联网,有利于规避安全风险。To sum up, in the method for interlocking multiple electronic devices provided by the embodiments of the present application, the executing device acquires the IFTTT rule in advance, and discovers other electronic devices in the IFTTT rule. After a condition device in the IFTTT rule has a trigger event, it can directly notify the execution device through the local network, and the execution device can also directly query the trigger events of other condition devices through the local network. When the triggering conditions of all condition devices meet the IFTTT rules, the execution device can execute the corresponding event, that is, the linkage is completed. It can be seen that the entire process from the occurrence of a trigger condition of a certain conditional device to the execution of the corresponding event by the execution device is completed in the local network. In this way, even if an electronic device in the local network is disconnected from the Internet, the present application can still complete the linkage of multiple electronic devices in the local network, which improves the success rate of linkage and improves the stability of the linkage system. In addition, during the linkage process, multiple electronic devices in the local network communicate directly instead of going through the Internet, which is beneficial to reduce the delay of communication and improve the efficiency of linkage. Furthermore, avoiding uploading the status of each electronic device in the local network and the implementation of the IFTTT rules to the Internet is beneficial to avoid security risks.

此外,在本申请实施例提供的方法中,是由IFTTT规则中的执行设备,与IFTTT规则中其他的条件设备进行直接通信,没有通过其他的中间设备进行中转和控制,即没有通过与本条IFTTT规则无关的其他设备(例如:网关)进行中转和控制。换言之,本申请实施例提供的方法,使得本地网络的多个电子设备联动时摆脱了对控制设备的依赖,有利于减少联动的时延,提升联动效率。In addition, in the method provided by the embodiment of the present application, the execution device in the IFTTT rule directly communicates with other conditional devices in the IFTTT rule, and no transfer and control are performed through other intermediate devices, that is, there is no communication with this IFTTT rule. Other devices (eg gateways) not related to the rules are relayed and controlled. In other words, the method provided by the embodiment of the present application makes the multiple electronic devices in the local network get rid of the dependence on the control device when they are linked, which is beneficial to reduce the delay of linkage and improve the efficiency of linkage.

在本申请的另一些实施例中,一条IFTTT规则中条件设备有2个以上,例如:还有第三条件设备,第三条件设备对应第四事件,则多个电子设备联动的过程与上述步骤S401至S409 相类似。不同之处在于:In other embodiments of the present application, there are more than two conditional devices in an IFTTT rule. For example, there is a third conditional device, and the third conditional device corresponds to the fourth event. The process of linking multiple electronic devices is the same as the above steps. S401 to S409 are similar. The difference is:

在步骤S403中,第一执行设备根据IFTTT规则,请求发现所有的条件设备,即包括发现第一条件设备、第二条件设备以及第三条件设备。因此,第一执行设备发送的组播消息或广播消息中还包括第三条件设备的标识。In step S403, the first execution device requests to discover all the conditional devices according to the IFTTT rule, that is, to discover the first conditional device, the second conditional device and the third conditional device. Therefore, the multicast message or broadcast message sent by the first execution device further includes the identifier of the third conditional device.

在步骤S404中,第三条件设备在接收到第一执行设备发送的组播消息或广播消息后,确定该组播消息或广播消息中包含第三条件设备的标识,也会向第一执行设备发送第三条件设备的地址,以便后续第一执行设备可以向第三条件设备发送联动相关的消息。In step S404, after receiving the multicast message or broadcast message sent by the first execution device, the third conditional device determines that the multicast message or broadcast message contains the identifier of the third conditional device, and also sends the message to the first execution device. The address of the third condition device is sent, so that the first execution device can subsequently send the linkage-related message to the third condition device.

在步骤S405中,第一执行设备也要向第三条件设备订阅第四事件。其中,第四事件为第三条件设备对应的触发事件,相关内容可以参考前面相关描述,此处不再赘述。In step S405, the first execution device also subscribes the fourth event to the third condition device. Wherein, the fourth event is a trigger event corresponding to the third conditional device, and the relevant content may refer to the previous related description, which will not be repeated here.

在步骤S407至S409中,在一些实施例中,若第一执行设备接收到第一事件的通知消息,未接收到第二事件和第四事件的通知消息,则第一执行设备向第二条件设备查询第二事件是否发生,向第三条件设备查询第四事件是否发生。第二条件设备和第三条件设备分别向第一执行设备返回查询结果,第一执行设备根据查询结果确定是否执行第三事件。In steps S407 to S409, in some embodiments, if the first execution device receives the notification message of the first event, but does not receive the notification message of the second event and the fourth event, the first execution device sends a notification message to the second condition The device queries whether the second event occurs, and queries the third condition device whether the fourth event occurs. The second condition device and the third condition device respectively return query results to the first execution device, and the first execution device determines whether to execute the third event according to the query results.

若第一执行设备接收到第一事件和第二事件的通知消息,未接收到第四事件的通知消息,则第一执行设备向第三条件设备查询第四事件是否发生。第三条件设备向第一执行设备返回查询结果,第一执行设备根据查询结果确定是否执行第三事件。If the first execution device receives the notification messages of the first event and the second event but does not receive the notification message of the fourth event, the first execution device queries the third condition device whether the fourth event occurs. The third condition device returns a query result to the first execution device, and the first execution device determines whether to execute the third event according to the query result.

若第一执行设备接收到第一事件、第二事件和第四事件的通知消息,则第一执行设备直接确定是否执行第三事件。If the first execution device receives notification messages of the first event, the second event and the fourth event, the first execution device directly determines whether to execute the third event.

其他内容请参考上文相关内容的描述,不再赘述。For other content, please refer to the description of the above-mentioned related content, which will not be repeated.

在本申请的另一些实施例中,一条IFTTT规则中执行设备有2个以及2个以上,例如:还有第二执行设备。In other embodiments of the present application, there are two or more execution devices in an IFTTT rule, for example, there is a second execution device.

例如:假设IFTTT规则为:如果第一条件设备的第一事件和第二条件设备的第二事件同时发生,则第一执行设备执行第三事件,且第二执行设备执行第五事件。其中,第五事件为第二执行设备的执行事件。For example, suppose the IFTTT rule is: if the first event of the first conditional device and the second event of the second conditional device occur simultaneously, the first execution device executes the third event, and the second execution device executes the fifth event. The fifth event is an execution event of the second execution device.

在一些示例中,可以理解的是,触发第一执行设备执行第三事件的条件,与触发第二执行设备执行第五事件的条件相同。故可以在第一执行设备确定要执行第三事件时,可以通知第二执行设备执行第五事件。那么,第二执行设备可以不用从电子设备10(电子设备A)或服务器11处获取IFTTT规则。仍然可以依照步骤S401至S409的方法执行多电子设备的联动过程。不同之处在于:In some examples, it can be understood that the conditions for triggering the first execution device to execute the third event are the same as the conditions for triggering the second execution device to execute the fifth event. Therefore, when the first execution device determines to execute the third event, the second execution device may be notified to execute the fifth event. Then, the second execution device may not acquire the IFTTT rule from the electronic device 10 (electronic device A) or the server 11 . The linkage process of multiple electronic devices can still be performed according to the methods of steps S401 to S409. The difference is:

在步骤S403中,第一执行设备根据IFTTT规则,请求发送IFTTT规则中的第一条件设备、第二条件设备以及第二执行设备。在一些实施例中,第一执行设备发送的组播消息或广播消息中还包括第二执行设备的标识。In step S403, the first execution device requests to send the first condition device, the second condition device and the second execution device in the IFTTT rule according to the IFTTT rule. In some embodiments, the multicast message or broadcast message sent by the first execution device further includes the identifier of the second execution device.

在步骤S404中,第二执行设备在接收到第一执行设备发送的组播消息或广播消息后,确定该组播消息或广播消息中包含第二执行设备的标识,也向第一执行设备发送第二执行设备的地址,以便后续第一执行设备可以向第二执行设备发送联动相关的消息。In step S404, after receiving the multicast message or broadcast message sent by the first execution device, the second execution device determines that the multicast message or broadcast message contains the identifier of the second execution device, and also sends the message to the first execution device. The address of the second execution device, so that the first execution device can subsequently send linkage-related messages to the second execution device.

在步骤S409中,当第一执行设备根据第一事件的通知消息和第二事件的查询结果,确定要执行第三事件时,向第二执行设备发送指令,通知第二执行设备执行第五事件。而后,第二执行设备执行第五事件。In step S409, when the first execution device determines to execute the third event according to the notification message of the first event and the query result of the second event, it sends an instruction to the second execution device to notify the second execution device to execute the fifth event . Then, the second execution device executes the fifth event.

在另一些示例中,第二执行设备可以从电子设备10(电子设备A)或服务器11处获取 IFTTT规则,第二执行设备获取IFTTT规则后的处理过程与第一执行设备获取IFTTT规则后的处理过程相同,不再重复赘述。In other examples, the second execution device may obtain the IFTTT rules from the electronic device 10 (electronic device A) or the server 11, and the processing after the second execution device obtains the IFTTT rules is the same as the processing after the first execution device obtains the IFTTT rules The process is the same and will not be repeated.

其他内容可参考上文的相关内容的描述,不再赘述。For other content, reference may be made to the description of the above related content, which will not be repeated.

可选的,本申请实施例提供的另一种多电子设备联动的方法中,由条件设备提前获取 IFTTT规则,并发现该IFTTT规则中的其他电子设备,例如执行设备。在IFTTT规则中的某个或某些条件设备发生触发事件后,可以直接通过本地网络通知其他条件设备。其他条件设备在确定满足IFTTT规则后,指示执行设备执行相应事件,即完成联动。Optionally, in another multi-electronic device linkage method provided by the embodiment of the present application, the conditional device acquires the IFTTT rule in advance, and discovers other electronic devices in the IFTTT rule, such as an execution device. After a trigger event occurs in one or some conditional devices in the IFTTT rule, other conditional devices can be notified directly through the local network. After the other condition device determines that the IFTTT rule is satisfied, it instructs the execution device to execute the corresponding event, that is, the linkage is completed.

可以理解的是,图4A所示的多个电子设备联动的方法也可以适用于两个电子设备之间的联动。具体的,请参考图4B所示,为本申请实施例提供的一种本地网络中两个电子设备 (执行设备和条件设备)联动的方法示意图,该方法具体包括:It can be understood that the method for linkage of multiple electronic devices shown in FIG. 4A can also be applied to linkage between two electronic devices. Specifically, please refer to FIG. 4B , which is a schematic diagram of a method for interlocking two electronic devices (execution device and condition device) in a local network provided by an embodiment of the present application, and the method specifically includes:

S410、执行设备获取IFTTT规则。S410. The executing device acquires the IFTTT rule.

其中,IFTTT规则是当条件设备发生第一事件时,执行设备执行相应的执行事件(如第一功能)。The IFTTT rule is that when a first event occurs in the condition device, the execution device executes the corresponding execution event (eg, the first function).

该步骤可参考图4A中的步骤S401中的相关描述。For this step, reference may be made to the relevant description in step S401 in FIG. 4A .

S411、执行设备对获取的IFTTT规则进行合法性检查。S411. The execution device checks the validity of the acquired IFTTT rule.

该步骤可参考图4A中的步骤S402中的相关描述。For this step, reference may be made to the relevant description in step S402 in FIG. 4A .

S412、执行设备请求发现IFTTT规则中的条件设备。S412. The executing device requests to discover the conditional device in the IFTTT rule.

该步骤可参考图4A中的步骤S403中的相关描述。For this step, reference may be made to the relevant description in step S403 in FIG. 4A .

S413、条件设备向执行设备返回自身的地址。S413, the conditional device returns its own address to the execution device.

该步骤可参考图4A中的步骤S404中的相关描述。For this step, reference may be made to the relevant description in step S404 in FIG. 4A .

S414、执行设备向条件设备发送针对第一事件的订阅消息。S414. The execution device sends a subscription message for the first event to the conditional device.

该步骤可参考图4A中的步骤S405中的相关描述。For this step, reference may be made to the relevant description in step S405 in FIG. 4A .

S415、当条件设备发生第一事件时,条件设备向执行设备发布第一事件的通知消息。S415. When the first event occurs in the condition device, the condition device issues a notification message of the first event to the execution device.

该步骤可参考图4A中的步骤S406中的相关描述。For this step, reference may be made to the relevant description in step S406 in FIG. 4A .

S416、执行设备根据第一事件,确定执行相应的执行事件。S416. The execution device determines to execute a corresponding execution event according to the first event.

该步骤可参考图4A中的步骤S409中的相关描述。For this step, reference may be made to the relevant description in step S409 in FIG. 4A .

如图5A所示,为本申请实施例提供的另一种本地网络中多个电子设备联动的方法示意图。在方法中,可以由条件设备获取IFTTT规则,而执行设备可以不获取IFTTT规则,该方法具体包括:As shown in FIG. 5A , it is a schematic diagram of another method for linking multiple electronic devices in a local network provided by an embodiment of the present application. In the method, the conditional device may acquire the IFTTT rules, while the execution device may not acquire the IFTTT rules, and the method specifically includes:

S501、第一条件设备和第二条件设备分别获取IFTTT规则。S501, the first condition device and the second condition device respectively acquire the IFTTT rules.

本步骤具体包括:第一条件设备获取IFTTT规则(步骤S501a)和第二条件设备获取IFTTT 规则(步骤S501b)。This step specifically includes: the first conditional device acquires the IFTTT rule (step S501a) and the second conditional device acquires the IFTTT rule (step S501b).

其中,第一条件设备和第二条件设备获取IFTTT规则的方法可参考步骤S401中第一执行设备获取IFTTT规则,不再赘述。Wherein, for the method for acquiring the IFTTT rule by the first condition device and the second condition device, reference may be made to acquiring the IFTTT rule by the first execution device in step S401, and details are not repeated here.

S502、第一条件设备和第二条件设备分别对获取到的IFTTT规则进行合法性检查。S502, the first condition device and the second condition device respectively check the acquired IFTTT rules for validity.

本步骤具体包括:第一条件设备对获取到的IFTTT规则进行合法性检查(步骤S502a),以及第二条件设备对获取到的IFTTT规则进行合法性检查(步骤S502b)。This step specifically includes: the first conditional device performs a legality check on the acquired IFTTT rules (step S502a), and the second conditional device performs a legality check on the acquired IFTTT rules (step S502b).

示例性的,第一条件设备和第二条件设备分别对获取到的IFTTT规则进行解析,确定该 IFTTT规则的完整性和正确性进行检查,以确保可以根据该获取到的IFTTT规则进行条件设备和执行设备的联动。Exemplarily, the first conditional device and the second conditional device respectively parse the acquired IFTTT rule, and check the integrity and correctness of the IFTTT rule to ensure that the conditional device and the acquired IFTTT rule can be performed according to the acquired IFTTT rule. Execute device linkage.

S503、第一条件设备根据IFTTT规则,请求发现第一执行设备和第二条件设备;第二条件设备根据IFTTT规则,请求发现第一执行设备和第一条件设备。S503. The first condition device requests to discover the first execution device and the second condition device according to the IFTTT rule; the second condition device requests to discover the first execution device and the first condition device according to the IFTTT rule.

本步骤具体包括:第一条件设备请求发现第一执行设备和第二条件设备(步骤S503b),和第二条件设备请求发现第一执行设备和第一条件设备(S503a)。This step specifically includes: the first conditional device requests to discover the first execution device and the second conditional device (step S503b), and the second conditional device requests to discover the first execution device and the first conditional device (S503a).

示例性的,第一条件设备和第二条件设备分别从IFTTT规则中获取相关的其他设备的标识,并在本地网络中进行组播或广播,请求发现该IFTTT规则中的其他设备。即,在本地网络中组播或广播的消息中,可以携带有IFTTT规则中的其他设备的标识。Exemplarily, the first condition device and the second condition device respectively obtain the identifiers of other related devices from the IFTTT rule, and perform multicast or broadcast in the local network, requesting to discover other devices in the IFTTT rule. That is, the multicast or broadcast messages in the local network may carry the identifiers of other devices in the IFTTT rules.

例如:假设IFTTT规则为:如果第一条件设备的第一事件和第二条件设备的第二事件同时发生,则第一执行设备执行第三事件。其中,第一事件为第一条件设备的触发事件,第二事件为第二条件设备的触发事件。第三事件为第一执行设备的执行事件。那么,第一执行设备可以将第一条件设备的标识、第二条件设备的标识进行组播或广播。那么,第一条件设备在本地网络中组播或广播的消息中,可以携带有第一执行设备和第二条件设备的标识。第二条件设备在本地网络中组播或广播的消息中,可以携带有第一执行设备和第一条件设备的标识。For example, it is assumed that the IFTTT rule is: if the first event of the first conditional device and the second event of the second conditional device occur simultaneously, the first execution device executes the third event. The first event is a triggering event of the first conditional device, and the second event is a triggering event of the second conditional device. The third event is an execution event of the first execution device. Then, the first execution device may multicast or broadcast the identifier of the first conditional device and the identifier of the second conditional device. Then, the message multicast or broadcast by the first condition device in the local network may carry the identifiers of the first execution device and the second condition device. The message multicast or broadcast by the second condition device in the local network may carry the identifiers of the first execution device and the first condition device.

S504、第一执行设备和第二条件设备向第一条件设备回复各自地址;第一执行设备和第一条件设备向第二条件设备回复各自的地址。S504 , the first execution device and the second condition device return their respective addresses to the first condition device; the first execution device and the first condition device return their respective addresses to the second condition device.

图中分别以步骤S504a、步骤S504b、步骤S504c和步骤S504d示出。In the figure, steps S504a, S504b, S504c and S504d are respectively shown.

S505、当第一条件设备的第一事件发生时,第一条件设备向第二条件设备发布第一事件。S505. When the first event of the first conditional device occurs, the first conditional device publishes the first event to the second conditional device.

第一条件设备发生第一事件后,可以向第二条件设备发送通知消息,用于通知第一条件设备已发生第一事件。After the first event occurs in the first condition device, a notification message may be sent to the second condition device for notifying the first condition device that the first event has occurred.

示例性的,该通知消息可以是一个特定格式或特定内容的消息,第二条件设备在接收到该通知消息后,可以根据该通知消息的发送者(第一条件设备)确定第一事件已发生。再示例性的,该通知消息也可以携带第一条件设备的标识,那么,第二条件设备在接收到该通知消息后,可以根据该第一条件设备的标识确定第一事件已发生。又示例性的,该通知消息也可以携带第一事件的标识或者第一事件的内容,那么,第二条件设备在接收到该通知消息后,可以根据第一事件的标识或者第一事件的内容确定第一事件已发生。本申请实施例中对通知消息的具体形式和内容不做限定。Exemplarily, the notification message may be a message of a specific format or specific content, and after receiving the notification message, the second conditional device may determine that the first event has occurred according to the sender of the notification message (the first conditional device) . For another example, the notification message may also carry the identifier of the first conditional device. Then, after receiving the notification message, the second conditional device may determine that the first event has occurred according to the identifier of the first conditional device. In another example, the notification message may also carry the identifier of the first event or the content of the first event. Then, after receiving the notification message, the second condition device may, according to the identifier of the first event or the content of the first event, Determine that the first event has occurred. The specific form and content of the notification message are not limited in the embodiments of the present application.

S506、当第二条件设备的第二事件发生时,第二条件设备向第一执行设备发送执行第三事件的命令。S506. When the second event of the second condition device occurs, the second condition device sends a command to execute the third event to the first execution device.

由于第二条件设备获取有IFTTT规则,所以,第二条件设备可以根据接收到的第一事件的通知消息,再结合自身发生的第二事件,确定是否满足IFTTT规则,若满足IFTTT规则,则向第一执行设备发送执行第三事件的命令。Since the second conditional device has acquired the IFTTT rule, the second conditional device can determine whether the IFTTT rule is satisfied according to the received notification message of the first event and the second event that occurs by itself, and if the IFTTT rule is satisfied, send the The first execution device sends a command to execute the third event.

在一些实施例中,第一事件的通知消息具有时效性。也就是说,第一事件的通知消息在预设的时间段内是有效的。若超过预设时间段,则该通知消息为无效,即该通知消息不能用于说明第一事件已发生,那么,当第二事件发生时,第二条件设备还需要向第一条件设备查询第一事件是否发生,本申请实施例不再重复赘述。In some embodiments, the notification message of the first event is time-sensitive. That is, the notification message of the first event is valid within a preset time period. If it exceeds the preset time period, the notification message is invalid, that is, the notification message cannot be used to indicate that the first event has occurred. Then, when the second event occurs, the second condition device also needs to query the first condition device for the first event. Whether an event occurs is not repeated in this embodiment of the present application.

S507、第一执行设备执行第三事件。S507. The first execution device executes the third event.

其中,第三事件为第一执行设备的执行事件,该执行事件可以是一个动作或者一系列的动作。即,当触发第一执行设备执行第三事件的条件满足时,第一执行设备同时执行或者顺序第三事件中一系列的动作。该执行事件还可以设置延迟,即,当触发第一执行设备执行第三事件的条件满足时,第一执行设备可以在预设的延迟时间后开始执行第三事件。本申请实施例对此不做限定。The third event is an execution event of the first execution device, and the execution event may be an action or a series of actions. That is, when the condition that triggers the first execution device to execute the third event is satisfied, the first execution device simultaneously executes or sequentially executes a series of actions in the third event. A delay may also be set for the execution event, that is, when a condition for triggering the first execution device to execute the third event is satisfied, the first execution device may start executing the third event after a preset delay time. This embodiment of the present application does not limit this.

可以理解的是,若第二条件设备的第二事件先于第一条件设备的第一事件发生时,第二条件设备会先向第一条件设备发布第二事件,后续当第一条件设备发生第一事件时,可以根据第二事件的通知消息和第一事件确定是否满足IFTTT规则。若满足,则第一条件设备指示第一执行设备执行第三事件。It can be understood that if the second event of the second conditional device occurs before the first event of the first conditional device, the second conditional device will first issue the second event to the first conditional device, and then when the first conditional device occurs During the first event, whether the IFTTT rule is satisfied may be determined according to the notification message of the second event and the first event. If satisfied, the first condition device instructs the first execution device to execute the third event.

下面结合具体的场景,示例性说明下该本申请实施例中的本地联动的方法。The method for local linkage in this embodiment of the present application is exemplarily described below with reference to specific scenarios.

如图5B所示,以电子设备10(电子设备A)是手机,第一条件设备是智能门,第二条件设备是亮度传感器,第一执行设备是灯为例进行说明。As shown in FIG. 5B , the electronic device 10 (electronic device A) is a mobile phone, the first conditional device is a smart door, the second conditional device is a brightness sensor, and the first execution device is a lamp for illustration.

智能门和亮度传感器分别从手机侧获取一条IFTTT规则,例如:如果智能门开锁,且亮度传感器检测到黑暗,则执行开灯。那么,当智能门执行了开锁后,会将该事件发布给亮度传感器,而亮度传感器检测房间亮度是否为黑暗,若为黑暗,则亮度传感器向灯发布事件。灯接收到亮度传感器发布的事件后,开灯。The smart door and the brightness sensor obtain an IFTTT rule from the mobile phone, for example: if the smart door is unlocked and the brightness sensor detects darkness, turn on the lights. Then, when the smart door is unlocked, the event will be released to the brightness sensor, and the brightness sensor will detect whether the room brightness is dark. If it is dark, the brightness sensor will issue an event to the light. After the light receives the event posted by the brightness sensor, it turns on the light.

综上,本申请实施例提供的多电子设备联动的方法中,由条件设备提前获取IFTTT规则,并发现该IFTTT规则中的其他电子设备。在IFTTT规则中的条件设备发生触发事件后,可以直接通过本地网络通知其他条件设备,由各个条件设备确定满足IFTTT规则后,指示执行设备执行相应事件,即完成联动。可见,从某个条件设备的触发条件发生,到执行设备执行相应事件的整个过程中,都是在本地网络中完成的,提高了联动的效率,提升了用户数据的安全性。To sum up, in the multi-electronic device linkage method provided by the embodiment of the present application, the conditional device acquires the IFTTT rule in advance, and discovers other electronic devices in the IFTTT rule. After a conditional device in the IFTTT rule triggers an event, it can directly notify other conditional devices through the local network. After each conditional device determines that the IFTTT rule is satisfied, it instructs the execution device to execute the corresponding event, that is, the linkage is completed. It can be seen that the entire process from the occurrence of a trigger condition of a conditional device to the execution of the corresponding event by the execution device is completed in the local network, which improves the efficiency of linkage and improves the security of user data.

在本申请的另一些实施例中,一条IFTTT规则中条件设备有2个以上,例如:还有第三条件设备,第三条件设备对应第四事件,则多个电子设备联动的过程与上述步骤S501至S507 相类似。不同之处在于:In other embodiments of the present application, there are more than two conditional devices in an IFTTT rule. For example, there is a third conditional device, and the third conditional device corresponds to the fourth event. The process of linking multiple electronic devices is the same as the above steps. S501 to S507 are similar. The difference is:

在步骤S501中,所有的条件设备都需要从服务器11或电子设备10(电子设备A)处获取IFTTT规则,也就是说,第三条件设备也要获取IFTTT规则。在步骤S502中,第三条件设备也要对IFTTT规则进行合法性检查。In step S501, all the conditional devices need to obtain the IFTTT rules from the server 11 or the electronic device 10 (electronic device A), that is, the third conditional device also needs to obtain the IFTTT rules. In step S502, the third condition device also checks the validity of the IFTTT rules.

在步骤S503中,第一条件设备和第二条件设备还要发现第三条件设备,即第一条件设备和第二条件设备发送的组播消息或广播消息中还包含有第三条件设备的标识。同理,第三条件设备也要发送组播消息或广播消息,用于发现IFTTT规则中的其他电子设备,例如:第一条件设备、第二条件设备和第一执行设备。In step S503, the first condition equipment and the second condition equipment also need to discover the third condition equipment, that is, the multicast message or broadcast message sent by the first condition equipment and the second condition equipment also contains the identifier of the third condition equipment . Similarly, the third condition device also sends a multicast message or a broadcast message for discovering other electronic devices in the IFTTT rule, such as the first condition device, the second condition device, and the first execution device.

在步骤S504中,第三条件设备在接收到第一条件设备和第二条件设备分别发送的组播消息或广播消息后,也会分别向第一条件设备和第二条件设备分别发送第三条件设备的地址。同理,第一条件设备、第二条件设备和第一执行设备在接收到第三条件设备发送的组播消息或广播消息后,也会向第三条件设备回复各自的网络地址。In step S504, after receiving the multicast message or broadcast message respectively sent by the first condition device and the second condition device, the third condition device also sends the third condition device to the first condition device and the second condition device respectively. The address of the device. Similarly, after receiving the multicast message or broadcast message sent by the third condition device, the first condition device, the second condition device and the first execution device will also reply to the third condition device with their respective network addresses.

在步骤S505至S506中,当第一条件设备发生第一事件时,第一条件设备分别向第二条件设备和第三条件设备发布第一事件。这样,第二条件设备和第三条件设备都获知到第一事件已发生。当第二事件发生后,第二条件设备向第三条件设备发布第二事件(也可以同时也向第一条件设备发布第二事件)。这样,当第三条件设备的第四事件(第三条件设备对应的触发事件)发生时,第三条件设备根据IFTTT规则,确定是否指示第一执行设备执行第三事件。In steps S505 to S506, when a first event occurs in the first conditional device, the first conditional device issues the first event to the second conditional device and the third conditional device, respectively. In this way, both the second conditional device and the third conditional device are informed that the first event has occurred. After the second event occurs, the second conditional device issues the second event to the third conditional device (and may also issue the second event to the first conditional device at the same time). In this way, when the fourth event of the third condition device (the trigger event corresponding to the third condition device) occurs, the third condition device determines whether to instruct the first execution device to execute the third event according to the IFTTT rule.

其他内容请参考上文相关内容的描述,不再赘述。For other content, please refer to the description of the above-mentioned related content, which will not be repeated.

在本申请的另一些实施例中,一条IFTTT规则中执行设备有2个以及2个以上,例如:还有第二执行设备,第二执行设备需要执行的事件为第五事件。那么,在确定所有条件设备的触发事件都满足IFTTT规则时,指示第一执行设备执行第三事件的同时,也指示其他执行设备执行相应的事件。In other embodiments of the present application, there are two or more execution devices in an IFTTT rule, for example, there is a second execution device, and the event to be executed by the second execution device is the fifth event. Then, when it is determined that the trigger events of all the conditional devices satisfy the IFTTT rule, the first execution device is instructed to execute the third event, and other execution devices are also instructed to execute the corresponding event.

例如:假设IFTTT规则为:如果第一条件设备的第一事件和第二条件设备的第二事件同时发生,则第一执行设备执行第三事件,且第二执行设备执行第五事件。其中,第五事件为第二执行设备的执行事件。For example, suppose the IFTTT rule is: if the first event of the first conditional device and the second event of the second conditional device occur simultaneously, the first execution device executes the third event, and the second execution device executes the fifth event. The fifth event is an execution event of the second execution device.

在这种场景下,仍然可以采用步骤S501至S507中的方法,不同之处在于:In this scenario, the methods in steps S501 to S507 can still be used, with the difference that:

在步骤S503至S504,条件设备发现IFTTT规则中其他设备的过程中,也需要发现第二执行设备。相关内容可参考上文描述,不再赘述。In steps S503 to S504, in the process of the conditional device discovering other devices in the IFTTT rule, it also needs to discover the second execution device. For related content, reference may be made to the above description, which will not be repeated.

在步骤S506中,当第二条件设备的第二事件发生时,第二条件设备指示第一执行设备执行第三事件,同时第二条件设备指示第二执行设备执行第五事件。In step S506, when the second event of the second condition device occurs, the second condition device instructs the first execution device to execute the third event, while the second condition device instructs the second execution device to execute the fifth event.

其他内容参考上文相关内容的描述,不再赘述。For other content, refer to the description of the above related content, which is not repeated here.

可选的,本申请实施例提供的又一种多电子设备联动的方法中,由执行设备和部分条件设备提前获取IFTTT规则,并发现该IFTTT规则中的其他电子设备,例如:其他条件设备。当获取IFTTT规则的某个条件设备发生触发事件后,可以查询其他条件设备的触发事件,或者可以通知执行设备,由执行设备条件设备去查询其他条件设备的触发事件。最后,当确定所有条件设备的触发条件均发生后,执行设备执行相应事件,即完成联动。Optionally, in yet another multi-electronic device linkage method provided by the embodiment of the present application, the execution device and some conditional devices acquire the IFTTT rules in advance, and discover other electronic devices in the IFTTT rules, such as other conditional devices. When a trigger event occurs on a condition device that has acquired the IFTTT rule, the trigger event of other condition devices can be queried, or the execution device can be notified, and the execution device condition device can query the trigger events of other condition devices. Finally, when it is determined that the triggering conditions of all the conditional devices have occurred, the execution device executes the corresponding event, that is, the linkage is completed.

如图6A所示,为本申请实施例提供的另一种本地网络中多个电子设备联动的方法示意图。在方法中,可以由部分条件设备和执行设备获取IFTTT规则,该方法具体包括:As shown in FIG. 6A , it is a schematic diagram of another method for linking multiple electronic devices in a local network according to an embodiment of the present application. In the method, the IFTTT rules can be acquired by some conditional devices and execution devices, and the method specifically includes:

S601、第一条件设备和第一执行设备分别获取IFTTT规则。S601, the first condition device and the first execution device respectively acquire the IFTTT rule.

本步骤具体包括:第一条件设备获取IFTTT规则(步骤S601a),和第一执行设备获取 IFTTT规则(步骤S601b)。This step specifically includes: the first condition device acquires the IFTTT rule (step S601a), and the first execution device acquires the IFTTT rule (step S601b).

其中,第一条件设备和第一执行设备获取IFTTT规则的方法可参考步骤S401中第一执行设备获取IFTTT规则,不再赘述。Wherein, for the method for acquiring the IFTTT rule by the first condition device and the first execution device, reference may be made to the acquisition of the IFTTT rule by the first execution device in step S401, and details are not repeated here.

S602、第一条件设备和第一执行设备分别对获取到的IFTTT规则进行合法性检查。S602, the first condition device and the first execution device respectively check the acquired IFTTT rules for validity.

本步骤具体包括:第一条件设备对获取到的IFTTT规则进行合法性检查(步骤S602b),和第一执行设备分别对获取到的IFTTT规则进行合法性检查(S602a)。This step specifically includes: the first condition device performs a legality check on the acquired IFTTT rules (step S602b), and the first execution device respectively performs a legality check on the acquired IFTTT rules (S602a).

示例性的,第一条件设备和第一执行设备分别对获取到的IFTTT规则进行解析,确定该 IFTTT规则的完整性和正确性进行检查,以确保可以根据该获取到的IFTTT规则进行条件设备和执行设备的联动。Exemplarily, the first conditional device and the first execution device respectively parse the acquired IFTTT rule, determine the integrity and correctness of the IFTTT rule and check to ensure that the conditional device and the acquired IFTTT rule can be performed according to the acquired IFTTT rule. Execute device linkage.

S603、第一条件设备根据IFTTT规则,请求发现第一执行设备和第二条件设备;第一执行设备根据IFTTT规则,请求发现第一条件设备和第二条件设备。S603. The first condition device requests to discover the first execution device and the second condition device according to the IFTTT rule; the first execution device requests to discover the first condition device and the second condition device according to the IFTTT rule.

本步骤具体包括:第一条件设备请求发现第一执行设备和第二条件设备(步骤S603a),以及第一执行设备请求发现第一条件设备和第二条件设备(步骤S603b)。This step specifically includes: the first conditional device requests to discover the first execution device and the second conditional device (step S603a), and the first execution device requests to discover the first conditional device and the second conditional device (step S603b).

示例性的,第一条件设备和第二条件设备分别从IFTTT规则中获取相关的其他设备的标识,并在本地网络中进行组播或广播,请求发现该IFTTT规则中的其他设备。即,在本地网络中组播或广播的消息中,可以携带有IFTTT规则中的其他设备的标识。Exemplarily, the first condition device and the second condition device respectively obtain the identifiers of other related devices from the IFTTT rule, and perform multicast or broadcast in the local network, requesting to discover other devices in the IFTTT rule. That is, the multicast or broadcast messages in the local network may carry the identifiers of other devices in the IFTTT rules.

在一些实施例中,由于第一条件设备不需要向第二条件设备发送数据,因此,在该步骤中时,第一条件设备也可以不发现第二条件设备。即,第一条件设备发送的组播消息或广播消息中不携带第二条件设备的标识,这样,当第二条件设备接收到该组播消息或广播消息后,不用向第一条件设备回复自身的网络地址。同理,第一执行设备不需要向第一条件设备发送数据,因此,在该步骤中,第一执行设备也可以不发现第一条件设备。即,第一执行设备发送的组播消息或广播消息中不携带第一条件设备的标识。In some embodiments, since the first conditional device does not need to send data to the second conditional device, in this step, the first conditional device may not discover the second conditional device. That is, the multicast message or broadcast message sent by the first conditional device does not carry the identifier of the second conditional device. In this way, when the second conditional device receives the multicast message or broadcast message, it does not need to reply to the first conditional device. network address. Similarly, the first execution device does not need to send data to the first conditional device. Therefore, in this step, the first execution device may not discover the first conditional device. That is, the multicast message or broadcast message sent by the first execution device does not carry the identifier of the first conditional device.

S604、第一执行设备和第二条件设备向第一条件设备回复各自地址;第一执行设备和第一条件设备项第二条件设备回复各自的地址。S604: The first execution device and the second condition device reply to their respective addresses to the first condition device; the first execution device and the first condition device and the second condition device reply to their respective addresses.

图中分别以步骤S604a、步骤S604b、步骤S604c和步骤S604d示出。In the figure, steps S604a, S604b, S604c and S604d are respectively shown.

S605、当第一条件设备的第一事件发生时,第一条件设备向第一执行设备发布第一事件。S605. When the first event of the first condition device occurs, the first condition device issues the first event to the first execution device.

第一条件设备发生第一事件后,可以向第一执行设备发送通知消息,用于通知第一条件设备已发生第一事件。After the first event occurs in the first condition device, a notification message may be sent to the first execution device for notifying the first condition device that the first event has occurred.

S606、第一执行设备根据IFTTT规则,向第二条件设备查询第二事件。S606. The first execution device queries the second condition device for the second event according to the IFTTT rule.

S607、第二条件设备向第一执行设备返回第二事件的查询结果。S607. The second condition device returns the query result of the second event to the first execution device.

S608、第一执行设备执行第三事件。S608. The first execution device executes the third event.

第一执行设备根据第一事件的通知消息和第二时间的查询结果,确定是否满足IFTTT规则。若满足,则执行第三事件。否则,不执行第三事件。The first execution device determines whether the IFTTT rule is satisfied according to the notification message of the first event and the query result of the second time. If so, execute the third event. Otherwise, the third event is not executed.

在本申请的另一些实施例中,第一条件设备发送第一事件后,也可以向第二条件设备查询第二事件。第一条件设备确定第一事件和第二事件是否满足IFTTT规则,若满足,则指示第一执行设备执行第三事件。也就是说,步骤S605至S607可替换为步骤S609至S610,即本申请实施例提供的多设备联动的方法包括:S601至S604,S609至S611,以及步骤S608,如下:In other embodiments of the present application, after the first condition device sends the first event, it may also query the second condition device for the second event. The first condition device determines whether the first event and the second event satisfy the IFTTT rule, and if so, instructs the first execution device to execute the third event. That is to say, steps S605 to S607 can be replaced with steps S609 to S610, that is, the multi-device linkage method provided by this embodiment of the present application includes: S601 to S604, S609 to S611, and step S608, as follows:

S609、当第一条件设备发生第一事件时,第一条件设备向第二条件设备查询第二事件是否发生。S609. When the first event occurs in the first condition device, the first condition device inquires of the second condition device whether the second event occurs.

S610、第二条件设备向第一条件设备返回第二时间的查询结果。S610. The second condition device returns the query result of the second time to the first condition device.

S611、第一条件设备根据第一事件和第二事件的查询结果,确定是否满足IFTTT规则,若满足,则指示第一执行设备执行第三事件。S611. The first condition device determines whether the IFTTT rule is satisfied according to the query results of the first event and the second event, and if satisfied, instructs the first execution device to execute the third event.

还需要说明都是,在一些实施例中,若电子设备采用步骤S609至S611的流程时,由于第一执行设备不需要向第一条件设备和第二条件设备发送数据,因此,在步骤S603和S604 中时,第一执行设备也可以不发现第一条件设备和第二条件设备。It should also be noted that, in some embodiments, if the electronic device adopts the processes of steps S609 to S611, since the first execution device does not need to send data to the first conditional device and the second conditional device, in steps S603 and S603 and In S604, the first execution device may not discover the first conditional device and the second conditional device.

综上,在该实施例中,由执行设备和条件设备获取IFTTT规则,可以省去执行设备向条件设备订阅触发事件的过程。而且,在该实施例中,只有当第一条件设备的第一事件发生时,才会去查询第二事件的状态。也就是说,当第二条件设备的第二事件频繁发生时,第二条件设备也不用频繁发布第二事件,有利于节省资源。To sum up, in this embodiment, the execution device and the conditional device acquire the IFTTT rules, which can save the process of the execution device subscribing to the conditional device for triggering events. Moreover, in this embodiment, only when the first event of the first condition device occurs, will the state of the second event be inquired. That is, when the second event of the second condition device occurs frequently, the second condition device does not need to publish the second event frequently, which is beneficial to saving resources.

例如:如图6B所示,以电子设备10(电子设备A)是手机,第一条件设备是智能门,第二条件设备是亮度传感器(用于检测室内环境的亮度),第一执行设备是灯为例进行说明。For example, as shown in FIG. 6B , the electronic device 10 (electronic device A) is a mobile phone, the first conditional device is a smart door, the second conditional device is a brightness sensor (used to detect the brightness of the indoor environment), and the first execution device is A lamp is used as an example to illustrate.

智能门和灯,分别从手机处获取IFTTT规则,例如为,如果智能门锁开锁了,且室内环境处于黑暗状态时,则自动开启室内灯。那么,当智能门开锁时,智能门向灯发布开锁事件。灯再向亮度传感器查询室内是否黑暗。若黑暗,则灯自动开启。可见,在本申请中,只有在智能门锁开锁时,即表示家里有人回来,才去查询亮度传感器的检测结果。若检测结果表明室内环境处于黑暗状态,则开灯。考虑到当家里没有人在时,室内环境可能一直处于黑暗状态。若亮度传感器一直发布室内黑暗的事件,没有意义,反而浪费资源。For smart doors and lights, the IFTTT rules are obtained from the mobile phone respectively. For example, if the smart door lock is unlocked and the indoor environment is in a dark state, the indoor lights are automatically turned on. Then, when the smart door is unlocked, the smart door releases the unlock event to the light. The light then queries the brightness sensor to see if the room is dark. If it is dark, the light will automatically turn on. It can be seen that, in the present application, the detection result of the brightness sensor is inquired only when the smart door lock is unlocked, which means that someone at home has returned. If the detection result shows that the indoor environment is in a dark state, turn on the light. Consider that the indoor environment can be kept dark all the time when no one is at home. It is meaningless if the brightness sensor keeps posting the events of indoor darkness, but it is a waste of resources.

在本申请的另一些实施例中,一条IFTTT规则中条件设备有2个以上,例如:还有第三条件设备,第三条件设备对应第四事件,则多个电子设备联动的过程与上述步骤S601至S608 相类似。In other embodiments of the present application, there are more than two conditional devices in an IFTTT rule. For example, there is a third conditional device, and the third conditional device corresponds to the fourth event. The process of linking multiple electronic devices is the same as the above steps. S601 to S608 are similar.

在一些示例中,第三条件设备可以不获取IFTTT规则,那么,与上述步骤S601至S608 采用的方法,不同之处在于:In some examples, the third conditional device may not acquire the IFTTT rule, then, the difference from the method used in the above steps S601 to S608 is:

在步骤S603至S604的发现其他电子设备的过程中,还要发现第三条件设备,具体发现过程不再赘述。In the process of discovering other electronic devices in steps S603 to S604, a third conditional device is also discovered, and the specific discovery process will not be repeated.

在步骤S606中,第一执行设备向第二条件设备查询第二事件时,也向第三条件设备查询第四事件。其中,第四事件为第三条件设备对应的触发事件。而后,第三条件设备向第一执行设备返回第四事件的查询结果。In step S606, when the first execution device queries the second condition device for the second event, it also queries the third condition device for the fourth event. The fourth event is a trigger event corresponding to the third condition device. Then, the third condition device returns the query result of the fourth event to the first execution device.

在步骤S608中,第一执行设备根据第一事件的通知消息、第二事件和第四事件的查询结果,确定是否满足IFTTT规则,是否执行第三事件。In step S608, the first execution device determines whether the IFTTT rule is satisfied and whether to execute the third event according to the notification message of the first event and the query results of the second event and the fourth event.

其他内容请参考上文相关内容的描述,不再赘述。For other content, please refer to the description of the above-mentioned related content, which will not be repeated.

在另一些示例中,第三条件设备可以获取IFTTT规则,那么,与上述S601至S604,S609 至S611,以及步骤S608的方法不同之处在于:In some other examples, the third conditional device can obtain the IFTTT rules, then, the difference from the above-mentioned methods of S601 to S604, S609 to S611, and step S608 is:

都获取了IFTTT规则的第一条件设备和第三条件设备之间的交互可以参考上述步骤S501 至S507中第一条件设备和第二条件设备之间的交互,不再赘述。For the interaction between the first condition device and the third condition device that have both acquired the IFTTT rules, reference may be made to the interaction between the first condition device and the second condition device in the above steps S501 to S507, and details are not repeated here.

在另一些示例中,第三条件设备可以获取IFTTT规则,那么,与上述S601至S604,S609 至S611,以及步骤S608的方法不同之处在于:In some other examples, the third conditional device can obtain the IFTTT rules, then, the difference from the above-mentioned methods of S601 to S604, S609 to S611, and step S608 is:

都获取了IFTTT规则的第一条件设备和第三条件设备之间的交互可以参考上述步骤S501 至S507中第一条件设备和第二条件设备之间的交互,不再赘述。For the interaction between the first condition device and the third condition device that have both acquired the IFTTT rules, reference may be made to the interaction between the first condition device and the second condition device in the above steps S501 to S507, and details are not repeated here.

在本申请的另一些实施例中,一条IFTTT规则中条件设备有2个以上,例如:还有第三条件设备,则多个电子设备联动的过程与上述S601至S604,S609至S611,以及步骤S608,相类似。In other embodiments of the present application, there are more than two conditional devices in an IFTTT rule. For example, if there is a third conditional device, the process of linking multiple electronic devices is the same as the above steps S601 to S604, S609 to S611, and steps S608, similar.

在一些示例中,第三条件设备可以不获取IFTTT规则,那么,与上述S601至S604,S609 至S611,以及步骤S608的方法不同之处在于:In some examples, the third conditional device may not acquire the IFTTT rules, then, the difference from the above-mentioned methods of S601 to S604, S609 to S611, and step S608 is:

在步骤S603至S604的发现其他电子设备的过程中,还要发现第三条件设备,具体发现过程不再赘述。In the process of discovering other electronic devices in steps S603 to S604, a third conditional device is also discovered, and the specific discovery process will not be repeated.

在步骤S609中,当第一条件设备的第一事件发生时,向第二条件设备查询第二事件,同时也向第三条件设备查询第四事件。而后,第三条件设备向第一条件设备返回第四事件的查询结果。In step S609, when the first event of the first conditional device occurs, the second conditional device is queried for the second event, and the third conditional device is also queried for the fourth event. Then, the third condition device returns the query result of the fourth event to the first condition device.

在步骤S611中,第一条件设备根据第一事件、第二事件以及第四事件的查询结果,确定是否指示第一执行设备执行第三事件。In step S611, the first condition device determines whether to instruct the first execution device to execute the third event according to the query results of the first event, the second event and the fourth event.

其他内容请参考上文相关内容的描述,不再赘述。For other content, please refer to the description of the above-mentioned related content, which will not be repeated.

在另一些示例中,第三条件设备可以获取IFTTT规则,那么,与上述S601至S604,S609 至S611,以及步骤S608的方法不同之处在于:In some other examples, the third conditional device can obtain the IFTTT rules, then, the difference from the above-mentioned methods of S601 to S604, S609 to S611, and step S608 is:

都获取了IFTTT规则的第一条件设备和第三条件设备之间的交互可以参考上述步骤S501 至S507中第一条件设备和第二条件设备之间的交互,不再赘述。For the interaction between the first condition device and the third condition device that have both acquired the IFTTT rules, reference may be made to the interaction between the first condition device and the second condition device in the above steps S501 to S507, and details are not repeated here.

在本申请的另一些实施例中,一条IFTTT规则中执行设备有2个以及2个以上,例如:还有第二执行设备,第二执行设备需要执行的事件为第五事件。那么,在确定所有条件设备的触发事件都满足IFTTT规则时,指示第一执行设备执行第三事件的同时,也指示其他执行设备执行相应的事件。In other embodiments of the present application, there are two or more execution devices in an IFTTT rule, for example, there is a second execution device, and the event to be executed by the second execution device is the fifth event. Then, when it is determined that the trigger events of all the conditional devices satisfy the IFTTT rule, the first execution device is instructed to execute the third event, and other execution devices are also instructed to execute the corresponding event.

例如:假设IFTTT规则为:如果第一条件设备的第一事件和第二条件设备的第二事件同时发生,则第一执行设备执行第三事件,且第二执行设备执行第五事件。其中,第五事件为第二执行设备的执行事件。For example, suppose the IFTTT rule is: if the first event of the first conditional device and the second event of the second conditional device occur simultaneously, the first execution device executes the third event, and the second execution device executes the fifth event. The fifth event is an execution event of the second execution device.

在这种场景下,仍然可以采用上述步骤S601至S608的方法或者上述步骤S601至S604,步骤S609至S611,以及步骤S608的方法,不同之处在于:In this scenario, the methods of the above-mentioned steps S601 to S608 or the above-mentioned steps S601 to S604, steps S609 to S611, and steps S608 can still be adopted, and the differences are:

在步骤S603至S604,条件设备和执行设备在发现IFTTT规则中其他设备的过程中,也需要发现第二执行设备。相关内容可参考上文描述,不再赘述。In steps S603 to S604, the condition device and the execution device also need to discover the second execution device in the process of discovering other devices in the IFTTT rule. For related content, reference may be made to the above description, which will not be repeated.

在步骤S608中,当第一执行设备确定执行第三事件时,也指示第二执行设备执行第五事件。或者,在步骤S611中,当第一条件设备指示第一执行设备执行第三事件时,也指示第二执行设备执行第五事件。In step S608, when the first execution device determines to execute the third event, it also instructs the second execution device to execute the fifth event. Alternatively, in step S611, when the first condition device instructs the first execution device to execute the third event, it also instructs the second execution device to execute the fifth event.

其他内容参考上文相关内容的描述,不再赘述。For other content, refer to the description of the above related content, which is not repeated here.

可以理解的是,上述终端等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。It can be understood that, in order to realize the above-mentioned functions, the above-mentioned terminal and the like include corresponding hardware structures and/or software modules for executing each function. Those skilled in the art should easily realize that, in conjunction with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the embodiments of the present invention.

本申请实施例可以根据上述方法示例对上述终端等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。下面以采用对应各个功能划分各个功能模块为例进行说明:In this embodiment of the present application, functional modules may be divided into the above terminal and the like according to the above method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiment of the present invention is schematic, and is only a logical function division, and there may be other division manners in actual implementation. The following is an example of dividing each function module corresponding to each function to illustrate:

图7示出了上述实施例中所涉及的一种装置的结构示意图,该装置可以实现本申请实施例提供的方法中电子设备的功能。该装置可以为电子设备或者为可以支持电子设备实现本申请实施例中电子设备的功能的装置,例如该装置为应用于电子设备中的芯片系统。该装置包括:处理单元701和通信单元702。其中,处理单元701可以用于支持图4A所示的电子设备执行上述实施例中的步骤S402和S409,或者用于支持图4B所示的电子设备执行上述实施例中的步骤S411和S416,或者用于支持图5A所示的电子设备执行上述实施例中的步骤 S502和S507,或者用于支持图6A所示的电子设备执行上述实施例中的步骤S602和S608。通信单元702用于支持图4A所示的电子设备执行上述实施例中的步骤S401、S403至S408,或者用于支持图4B所示的电子设备执行上述实施例中的步骤S412至S415,或者用于支持图5A所示的电子设备执行上述实施例中的步骤S501、S503至S506,或者用于支持图6A所示的电子设备执行上述实施例中的步骤S601、S603至S607,S609至S611。上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。FIG. 7 shows a schematic structural diagram of an apparatus involved in the foregoing embodiment, and the apparatus can implement the functions of the electronic device in the method provided by the embodiment of the present application. The apparatus may be an electronic device or a device that can support the electronic device to implement the functions of the electronic device in the embodiments of the present application, for example, the device is a chip system applied to the electronic device. The apparatus includes: a processing unit 701 and a communication unit 702 . The processing unit 701 may be configured to support the electronic device shown in FIG. 4A to perform steps S402 and S409 in the above embodiment, or to support the electronic device shown in FIG. 4B to perform steps S411 and S416 in the above embodiment, or It is used to support the electronic device shown in FIG. 5A to perform steps S502 and S507 in the above embodiment, or to support the electronic device shown in FIG. 6A to perform steps S602 and S608 in the above embodiment. The communication unit 702 is used to support the electronic device shown in FIG. 4A to perform steps S401, S403 to S408 in the above embodiment, or to support the electronic device shown in FIG. 4B to perform steps S412 to S415 in the above embodiment, or use It is used to support the electronic device shown in FIG. 5A to perform steps S501 , S503 to S506 in the above embodiment, or to support the electronic device shown in FIG. 6A to perform steps S601 , S603 to S607 , S609 to S611 in the above embodiment. All relevant contents of the steps involved in the foregoing method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.

可选的,本申请的实施例中,芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。Optionally, in the embodiment of the present application, the chip system may be composed of chips, or may include chips and other discrete devices.

可选的,本申请实施例中的通信单元可以为电路、器件、接口、总线、软件模块、收发器或者其它任意可以实现通信的装置。Optionally, the communication unit in this embodiment of the present application may be a circuit, a device, an interface, a bus, a software module, a transceiver, or any other device that can implement communication.

可选地,通信单元702可以为电子设备或者应用于电子设备中的芯片系统的通信接口,例如,该通信接口可以为收发电路,处理单元701可以为集成在电子设备或者应用于电子设备中的芯片系统的处理器上。Optionally, the communication unit 702 may be an electronic device or a communication interface of a chip system applied in the electronic device, for example, the communication interface may be a transceiver circuit, and the processing unit 701 may be integrated in the electronic device or applied in the electronic device. on the processor of the system-on-a-chip.

图8示出了上述实施例中所涉及的装置的一种可能的逻辑结构示意图,该装置可以实现本申请实施例提供的方法中电子设备的功能。该装置可以为电子设备或者应用于电子设备中的芯片系统,该装置包括:处理模块801和通信模块803。处理模块801用于对图7所示的装置的动作进行控制管理,例如,处理模块801用于执行在图7所示的装置侧进行消息或数据处理的步骤。例如,可以用于支持图7所示的装置执行上述实施例中的步骤S402和S409,或者执行上述实施例中的步骤S411和S416,或者执行上述实施例中的步骤S502和S507,或者执行上述实施例中的步骤S602和S608。通信模块803用于支持图7所示的装置执行上述实施例中的步骤S401、S403至S408,或者执行上述实施例中的步骤S412至S415,或者用于执行上述实施例中的步骤S501、S503至S506,或者执行上述实施例中的步骤S601、S603至S607,S609至S611。和/或用于本文所描述的技术的其他由图8所示的装置执行的过程。可选的,图8所示的装置还可以包括存储模块802,用于存储该装置的程序代码和数据。FIG. 8 is a schematic diagram of a possible logical structure of the apparatus involved in the foregoing embodiment, and the apparatus may implement the functions of the electronic device in the method provided by the embodiment of the present application. The apparatus may be an electronic device or a chip system applied in the electronic device, and the apparatus includes: a processing module 801 and a communication module 803 . The processing module 801 is used to control and manage the actions of the device shown in FIG. 7 , for example, the processing module 801 is used to execute the steps of message or data processing on the device side shown in FIG. 7 . For example, it can be used to support the apparatus shown in FIG. 7 to perform steps S402 and S409 in the above embodiments, or to perform steps S411 and S416 in the above embodiments, or to perform steps S502 and S507 in the above embodiments, or to perform the above Steps S602 and S608 in the embodiment. The communication module 803 is configured to support the apparatus shown in FIG. 7 to perform steps S401, S403 to S408 in the above embodiments, or to perform steps S412 to S415 in the above embodiments, or to perform steps S501 and S503 in the above embodiments to S506, or perform steps S601, S603 to S607, and S609 to S611 in the above embodiment. and/or other processes performed by the apparatus shown in FIG. 8 for the techniques described herein. Optionally, the apparatus shown in FIG. 8 may further include a storage module 802 for storing program codes and data of the apparatus.

其中,处理模块801可以是处理器或控制器,例如可以是中央处理器单元,通用处理器,数字信号处理器,专用集成电路,现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请实施例公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理器和微处理器的组合等等。通信模块803可以是收发器、收发电路或通信接口等。存储模块802可以是存储器。The processing module 801 may be a processor or a controller, such as a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logical blocks, modules and circuits described in connection with the disclosure of the embodiments of this application. A processor may also be a combination that performs computing functions, such as a combination comprising one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The communication module 803 may be a transceiver, a transceiver circuit, a communication interface, or the like. The storage module 802 may be a memory.

当处理模块801为处理器110,通信模块803为移动通信模块150或者无线通信模块160 或者USB接口130,存储模块802为内部存储器121,或者外部存储器接口120连接的外部存储器时,本申请实施例所涉及的装置可以为图2A所示的电子设备100。When the processing module 801 is theprocessor 110, the communication module 803 is themobile communication module 150 or thewireless communication module 160 or the USB interface 130, and the storage module 802 is the internal memory 121 or the external memory connected to theexternal memory interface 120, the embodiment of the present application The involved apparatus may be the electronic device 100 shown in FIG. 2A .

本申请实施例提供的方法中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例描述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、终端或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等) 方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机可以存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,SSD)等。The methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, a special purpose computer, a computer network, a network device, a terminal or other programmable device. The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available media that can be accessed by a computer, or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, digital video discs (DVDs)), or semiconductor media (eg, SSDs), and the like.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

以上,仅为本申请的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以权利要求的保护范围为准。The above are only specific implementations of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the embodiments of the present application. , all should be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims (22)

Translated fromChinese
1.一种多电子设备联动控制的方法,其特征在于,所述方法包括:1. A method for multi-electronic equipment linkage control, wherein the method comprises:第一电子设备获取第一规则,所述第一规则指示当第二电子设备发生第一事件时,所述第一电子设备执行第一功能;The first electronic device acquires a first rule, the first rule indicates that when a first event occurs to the second electronic device, the first electronic device performs a first function;所述第一电子设备根据所述第一规则,向所述第二电子设备发送针对所述第一事件的订阅消息;The first electronic device sends a subscription message for the first event to the second electronic device according to the first rule;所述第一电子设备接收所述第二电子设备发送的所述第一事件的通知消息;receiving, by the first electronic device, a notification message of the first event sent by the second electronic device;响应于接收到的所述第一事件的通知消息,所述第一电子设备根据所述第一规则执行所述第一功能。In response to the received notification message of the first event, the first electronic device performs the first function according to the first rule.2.根据权利要求1所述的方法,其特征在于,还包括:2. The method of claim 1, further comprising:所述第一电子设备获取第二规则,所述第二规则指示当第三电子设备发生第二事件,且第四电子设备发送第三事件时,则所述第一电子设备执行第二功能;The first electronic device acquires a second rule, the second rule indicates that when a second event occurs in the third electronic device and the fourth electronic device sends the third event, the first electronic device performs the second function;所述第一电子设备根据所述第二规则,向所述第三电子设备发送针对所述第二事件的订阅消息;The first electronic device sends a subscription message for the second event to the third electronic device according to the second rule;所述第一电子设备接收到所述第三电子设备发送的所述第二事件的通知消息;The first electronic device receives a notification message of the second event sent by the third electronic device;所述第一电子设备确定所述第四电子设备是否发生所述第三事件;the first electronic device determines whether the third event occurs to the fourth electronic device;响应于确定所述第四电子设备发生所述第三事件,所述第一电子设备根据所述第二规则执行所述第二功能。In response to determining that the third event occurred to the fourth electronic device, the first electronic device performs the second function according to the second rule.3.根据权利要求2所述的方法,其特征在于,所述响应于确定所述第四电子设备发生所述第三事件,所述第一电子设备根据所述第二规则执行所述第二功能,具体为:3 . The method of claim 2 , wherein, in response to determining that the third event occurs on the fourth electronic device, the first electronic device executes the second event according to the second rule. 4 . function, specifically:响应于所述第一电子设备接收所述第四电子设备发送的已发生所述第三事件的通知消息,所述第一电子设备根据所述第二规则执行所述第二功能。In response to the first electronic device receiving the notification message sent by the fourth electronic device that the third event has occurred, the first electronic device performs the second function according to the second rule.4.根据权利要求3所述的方法,其特征在于,在所述第一电子设备接收所述第四电子设备发送的已发生所述第三事件的通知消息之前,所述方法还包括:4. The method according to claim 3, wherein before the first electronic device receives a notification message sent by the fourth electronic device that the third event has occurred, the method further comprises:响应于接收到所述第三电子设备发送的所述第二事件的通知消息,所述第一电子设备向所述第四电子设备发送查询所述第三事件是否发生的消息。In response to receiving the notification message of the second event sent by the third electronic device, the first electronic device sends a message for querying whether the third event occurs to the fourth electronic device.5.根据权利要求2-4任一项所述的方法,其特征在于,在所述第一电子设备获取所述第二规则之后,所述方法还包括:5. The method according to any one of claims 2-4, wherein after the first electronic device acquires the second rule, the method further comprises:所述第一电子设备根据所述第二规则,获取所述第三电子设备的地址和所述第四电子设备的地址。The first electronic device acquires the address of the third electronic device and the address of the fourth electronic device according to the second rule.6.根据权利要求5所述的方法,其特征在于,所述第二规则包括所述第三电子设备的标识和所述第四电子设备的标识;6. The method according to claim 5, wherein the second rule comprises an identification of the third electronic device and an identification of the fourth electronic device;所述第一电子设备根据所述第二规则,获取所述第三电子设备的地址和所述第四电子设备的地址,具体包括:The first electronic device acquires the address of the third electronic device and the address of the fourth electronic device according to the second rule, specifically including:所述第一电子设备组播或广播第一消息,所述第一消息包括所述第三电子设备的标识和所述第四电子设备的标识;The first electronic device multicasts or broadcasts a first message, where the first message includes the identity of the third electronic device and the identity of the fourth electronic device;所述第一电子设备接收所述第三电子设备返回的所述第三电子设备的地址;所述电子设备接收所述第四电子设备返回的所述第四电子设备的地址。The first electronic device receives the address of the third electronic device returned by the third electronic device; the electronic device receives the address of the fourth electronic device returned by the fourth electronic device.7.根据权利要求2-6任一项所述的方法,其特征在于,在所述第一电子设备获取第二规则之后,所述方法还包括:7. The method according to any one of claims 2-6, wherein after the first electronic device acquires the second rule, the method further comprises:所述第一电子设备检测所述第二规则的合法性。The first electronic device detects the validity of the second rule.8.根据权利要求2-7任一项所述的方法,其特征在于,所述第一电子设备获取第二规则包括:8. The method according to any one of claims 2-7, wherein acquiring the second rule by the first electronic device comprises:所述第一电子设备从服务器或第五电子设备获取所述第二规则。The first electronic device acquires the second rule from a server or a fifth electronic device.9.一种多电子设备联动控制的方法,其特征在于,所述方法包括:9. A method for linkage control of multiple electronic devices, wherein the method comprises:第一电子设备获取第一规则,所述第一规则指示当所述第一电子设备发生第一事件,且第二电子设备发生第二事件时,第三电子设备执行第一功能;The first electronic device acquires a first rule, the first rule indicates that when a first event occurs in the first electronic device and a second event occurs in the second electronic device, the third electronic device performs a first function;所述第一电子设备接收到所述第二电子设备发送的所述第二事件的通知消息;The first electronic device receives a notification message of the second event sent by the second electronic device;响应于接收到的所述第二事件的通知消息,所述第一电子设备检测所述第一事件是否发生;In response to the received notification message of the second event, the first electronic device detects whether the first event occurs;若检测到所述第一事件已发生,则所述第一电子设备向所述第三电子设备发送执行指令,所述执行指令指示所述第三电子设备执行所述第一功能。If it is detected that the first event has occurred, the first electronic device sends an execution instruction to the third electronic device, and the execution instruction instructs the third electronic device to execute the first function.10.一种多电子设备联动控制的系统,其特征在于,包括第一电子设备和第二电子设备;10. A system for linkage control of multiple electronic devices, comprising a first electronic device and a second electronic device;所述第一电子设备,用于:The first electronic device is used for:获取第一规则,所述第一规则指示当所述第二电子设备发生第一事件时,所述第一电子设备执行第一功能;acquiring a first rule, the first rule indicating that when a first event occurs on the second electronic device, the first electronic device performs a first function;根据所述第一规则,向所述第二电子设备发送针对所述第一事件的订阅消息;sending a subscription message for the first event to the second electronic device according to the first rule;所述第二电子设备,用于当检测到已发生所述第一事件时,向所述第一电子设备发送所述第一事件的通知消息;the second electronic device, configured to send a notification message of the first event to the first electronic device when it is detected that the first event has occurred;所述第一电子设备,还用于响应于接收到的所述第一事件的通知消息,根据所述第一规则执行所述第一功能。The first electronic device is further configured to execute the first function according to the first rule in response to the received notification message of the first event.11.根据权利要求10所述的系统,其特征在于,所述系统还包括第三电子设备和第四电子设备,11. The system of claim 10, wherein the system further comprises a third electronic device and a fourth electronic device,所述第一电子设备,还用于:The first electronic device is also used for:获取第二规则,所述第二规则指示当所述第三电子设备发生第二事件,且第四电子设备发送第三事件时,则所述第一电子设备执行第二功能;acquiring a second rule, the second rule indicates that when a second event occurs on the third electronic device and the fourth electronic device sends a third event, the first electronic device performs the second function;根据所述第二规则,向所述第三电子设备发送针对所述第二事件的订阅消息;sending a subscription message for the second event to the third electronic device according to the second rule;所述第三电子设备,用于当检测到已发生所述第二事件时,向所述第一电子设备发送所述第二事件已发生的通知消息;the third electronic device, configured to send a notification message that the second event has occurred to the first electronic device when it is detected that the second event has occurred;所述第一电子设备,还用于:The first electronic device is also used for:确定所述第四电子设备是否发生所述第三事件;determining whether the third event occurs in the fourth electronic device;响应于确定所述第四电子设备发生所述第三事件,根据所述第二规则执行所述第二功能。In response to determining that the third event occurred to the fourth electronic device, the second function is performed according to the second rule.12.一种第一电子设备,其特征在于,包括:处理器和存储器,所述存储器与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述计算机指令被所述第一电子设备执行时,使得所述第一电子设备执行如下操作:12. A first electronic device, comprising: a processor and a memory, wherein the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when When the computer instructions are executed by the first electronic device, the first electronic device is caused to perform the following operations:获取第一规则,所述第一规则指示当第二电子设备发生第一事件时,所述第一电子设备执行第一功能;acquiring a first rule, the first rule indicating that when a first event occurs in the second electronic device, the first electronic device performs a first function;根据所述第一规则,向所述第二电子设备发送针对所述第一事件的订阅消息;sending a subscription message for the first event to the second electronic device according to the first rule;接收所述第二电子设备发送的所述第一事件的通知消息;receiving a notification message of the first event sent by the second electronic device;响应于接收到的所述第一事件的通知消息,根据所述第一规则执行所述第一功能。The first function is performed according to the first rule in response to the received notification message of the first event.13.根据权利要求12所述的第一电子设备,其特征在于,当所述计算机指令被所述第一电子设备执行时,还使得所述第一电子设备执行如下操作:13. The first electronic device according to claim 12, wherein when the computer instruction is executed by the first electronic device, the first electronic device is further caused to perform the following operations:获取第二规则,所述第二规则指示当第三电子设备发生第二事件,且第四电子设备发送第三事件时,则所述第一电子设备执行第二功能;acquiring a second rule, the second rule indicates that when a second event occurs in the third electronic device and the fourth electronic device sends the third event, the first electronic device performs the second function;根据所述第二规则,向所述第三电子设备发送针对所述第二事件的订阅消息;sending a subscription message for the second event to the third electronic device according to the second rule;接收到所述第三电子设备发送的所述第二事件的通知消息;receiving a notification message of the second event sent by the third electronic device;确定所述第四电子设备是否发生所述第三事件;determining whether the third event occurs in the fourth electronic device;响应于确定所述第四电子设备发生所述第三事件,根据所述第二规则执行所述第二功能。In response to determining that the third event occurred to the fourth electronic device, the second function is performed according to the second rule.14.根据权利要求13所述的第一电子设备,其特征在于,所述响应于确定所述第四电子设备发生所述第三事件,根据所述第二规则执行所述第二功能,具体为:14. The first electronic device according to claim 13, wherein, in response to determining that the third event occurs in the fourth electronic device, the second function is executed according to the second rule, specifically for:响应于接收所述第四电子设备发送的已发生所述第三事件的通知消息,根据所述第二规则执行所述第二功能。In response to receiving a notification message sent by the fourth electronic device that the third event has occurred, the second function is performed according to the second rule.15.根据权利要求14所述的第一电子设备,其特征在于,当所述计算机指令被所述第一电子设备执行时,还使得所述第一电子设备执行如下操作:15. The first electronic device according to claim 14, wherein when the computer instruction is executed by the first electronic device, the first electronic device is further caused to perform the following operations:响应于接收到所述第三电子设备发送的所述第二事件的通知消息,所述第一电子设备向所述第四电子设备发送查询所述第三事件是否发生的消息。In response to receiving the notification message of the second event sent by the third electronic device, the first electronic device sends a message for querying whether the third event occurs to the fourth electronic device.16.根据权利要求13-15任一项所述的第一电子设备,其特征在于,当所述计算机指令被所述第一电子设备执行时,还使得所述第一电子设备执行如下操作:16. The first electronic device according to any one of claims 13-15, wherein when the computer instruction is executed by the first electronic device, the first electronic device is further caused to perform the following operations:根据所述第二规则,获取所述第三电子设备的地址和所述第四电子设备的地址。According to the second rule, the address of the third electronic device and the address of the fourth electronic device are obtained.17.根据权利要求16所述的第一电子设备,其特征在于,所述第二规则包括所述第三电子设备的标识和所述第四电子设备的标识;17. The first electronic device according to claim 16, wherein the second rule comprises an identification of the third electronic device and an identification of the fourth electronic device;所述根据所述第二规则,获取所述第三电子设备的地址和所述第四电子设备的地址,具体包括:The acquiring the address of the third electronic device and the address of the fourth electronic device according to the second rule specifically includes:组播或广播第一消息,所述第一消息包括所述第三电子设备的标识和所述第四电子设备的标识;multicast or broadcast a first message, where the first message includes the identifier of the third electronic device and the identifier of the fourth electronic device;接收所述第三电子设备返回的所述第三电子设备的地址;所述电子设备接收所述第四电子设备返回的所述第四电子设备的地址。Receive the address of the third electronic device returned by the third electronic device; the electronic device receives the address of the fourth electronic device returned by the fourth electronic device.18.根据权利要求13-17任一项所述的第一电子设备,其特征在于,当所述计算机指令被所述第一电子设备执行时,还使得所述第一电子设备执行如下操作:18. The first electronic device according to any one of claims 13-17, wherein when the computer instruction is executed by the first electronic device, the first electronic device is further caused to perform the following operations:检测所述第二规则的合法性。Check the validity of the second rule.19.根据权利要求13-18任一项所述的第一电子设备,其特征在于,所述获取第二规则具体为:从服务器或第五电子设备获取所述第二规则。19. The first electronic device according to any one of claims 13-18, wherein the acquiring the second rule is specifically: acquiring the second rule from a server or a fifth electronic device.20.一种第一电子设备,其特征在于,包括:处理器和存储器,所述存储器与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述计算机指令被所述第一电子设备执行时,使得所述第一电子设备执行如下操作:20. A first electronic device, comprising: a processor and a memory, wherein the memory is coupled to the processor, and the memory is used for storing computer program code, the computer program code comprising computer instructions, when When the computer instructions are executed by the first electronic device, the first electronic device is caused to perform the following operations:获取第一规则,所述第一规则指示当所述第一电子设备发生第一事件,且第二电子设备发生第二事件时,第三电子设备执行第一功能;acquiring a first rule, the first rule indicating that when a first event occurs in the first electronic device and a second event occurs in the second electronic device, the third electronic device performs a first function;接收到所述第二电子设备发送的所述第二事件已发生的通知消息;receiving a notification message sent by the second electronic device that the second event has occurred;响应于接收到的所述第二事件已发生的通知消息,检测所述第一事件是否发生;In response to the received notification message that the second event has occurred, detecting whether the first event has occurred;若检测到所述第一事件已发生,则向所述第三电子设备发送执行指令,所述执行指令指示所述第三电子设备执行所述第一功能。If it is detected that the first event has occurred, an execution instruction is sent to the third electronic device, and the execution instruction instructs the third electronic device to execute the first function.21.一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在终端上运行时,使得所述终端执行如权利要求1-9中任一项多电子设备联动控制的方法。21. A computer storage medium, comprising computer instructions, which, when the computer instructions are executed on a terminal, cause the terminal to execute the method for multi-electronic device linkage control according to any one of claims 1-9.22.一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-9中任一项所述多电子设备联动控制的方法。22. A computer program product, characterized in that, when the computer program product runs on a computer, the computer is caused to execute the method for multi-electronic device linkage control according to any one of claims 1-9.
CN201910142363.1A2019-02-262019-02-26 A method, device and system for linkage control of multi-intelligent devicesPendingCN111614524A (en)

Priority Applications (2)

Application NumberPriority DateFiling DateTitle
CN201910142363.1ACN111614524A (en)2019-02-262019-02-26 A method, device and system for linkage control of multi-intelligent devices
PCT/CN2020/075982WO2020173375A1 (en)2019-02-262020-02-20Multi-intelligent device linkage control method, device and system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910142363.1ACN111614524A (en)2019-02-262019-02-26 A method, device and system for linkage control of multi-intelligent devices

Publications (1)

Publication NumberPublication Date
CN111614524Atrue CN111614524A (en)2020-09-01

Family

ID=72203003

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910142363.1APendingCN111614524A (en)2019-02-262019-02-26 A method, device and system for linkage control of multi-intelligent devices

Country Status (2)

CountryLink
CN (1)CN111614524A (en)
WO (1)WO2020173375A1 (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112702428A (en)*2020-12-232021-04-23上海商米科技集团股份有限公司Distributed Internet of things equipment interoperation method and system
CN113406891A (en)*2021-06-182021-09-17杭州深渡科技有限公司Internet of things equipment linkage control method, system and device and storage medium
CN113452793A (en)*2021-06-302021-09-28东软睿驰汽车技术(沈阳)有限公司Diagnostic service processing method and device, vehicle-mounted terminal and medium
CN114090152A (en)*2021-11-122022-02-25珠海格力电器股份有限公司 A device theme switching method and device
CN114143906A (en)*2022-01-302022-03-04荣耀终端有限公司Electronic equipment connection method and electronic equipment
CN114157725A (en)*2021-11-112022-03-08珠海格力电器股份有限公司Equipment linkage method and device, server, electronic equipment and storage medium
CN114167738A (en)*2021-11-262022-03-11珠海格力电器股份有限公司Equipment linkage control method, device, equipment and storage medium
CN114363820A (en)*2020-09-292022-04-15华为终端有限公司Electronic equipment searching method and electronic equipment
CN114584414A (en)*2020-12-012022-06-03深圳绿米联创科技有限公司Device control method, device, electronic device and computer-readable storage medium
CN114815642A (en)*2022-03-302022-07-29青岛海尔科技有限公司Control method and device of intelligent equipment, storage medium and electronic device
WO2022218138A1 (en)*2021-04-162022-10-20华为技术有限公司Event processing method and system, and device
CN115390462A (en)*2021-05-202022-11-25深圳绿米联创科技有限公司 Device control method and device, terminal device, gateway and medium
CN115412391A (en)*2022-11-022022-11-29长沙朗源电子科技有限公司Method and system for building intelligent scene of multiple small household appliances and storage medium
CN115550090A (en)*2021-06-302022-12-30华为技术有限公司 A device collaboration method and electronic device
WO2023071484A1 (en)*2021-10-252023-05-04华为技术有限公司Automatic control method based on human body sensing, and electronic device and system
WO2024041359A1 (en)*2022-08-262024-02-29华为技术有限公司Link control method and electronic device

Citations (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103440606A (en)*2013-08-022013-12-11马祥龙Integrated remote network smart home security rescue management system
CN104216379A (en)*2014-09-092014-12-17联想(北京)有限公司Information processing method and electronic device
CN104932456A (en)*2015-04-272015-09-23小米科技有限责任公司Intelligent scene realizing method and device, intelligent terminal and controller
CN105549415A (en)*2016-03-042016-05-04橙朴(上海)智能科技有限公司Decentralized intelligent home control system
CN106054655A (en)*2016-07-252016-10-26青岛海信电器股份有限公司Smart furniture linkage control method and device
CN205721123U (en)*2016-03-042016-11-23橙朴(上海)智能科技有限公司A kind of intelligent home control system of decentration
CN106227045A (en)*2016-07-252016-12-14青岛海信电器股份有限公司A kind of Smart Home inter-linked controlling method, device and system
CN107783781A (en)*2016-08-242018-03-09北京京东尚科信息技术有限公司Smart machine interlock method and device based on IFTTT
CN108733005A (en)*2017-04-212018-11-02北京京东尚科信息技术有限公司A kind of method and device of control smart machine linkage
CN109302415A (en)*2018-11-092019-02-01四川虹微技术有限公司A kind of authentication method, block chain node and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US9252967B2 (en)*2011-09-012016-02-02Sony CorporationFacilitated use of heterogeneous home-automation edge components
US20150370272A1 (en)*2014-06-232015-12-24Google Inc.Intelligent configuration of a smart environment based on arrival time
CN204908704U (en)*2015-06-072015-12-30何连婷Semiconductor refrigeration mattress circuit
CN105913596A (en)*2016-06-232016-08-31余新城Home security system
WO2018006203A1 (en)*2016-07-022018-01-11李珂悦Smart air conditioner
CN106996621A (en)*2017-04-102017-08-01盐城师范学院Intelligent air condition control device and control method based on infrared acquisition

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103440606A (en)*2013-08-022013-12-11马祥龙Integrated remote network smart home security rescue management system
CN104216379A (en)*2014-09-092014-12-17联想(北京)有限公司Information processing method and electronic device
CN104932456A (en)*2015-04-272015-09-23小米科技有限责任公司Intelligent scene realizing method and device, intelligent terminal and controller
CN105549415A (en)*2016-03-042016-05-04橙朴(上海)智能科技有限公司Decentralized intelligent home control system
CN205721123U (en)*2016-03-042016-11-23橙朴(上海)智能科技有限公司A kind of intelligent home control system of decentration
CN106054655A (en)*2016-07-252016-10-26青岛海信电器股份有限公司Smart furniture linkage control method and device
CN106227045A (en)*2016-07-252016-12-14青岛海信电器股份有限公司A kind of Smart Home inter-linked controlling method, device and system
CN107783781A (en)*2016-08-242018-03-09北京京东尚科信息技术有限公司Smart machine interlock method and device based on IFTTT
CN108733005A (en)*2017-04-212018-11-02北京京东尚科信息技术有限公司A kind of method and device of control smart machine linkage
CN109302415A (en)*2018-11-092019-02-01四川虹微技术有限公司A kind of authentication method, block chain node and storage medium

Cited By (22)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114363820A (en)*2020-09-292022-04-15华为终端有限公司Electronic equipment searching method and electronic equipment
CN114584414A (en)*2020-12-012022-06-03深圳绿米联创科技有限公司Device control method, device, electronic device and computer-readable storage medium
CN114584414B (en)*2020-12-012024-05-03深圳绿米联创科技有限公司Device control method, device, electronic device, and computer-readable storage medium
CN112702428A (en)*2020-12-232021-04-23上海商米科技集团股份有限公司Distributed Internet of things equipment interoperation method and system
CN112702428B (en)*2020-12-232023-04-18上海商米科技集团股份有限公司Distributed Internet of things equipment interoperation method and system
WO2022218138A1 (en)*2021-04-162022-10-20华为技术有限公司Event processing method and system, and device
CN115390462B (en)*2021-05-202025-07-25深圳绿米联创科技有限公司Equipment control method and device, terminal equipment, gateway and medium
CN115390462A (en)*2021-05-202022-11-25深圳绿米联创科技有限公司 Device control method and device, terminal device, gateway and medium
CN113406891B (en)*2021-06-182023-04-21杭州深渡科技有限公司Internet of things equipment linkage control method, system, device and storage medium
CN113406891A (en)*2021-06-182021-09-17杭州深渡科技有限公司Internet of things equipment linkage control method, system and device and storage medium
CN113452793B (en)*2021-06-302024-05-14东软睿驰汽车技术(沈阳)有限公司Diagnostic service processing method and device, vehicle-mounted terminal and medium
CN115550090A (en)*2021-06-302022-12-30华为技术有限公司 A device collaboration method and electronic device
CN113452793A (en)*2021-06-302021-09-28东软睿驰汽车技术(沈阳)有限公司Diagnostic service processing method and device, vehicle-mounted terminal and medium
WO2023071484A1 (en)*2021-10-252023-05-04华为技术有限公司Automatic control method based on human body sensing, and electronic device and system
CN114157725A (en)*2021-11-112022-03-08珠海格力电器股份有限公司Equipment linkage method and device, server, electronic equipment and storage medium
CN114157725B (en)*2021-11-112023-09-12珠海格力电器股份有限公司Method, device, server, electronic equipment and storage medium for equipment linkage
CN114090152A (en)*2021-11-122022-02-25珠海格力电器股份有限公司 A device theme switching method and device
CN114167738A (en)*2021-11-262022-03-11珠海格力电器股份有限公司Equipment linkage control method, device, equipment and storage medium
CN114143906A (en)*2022-01-302022-03-04荣耀终端有限公司Electronic equipment connection method and electronic equipment
CN114815642A (en)*2022-03-302022-07-29青岛海尔科技有限公司Control method and device of intelligent equipment, storage medium and electronic device
WO2024041359A1 (en)*2022-08-262024-02-29华为技术有限公司Link control method and electronic device
CN115412391A (en)*2022-11-022022-11-29长沙朗源电子科技有限公司Method and system for building intelligent scene of multiple small household appliances and storage medium

Also Published As

Publication numberPublication date
WO2020173375A1 (en)2020-09-03

Similar Documents

PublicationPublication DateTitle
CN111614524A (en) A method, device and system for linkage control of multi-intelligent devices
CN111752443B (en)Method, related device and system for controlling page of display equipment
CN113272745B (en)Smart home equipment sharing system and method and electronic equipment
CN113497909B (en) A device interaction method and electronic device
CN111650840B (en)Intelligent household scene arranging method and terminal
CN113691842B (en)Cross-device content projection method and electronic device
WO2021000808A1 (en)Device control method and device
CN113961157B (en)Display interaction system, display method and equipment
CN116489268A (en)Equipment identification method and related device
CN114079691B (en) A device identification method and related device
CN110198362A (en)A kind of method and system for adding smart home device in contact person
WO2021052204A1 (en)Address book-based device discovery method, audio and video communication method, and electronic device
CN113986369B (en)Internet of things equipment control method and system, electronic equipment and storage medium
WO2023071454A1 (en)Scenario synchronization method and apparatus, and electronic device and readable storage medium
CN115460445A (en)Screen projection method of electronic equipment and electronic equipment
WO2022052713A1 (en)Interaction method and apparatus, and electronic device
WO2023142941A1 (en)Playing record display method and related device
WO2022267917A1 (en)Bluetooth communication method and system
CN115883714B (en)Message reply method and related equipment
WO2022143273A1 (en)Information processing method and electronic device
WO2023016347A1 (en)Voiceprint authentication response method and system, and electronic devices
CN117009099A (en)Message processing method and electronic equipment
CN118613782A (en) Application component management method and related equipment
CN117440081A (en)Message sharing method and related equipment
CN117439932A (en) Exception handling method, electronic equipment and communication system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20200901


[8]ページ先頭

©2009-2025 Movatter.jp