A device control method and apparatus, an electronic device, and a storage medium

By deploying a graph neural network on smart home devices, obtaining the topology graph, and electing a temporary master node, the problem of device linkage paralysis caused by control terminal failure is solved, achieving seamless collaborative control between devices and improving the reliability and intelligence of the system.

CN123185054APending Publication Date: 2026-11-27GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611673988.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-28
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

When existing smart home systems malfunction at the control end, the collaborative operation and linkage between devices will be paralyzed, affecting the user experience.

Method used

By deploying a graph neural network on the device side, the context state information of the device nodes is determined by acquiring the topology graph and multiple rounds of message passing. A temporary master node is elected to replace the control terminal for control, thereby realizing collaborative work and linkage between devices.

Benefits of technology

Even in the event of a control failure, the devices can still maintain collaborative operation and联动 control, improving the reliability and intelligence of smart home devices and enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185054A_ABST
    Figure CN123185054A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a device control method and device, an electronic device and a storage medium, comprising: obtaining a topology graph of devices in a preset home environment, performing multi-round message passing on device nodes and corresponding neighbor device nodes through a graph neural network to obtain context state information of each device node, detecting that a control end is faulty and has not recovered within a preset time length, determining the suitability of each device node according to the context state information, determining a temporary master node from the device nodes to replace the control end to control each device, and detecting that the control end has recovered normally, switching back from the temporary master node to the control end to control each device. The present application deploys a graph neural network on each device node, and when the control end is faulty, the temporary master node takes over to replace the control end, so that the devices can still maintain cooperative work and linkage control, improving the reliability and intelligent level of smart home devices and further improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of smart home technology, specifically relating to a device control method, a device control apparatus, an electronic device, and a computer-readable storage medium. Background Technology

[0002] With the rapid development of IoT and AI technologies, smart homes have become an important part of modern life. Smart home systems integrate various smart devices, such as smart lights, temperature and humidity sensors, smart door locks, air conditioners, and smart central control screens, providing users with a more convenient and comfortable living environment.

[0003] Currently, to achieve collaborative work and linkage between devices, smart home systems generally adopt a centralized control architecture with smartphones, routers, and gateways as control terminals. Under this architecture, each device reports its status to the control terminal, which then performs unified logical judgments and issues control commands. However, if the control terminal malfunctions and the connection is interrupted, the devices will lose their coordination hub, causing the intelligent linkage between devices to completely collapse. This makes it impossible to guarantee collaborative work and linkage between devices, thus affecting the user experience. Summary of the Invention

[0004] In view of the above problems, embodiments of this application are proposed to provide a method to overcome or at least partially solve the above problems.

[0005] This application discloses a device control method applied to a device, wherein the device is pre-controlled centrally by a control terminal, and each device node of the device is equipped with a graph neural network. The method includes: Obtain a topology map of devices in a preset home environment; the topology map includes device nodes and semantic nodes, and the semantic nodes are used to represent semantic information that affects device control; Based on the topology graph, the graph neural network is used to perform multiple rounds of message passing between the device node and its corresponding neighboring device nodes to obtain the context state information of each device node. In response to the detection of a control terminal failure that has not been resolved within a preset time period, the competence of each device node is determined based on the context state information. A temporary master node is determined from the device nodes based on the competence rating, and the temporary master node is used to replace the control terminal to control each device. In response to the detection that the control terminal has returned to normal, the system switches back from the temporary master node to the control terminal to control each device.

[0006] Optionally, before obtaining the topology map of devices in a preset home environment, the method further includes: The devices in the home environment are used as device nodes, and the ambient light, current time period and scene mode are used as semantic nodes respectively. Based on the communication reachability and historical linkage frequency between the device nodes, a weighted edge is established between the communication reachable device nodes; Based on the functional dependency relationship between the device node and the semantic node, a semantic edge is established between the device node and the semantic node that have functional dependency. By constructing a heterogeneous graph structure from the device nodes, semantic nodes, weighted edges, and semantic edges, a topology graph of the device is obtained.

[0007] Optionally, based on the topology graph, the step of performing multiple rounds of message passing between the device node and its corresponding neighboring device nodes through the graph neural network to obtain the context state information of each device node includes: Based on the communication reachability and / or functional dependencies represented in the topology graph, the neighboring device nodes corresponding to the device node are determined; The device node uses a graph neural network to perform multiple rounds of message passing with its neighboring device nodes to obtain the status information of each neighboring device node; the status information includes at least one of device type, operating parameters, and network quality indicators. The state information of each neighboring device node is weighted and fused according to its corresponding weight to obtain the neighbor aggregation feature; Acquire local data of the device node and encode the local data into local features; the local data includes at least one of switch status, load status, and remaining power. The neighbor aggregation feature is concatenated with the local feature, and the concatenated feature is subjected to linear transformation and nonlinear activation to obtain the context state information of the device node.

[0008] Optionally, calculating the suitability of each device node based on the context state information includes: Obtain the capability indicators, device type, and function tags of the device node; the capability indicators include at least one of real-time computing power, network centrality, and historical stability. The capability indicators, device type, function tags, and context state information are used to construct the node feature vector of the device node; The graph neural network is used to perform message passing and aggregation on the node feature vectors, and the suitability of the device node is obtained by mapping.

[0009] Optionally, determining a temporary master node from the device nodes based on the competence includes: Broadcast the competence of the device node, and receive the competence broadcast by other device nodes; Based on the competence of each device node, multiple rounds of consensus negotiation are conducted through a consensus algorithm until each device node reaches a consensus on the candidate device node. Candidate device nodes that meet the consensus criteria are designated as the temporary master nodes.

[0010] Optionally, the method further includes: Obtain the current inference error of the graph neural network of the device node, and determine the gradient update amount of the graph neural network model parameters; The gradient update amount is encrypted and uploaded to the cloud server; The system receives updated graph neural network model parameters from the cloud server; the cloud server decrypts the gradient update amount and updates the graph neural network model parameters based on the gradient update amount. The graph neural network deployed on the device node is updated based on the updated graph neural network model parameters.

[0011] Optionally, after determining the temporary master node from the device nodes based on the competence, the method further includes: The failure status of the control terminal is injected into the topology graph as an input feature. The failure probability of each hop neighbor device node is calculated, and the propagation path with the failure probability exceeding a preset threshold is identified as a risk path. Based on the risk path, alternative relay nodes are selected from the device nodes; Construct a multi-hop path using the temporary master node, the alternative relay node, and the target device node to be controlled; Based on the multi-hop path, the topology of the devices is updated so that the linkage corresponding to the risk path is executed through the multi-hop path.

[0012] Optionally, after determining the temporary master node from the device nodes based on the competence, the method further includes: The feature vectors of the semantic nodes are used as constraints to embed a preset loss function to obtain the constraint conditions. With the optimization objectives of minimizing response latency, minimizing energy consumption, and maximizing linkage success rate, the operating parameters of the target device node that meet the constraints are determined, and the target device node is controlled according to the operating parameters.

[0013] Optionally, the step of switching back from the temporary master node to the control terminal to control each device in response to detecting that the control terminal has returned to normal includes: In response to the detection that the control terminal has returned to normal, the device topology and / or graph neural network model parameters updated during the temporary master node takeover will be synchronized to the control terminal. Switching back from the temporary master node to the control terminal allows each device node to resume centralized control from the control terminal.

[0014] This application discloses a device control apparatus applied to a device, wherein the device is pre-controlled centrally by a control terminal, and each device node of the device is equipped with a graph neural network. The apparatus includes: The first acquisition module is used to acquire a topology map of devices in a preset home environment; the topology map includes device nodes and semantic nodes, and the semantic nodes are used to represent semantic information that affects device control; The processing module is used to perform multiple rounds of message passing between the device node and its corresponding neighboring device node through the graph neural network based on the topology graph to obtain the context state information of each device node. The first determining module is used to determine the suitability of each device node based on the context state information in response to the detection of a fault in the control terminal. The second determining module is used to determine a temporary master node from the device nodes based on the competence; the temporary master node is used to replace the control terminal to control each device; The first control module is used to switch back from the temporary master node to the control terminal to control each device in response to the detection that the control terminal has returned to normal.

