Equipment linkage method and system
Through the mechanism of slave subscribing to the host status, the problems of state synchronization lag and communication blockage in the multi-device linkage system are solved, and efficient device linkage state synchronization is achieved, improving user experience.
Patent Information
- Application Number
- CN202510259556.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-07-11
AI Technical Summary
In multi-device linkage systems, the prior art has communication blockage caused by lag in slave state acquisition or frequent requests, which affects user experience and system efficiency.
The mechanism of slave subscribing to the host state is adopted. The host sends status update information to the slave when the state changes, and the slave performs corresponding linkage operations to realize state synchronization of the master and slave devices.
It improves the state synchronization efficiency of master-slave device linkage, reduces communication resource usage, and improves user experience.
Smart Images

Figure CN120301722A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of kitchen appliance linkage, and particularly to a device linkage method and system. Background Art
[0002] With the rapid development and popularization of Internet of Things technology, the intelligent linkage function applications among kitchen appliances are increasing. For example, the smoke range linkage supports automatically turning on the range hood for smoke exhaust when the gas stove is turned on, and automatically turning off the range hood after a certain delay when the gas stove is turned off, bringing a more convenient intelligent experience to users. However, when the number and types of devices to be linked increase, the entire linkage system becomes more complex, and the problems of linkage delay and conflict among multiple devices are serious, greatly affecting the user experience.
[0003] To address the above problems, the current common method in the kitchen appliance industry is to build a master-slave linkage solution. In this solution, a host (intelligent kitchen appliance or central control screen) serves as the core, and other kitchen appliances serve as slaves. The host and slaves are connected via Bluetooth, and the device linkage in the entire system is uniformly managed by the host, providing a more convenient and efficient intelligent experience for users.
[0004] Although the Bluetooth master-slave system has advantages such as high integration and convenient management, it also has the following main problems: Some linkage functions require the slave to perform corresponding operations according to the state changes of the host. Therefore, the slave needs to obtain the state update information of the host in a timely manner. Currently, the method of the slave regularly sending requests to the host to obtain the host state is usually adopted. If the request interval of the slave is too long, the time to obtain the host state will lag, and the slave cannot perform the linkage operation in a timely manner, affecting the user experience; if the slave requests frequently, it will occupy more communication resources. When multiple slaves have linkage requirements, a large number of frequent requests will cause serious communication congestion in the system, reducing the communication efficiency of the system and affecting the normal linkage of the master and slave devices. Summary of the Invention
[0005] To solve the above technical problems, the present invention discloses a device linkage method and system, which realizes the state synchronization of master-slave linkage through the mechanism of the slave subscribing to the host state. When the corresponding state of the host changes, the host sends the state change information to the slave according to the subscription information, and the slave executes the corresponding linkage operation after receiving it, thereby improving the state synchronization efficiency of master-slave linkage.
[0006] To achieve the above object, the present invention provides a device linkage method, which is applied to a master device, and the method includes:
[0007] Obtain a target subscription request of a first slave device; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device;
[0008] When the target device type indicates that the target device is the master device, establish a first correspondence between the target state and the first slave device based on the target subscription request;
[0009] When the target state changes, based on the first correspondence, send the updated target state to the first slave device so that the first slave device performs a linkage operation corresponding to the updated target state.
[0010] In an optional embodiment, after obtaining the target subscription request of the first slave device, the method further includes:
[0011] When the target device type indicates that the target device is the second slave device, send the target subscription request to the second slave device;
[0012] Establish a second correspondence among the target state, the first slave device, and the second slave device based on the target subscription request;
[0013] When receiving the updated target state sent by the second slave device, based on the second correspondence, send the updated target state to the first slave device so that the first slave device performs a linkage operation corresponding to the updated target state.
[0014] In an optional embodiment, after establishing the first correspondence between the target state and the first slave device when the target device type indicates that the target device is the master device, the method further includes:
[0015] Send the initial target state of the master device to the first slave device; the initial target state is the target state of the master device when the master device receives the target subscription request;
[0016] Based on the first correspondence, send the current target state of the master device to the first slave device every first preset duration, so that when the current target state is inconsistent with the initial target state and the first slave device has not performed the linkage operation corresponding to the current target state, the first slave device performs the linkage operation corresponding to the current target state and determines the current target state as the initial target state.
[0017] In an optional embodiment, after establishing the second correspondence among the target state, the first slave device, and the second slave device, the method further includes:
[0018] Receive the initial target state of the second slave device, and based on the second corresponding relationship, send the initial target state to the first slave device; the initial target state is the target state of the second slave device when the second slave device receives the target subscription request.
[0019] When the current target state of the second slave device is received every second preset time period, based on the second corresponding relationship, send the current target state to the first slave device, so that when the current target state is inconsistent with the initial target state and the first slave device has not performed the linkage operation corresponding to the current target state, the first slave device performs the linkage operation corresponding to the current target state and determines the current target state as the initial target state.
[0020] The present invention also provides a device linkage method, which is applied to a first slave device, and the method includes:
[0021] Send a target subscription request to the master device, where the target subscription request is used to subscribe to the target state of the target device, and the target subscription request includes the target device type of the target device and the target state of the target device, so that when the target device type indicates that the target device is the master device, the master device establishes a first corresponding relationship between the target state and the first slave device based on the target subscription request, and when the target state changes, based on the first corresponding relationship, send the updated target state to the first slave device;
[0022] When the updated target state is received, perform the linkage operation corresponding to the updated target state.
[0023] In an optional embodiment, after sending the target subscription request to the master device, the method further includes:
[0024] Receive the initial target state of the master device; the initial target state is the target state of the master device when the master device receives the target subscription request;
[0025] When the current target state of the master device is received every first preset time period, compare the current target state with the initial target state;
[0026] When the current target state is inconsistent with the initial target state and the first slave device has not performed the linkage operation corresponding to the current target state, perform the linkage operation corresponding to the current target state and determine the current target state as the initial target state.
[0027] In an optional embodiment, the method further includes:
[0028] Send the target subscription request to the master device, so that when the target device type indicates that the target device is the second slave device, the master device sends the target subscription request to the second slave device, establish a second correspondence relationship among the target state, the first slave device, and the second slave device based on the target subscription request, and when receiving the updated target state sent by the second slave device, send the updated target state to the first slave device based on the second correspondence relationship;
[0029] When receiving the updated target state, perform an associated operation corresponding to the updated target state.
[0030] In an alternative embodiment, after sending the target subscription request to the master device, the method further includes:
[0031] Receive the initial target state of the second slave device sent by the master device; the initial target state is the target state when the second slave device receives the target subscription request;
[0032] When receiving the current target state of the second slave device sent by the master device every second preset duration, compare the current target state with the initial target state;
[0033] When the current target state is inconsistent with the initial target state and the first slave device has not performed the associated operation corresponding to the current target state, perform the associated operation corresponding to the current target state and determine the current target state as the initial target state.
[0034] In an alternative embodiment, the method further includes:
[0035] Receive the target subscription request of the third slave device sent by the master device; the target subscription request of the third slave device is used to subscribe to the target state of the first slave device, and the target subscription request of the third slave device includes the target device type of the first slave device and the target state of the first slave device;
[0036] When the target state of the first slave device changes, send the updated target state to the master device, so that the master device sends the updated target state to the third slave device based on the third correspondence relationship among the target state, the first slave device, and the third slave device, and the third slave device performs the associated operation corresponding to the updated target state.
[0037] The present invention also provides a device linkage system, including a master device and a first slave device;
[0038] The first slave device is configured to send a target subscription request to the master device; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device;
[0039] The master device is configured to obtain the target subscription request of the first slave device; when the target device type indicates that the target device is the master device, establish a first correspondence between the target state and the first slave device based on the target subscription request; when the target state changes, based on the first correspondence, send the updated target state to the first slave device;
[0040] The first slave device is configured to perform a linkage operation corresponding to the updated target state when receiving the updated target state.
[0041] In an optional embodiment, the system further includes a second slave device;
[0042] The master device is further configured to, when the target device type indicates that the target device is the second slave device, send the target subscription request to the second slave device; establish a second correspondence between the target state, the first slave device, and the second slave device based on the target subscription request;
[0043] The second slave device is configured to send the updated target state to the master device when the target state of the second slave device changes;
[0044] The master device is further configured to, when receiving the updated target state sent by the second slave device, based on the second correspondence, send the updated target state to the first slave device;
[0045] The first slave device is further configured to perform a linkage operation corresponding to the updated target state when receiving the updated target state.
[0046] In an optional embodiment, the system further includes a third slave device;
[0047] The third slave device is configured to send a target subscription request to the master device; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device;
[0048] The master device is further configured to, when the target device type indicates that the target device is the first slave device, send the target subscription request to the first slave device; and establish a third correspondence relationship among the target state, the first slave device, and the third slave device based on the target subscription request.
[0049] The first slave device is further configured to, when the target state of the first slave device changes, send the updated target state to the master device.
[0050] The master device is further configured to, when receiving the updated target state sent by the first slave device, send the updated target state to the third slave device based on the third correspondence relationship.
[0051] The third slave device is configured to perform an associated operation corresponding to the updated target state when receiving the updated target state.
[0052] Implementing the embodiments of the present invention has the following beneficial effects:
[0053] The device linkage method disclosed in the present invention realizes the state synchronization of master-slave linkage through the mechanism of slave devices subscribing to the status of the master device. When the corresponding status of the master device changes, the master device sends status change information to the slave devices according to the subscription information, and the slave devices execute the corresponding associated operations after receiving it, thereby improving the efficiency of state synchronization of master-slave linkage. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the device linkage method and system described in the present invention, the accompanying drawings required for the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0055] Figure 1 It is a schematic flowchart of a device linkage method applied to a master device provided by an embodiment of the present invention;
[0056] Figure 2 It is a schematic flowchart of a device linkage method applied to a master device provided by an embodiment of the present invention;
[0057] Figure 3 It is a schematic flowchart of a state timing sending mechanism of a master device in master-slave linkage provided by an embodiment of the present invention;
[0058] Figure 4 It is a schematic flowchart of a state timing sending mechanism of a second slave device in slave device linkage provided by an embodiment of the present invention;
[0059] Figure 5 Schematic diagram of a device linkage system provided by an embodiment of the present invention;
[0060] Figure 6 Schematic diagram of a device linkage system provided by an embodiment of the present invention;
[0061] Figure 7 Schematic diagram of a device linkage system provided by an embodiment of the present invention. Detailed implementation manners
[0062] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0063] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0064] Please refer to Figure 1 , which shows a flowchart of a device linkage method applied to a master device provided by an embodiment of the present invention. This specification provides the method operation steps as described in the embodiment or flowchart, but based on routine or non-creative labor, more or fewer operation steps may be included. The step order listed in the embodiment is only one of the execution orders of numerous steps and does not represent the only execution order. When the actual system or server product executes, it can be executed in the method order shown in the embodiment or the drawing. Specifically, as Figure 1 shown, the device linkage method is applied to a master device, and the method includes:
[0065] S101, obtaining a target subscription request of a first slave device; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device;
[0066] In the embodiments of this specification, the first slave device subscribes to the target state of the target device according to its own linkage requirements. The target device can be the master device or other slave devices except the first slave device, and the target state refers to the state of the target device related to the linkage requirements of the first slave device;
[0067] In the embodiments of this specification, the target subscription request of the first slave device includes the target device type of the target device and the target state of the target device. The target device type is used to identify the target device linked by the first slave device, and the target state is used to represent the target device state that the first slave device needs to subscribe to. The data format of the target subscription request of the first slave device is as follows:
[0068]
[0069] Among them, UUID (Universally Unique Identifier) is a universal unique identifier, which is used to identify the target subscription request of the first slave device;
[0070] In the embodiments of this specification, the first slave device can send the target subscription request to the master device via Bluetooth;
[0071] In the embodiments of this specification, the master device can be an intelligent kitchen electrical appliance device or a central control screen, and the first slave device can be other intelligent kitchen electrical appliance devices except the master device;
[0072] In the embodiments of this specification, the target state can be the switch state, working duration, etc. of the target device, which are states related to the operation of the target device.
[0073] S103, when the target device type indicates that the target device is the master device, establish a first correspondence between the target state and the first slave device based on the target subscription request;
[0074] In the embodiments of this specification, after receiving the target subscription request of the first slave device, the master device determines the target device linked by the first slave device based on the target device type included in the target subscription request;
[0075] In the embodiments of this specification, when the target device type included in the target subscription request indicates that the target device linked by the first slave device is the master device, that is, when the first slave device needs to subscribe to the target state of the master device, the master device establishes a first correspondence between the target state of the master device and the first slave device based on the target subscription request;
[0076] In the embodiments of this specification, if multiple first slave devices subscribe to different states of the master device, the master device establishes a correspondence table according to the subscription requests sent by each first slave device and saves it at the master device end. The data format of the subscription relationship table is as follows:
[0077] First slave device Status information First slave device A Master device target state 1 First slave device B Master device target state 1 First slave device B Master device target state 2 First slave device C Master device target state 2 First slave device D Master device target state 3 …… ……
[0078] S105. When the target state changes, based on the first correspondence, send the updated target state to the first slave device, so that the first slave device performs an associated operation corresponding to the updated target state.
[0079] In the embodiments of this specification, when the target state of the master device changes, the master device, based on the first correspondence between the target state of the master device and the first slave device, sends the updated target state to the first slave device, so that the first slave device performs an associated operation corresponding to the updated target state.
[0080] In the embodiments of this specification, the master device can send the updated target state to the first slave device that has subscribed to the target state via Bluetooth.
[0081] For example, when the master device is a gas stove and the first slave device is a range hood, the range hood needs to be associated with the gas stove, automatically turn on for smoke exhaust when the gas stove is turned on, and automatically turn off after a delay when the gas stove is turned off. Therefore, the range hood needs to subscribe to the switch state of the gas stove. The range hood sends a subscription request to the gas stove, and the subscription request includes the device type of the gas stove and the switch state of the gas stove. After receiving the subscription request, the gas stove establishes a correspondence between the switch state of the gas stove and the range hood. When the switch state of the gas stove changes (from the off state to the on state or from the on state to the off state), it sends the updated switch state (i.e., the changed state) to the range hood, and the range hood performs an associated operation corresponding to the updated switch state. For example, if the gas stove changes from the off state to the on state, the gas stove sends the on state of the gas stove to the range hood, and the range hood automatically turns on for smoke exhaust after receiving it.
[0082] In the embodiments of this specification, Figure 2 is a schematic flowchart of a device association method applied to a master device provided by an embodiment of the present invention. After obtaining the target subscription request of the first slave device, the method further includes:
[0083] S201. When the target device type indicates that the target device is a second slave device, send the target subscription request to the second slave device.
[0084] In the embodiments of this specification, after receiving the target subscription request of the first slave device, the master device determines the target device associated with the first slave device based on the target device type included in the target subscription request.
[0085] In the embodiments of this specification, when the target device type included in the target subscription request indicates that the target device associated with the first slave device is the second slave device, that is, when the first slave device needs to subscribe to the target state of the second slave device, the master device forwards the target subscription request of the first slave device to the second slave device;
[0086] In the embodiments of this specification, the master device may be a smart kitchen appliance device or a central control screen, the first slave device may be other smart kitchen appliance devices except the master device, and the second slave device may be other smart kitchen appliance devices except the master device and the first slave device.
[0087] S203. Establish a second correspondence relationship among the target state, the first slave device, and the second slave device based on the target subscription request;
[0088] In the embodiments of this specification, the master device establishes a second correspondence relationship among the target state of the second slave device, the first slave device, and the second slave device based on the target subscription request of the first slave device;
[0089] In the embodiments of this specification, if there is a status subscription relationship among multiple groups of first slave device - second slave device, the master device establishes a correspondence table according to the subscription requests sent by each first slave device and saves it on the master device side. The data format of the subscription relationship table is as follows:
[0090] First slave device Second slave device Status information First slave device A Second slave device B Second slave device B target state 1 First slave device A Second slave device C Second slave device C target state 1 First slave device B Second slave device C Second slave device C target state 2 First slave device C Second slave device D Second slave device D target state 1 First slave device D Second slave device F Second slave device F target state 1 …… …… ……
[0091] S205. When receiving the updated target state sent by the second slave device, based on the second correspondence relationship, send the updated target state to the first slave device so that the first slave device performs a linkage operation corresponding to the updated target state.
[0092] In the embodiments of this specification, when the target state of the second slave device changes, the second slave device sends the updated target state to the master device, and the master device then sends the updated target state to the first slave device based on the second correspondence relationship among the target state of the second slave device, the first slave device, and the second slave device, so that the first slave device performs a linkage operation corresponding to the updated target state;
[0093] In the embodiments of this specification, the second slave device may save a list of status information of itself that has been subscribed. When a certain status of itself changes, the second slave device queries this list of status information. If the changed status has been subscribed, the second slave device sends the updated status information to the master device. The list of status information that has been subscribed saved on each second slave device side is as follows (each second slave device only saves the list of status information of itself that has been subscribed):
[0094]
[0095] In the embodiments of this specification, the state synchronization of slave device linkage can be realized through the mechanism of subscribing to the inter-slave state. Taking the master device as an intermediary, the source slave device subscribes to the specified state of the target slave device. When the specified state of the target slave device changes, the target slave device sends state change information to the master device. After receiving it, the master device forwards the state change information to the source slave device according to the subscription information of the source slave device, realizing the state synchronization between slave devices and improving the state synchronization efficiency of slave device linkage.
[0096] In the embodiments of this specification, Figure 3 is a schematic flowchart of a mechanism for periodically sending the state of the master device in master-slave linkage provided by the embodiments of the present invention. After establishing the first correspondence between the target state and the first slave device based on the target subscription request when the target device type indicates that the target device is the master device, the method further includes:
[0097] S301, sending the initial target state of the master device to the first slave device; the initial target state is the target state of the master device when it receives the target subscription request;
[0098] In the embodiments of this specification, after establishing the first correspondence between the target state of the master device and the first slave device based on the target subscription request of the first slave device, the master device sends the initial target state of the master device to the first slave device. The initial target state refers to the target state of the master device when it receives the target subscription request of the first slave device;
[0099] In the embodiments of this specification, after receiving the initial target state of the master device, the first slave device locally saves the initial target state of the master device.
[0100] S303, based on the first correspondence, sending the current target state of the master device to the first slave device every first preset time period, so that when the current target state is inconsistent with the initial target state and the first slave device has not performed the linkage operation corresponding to the current target state, the first slave device performs the linkage operation corresponding to the current target state and determines the current target state as the initial target state.
[0101] In the embodiments of this specification, based on the first correspondence between the target state of the master device and the first slave device, the master device sends the current target state of the master device to the first slave device every first preset duration. After receiving the current target state of the master device, the first slave device compares the current target state of the master device with the initial target state of the master device saved locally. If they are the same, it indicates that the target state of the master device has not changed, and the first slave device does not perform any operation. If they are different and the first slave device has not performed the linkage operation corresponding to the current target state of the master device, the first slave device performs the linkage operation corresponding to the current target state of the master device, determines the current target state of the master device as the initial target state of the master device, and updates the initial target state of the master device saved locally.
[0102] In the embodiments of this specification, the first preset duration can be set according to actual linkage requirements. For example, the first preset duration can be 30 seconds.
[0103] For example, when the master device is a gas stove and the first slave device is a range hood, the gas stove sends the initial switch state of the gas stove being off to the range hood. The initial switch state of the gas stove saved locally by the range hood is the gas stove being off. The gas stove sends the current switch state of the gas stove to the range hood every first preset duration. When the current switch state of the gas stove sent by the gas stove to the range hood is the gas stove being on, the current switch state of the gas stove is different from the initial switch state of the gas stove saved locally by the range hood. If the range hood has not performed the automatic opening operation corresponding to the gas stove being on, the range hood automatically opens.
[0104] In the embodiments of this specification, to avoid the situation where the slave device fails to receive the updated status information sent by the master device normally due to network anomalies or other problems when the master device sends the updated status information to the slave device, the master device regularly sends the current status corresponding to the status subscribed by the slave device to the slave device to ensure the synchronization of the status information between the master and slave devices.
[0105] In the embodiments of this specification, Figure 4 is a schematic flowchart of the status timing sending mechanism of the second slave device in the slave device linkage provided by the embodiments of the present invention. After establishing the second correspondence between the target state, the first slave device, and the second slave device based on the target subscription request, the method further includes:
[0106] S401, receiving the initial target state of the second slave device, and based on the second correspondence, sending the initial target state to the first slave device; the initial target state is the target state of the second slave device when it receives the target subscription request.
[0107] In the embodiments of this specification, in response to the target subscription request of the first slave device forwarded by the master device, the second slave device sends the initial target state of the second slave device to the master device, where the initial target state refers to the target state of the second slave device when it receives the target subscription request of the first slave device;
[0108] In the embodiments of this specification, after receiving the initial target state of the second slave device, the master device sends the initial target state of the second slave device to the first slave device based on the target state of the second slave device and the second correspondence between the first slave device and the second slave device;
[0109] In the embodiments of this specification, after receiving the initial target state of the second slave device, the first slave device locally saves the initial target state of the second slave device.
[0110] S403. When the current target state of the second slave device is received every second preset duration, based on the second correspondence, the current target state is sent to the first slave device, so that when the current target state is inconsistent with the initial target state and the first slave device has not performed the linkage operation corresponding to the current target state, the first slave device performs the linkage operation corresponding to the current target state and determines the current target state as the initial target state.
[0111] In the embodiments of this specification, the second slave device sends the current target state of the second slave device to the master device every second preset duration. The master device sends the current target state of the second slave device to the first slave device based on the target state of the second slave device and the second correspondence between the first slave device and the second slave device. After receiving the current target state of the second slave device, the first slave device compares the current target state of the second slave device with the initial target state of the second slave device saved locally. If they are the same, it indicates that the target state of the second slave device has not changed, and the first slave device does not perform any operation; if they are different and the first slave device has not performed the linkage operation corresponding to the current target state of the second slave device, the first slave device performs the linkage operation corresponding to the current target state of the second slave device and determines the current target state of the second slave device as the initial target state of the second slave device, and updates the initial target state of the second slave device saved locally;
[0112] In the embodiments of this specification, the second preset duration can be set according to actual linkage requirements. For example, the second preset duration can be 45 seconds;
[0113] In the embodiments of this specification, to avoid the situation where the host or the source slave device fails to receive the updated status information normally when the target slave device sends the updated status information due to network anomalies or other problems, the target slave device periodically sends the current status corresponding to the status subscribed by the source slave device to the host, and the host then forwards it to the source slave device to ensure the synchronization of the status information between the target slave device and the source slave device.
[0114] The embodiments of the present invention also provide a device linkage method applied to a first slave device, and the method includes:
[0115] Sending a target subscription request to the master device, where the target subscription request is used to subscribe to the target status of the target device, and the target subscription request includes the target device type of the target device and the target status of the target device, so that when the target device type indicates that the target device is the master device, the master device establishes a first correspondence between the target status and the first slave device based on the target subscription request, and when the target status changes, based on the first correspondence, sends the updated target status to the first slave device;
[0116] When receiving the updated target status, performing a linkage operation corresponding to the updated target status.
[0117] In the embodiments of this specification, the first slave device subscribes to the target status of the target device according to its own linkage requirements. The target device may be the master device or other slave devices other than the first slave device, and the target status refers to the target device status related to the linkage requirements of the first slave device;
[0118] In the embodiments of this specification, the target subscription request of the first slave device includes the target device type of the target device and the target status of the target device. The target device type is used to identify the target device linked by the first slave device, and the target status is used to represent the target device status that the first slave device needs to subscribe to;
[0119] In the embodiments of this specification, the first slave device may send the target subscription request to the master device via Bluetooth;
[0120] In the embodiments of this specification, the master device may be an intelligent kitchen appliance device or a central control screen, and the first slave device may be other intelligent kitchen appliance devices other than the master device;
[0121] In the embodiments of this specification, the target status may be a status related to the operation of the target device, such as the switch status or working duration of the target device;
[0122] In the embodiments of this specification, after receiving the target subscription request of the first slave device, the master device determines the target device linked by the first slave device based on the target device type included in the target subscription request;
[0123] In the embodiments of this specification, when the target device type included in the target subscription request indicates that the target device associated with the first slave device is the master device, that is, when the first slave device needs to subscribe to the target state of the master device, the master device establishes a first correspondence between the target state of the master device and the first slave device based on the target subscription request;
[0124] In the embodiments of this specification, when the target state of the master device changes, the master device sends the updated target state to the first slave device based on the first correspondence between the target state of the master device and the first slave device, so that the first slave device performs an associated operation corresponding to the updated target state;
[0125] In the embodiments of this specification, the master device can send the updated target state to the first slave device that has subscribed to the target state through Bluetooth;
[0126] The embodiments of this specification can implement the state synchronization of master-slave linkage through the mechanism of the slave device subscribing to the host device state. When the corresponding state of the host device changes, the host device sends state change information to the slave device according to the subscription information, and the slave device performs the corresponding associated operation after receiving it, thereby improving the state synchronization efficiency of master-slave linkage.
[0127] In the embodiments of this specification, after sending the target subscription request to the master device, the method further includes:
[0128] Receiving the initial target state of the master device; the initial target state is the target state of the master device when the master device receives the target subscription request;
[0129] When the current target state of the master device is received every first preset time period, comparing the current target state with the initial target state;
[0130] When the current target state is inconsistent with the initial target state, and the first slave device has not performed the associated operation corresponding to the current target state, performing the associated operation corresponding to the current target state and determining the current target state as the initial target state.
[0131] In the embodiments of this specification, after the master device receives the target subscription request from the first slave device, the master device sends the initial target state of the master device to the first slave device, and the initial target state refers to the target state of the master device when the master device receives the target subscription request from the first slave device;
[0132] In the embodiments of this specification, after the first slave device receives the initial target state of the master device, it locally saves the initial target state of the master device;
[0133] In the embodiments of this specification, based on the first correspondence between the target state of the master device and the first slave device, the master device sends the current target state of the master device to the first slave device every first preset duration. After receiving the current target state of the master device, the first slave device compares the current target state of the master device with the initial target state of the master device saved locally. If they are the same, it indicates that the target state of the master device has not changed, and the first slave device does not perform any operation. If they are different and the first slave device has not performed the linkage operation corresponding to the current target state of the master device, the first slave device performs the linkage operation corresponding to the current target state of the master device, determines the current target state of the master device as the initial target state of the master device, and updates the initial target state of the master device saved locally.
[0134] In the embodiments of this specification, the first preset duration can be set according to actual linkage requirements. For example, the first preset duration can be 30 seconds.
[0135] In the embodiments of this specification, to avoid the situation where the slave device fails to receive the updated status information sent by the master device due to network anomalies or other problems when the master device sends the updated status information to the slave device, the master device regularly sends the current status corresponding to the status subscribed by the slave device to the slave device to ensure the synchronization of the status information between the master and slave devices.
[0136] In the embodiments of this specification, the method further includes:
[0137] Sending the target subscription request to the master device, so that when the target device type indicates that the target device is the second slave device, the master device sends the target subscription request to the second slave device, establishing a second correspondence between the target state, the first slave device, and the second slave device based on the target subscription request, and when receiving the updated target state sent by the second slave device, sending the updated target state to the first slave device based on the second correspondence;
[0138] When receiving the updated target state, perform the linkage operation corresponding to the updated target state.
[0139] In the embodiments of this specification, after receiving the target subscription request from the first slave device, the master device determines the target device linked by the first slave device based on the target device type included in the target subscription request.
[0140] In an embodiment of the present specification, when the target device type included in the target subscription request indicates that the target device associated with the first slave device is the second slave device, that is, when the first slave device needs to subscribe to the target state of the second slave device, the master device forwards the target subscription request of the first slave device to the second slave device, and establishes a second correspondence relationship among the target state of the second slave device, the first slave device, and the second slave device based on the target subscription request of the first slave device;
[0141] In an embodiment of the present specification, the master device may be an intelligent kitchen appliance device or a central control screen, the first slave device may be other intelligent kitchen appliance devices except the master device, and the second slave device may be other intelligent kitchen appliance devices except the master device and the first slave device;
[0142] In an embodiment of the present specification, when the target state of the second slave device changes, the second slave device sends the updated target state to the master device, and the master device then sends the updated target state to the first slave device based on the second correspondence relationship among the target state of the second slave device, the first slave device, and the second slave device, so that the first slave device performs a linkage operation corresponding to the updated target state;
[0143] The embodiment of the present specification can realize the state synchronization of slave device linkage through the mechanism of inter-slave device state subscription. Taking the master device as an intermediary, the source slave device subscribes to the specified state of the target slave device. When the specified state of the target slave device changes, the target slave device sends state change information to the master device. After receiving it, the master device forwards the state change information to the source slave device according to the subscription information of the source slave device, realizing the state synchronization between slave devices and improving the state synchronization efficiency of inter-slave device linkage.
[0144] In an embodiment of the present specification, after sending the target subscription request to the master device, the method further includes:
[0145] Receiving the initial target state of the second slave device sent by the master device; the initial target state is the target state of the second slave device when it receives the target subscription request;
[0146] When receiving the current target state of the second slave device sent by the master device every second preset duration, comparing the current target state with the initial target state;
[0147] When the current target state is inconsistent with the initial target state, and the first slave device has not performed the linkage operation corresponding to the current target state, performing the linkage operation corresponding to the current target state, and determining the current target state as the initial target state.
[0148] In the embodiment of this specification, in response to the target subscription request of the first slave device forwarded by the master device, the second slave device sends the initial target state of the second slave device to the master device, where the initial target state refers to the target state of the second slave device when it receives the target subscription request of the first slave device;
[0149] In the embodiment of this specification, after receiving the initial target state of the second slave device, the master device sends the initial target state of the second slave device to the first slave device based on the target state of the second slave device and the second correspondence between the first slave device and the second slave device;
[0150] In the embodiment of this specification, after receiving the initial target state of the second slave device, the first slave device locally saves the initial target state of the second slave device;
[0151] In the embodiment of this specification, the second slave device sends the current target state of the second slave device to the master device every second preset duration. The master device sends the current target state of the second slave device to the first slave device based on the target state of the second slave device and the second correspondence between the first slave device and the second slave device. After receiving the current target state of the second slave device, the first slave device compares the current target state of the second slave device with the locally saved initial target state of the second slave device. If they are the same, it indicates that the target state of the second slave device has not changed, and the first slave device does not perform any operation; if they are different and the first slave device has not performed the linkage operation corresponding to the current target state of the second slave device, the first slave device performs the linkage operation corresponding to the current target state of the second slave device and determines the current target state of the second slave device as the initial target state of the second slave device, and updates the locally saved initial target state of the second slave device;
[0152] In the embodiment of this specification, the second preset duration can be set according to actual linkage requirements. For example, the second preset duration can be 45 seconds;
[0153] In the embodiment of this specification, to avoid the situation where when the target slave device sends the updated status information, the host or the source slave device fails to receive it normally due to network anomalies or other problems, the target slave device regularly sends the current status corresponding to the status subscribed by the source slave device to the host, and the host then forwards it to the source slave device to ensure the synchronization of the status information between the target slave device and the source slave device.
[0154] In the embodiment of this specification, the method further includes:
[0155] Receive the target subscription request of the third slave device sent by the master device; the target subscription request of the third slave device is used to subscribe to the target status of the first slave device, and the target subscription request of the third slave device includes the target device type of the first slave device and the target status of the first slave device;
[0156] When the target status of the first slave device changes, send the updated target status to the master device, so that the master device, based on the third correspondence relationship among the target status, the first slave device, and the third slave device, sends the updated target status to the third slave device, and the third slave device performs a linkage operation corresponding to the updated target status.
[0157] In the embodiments of this specification, while the first slave device serves as an active subscription end for subscribing to the status of the second slave device, it can also serve as a subscribed end for being subscribed by other slave devices;
[0158] In the embodiments of this specification, after the master device receives the target subscription request of the third slave device, it determines the target device linked by the third slave device based on the target device type included in the target subscription request;
[0159] In the embodiments of this specification, when the target device type included in the target subscription request indicates that the target device linked by the third slave device is the first slave device, that is, when the third slave device needs to subscribe to the target status of the first slave device, the master device forwards the target subscription request of the third slave device to the first slave device, and establishes a third correspondence relationship among the target status of the first slave device, the first slave device, and the third slave device based on the target subscription request of the third slave device;
[0160] In the embodiments of this specification, when the target status of the first slave device changes, the first slave device sends the updated target status to the master device, and the master device then sends the updated target status to the third slave device based on the third correspondence relationship among the target status of the first slave device, the first slave device, and the third slave device, so that the third slave device performs a linkage operation corresponding to the updated target status;
[0161] The embodiments of this specification can achieve the status synchronization of slave device linkage through the mechanism of inter-slave device status subscription. With the host as the intermediary, the source slave device subscribes to the specified status of the target slave device. When the specified status of the target slave device changes, the target slave device sends status change information to the host. After receiving it, the host forwards the status change information to the source slave device according to the subscription information of the source slave device, realizing the status synchronization between slave devices and improving the status synchronization efficiency of inter-slave device linkage.
[0162] The embodiments of the present invention also provide a device linkage system, as Figure 5As shown, it is a schematic structural diagram of a device linkage system provided by an embodiment of the present invention; specifically, the system includes a master device 01 and a first slave device 02;
[0163] The first slave device 02 is used to send a target subscription request to the master device 01; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device;
[0164] The master device 01 is used to obtain the target subscription request of the first slave device 02; when the target device type indicates that the target device is the master device 01, a first correspondence is established between the target state and the first slave device 02 based on the target subscription request; when the target state changes, the updated target state is sent to the first slave device 02 based on the first correspondence;
[0165] The first slave device 02 is used to perform a linkage operation corresponding to the updated target state when receiving the updated target state.
[0166] In an embodiment of this specification, Figure 6 It is a schematic structural diagram of a device linkage system provided by an embodiment of the present invention, and the system further includes a second slave device 03;
[0167] The master device 01 is further used to send the target subscription request to the second slave device 03 when the target device type indicates that the target device is the second slave device 03; a second correspondence is established between the target state, the first slave device 02, and the second slave device 03 based on the target subscription request;
[0168] The second slave device 03 is used to send the updated target state to the master device 01 when the target state of the second slave device 03 changes;
[0169] The master device 01 is further used to send the updated target state to the first slave device 02 based on the second correspondence when receiving the updated target state sent by the second slave device 03;
[0170] The first slave device 02 is further used to perform a linkage operation corresponding to the updated target state when receiving the updated target state.
[0171] In an embodiment of this specification, Figure 7 It is a schematic structural diagram of a device linkage system provided by an embodiment of the present invention, and the system further includes a third slave device 04;
[0172] The third slave device 04 is configured to send a target subscription request to the master device 01; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device.
[0173] The master device 01 is further configured to, when the target device type indicates that the target device is the first slave device 02, send the target subscription request to the first slave device 02; establish a third correspondence relationship among the target state, the first slave device 02, and the third slave device 04 based on the target subscription request.
[0174] The first slave device 02 is further configured to, when the target state of the first slave device 02 changes, send the updated target state to the master device 01.
[0175] The master device 01 is further configured to, when receiving the updated target state sent by the first slave device 02, send the updated target state to the third slave device 04 based on the third correspondence relationship.
[0176] The third slave device 04 is configured to perform an association operation corresponding to the updated target state when receiving the updated target state.
[0177] It should be noted that: the above sequence of the embodiments of the present invention is only for description and does not represent the superiority or inferiority of the embodiments. Moreover, the above description of specific embodiments of this specification is provided, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims may be executed in a different order from that in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or continuous order shown to achieve the desired result. In certain embodiments, multi-tasking and parallel processing are also possible or may be advantageous.
[0178] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.
[0179] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk, an optical disc, etc.
[0180] The above-disclosed is only a preferred embodiment of the present invention. Of course, the scope of the rights of the present invention cannot be limited by this. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.
Claims
1. A device linkage method, characterized in that, Applied to a master device, the method includes: Obtaining a target subscription request of a first slave device; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device; When the target device type indicates that the target device is the master device, establishing a first correspondence between the target state and the first slave device based on the target subscription request; When the target state changes, based on the first correspondence, sending the updated target state to the first slave device so that the first slave device performs an associated operation corresponding to the updated target state.
2. The device linkage method according to claim 1, wherein After obtaining the target subscription request of the first slave device, the method further includes: When the target device type indicates that the target device is a second slave device, sending the target subscription request to the second slave device; Establishing a second correspondence between the target state, the first slave device, and the second slave device based on the target subscription request; When receiving the updated target state sent by the second slave device, based on the second correspondence, sending the updated target state to the first slave device so that the first slave device performs an associated operation corresponding to the updated target state.
3. The device linkage method according to claim 1, wherein After establishing the first correspondence between the target state and the first slave device based on the target subscription request when the target device type indicates that the target device is the master device, the method further includes: Sending the initial target state of the master device to the first slave device; the initial target state is the target state of the master device when the master device receives the target subscription request; Based on the first correspondence, sending the current target state of the master device to the first slave device every first preset duration so that the first slave device performs an associated operation corresponding to the current target state and determines the current target state as the initial target state when the current target state is inconsistent with the initial target state and the first slave device has not performed the associated operation corresponding to the current target state.
4. The device linkage method according to claim 2, characterized in that After establishing the second correspondence between the target state, the first slave device, and the second slave device based on the target subscription request, the method further includes: Receiving the initial target state of the second slave device and sending the initial target state to the first slave device based on the second correspondence; the initial target state is the target state of the second slave device when the second slave device receives the target subscription request; When receiving the current target state of the second slave device every other second preset duration, based on the second corresponding relationship, send the current target state to the first slave device, so that when the current target state is inconsistent with the initial target state and the first slave device has not executed the linkage operation corresponding to the current target state, the first slave device executes the linkage operation corresponding to the current target state and determines the current target state as the initial target state.
5. A device linkage method, characterized in that, Applied to the first slave device, the method includes: Send a target subscription request to the master device, where the target subscription request is used to subscribe to the target state of the target device, and the target subscription request includes the target device type of the target device and the target state of the target device, so that when the target device type indicates that the target device is the master device, the master device establishes a first corresponding relationship between the target state and the first slave device based on the target subscription request, and when the target state changes, based on the first corresponding relationship, send the updated target state to the first slave device; When receiving the updated target state, execute the linkage operation corresponding to the updated target state.
6. The device linkage method according to claim 5, wherein After sending the target subscription request to the master device, the method further includes: Receive the initial target state of the master device; the initial target state is the target state when the master device receives the target subscription request; When receiving the current target state of the master device every first preset duration, compare the current target state with the initial target state; When the current target state is inconsistent with the initial target state and the first slave device has not executed the linkage operation corresponding to the current target state, execute the linkage operation corresponding to the current target state and determine the current target state as the initial target state.
7. The device linkage method according to claim 5, wherein The method further includes: Send the target subscription request to the master device, so that when the target device type indicates that the target device is the second slave device, the master device sends the target subscription request to the second slave device, establishes a second corresponding relationship between the target state, the first slave device, and the second slave device based on the target subscription request, and when receiving the updated target state sent by the second slave device, based on the second corresponding relationship, send the updated target state to the first slave device; When receiving the updated target state, execute the linkage operation corresponding to the updated target state.
8. The device linkage method according to claim 7, wherein After sending the target subscription request to the master device, the method further includes: Receive the initial target state of the second slave device sent by the master device; the initial target state is the target state when the second slave device receives the target subscription request; When receiving the current target state of the second slave device sent by the master device every second preset time period, compare the current target state with the initial target state; When the current target state is inconsistent with the initial target state and the first slave device has not performed the linkage operation corresponding to the current target state, perform the linkage operation corresponding to the current target state and determine the current target state as the initial target state.
9. The device linkage method according to claim 5, characterized in that, The method further includes: Receiving a target subscription request of a third slave device sent by the master device; the target subscription request of the third slave device is used to subscribe to the target state of the first slave device, and the target subscription request of the third slave device includes the target device type of the first slave device and the target state of the first slave device; When the target state of the first slave device changes, send the updated target state to the master device, so that the master device, based on the third corresponding relationship among the target state, the first slave device, and the third slave device, sends the updated target state to the third slave device, and the third slave device performs the linkage operation corresponding to the updated target state.
10. A device linkage system, characterized in that, Including a master device and a first slave device; The first slave device is used to send a target subscription request to the master device; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device; The master device is used to obtain the target subscription request of the first slave device; When the target device type indicates that the target device is the master device, establish a first corresponding relationship between the target state and the first slave device based on the target subscription request; When the target state changes, based on the first corresponding relationship, send the updated target state to the first slave device; The first slave device is used to perform the linkage operation corresponding to the updated target state when receiving the updated target state.
11. The device linkage system according to claim 10, wherein The system further includes a second slave device; The master device is further used to send the target subscription request to the second slave device when the target device type indicates that the target device is the second slave device; Establish a second corresponding relationship among the target state, the first slave device, and the second slave device based on the target subscription request; The second slave device is used to send the updated target state to the master device when the target state of the second slave device changes; The master device is further used to send the updated target state to the first slave device based on the second corresponding relationship when receiving the updated target state sent by the second slave device; The first slave device is further used to perform the linkage operation corresponding to the updated target state when receiving the updated target state.
12. The device linkage system according to claim 10, characterized in that, The system further includes a third slave device; The third slave device is configured to send a target subscription request to the master device; the target subscription request is used to subscribe to the target state of a target device, and the target subscription request includes the target device type of the target device and the target state of the target device; The master device is further configured to, when the target device type indicates that the target device is the first slave device, send the target subscription request to the first slave device; Establish a third correspondence relationship among the target state, the first slave device, and the third slave device based on the target subscription request; The first slave device is further configured to, when the target state of the first slave device changes, send the updated target state to the master device; The master device is further configured to, when receiving the updated target state sent by the first slave device, send the updated target state to the third slave device based on the third correspondence relationship; The third slave device is configured to perform an associated operation corresponding to the updated target state when receiving the updated target state.