[0015] Optionally, the device further includes: The third determining module is used to treat the devices in the home environment as device nodes, and the ambient light, current time period and scene mode as semantic nodes respectively. The first creation module is used to establish weighted edges between communication-reachable device nodes based on the communication reachability and historical linkage frequency between the device nodes. The second creation module is used to establish semantic edges between device nodes and semantic nodes that have functional dependencies, based on the functional dependency relationship between the device nodes and the semantic nodes. The topology module is used to construct a heterogeneous graph structure from the device nodes, the semantic nodes, the weighted edges, and the semantic edges to obtain the topology graph of the device.

[0016] Optionally, the processing module includes: The first determining submodule is used to determine the neighboring device nodes corresponding to the device node based on the communication reachability and / or functional dependencies represented in the topology graph; The message passing submodule is used to perform multiple rounds of message passing with the neighboring device nodes through the graph neural network of the device node to obtain the status information of each neighboring device node; the status information includes at least one of device type, operating parameters, and network quality indicators. The first processing submodule is used to weight and fuse the state information of each neighboring device node according to the corresponding weights to obtain the neighbor aggregation feature; The second processing submodule is used to acquire local data of the device node and encode the local data into local features; the local data includes at least one of switch status, load status, and remaining power. The third processing submodule is used to concatenate the neighbor aggregation features with the local features, and perform linear transformation and nonlinear activation on the concatenated features to obtain the context state information of the device node.

[0017] Optionally, the first determining module includes: The acquisition submodule is used to acquire the capability indicators, device type, and function tags of the device node; the capability indicators include at least one of real-time computing power, network centrality, and historical stability. A construction submodule is used to construct the node feature vector of the device node from the capability indicators, the device type, the function tags and the context state information; The mapping submodule is used to perform message passing and aggregation on the node feature vectors through the graph neural network, and map the suitability of the device node.

[0018] Optionally, the second determining module includes: The broadcast submodule is used to broadcast the competence of the device node and to receive competence broadcast by other device nodes. The negotiation submodule is used to conduct multiple rounds of consensus negotiation based on the competence of each device node through a consensus algorithm until each device node reaches a consensus on the candidate device node. The second determination submodule is used to determine the candidate device nodes that meet the consensus conditions as the temporary master node.

[0019] Optionally, the device further includes: The second acquisition module is used to acquire the current inference error of the graph neural network of the device node and determine the gradient update amount of the graph neural network model parameters. The upload module is used to encrypt and upload the gradient update amount to the cloud server; The receiving module is used to receive the updated graph neural network model parameters sent by the cloud server; the cloud server is used to decrypt to obtain the gradient update amount, and update the graph neural network model parameters based on the gradient update amount. The first update module is used to update the graph neural network deployed on the device node based on the updated graph neural network model parameters.

[0020] Optionally, the device further includes: The path identification module is used to inject the failure status of the control terminal as input features into the topology graph, calculate the failure probability of each hop neighbor device node, and identify the propagation path with the failure probability exceeding a preset threshold as a risk path. The fourth determining module is used to select alternative relay nodes from the device nodes based on the risk path; The path construction module is used to construct a multi-hop path for the temporary master node, the alternative relay node and the target device node to be controlled; The second update module is used to update the topology of the devices based on the multi-hop path, so that the linkage corresponding to the risk path is executed through the multi-hop path.

[0021] Optionally, the device further includes: The constraint module is used to embed the feature vector of the semantic node as a constraint into a preset loss function to obtain the constraint conditions. The second control module is used to determine the operating parameters of the target device node that meet the constraints with the optimization objectives of minimizing response delay, minimizing energy consumption and maximizing linkage success rate, and to control the target device node according to the operating parameters.

[0022] Optionally, the first control module includes: A synchronization submodule is used to synchronize the device topology and / or graph neural network model parameters updated during the temporary master node takeover to the control terminal in response to detecting that the control terminal has returned to normal. The control submodule is used to switch back from the temporary master node to the control terminal, so that each of the device nodes can resume centralized control by the control terminal.

[0023] This application also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method described in the embodiments of this application.

[0024] This application also discloses a computer-readable medium storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this application.

[0025] The embodiments of this application have the following advantages: In this embodiment, the device is pre-controlled centrally by a control terminal. Each device node on the device is equipped with a graph neural network. By acquiring a topology graph of the devices in a pre-defined home environment, which includes device nodes and semantic nodes, the semantic nodes are used to represent semantic information that affects device control. Based on the topology graph, the graph neural network performs multiple rounds of message passing between the device nodes and their corresponding neighboring device nodes to obtain the context state information of each device node. In response to the detection of a control terminal failure that has not been resolved within a preset time period, the suitability of each device node is determined based on the context state information. A temporary master node is determined from the device nodes based on the suitability. The temporary master node is used to replace the control terminal in controlling each device. In response to the detection that the control terminal has recovered, the control terminal is switched back from the temporary master node to control each device. This application embodiment deploys a graph neural network on each device node and obtains context state information through multi-round message passing based on the topology graph when the control terminal fails. This determines the suitability of each device node and elects a temporary master node. By dynamically evaluating the suitability of each device node based on multi-dimensional information, intelligent and dynamic temporary master node election is achieved. When the control terminal fails, the temporary master node takes over the coordination and decision-making functions, enabling devices to maintain collaborative work and linkage control. After the control terminal recovers, a seamless closed-loop operation is completed from centralized control to edge autonomy and then to centralized management, improving the reliability and intelligence level of smart home devices and further enhancing the user experience. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart of the steps of a device control method provided in the embodiments of this application; Figure 2 This is a structural block diagram of a device control apparatus provided in the embodiments of this application; Figure 3 This is a structural block diagram of an electronic device provided in the embodiments of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0030] Reference Figure 1 This document illustrates a flowchart of a device control method provided in an embodiment of this application. The method is applied to a device, which is pre-controlled centrally by a control terminal. Each device node on the device is equipped with a graph neural network. Specifically, the method may include the following steps: Step 101: Obtain the topology diagram of devices in the preset home environment; the topology diagram includes device nodes and semantic nodes, and the semantic nodes are used to represent semantic information that affects device control.

[0031] In this embodiment, the preset home environment is an environment or area where multiple smart devices are deployed. These preset home environments include, but are not limited to, the following physical devices: smart lights, temperature and humidity sensors, ambient light sensors, smart door locks, smart alarms, air conditioners, smart central control screens, high-end speakers, smart curtains, smart sockets, etc. All of these physical devices possess certain communication capabilities (such as Wi-Fi, Zigbee, Bluetooth, etc.) and / or computing power, enabling them to access the home network and interact with other devices. In this embodiment, the devices in the preset home environment are initially controlled centrally by a control terminal. This control terminal can be at least one of a router gateway or a smart terminal such as a mobile phone, used to uniformly receive status reports from each device, execute linkage logic judgments, and issue control commands. The linkage logic between devices includes things like "lights on when the door is open," "air conditioner on when the temperature is too high," and "lights off in sleep mode."

[0032] In practical implementation, each device node on the device side deploys a Graph Neural Network (GNN). A GNN refers to a graph neural network model with a small number of parameters, low computational complexity, and suitable for running on edge devices with limited computing power. Without relying on control terminals such as routers or gateways, each device node can exchange information with neighboring device nodes through the lightweight GNN model running at the edge, thereby gaining real-time awareness of its own and the surrounding network's health and changes. The graph neural network includes an input layer, a graph convolutional layer, and an output layer. The graph convolutional layer is the core component of the GNN, used for message passing and aggregation.

[0033] In this embodiment, during the initialization phase, the physical devices in the preset home environment are first abstractly modeled to generate device nodes. At the same time, semantic nodes for representing the environment, time, and scene patterns are automatically generated. Then, based on the communication and linkage relationships between device nodes and the functional dependencies between device nodes and semantic nodes, a heterogeneous graph structure that combines physical connections and semantic associations, namely a topology graph, is constructed as the basis for subsequent graph neural network inference. Therefore, the topology graph of the devices in the preset home environment is obtained first.

[0034] In the specific implementation, the topology graph includes device nodes and semantic nodes. Each real device node corresponds to a physical device. For example, smart lights correspond to a lighting node, temperature and humidity sensors correspond to a sensor node, smart door locks correspond to a door lock node, air conditioners correspond to air conditioner nodes, and smart central control screens correspond to central control screen nodes. Each device node loads a local configuration file, which contains device attribute information that is pre-configured or automatically generated when the device is connected to the smart home system. This includes data such as device type, communication capability, computing power level, and energy consumption level. Device type is used to characterize the type of device, communication capability is used to characterize the communication protocols and communication quality supported by the device. Communication quality can be reflected by communication bandwidth, communication distance, etc. Computing power level is used to characterize the computing power of the device, and energy consumption level is used to characterize the energy consumption characteristics of the device.

[0035] In this embodiment, semantic nodes are automatically generated virtual auxiliary nodes, not physical devices, used to represent semantic information that affects device control. Semantic nodes include at least one of an indoor light intensity node, a current time period node, and a scene mode node. The indoor light intensity node is driven in real-time by an ambient light sensor and represents the current indoor light intensity state. The state value of this node is updated in real-time with the data collected by the ambient light sensor. The indoor light intensity node is used to drive or influence the control decisions of the real device nodes; for example, the brightness of lights can be adaptively adjusted based on the light intensity represented by this node. The current time period node is driven by a local clock and represents the current time. The current time period node can be used to influence device control strategies, such as automatically reducing light brightness at night or automatically opening curtains in the morning. The scene mode node is set by user habits or manual triggering and represents the current scene mode, such as sleep mode, away mode, movie mode, home mode, etc. The scene mode node can carry corresponding constraints; for example, the sleep mode node can carry constraints such as upper limit of light intensity, temperature range, and noise threshold. The scene mode node is used to drive the linkage control of device nodes; for example, sleep mode triggers the air conditioner to lower its fan speed or the lights to dim. The aforementioned semantic nodes and device nodes together constitute a heterogeneous graph structure. Semantic nodes do not participate in the election of subsequent temporary master nodes, but can only serve as the source of input features for graph neural network inference or device control.

[0036] Step 102: Based on the topology graph, a graph neural network is used to perform multiple rounds of message passing between the device node and its corresponding neighboring device nodes to obtain the context state information of each device node.

[0037] In this embodiment, inference is performed on the edge side by deploying a graph neural network, and multiple rounds of message passing are conducted with neighboring device nodes. The neighbor state information is aggregated and its own local features are fused to generate context state information containing the local network context. The context state information includes the current device node's own local state and the state information of the one-hop and two-hop neighboring device nodes, which is a comprehensive representation of the local network context by the device node.

[0038] In this embodiment, neighboring device nodes corresponding to a device node can be determined based on the communication reachability and / or functional dependencies represented in the topology graph. The weighted edges in the topology graph reflect the communication reachability between device nodes; for a device node, the device nodes with which it has a weighted edge are its reachable neighboring device nodes. The semantic edges in the topology graph reflect the functional dependencies between device nodes and semantic nodes; semantic nodes with which a device node has a semantic edge, and other device nodes with which that semantic node has a semantic edge, can be considered as semantically associated neighboring device nodes of the device node. Neighboring device nodes include one-hop neighboring device nodes and two-hop neighboring device nodes. One-hop neighboring device nodes are those with a direct weighted edge or semantic edge to the device node; two-hop neighboring device nodes are those with a direct weighted edge or semantic edge to the one-hop neighboring device node. By aggregating the state information of one-hop and two-hop neighboring device nodes, a wider range of local network context can be obtained, thereby providing a more comprehensive understanding of the network state.

[0039] Step 103: In response to the detection of a control terminal failure that has not been resolved within a preset time period, determine the competence of each device node based on the context status information.

[0040] In this embodiment of the application, in response to the detection of a control terminal failure that has not been recovered within a preset time, the decentralized autonomous mode is immediately triggered. Based on the context state information, the suitability of each device node is determined. Specifically, the context state information obtained through GNN message transmission during normal operation can be combined with the device node's own capability indicators, device type, and function tags to calculate the suitability of each device node.

[0041] In this embodiment, the capability indicators of a device node include at least one of real-time computing power, network centrality, and historical stability. These capability indicators characterize the hardware foundation and network conditions for a device node to assume the function of coordinating temporary master nodes. The capability indicators, device type, function labels, and context state information are constructed as node feature vectors for the device node. Graph neural networks are used to perform message passing and aggregation on the node feature vectors to map the device node's suitability. The graph neural network includes graph convolutional layers. Each device node uses its node feature vector as input to the graph convolutional layer, and performs message passing and aggregation through the graph convolutional layer. By stacking multiple graph convolutional layers, each device node can aggregate a wider range of neighbor information to obtain a high-dimensional representation vector containing the global network context. In the output layer, a fully connected network maps the aggregated high-dimensional representation to a scalar value, namely the suitability. The suitability is used to characterize the device node's ability to assume the function of coordinating temporary master nodes. The higher the suitability, the more suitable the device node is to assume the function of a temporary master node.

[0042] Step 104: Determine a temporary master node from the device nodes based on the competence. The temporary master node is used to replace the control terminal to control each device.

[0043] In this embodiment of the application, after determining the competence of each device node, a temporary master node needs to be elected from each device node based on the competence. The temporary master node replaces the control terminal and takes over the coordination and control decision-making functions of each device to ensure that the network does not become paralyzed due to the absence of the control terminal. The temporary master node is determined from the device nodes based on the competence and is used to replace the control terminal to control each device.

[0044] In this embodiment, based on the acquired competence of each device node, multiple rounds of consensus negotiation are conducted through a consensus algorithm until all device nodes reach a consensus on the candidate device nodes. The consensus algorithm is a distributed consensus mechanism. Each device node negotiates consensus based on its competence. After reaching a consensus within a preset number of rounds, a temporary master node is determined. The temporary master node is used to replace the control terminal in controlling each device and takes over the coordination and decision-making functions originally undertaken by the control terminal. The temporary master node is a candidate device node that meets the consensus conditions. The consensus conditions can be that the temporary master node is the device node with the highest competence, is under stable power supply, and is centrally located in the network. That is, among all device nodes, this device node has the highest competence, is under continuous power supply, or has sufficient battery power, and has high network centrality, being located in the center of the network.

[0045] Step 105: In response to the detection that the control terminal has returned to normal, switch back from the temporary master node to the control terminal to control each device.

[0046] This application embodiment deploys a graph neural network on each device node and obtains context state information through multi-round message passing based on the topology graph when the control terminal fails. This determines the suitability of each device node and elects a temporary master node. By dynamically evaluating the suitability of each device node based on multi-dimensional information, intelligent and dynamic temporary master node election is achieved. When the control terminal fails, the temporary master node takes over the coordination and decision-making functions, enabling devices to maintain collaborative work and linkage control. After the control terminal recovers, a seamless closed-loop operation is completed from centralized control to edge autonomy and then to centralized management, improving the reliability and intelligence level of smart home devices and further enhancing the user experience.

[0047] In some embodiments of this application, step 101, before obtaining the topology map of devices in a preset home environment, may further include: Step 01: Treat the devices in the home environment as device nodes, and treat the ambient light, current time period, and scene mode as semantic nodes respectively. Step 02: Based on the communication reachability and historical linkage frequency between device nodes, establish weighted edges between communication-reachable device nodes; Step 03: Based on the functional dependency relationship between device nodes and semantic nodes, establish semantic edges between device nodes and semantic nodes that have functional dependencies. Step 04: Construct a heterogeneous graph structure from device nodes, semantic nodes, weighted edges, and semantic edges to obtain the device topology graph.

[0048] In this embodiment, devices in a preset home environment are abstracted as device nodes, and environmental states, time, and scene patterns that affect device control decisions are abstracted as semantic nodes. Weighted edges and semantic edges are established based on communication reachability, historical linkage frequency, and functional dependencies, thereby forming a heterogeneous graph structure that combines physical connections and semantic associations, providing a reliable foundation for subsequent graph neural network inference, temporary master node election, and topology reconstruction.

[0049] In the specific implementation, the topology graph can be a heterogeneous graph structure. Devices in the home environment are treated as device nodes, and ambient light, current time period, and scene mode are treated as semantic nodes. For any two real device nodes, it is determined whether they are communicatively reachable. Each device node periodically broadcasts heartbeat packets, such as every 5 seconds or every 10 seconds, to surrounding devices. Neighboring device nodes record the reception of heartbeat packets and indicators such as round-trip latency and packet loss rate. If two device nodes can successfully receive heartbeat packets for several consecutive periods, such as 3 consecutive periods or 5 consecutive periods, then they are considered communicatively reachable and can be marked as communicatively reachable. If two device nodes are communicatively reachable, a weighted edge is established between the two device nodes, so that the heterogeneous graph structure can reflect the actual communication relationship and historical linkage relationship between devices, providing a physical connection basis for subsequent GNN message passing.

[0050] The weights of the weighted edges can be obtained by weighting communication quality and historical linkage frequency. Communication quality can be determined based on indicators such as round-trip latency and packet loss rate. Historical linkage frequency can be obtained by recording linkage logs and counting the number of times device B follows device A after triggering within a set time window, followed by time decay weighting and normalization. For example, the linkage log records each device linkage event, including the triggering device identifier, following device identifier, trigger time, etc. The set time window can be the past 1 hour, the past 24 hours, the past 7 days, etc. Linkage events closer to the current time have higher weights, and linkage events further away from the current time have lower weights. Time decay weighting can be implemented using an exponential decay function. The number of times after time decay weighting is normalized to obtain the historical linkage frequency value. The normalization method can be to divide the weighted number by the total number of all linkage events within the set time window.

[0051] In this embodiment, based on the functional dependency relationship between device nodes and semantic nodes, a semantic edge is established between device nodes and semantic nodes that have functional dependencies. The functional dependency relationship refers to the relationship in which the control decision of the device is driven by the semantic node or contributes data to it. For example, the brightness of the light depends on the light intensity node, that is, the control decision of the light is driven by the indoor light intensity node; the air conditioner temperature setting depends on the current time period node, that is, the control decision of the air conditioner is driven by the current time period node; the linkage between the light and the air conditioner depends on the sleep mode node, that is, the control decision of the light and the air conditioner is driven by the sleep mode node.

[0052] For any device node and a semantic node, determine whether there is a functional dependency between them. If there is a functional dependency between the device node and the semantic node, establish a semantic edge between them. When a device accesses the system, it can declare the semantic node on which its control decisions depend through configuration files or registration information. All possible connections between the device node and the semantic node are taken as candidate edges. The candidate edges are scored through an attention mechanism. High-scoring edges are retained as semantic edges, and low-scoring edges are pruned. The attention mechanism is used to score the importance of candidate edges based on device type, semantic node type, historical linkage data, etc.

[0053] The aforementioned device nodes, semantic nodes, weighted edges between device nodes, and semantic edges between device nodes and semantic nodes together constitute a heterogeneous graph structure. As a topological graph, the heterogeneous graph structure has both physical connections and semantic associations. It reflects both the actual communication relationships between devices and the semantic dependencies between devices and environmental states, time, and scene modes. In subsequent operation, the graph neural network can dynamically update edge weights through message passing, forming a heterogeneous graph structure in which physically weighted edges and semantically dependent edges coexist.

[0054] This application embodiment constructs a heterogeneous graph structure by abstracting devices as device nodes and auxiliary information as semantic nodes, providing a data foundation for subsequent graph neural network message passing, competency calculation, temporary master node election, etc.

[0055] In some embodiments of this application, step 102, based on the topology graph, involves using a graph neural network to perform multiple rounds of message passing between the device node and its corresponding neighboring device nodes to obtain the context state information of each device node. Specifically, this may include the following steps: Sub-step S11: Based on the communication reachability and / or functional dependencies represented in the topology graph, determine the neighboring device nodes corresponding to the device node; Sub-step S12 involves using the graph neural network of the device node to conduct multiple rounds of message passing with neighboring device nodes to obtain the status information of each neighboring device node; the status information includes at least one of device type, operating parameters, and network quality indicators. Sub-step S13: The state information of each neighboring device node is weighted and fused according to the corresponding weights to obtain the neighbor aggregation feature; Sub-step S14: Obtain local data of the device node and encode the local data into local features; the local data includes at least one of switch status, load status, and remaining power. Sub-step S15 involves concatenating the neighbor aggregation features with the local features, and then performing linear transformation and nonlinear activation on the concatenated features to obtain the context state information of the device node.

[0056] In this embodiment, each device node periodically collects local data and performs inference on the edge through a deployed graph neural network. It conducts multiple rounds of message passing with one-hop and two-hop neighboring device nodes, aggregating neighboring state information and fusing its own local features to generate contextual state information containing local network context. Here, multiple rounds of message passing refers to multiple rounds of information exchange between the device node and neighboring device nodes, such as 1 to 3 rounds. In each round of message passing, the device node sends its own state information to the neighboring device node and receives the state information broadcast by the neighboring device node. As the number of rounds increases, the device node can aggregate the state information of neighboring device nodes in a local range.

[0057] In practical implementation, based on the communication reachability and / or functional dependencies represented in the topology graph, the neighboring device nodes corresponding to a device node are determined. Weighted edges in the topology graph reflect the communication reachability between device nodes; for a device node, the device nodes with which it has a weighted edge are its reachable neighboring device nodes. Semantic edges in the topology graph reflect the functional dependencies between device nodes and semantic nodes. Semantic nodes with which a device node has a semantic edge, as well as other device nodes with which that semantic node has a semantic edge, can be considered as semantically related neighboring device nodes of the device node. Neighboring device nodes include one-hop neighboring device nodes and two-hop neighboring device nodes. One-hop neighboring device nodes are those with a direct weighted edge or semantic edge to the device node; two-hop neighboring device nodes are those with a direct weighted edge or semantic edge to the one-hop neighboring device node. By aggregating the state information of one-hop and two-hop neighboring device nodes, a wider range of local network context can be obtained, thus providing a more comprehensive understanding of the network state.

[0058] In this embodiment, a graph neural network of a device node is used to conduct multiple rounds of message passing with neighboring device nodes to obtain the status information of each neighboring device node. This status information includes at least one of device type, operating parameters, and network quality indicators, enabling the device node to acquire the status information of one-hop and two-hop neighboring device nodes, thereby perceiving the local network context, such as surrounding online devices, faulty devices, and link quality. The status information of each neighboring device node is weighted and summed according to corresponding weights to obtain a neighbor aggregation feature. This feature is a weighted combination of the status information of each neighboring device node, reflecting the comprehensive status of the current device node's surrounding neighbors. The weights characterize the importance of each neighboring device node's status information; a higher weight indicates greater importance to the current device node. For example, neighboring device nodes with higher communication quality and higher historical linkage frequency have higher weights.

[0059] In this embodiment, the device node acquires its own local data and encodes it into local features. The local data includes at least one of on / off status, load status, and remaining battery power. The local data can be acquired through the device's local sensors, operating system interface, power management module, etc. Encoding the above local data into a local feature vector of a unified dimension enables the device node to incorporate its own state information into the subsequent feature fusion process, thereby generating contextual state information that simultaneously includes its own state and the states of neighboring devices.

[0060] In the specific implementation, the neighbor aggregation features and local features are concatenated to obtain a concatenated feature vector. The concatenation can be achieved by linking the two features end-to-end along their dimensions to form a higher-dimensional feature vector. The concatenated feature vector is then linearly transformed by multiplying it by a preset weight matrix and adding a bias term. This linearly transformed feature vector is then non-linearly activated using activation functions such as ReLU or LeakyReLU to obtain an updated high-dimensional representation vector. This updated high-dimensional representation vector is used as the context state information of the current device node. The context state information includes the local state of the current device node and the state information of its one-hop and two-hop neighbor device nodes, representing a comprehensive representation of the local network context by the device node.

[0061] In this embodiment, each device node at the edge performs multi-round message passing, aggregates neighbor state information, and fuses local features through GNN to generate context state information, enabling each device node to perceive the health status and changes of itself and the surrounding network in real time.

[0062] In some embodiments of this application, step 103, calculating the competence of each device node based on the context state information, may specifically include the following steps: Sub-step S21: Obtain the capability indicators, device type, and function tags of the device nodes; the capability indicators include at least one of real-time computing power, network centrality, and historical stability. Sub-step S22: Construct the node feature vector of the device node from the capability indicators, device type, function label and context status information; Sub-step S23 involves using a graph neural network to perform message passing and aggregation on the node feature vectors, and mapping the device node's suitability.

[0063] In this embodiment, when a control terminal failure is detected and cannot be recovered within a preset time, a decentralized autonomous mode is immediately triggered. This involves calculating the competence of each device node based on context state information to elect a temporary master node. Specifically, the competence of each device node is calculated by combining the context state information obtained through GNN message passing during normal operation with its own capability indicators, device type, and functional tags.

[0064] In specific implementation, the capability indicators, device type, and function tags of the device node are obtained. The capability indicators include at least one of real-time computing power, network centrality, and historical stability. The capability indicators are used to characterize the hardware foundation and network conditions for the device node to assume the coordination function of a temporary master node. In some implementations, the capability indicators may also include the remaining battery power.

[0065] Real-time computing power is read through the device node's local operating system interface, specifically determined by CPU utilization. Lower CPU utilization indicates more available computing resources for coordination and decision-making. Network centrality characterizes the importance of a device node's position in the network topology. Each device node maintains adjacency relationships in the heterogeneous graph structure by listening to heartbeat packets and topology status. Based on these adjacency relationships, the number of shortest paths between each device node and other device nodes is calculated, and the result is used as network centrality. Higher network centrality indicates a more central position in the network, making it more suitable for coordination and decision-making. Historical stability characterizes the historical online reliability of a device node. Each device node calculates historical stability based on its online records, for example, the online rate over the past 24 hours. A higher online rate indicates greater stability and suitability for temporary master node functions. Remaining battery power is read from the device node's local power management module. Higher remaining battery power indicates stronger sustainable power supply capability and suitability for temporary master node functions.

[0066] In this embodiment, capability indicators, device type, function labels, and context state information are constructed as node feature vectors for device nodes. Incorporating context state information into these node feature vectors allows the suitability calculation to consider not only the device node's hardware foundation and functional characteristics but also its ability to perceive the local network state, thus providing a more comprehensive assessment of whether a device node is suitable to assume the role of a temporary master node. A graph neural network is used to perform message passing and aggregation on the node feature vectors, mapping the device node's suitability. The graph neural network includes graph convolutional layers. Each device node uses its node feature vector as input to the graph convolutional layer, performing message passing and aggregation. Through the stacking of multiple graph convolutional layers, each device node can aggregate a wider range of neighbor information, obtaining a high-dimensional representation vector containing the global network context. In the output layer, a fully connected network maps the aggregated high-dimensional representation to a scalar value, i.e., the suitability. The suitability characterizes the device node's ability to assume the coordination function of a temporary master node; a higher suitability indicates that the device node is more suitable to assume the role of a temporary master node.

[0067] This application embodiment outputs the suitability through GNN inference, realizing the dynamic and intelligent evaluation of the ability of each device node to assume the function of a temporary master node when the control end fails. Since GNN can integrate multi-dimensional indicators and coordination capabilities, it can more accurately select the optimal temporary master node, ensuring that the network does not fall into paralysis due to the absence of the control end.

[0068] In some embodiments of this application, step 104, determining a temporary master node from the device nodes based on competence, may specifically include the following steps: Sub-step S31: Broadcast the competence of the device node and receive the competence broadcast by other device nodes. Sub-step S32: Based on the competence of each device node, conduct multiple rounds of consensus negotiation through a consensus algorithm until each device node reaches a consensus on the candidate device node; Sub-step S33: The candidate device node that meets the consensus condition is determined as the temporary master node.

[0069] In this embodiment of the application, after determining the competence of each device node, a temporary master node needs to be elected from each device node according to the competence. The temporary master node replaces the control terminal and takes over the coordination and control decision-making functions of each device to ensure that the network does not become paralyzed due to the absence of the control terminal.

[0070] In the specific implementation, each device node encapsulates its own competence and device identifier into an election message, and broadcasts the election message to neighboring device nodes according to the topological relationship in the heterogeneous graph structure. While broadcasting its own election message, each device node also receives the election messages broadcast by neighboring device nodes and records the competence and device identifier of each device node received. Each device node can obtain the competence information of other device nodes in the network.

[0071] In this embodiment, based on the acquired competence of each device node, multiple rounds of consensus negotiation are conducted through a consensus algorithm until each device node reaches a consensus on the candidate device node. The consensus algorithm is a distributed consensus mechanism. Each device node conducts consensus negotiation based on competence, and after reaching a consensus within a preset number of rounds, a temporary master node is determined.

[0072] In practice, each device node records its highest known competence and its corresponding device identifier. In each round of consensus negotiation, it broadcasts the highest known competence and its corresponding device identifier to its neighboring device nodes. It receives the highest competence and its corresponding device identifier broadcast by its neighboring device nodes and compares the received competence with its own recorded highest competence. If the received competence is higher than its own recorded highest competence, it updates its own recorded highest competence and its corresponding device identifier and forwards the updated result to its neighboring device nodes. If the received competence is lower than its own recorded highest competence, it retains its own record and continues to receive broadcasts from other device nodes. If the received competence is equal to its own recorded highest competence, it determines which device to retain based on its device type priority. After multiple rounds of broadcasting and comparison, each device node reaches a consensus on the device identifier corresponding to the highest competence. When all device nodes reach a consensus on the candidate device nodes, the consensus negotiation ends.

[0073] In this embodiment, candidate device nodes that meet the consensus conditions are determined as temporary master nodes. These temporary master nodes replace the control terminal in controlling the devices and take over the coordination and decision-making functions originally performed by the control terminal. The temporary master node is a candidate device node that meets the consensus conditions. These conditions can be that the temporary master node has the highest competence, is under stable power supply, and is centrally located in the network. Specifically, among all device nodes, this device node has the highest competence, is continuously powered, or has sufficient battery power, and has high network centrality, being located at the center of the network. For example, a smart central control screen is a temporary master node. Smart central control screens typically have high computing power, continuous power supply, a central network location, and high historical stability; therefore, their competence is usually the highest, making them suitable as temporary master nodes.

[0074] This application embodiment determines a temporary master node from the device nodes through consensus, realizing the dynamic and intelligent election of the optimal temporary master node in the event of a control terminal failure. After the temporary master node takes over, it maintains the collaborative work and linkage control between devices, ensuring that the network does not become paralyzed due to the absence of the control terminal.

[0075] In some embodiments of this application, the method further includes: Obtain the current inference error of the graph neural network of the device node, and determine the gradient update amount of the graph neural network model parameters; The gradient update data is encrypted and uploaded to the cloud server. Receive the updated graph neural network model parameters from the cloud server; the cloud server uses this to decrypt and obtain the gradient update amount, and updates the graph neural network model parameters based on the gradient update amount. The graph neural network deployed on the device nodes is updated based on the updated graph neural network model parameters.

[0076] In this embodiment, the graph neural network model is updated based on federated continuous learning. Each device node periodically uploads the locally trained model gradients to the cloud server without uploading the original data. After the cloud server completes the aggregation, it distributes the updated global model parameters of the graph neural network, so that the entire network can continuously adapt to the device and realize the online evolution and continuous adaptation of the graph neural network model.

[0077] In the specific implementation, each device node performs backpropagation locally using the collected data and the error generated by the graph neural network inference to calculate the gradient update of the model parameters. During normal operation, each device node continuously collects local data and performs inference through the deployed graph neural network to obtain the inference result, which includes context state information, fitness, etc. The inference result is compared with the actual result to calculate the inference error. The inference error can be calculated using a loss function, such as mean squared error or cross-entropy loss, which is not specifically limited here. Based on the inference error, the gradient update of the graph neural network model parameters is calculated using the backpropagation algorithm. Specifically, starting from the output layer, the partial derivatives of the loss function with respect to the model parameters of each layer are calculated layer by layer to obtain the gradient update of the model parameters of each layer. The model parameters include the weight matrix and bias terms of the graph convolutional layer, the parameters of the attention mechanism, and the weight matrix and bias terms of the fully connected network of the output layer.

[0078] In this embodiment, each device node encrypts the gradient update amount through a local encryption module and uploads the encrypted gradient update amount to the cloud server. The uploaded content only includes the encrypted gradient update amount and does not include the original data. The encryption method is not limited. The cloud server decrypts the gradient update amount and updates the graph neural network model parameters based on the gradient update amount. Specifically, after receiving the encrypted gradient update amount uploaded by each device node, the cloud server decrypts the gradient update amount, executes a secure aggregation algorithm such as the FedAvg algorithm, and sums all gradient update amounts according to the device data volume to obtain the global gradient update amount. The initial global model parameters it saves are then updated based on the global gradient update amount to obtain the updated graph neural network model parameters. That is, the global gradient update amount can be applied to the current global model parameters according to a preset learning rate to obtain the updated graph neural network model parameters.

[0079] In this embodiment, the cloud server sends the updated graph neural network model parameters to each device node. Each device node receives and loads the updated model parameters sent by the cloud server, updates the locally deployed graph neural network, completes model iteration, and after loading the new parameters, each device node uses the updated graph neural network to continue to perform inference tasks, realizing the online evolution of the entire distribution network GNN model.

[0080] This application embodiment utilizes a federated continuous learning-based graph neural network model update mechanism. Each device node loads new model parameters to complete model iteration, resulting in an updated global graph neural network, thus achieving continuous evolution and adaptation of the GNN model.

[0081] In some embodiments of this application, step 104, after determining the temporary master node from the device nodes based on competence, may further include: The failure status of the control terminal is injected into the topology graph as an input feature. The failure probability of each hop neighbor device node is calculated, and the propagation path with a failure probability exceeding a preset threshold is identified as a risk path. Based on the risk path, alternative relay nodes are selected from the device nodes; Construct a multi-hop path from the temporary master node, the alternative relay node, and the target device node to be controlled; Based on multi-hop paths, the topology of the devices is updated so that the linkages corresponding to the risk paths are executed via multi-hop paths.

[0082] In this embodiment, the temporary master node takes over the coordination and decision-making functions originally undertaken by the control terminal. The temporary master node performs fault propagation prediction based on the heterogeneous graph structure, identifies high-risk paths that may be caused by the continuous failure of the control terminal, and actively reconstructs the communication topology to ensure that critical linkages are not interrupted.

[0083] In the specific implementation, the temporary master node, based on the current topology, injects the failure state of the control terminal as input features into the heterogeneous graph structure. Through multi-layer message passing of the graph neural network, it simulates the spread of the fault in the network and calculates the failure probability of each hop neighboring device node due to the loss of the control terminal, thereby identifying risky paths. Specifically, the node corresponding to the control terminal is marked as the failure state. Starting from the failed control terminal node, the GNN passes failure information to the neighboring device nodes layer by layer. In each layer of message passing, the neighboring device node calculates its own failure probability due to the loss of the control terminal based on the connection relationship with the control terminal node, communication quality, functional dependency relationship, etc.

[0084] In this embodiment, after calculating the failure probability of each hop neighboring device node, propagation paths with failure probabilities exceeding a preset threshold are identified as risk paths. The preset threshold can be set according to the actual scenario, such as 0.7, 0.8, etc. For example, the interruption of the communication link between the smart door lock and the alarm will directly affect the security linkage. This link is identified as a risk path. Specifically, if the link from the door lock to the alarm is interrupted due to a control terminal failure, the door lock cannot forward the door opening signal to the alarm via the control terminal, resulting in the failure of the security linkage. This path is identified as a risk path.

[0085] In this embodiment, the temporary master node selects alternative relay nodes from the device nodes based on the node importance score output by the graph neural network. These alternative relay nodes are used to replace failed nodes or links in the risk path. During the fault propagation prediction process, the graph neural network simultaneously outputs the node importance of each device node. The node importance characterizes the ability and importance of a device node to perform relay forwarding functions in the network. Node importance can be determined based on at least one of the following factors: network centrality, real-time computing power, historical stability, power supply status, and communication quality. Based on the node importance, alternative relay nodes are selected from the device nodes.

[0086] In practice, the temporary master node, the substitute relay node, and the target device node to be controlled are connected sequentially according to their communication relationships to construct a multi-hop path. The multi-hop path is the communication path from the temporary master node through the substitute relay node to the target device node. For example, if the link from the door lock to the alarm is interrupted, the temporary master node constructs a multi-hop path: from the door lock to the smart light fixture to the alarm fixture. The door lock sends the door opening signal to the smart light fixture, and the smart light fixture forwards the signal to the alarm fixture, thereby restoring the security linkage path.

[0087] In this embodiment, the temporary master node updates the topology of the devices based on the constructed multi-hop paths, enabling the linkages corresponding to risky paths to be executed via these multi-hop paths. The temporary master node proactively reconstructs the communication topology by broadcasting updates to the routing table and GNN edge weights. Specifically, it writes the multi-hop paths into the routing tables of each device node, making each device node aware of the new communication paths, adjusting the edge weights of relevant edges in the heterogeneous graph structure to reflect the new communication relationships, adjusting the linkage rules at the semantic layer, and migrating critical tasks to stable nodes. After updating the topology, the linkages corresponding to risky paths are executed via the multi-hop paths. For example, if the link from the door lock to the alarm is interrupted, the door lock's opening signal is forwarded to the alarm via the smart light fixture, and the security linkage is restored.

[0088] In some embodiments of this application, step 104, after determining the temporary master node from the device nodes based on competence, may further include: The feature vectors of semantic nodes are used as constraints to embed into a preset loss function to obtain the constraint conditions. With the optimization objectives of minimizing response latency, minimizing energy consumption, and maximizing linkage success rate, the operating parameters of the target device node that meet the constraints are determined, and the target device node is controlled according to the operating parameters.

[0089] In this embodiment, the temporary master node performs multi-objective optimization for user experience quality through a graph neural network. While meeting user comfort constraints, it optimizes response latency, energy consumption, and linkage success rate, thereby maintaining or even improving the user experience during control terminal failures.

[0090] In the specific implementation, the temporary master node embeds the feature vectors of the semantic nodes as constraints into a preset loss function to obtain the constraints required for multi-objective optimization. The semantic nodes include scene mode nodes and / or environment state nodes. Scene mode nodes include sleep mode nodes, away-from-home mode nodes, movie-watching mode nodes, etc., and environment state nodes include indoor light intensity nodes, etc. The feature vectors of the above semantic nodes are embedded as constraints into the preset loss function, and the feature vectors of the semantic nodes are converted into constraint terms in the loss function, so that the optimization process is carried out under the premise of satisfying the constraints.

[0091] In this embodiment, the temporary master node optimizes by minimizing response latency, minimizing energy consumption, and maximizing linkage success rate. It determines the operating parameters of the target device node that meet the constraints through graph neural network inference and controls the target device node according to the operating parameters. Minimizing response latency is used to make the response time of the device to the control command as short as possible. Minimizing energy consumption reduces the possibility of the overall network being exhausted, extends the battery life of battery-powered devices, and reduces energy consumption. Maximizing linkage success rate makes the probability of successful linkage between devices as high as possible, ensuring that critical linkages are not interrupted.

[0092] In practical implementation, the graph neural network (GNN) optimizes multiple objectives simultaneously during inference. It obtains optimal device operating parameters through Pareto front search, searching for Pareto optimal solutions in the multi-objective space. From these Pareto optimal solutions, the solution that satisfies the constraints and has the best overall performance is selected as the operating parameters for the target device node. The target device node is then controlled according to these operating parameters. For example, in sleep mode, the GNN obtains optimal operating parameters through multi-objective optimization: lowering the air conditioner fan speed and dimming the lights. While meeting the light intensity limits, temperature range, and noise thresholds of the sleep mode node, it reduces the air conditioner compressor frequency and dims lights in unnecessary areas. It should be noted that the above is only a specific example. This process is not limited to sleep mode but can also be extended to other semantic nodes such as away-from-home mode, movie-watching mode, and indoor light intensity, enabling the GNN to output self-optimizing strategies that meet user expectations in different scenarios, improving user experience quality and network energy efficiency.

[0093] This application embodiment uses multi-objective optimization to enable the temporary master node to optimize response latency, energy consumption, and linkage success rate while meeting user comfort constraints during control terminal failures, determine the optimal device operating parameters, and perform linkage control on the device, thereby realizing a self-optimization strategy oriented towards user experience quality.

[0094] In some embodiments of this application, step 105, in response to detecting that the control terminal has returned to normal, switching back from the temporary master node to the control terminal to control each device, may specifically include the following steps: Sub-step S41: In response to detecting that the control terminal has returned to normal, the device topology and / or graph neural network model parameters updated during the temporary master node takeover will be synchronized to the control terminal. Sub-step S42: Switch back from the temporary master node to the control terminal so that each device node can be centrally controlled by the control terminal again.

[0095] In this embodiment, in response to the detection that the control terminal has restored normal connectivity, the temporary master node synchronizes the updated device topology and / or graph neural network model parameters it carried out during the takeover of coordination and decision-making functions to the control terminal, so that the control terminal can obtain the latest changes in network status and model during the autonomous mode. The detection method for the control terminal restoring normal connectivity may include at least one of the following: the control terminal periodically broadcasts heartbeat packets, and each device node determines that the control terminal has restored normal connectivity upon receiving the heartbeat packets; the control terminal actively initiates connection reconstruction requests to each device node, and each device node determines that the control terminal has restored normal connectivity upon responding; the cloud server, after detecting that the control terminal has returned to online status, broadcasts a control terminal restoration notification to each device node.

[0096] In this embodiment, during the period when the temporary master node takes over the coordination and decision-making functions, it may perform fault propagation prediction and topology reconstruction, resulting in changes to the device topology relationships. Each device node continuously performs federated continuous learning, causing changes to the graph neural network model parameters. The updated device topology during the temporary master node's takeover includes communication topology, routing tables, and GNN edge weights. Therefore, the temporary master node synchronizes the aforementioned device topology and / or model parameters to the control terminal. Specifically, this can be achieved by the temporary master node uploading the device topology and / or model parameters to a cloud server, which then synchronizes them to the control terminal.

[0097] In this embodiment, the updated device topology and / or model parameters during the temporary master node takeover are synchronized to the control terminal, enabling the control terminal to obtain the latest changes in network status and model during the autonomous mode. This provides a data foundation for a smooth switch back to centralized control mode, avoiding information inconsistencies caused by topology changes or model updates. The switch from the temporary master node back to the control terminal allows each device node to resume centralized control by the control terminal.

[0098] In this embodiment, after the control terminal returns to normal, the autonomous mode that takes over the coordination and decision-making functions from the temporary master node smoothly switches back to the centralized control mode of the control terminal, realizing a seamless closed-loop operation from centralized control to edge autonomy and then to centralized management.

[0099] Reference Figure 2 This diagram illustrates a structural block diagram of a device control apparatus provided in an embodiment of this application. The apparatus is applied to a device, which is pre-controlled centrally by a control terminal. Each device node on the device is equipped with a graph neural network, and may specifically include the following modules: The first acquisition module 201 is used to acquire a topology map of devices in a preset home environment; the topology map includes device nodes and semantic nodes, and the semantic nodes are used to represent semantic information that affects device control; Processing module 202 is used to perform multiple rounds of message passing between the device node and its corresponding neighboring device node through the graph neural network based on the topology graph to obtain the context state information of each device node; The first determining module 203 is used to determine the suitability of each device node based on the context state information in response to detecting a fault in the control terminal. The second determining module 204 is used to determine a temporary master node from the device nodes based on the competence; the temporary master node is used to replace the control terminal to control each device. The first control module 205 is used to switch back from the temporary master node to the control terminal to control each device in response to detecting that the control terminal has returned to normal.

[0100] Optionally, the device further includes: The third determining module is used to treat the devices in the home environment as device nodes, and the ambient light, current time period and scene mode as semantic nodes respectively. The first creation module is used to establish weighted edges between communication-reachable device nodes based on the communication reachability and historical linkage frequency between the device nodes. The second creation module is used to establish semantic edges between device nodes and semantic nodes that have functional dependencies, based on the functional dependency relationship between the device nodes and the semantic nodes. The topology module is used to construct a heterogeneous graph structure from the device nodes, the semantic nodes, the weighted edges, and the semantic edges to obtain the topology graph of the device.

[0101] Optionally, the processing module 202 includes: The first determining submodule is used to determine the neighboring device nodes corresponding to the device node based on the communication reachability and / or functional dependencies represented in the topology graph; The message passing submodule is used to perform multiple rounds of message passing with the neighboring device nodes through the graph neural network of the device node to obtain the status information of each neighboring device node; the status information includes at least one of device type, operating parameters, and network quality indicators. The first processing submodule is used to weight and fuse the state information of each neighboring device node according to the corresponding weights to obtain the neighbor aggregation feature; The second processing submodule is used to acquire local data of the device node and encode the local data into local features; the local data includes at least one of switch status, load status, and remaining power. The third processing submodule is used to concatenate the neighbor aggregation features with the local features, and perform linear transformation and nonlinear activation on the concatenated features to obtain the context state information of the device node.

[0102] Optionally, the first determining module 203 includes: The acquisition submodule is used to acquire the capability indicators, device type, and function tags of the device node; the capability indicators include at least one of real-time computing power, network centrality, and historical stability. A construction submodule is used to construct the node feature vector of the device node from the capability indicators, the device type, the function tags and the context state information; The mapping submodule is used to perform message passing and aggregation on the node feature vectors through the graph neural network, and map the suitability of the device node.

[0103] Optionally, the second determining module includes: The broadcast submodule is used to broadcast the competence of the device node and to receive competence broadcast by other device nodes. The negotiation submodule is used to conduct multiple rounds of consensus negotiation based on the competence of each device node through a consensus algorithm until each device node reaches a consensus on the candidate device node. The second determination submodule is used to determine the candidate device nodes that meet the consensus conditions as the temporary master node.

[0104] Optionally, the device further includes: The second acquisition module is used to acquire the current inference error of the graph neural network of the device node and determine the gradient update amount of the graph neural network model parameters. The upload module is used to encrypt and upload the gradient update amount to the cloud server; The receiving module is used to receive the updated graph neural network model parameters sent by the cloud server; the cloud server is used to decrypt to obtain the gradient update amount, and update the graph neural network model parameters based on the gradient update amount. The first update module is used to update the graph neural network deployed on the device node based on the updated graph neural network model parameters.

[0105] Optionally, the device further includes: The path identification module is used to inject the failure status of the control terminal as input features into the topology graph, calculate the failure probability of each hop neighbor device node, and identify the propagation path with the failure probability exceeding a preset threshold as a risk path. The fourth determining module is used to select alternative relay nodes from the device nodes based on the risk path; The path construction module is used to construct a multi-hop path for the temporary master node, the alternative relay node and the target device node to be controlled; The second update module is used to update the topology of the devices based on the multi-hop path, so that the linkage corresponding to the risk path is executed through the multi-hop path.

[0106] Optionally, the device further includes: The constraint module is used to embed the feature vector of the semantic node as a constraint into a preset loss function to obtain the constraint conditions. The second control module is used to determine the operating parameters of the target device node that meet the constraints with the optimization objectives of minimizing response delay, minimizing energy consumption and maximizing linkage success rate, and to control the target device node according to the operating parameters.

[0107] Optionally, the first control module includes: A synchronization submodule is used to synchronize the device topology and / or graph neural network model parameters updated during the temporary master node takeover to the control terminal in response to detecting that the control terminal has returned to normal. The control submodule is used to switch back from the temporary master node to the control terminal, so that each of the device nodes can resume centralized control by the control terminal.

[0108] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0109] This application embodiment deploys a graph neural network on each device node and obtains context state information through multi-round message passing based on the topology graph when the control terminal fails. This determines the suitability of each device node and elects a temporary master node. By dynamically evaluating the suitability of each device node based on multi-dimensional information, intelligent and dynamic temporary master node election is achieved. When the control terminal fails, the temporary master node takes over the coordination and decision-making functions, enabling devices to maintain collaborative work and linkage control. After the control terminal recovers, a seamless closed-loop operation is completed from centralized control to edge autonomy and then to centralized management, improving the reliability and intelligence level of smart home devices and further enhancing the user experience.

[0110] Reference Figure 3 This application also provides an electronic device, such as... Figure 3 As shown, it includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304. Memory 303 is used to store computer programs; When processor 301 executes a program stored in memory 303, it performs the following steps: Obtain a topology map of devices in a preset home environment; the topology map includes device nodes and semantic nodes, and the semantic nodes are used to represent semantic information that affects device control; Based on the topology graph, the graph neural network is used to perform multiple rounds of message passing between the device node and its corresponding neighboring device nodes to obtain the context state information of each device node. In response to the detection of a control terminal failure that has not been resolved within a preset time period, the competence of each device node is determined based on the context state information. A temporary master node is determined from the device nodes based on the competence rating, and the temporary master node is used to replace the control terminal to control each device. In response to the detection that the control terminal has returned to normal, the system switches back from the temporary master node to the control terminal to control each device.

[0111] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described production process adjustment method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0112] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0113] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, EEPROM, Flash, and eMMC, etc.) containing computer-usable program code.

[0114] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0117] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0118] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0119] The above provides a detailed description of a production process adjustment method and a production process adjustment device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A device control method, characterized in that, Applied to the device side, where the device side is pre-controlled centrally by a control terminal, and each device node of the device side is deployed with a graph neural network, the method includes: Obtain a topology map of devices in a preset home environment; the topology map includes device nodes and semantic nodes, and the semantic nodes are used to represent semantic information that affects device control; Based on the topology graph, the graph neural network is used to perform multiple rounds of message passing between the device node and its corresponding neighboring device nodes to obtain the context state information of each device node. In response to the detection of a control terminal failure that has not been resolved within a preset time period, the competence of each device node is determined based on the context state information. A temporary master node is determined from the device nodes based on the competence rating, and the temporary master node is used to replace the control terminal to control each device. In response to the detection that the control terminal has returned to normal, the system switches back from the temporary master node to the control terminal to control each device.

2. The method according to claim 1, characterized in that, Before obtaining the topology map of devices in a preset home environment, the process also includes: The devices in the home environment are used as device nodes, and the ambient light, current time period and scene mode are used as semantic nodes respectively. Based on the communication reachability and historical linkage frequency between the device nodes, a weighted edge is established between the communication reachable device nodes; Based on the functional dependency relationship between the device node and the semantic node, a semantic edge is established between the device node and the semantic node that have functional dependency. By constructing a heterogeneous graph structure from the device nodes, semantic nodes, weighted edges, and semantic edges, a topology graph of the device is obtained.

3. The method according to claim 1 or 2, characterized in that, Based on the topology graph, the graph neural network is used to perform multiple rounds of message passing between the device nodes and their corresponding neighboring device nodes to obtain the context state information of each device node, including: Based on the communication reachability and / or functional dependencies represented in the topology graph, the neighboring device nodes corresponding to the device node are determined; The device node uses a graph neural network to perform multiple rounds of message passing with its neighboring device nodes to obtain the status information of each neighboring device node; the status information includes at least one of device type, operating parameters, and network quality indicators. The state information of each neighboring device node is weighted and fused according to its corresponding weight to obtain the neighbor aggregation feature; Acquire local data of the device node and encode the local data into local features; the local data includes at least one of switch status, load status, and remaining power. The neighbor aggregation feature is concatenated with the local feature, and the concatenated feature is subjected to linear transformation and nonlinear activation to obtain the context state information of the device node.

4. The method according to claim 1, characterized in that, The step of calculating the suitability of each device node based on the context state information includes: Obtain the capability indicators, device type, and function tags of the device node; the capability indicators include at least one of real-time computing power, network centrality, and historical stability. The capability indicators, device type, function tags, and context state information are used to construct the node feature vector of the device node; The graph neural network is used to perform message passing and aggregation on the node feature vectors, and the suitability of the device node is obtained by mapping.

5. The method according to claim 1, characterized in that, The step of determining a temporary master node from the device nodes based on the competence includes: Broadcast the competence of the device node, and receive the competence broadcast by other device nodes; Based on the competence of each device node, multiple rounds of consensus negotiation are conducted through a consensus algorithm until each device node reaches a consensus on the candidate device node. Candidate device nodes that meet the consensus criteria are designated as the temporary master nodes.

6. The method according to claim 1, characterized in that, The method further includes: Obtain the current inference error of the graph neural network of the device node, and determine the gradient update amount of the graph neural network model parameters; The gradient update amount is encrypted and uploaded to the cloud server; The system receives updated graph neural network model parameters from the cloud server; the cloud server decrypts the gradient update amount and updates the graph neural network model parameters based on the gradient update amount. The graph neural network deployed on the device node is updated based on the updated graph neural network model parameters.

7. The method according to claim 1, characterized in that, After determining the temporary master node from the device nodes based on the competence, the method further includes: The failure status of the control terminal is injected into the topology graph as an input feature. The failure probability of each hop neighbor device node is calculated, and the propagation path with the failure probability exceeding a preset threshold is identified as a risk path. Based on the risk path, alternative relay nodes are selected from the device nodes; Construct a multi-hop path using the temporary master node, the alternative relay node, and the target device node to be controlled; Based on the multi-hop path, the topology of the devices is updated so that the linkage corresponding to the risk path is executed through the multi-hop path.

8. The method according to claim 1, characterized in that, After determining the temporary master node from the device nodes based on the competence, the method further includes: The feature vectors of the semantic nodes are used as constraints to embed a preset loss function to obtain the constraint conditions. With the optimization objectives of minimizing response latency, minimizing energy consumption, and maximizing linkage success rate, the operating parameters of the target device node that meet the constraints are determined, and the target device node is controlled according to the operating parameters.

9. The method according to claim 1, characterized in that, The response to detecting that the control terminal has returned to normal, switching back from the temporary master node to the control terminal to control each device includes: In response to the detection that the control terminal has returned to normal, the device topology and / or graph neural network model parameters updated during the temporary master node takeover will be synchronized to the control terminal. Switching back from the temporary master node to the control terminal allows each device node to resume centralized control from the control terminal.

10. A device control apparatus, characterized in that, Applied to the device side, wherein the device side is pre-controlled centrally by a control terminal, and each device node of the device side is deployed with a graph neural network, the device includes: The first acquisition module is used to acquire a topology map of devices in a preset home environment; the topology map includes device nodes and semantic nodes, and the semantic nodes are used to represent semantic information that affects device control; The processing module is used to perform multiple rounds of message passing between the device node and its corresponding neighboring device node through the graph neural network based on the topology graph to obtain the context state information of each device node. The first determining module is used to determine the suitability of each device node based on the context state information in response to the detection of a fault in the control terminal. The second determining module is used to determine a temporary master node from the device nodes based on the competence; the temporary master node is used to replace the control terminal to control each device; The first control module is used to switch back from the temporary master node to the control terminal to control each device in response to the detection that the control terminal has returned to normal.

11. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-9.

12. A computer-readable medium, characterized in that, It stores instructions that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-9.