A multi-channel-based smart home device adaptive control method and device

By employing hysteresis channel selection and cross-channel idempotency identification mechanisms in smart home systems, the stability and consistency issues in multi-channel control are resolved, achieving end-to-end instruction execution consistency and improving user experience.

CN121325636BActive Publication Date: 2026-07-21XIAMEN LEELEN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAMEN LEELEN TECH CO LTD
Filing Date
2025-11-13
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing smart home systems suffer from problems such as frequent switching due to network fluctuations, lack of a unified cross-channel identification system, and difficulty in ensuring consistency of end-to-end control results in multi-channel control, which affect system stability and user experience.

Method used

An adaptive control method for smart home devices based on multiple channels is adopted. The control channel with the best health status is dynamically selected through a hysteresis channel selection algorithm, a unique idempotent identifier is generated across channels, and a consistency table mechanism is used to ensure that the instruction is executed only once in any channel. The system listens for acknowledgments and switches to a backup channel to resend the instruction in case of failure.

Benefits of technology

It effectively solves the stability and consistency problems in multi-channel control, reduces the rate of repeated execution, improves the stability and success rate of the control process, ensures end-to-end instruction execution consistency, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121325636B_ABST
    Figure CN121325636B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on multi-channel's smart home equipment adaptive control method and device, comprising: receiving the device control instruction request initiated by user through smart home application;According to the device control instruction request, the health state data of each control channel is obtained;Based on the health state data, current control channel is selected from the control channel by hysteresis channel selection algorithm;For the device control instruction request, cross-channel unique idempotent identification is generated, the idempotent identification is associated with the device control instruction request and is stored to consistency table;The device control instruction request is sent to target equipment for control by the current control channel carrying the idempotent identification, and the execution receipt of target equipment is listened to;If the execution receipt is received and the idempotent identification is matched, then enter receipt processing procedure;Otherwise, switch to standby control channel and resend the device control instruction request using the same idempotent identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart home technology, and in particular to an adaptive control method and device for smart home devices based on multi-channel technology. Background Technology

[0002] With the rapid development of the Internet of Things (IoT) and the smart home industry, the number of various smart devices in homes (such as gateways, smart lights, air conditioners, cameras, door locks, etc.) is constantly increasing, and the communication methods and control channels between devices are becoming increasingly diversified. Remote or local control of devices via smart home apps has become the mainstream interaction method. Currently, smart home systems generally adopt a multi-channel control architecture that combines cloud channels, local area network (LAN) channels, and infrared channels, aiming to integrate the convenience of remote control and local operation, and improve response speed and system reliability. Specifically, the cloud channel relies on the internet for remote control, the LAN channel supports direct local communication, and the infrared channel is used for compatibility with traditional non-networked devices. This architecture has undergone technological evolution from single-cloud control to dual-channel complementarity, and then to multi-channel integration, significantly enhancing the system's adaptability.

[0003] However, in practical applications, although multi-channel control has made some progress and the industry has proposed various optimization ideas, existing solutions still have significant limitations. For example, systems often rely on simple priority or shortest delay when selecting channels, which can easily lead to frequent switching due to network fluctuations, affecting control stability; idempotent control mechanisms are often limited to the single-channel level, lacking a unified identification system across channels, and cannot effectively prevent duplicate command execution; furthermore, due to inherent differences in communication mechanisms and feedback capabilities among different channels (e.g., infrared channels lack direct feedback), the system struggles to ensure end-to-end consistency of control results. These shortcomings collectively restrict the stability and consistency of smart home systems in real-world, complex network environments, affecting the reliability of multi-channel control systems and user experience. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide an adaptive control method, device, system, and computer program product for smart home devices based on multi-channel technology, in order to solve the above-mentioned problems.

[0005] To achieve the above objectives, the present invention provides an adaptive control method for smart home devices based on multi-channel technology, the method comprising:

[0006] Receive device control command requests initiated by users through smart home applications;

[0007] The device control command requests the acquisition of health status data for each control channel, and the channel types of the control channels include cloud channels, local area network channels, and infrared channels.

[0008] Based on the health status data, the current control channel is selected from the control channels using a hysteresis channel selection algorithm;

[0009] Generate a cross-channel unique idempotent identifier for the device control command request, and associate the idempotent identifier with the device control command request and store it in a consistency table;

[0010] The device control command request carrying the idempotency identifier is sent to the target device through the current control channel for control, and the execution receipt of the target device is listened for.

[0011] If an execution receipt is received and the idempotency identifier matches, the receipt processing procedure is initiated; otherwise, the status of the current control channel is updated and switched to the backup control channel, and the device control command request is resent using the same idempotency identifier until an execution receipt is received or all control channels fail to execute.

[0012] Preferably, the health status data includes a health score and health indicators; the step of requesting to obtain the health status data of each control channel according to the device control command includes:

[0013] A health score and a health indicator are calculated based on the evaluation indicators of each control channel, including round-trip delay, jitter, packet loss rate, availability status, and authentication status; wherein the health indicator includes a good, degraded, or unavailable status.

[0014] Preferably, the step of selecting the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm includes:

[0015] The hysteresis channel selection algorithm uses the setting of the upper cut-off threshold, the lower cut-off threshold, and the hold time as hysteresis parameters;

[0016] When the health score of the control channel is determined to be higher than the cut-off threshold and the stabilization time exceeds the hold time, the corresponding control channel is designated as the current control channel.

[0017] Preferably, the step of generating a cross-channel unique idempotent identifier for the device control command request, and associating the idempotent identifier with the device control command request and storing it in a consistency table, includes:

[0018] Based on the user identifier, device identifier, instruction action digest, timestamp, and random number, the idempotent identifier is generated by using a hash algorithm, UUIDv7 combined with session salt, or a serial number signed by the device public key, and a valid lifespan is set for the idempotent identifier.

[0019] The idempotency identifier is associated with the device control command request and stored in the consistency table to generate a new record, and the record status corresponding to the device control command request is marked as pending execution; wherein, the consistency table includes an idempotency identifier, a device identifier, a channel type, a sending timestamp, a receipt timestamp, a record status, and a result summary, and the record status includes pending execution, executed, or execution failed.

[0020] Preferably, the step of sending the device control command request carrying the idempotency identifier to the target device through the current control channel for control, and listening for the execution receipt of the target device, includes:

[0021] When the current control channel is a cloud channel, the cloud channel is invoked to publish the device control command request containing the idempotency identifier to the MQTT topic of the target device, and wait for the execution receipt returned by the cloud or the target device. The execution receipt includes the corresponding idempotency identifier and the execution result status.

[0022] When the current control channel is a local area network (LAN) channel, the LAN channel is invoked to send the instruction message containing the device control instruction request with the idempotency identifier to the LAN address port of the target device via UDP, and wait for the target device to reply with an acknowledgment or status message via UDP.

[0023] When the current control channel is the infrared channel, the infrared channel is invoked to generate the corresponding infrared encoding sequence according to the device control command request, and the infrared emitting diode is controlled to send it to the target device, and a proxy receipt is fed back through the gateway.

[0024] Preferably, the receipt processing procedure includes:

[0025] The consistency table is queried based on the idempotency identifier in the execution receipt. If the record status corresponding to the idempotency identifier is pending execution, the execution receipt is treated as a valid receipt, the record status is updated to executed, and the successful execution of the device control command request is confirmed.

[0026] If the record status corresponding to the idempotent flag is "executed", then the execution receipt is treated as an invalid receipt and ignored.

[0027] Preferably, the step of switching to the backup control channel and retransmitting the device control command request using the same idempotent identifier includes:

[0028] The backup control channel is selected according to a preset degradation sequence and the corresponding health score is evaluated; wherein, the preset degradation sequence is, in order, cloud channel, local area network channel and infrared channel;

[0029] When the health score is lower than the cut-off threshold and the duration exceeds the hold time, switch to the backup control channel where the health score is higher than the cut-off threshold, and resend the device control command request using the same idempotent identifier.

[0030] To achieve the above objectives, the present invention also provides a multi-channel-based adaptive control device for smart home devices, the device comprising:

[0031] The request receiving unit is used to receive device control command requests initiated by users through smart home applications.

[0032] A health assessment unit is used to request health status data of each control channel according to the device control command. The channel types of the control channels include cloud channels, local area network channels, and infrared channels.

[0033] A channel selection unit is used to select the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm.

[0034] The identifier generation unit is used to generate a cross-channel unique idempotent identifier for the device control command request, and associate the idempotent identifier with the device control command request and store it in a consistency table;

[0035] The control unit is used to send a device control command request carrying the idempotency identifier to the target device through the current control channel for control, and to listen for the execution receipt of the target device;

[0036] The receipt unit is used to enter the receipt processing flow if an execution receipt is received and the idempotency identifier matches; otherwise, it updates the status of the current control channel and switches to the backup control channel and resends the device control command request using the same idempotency identifier until an execution receipt is received or all control channels fail to execute.

[0037] To achieve the above objectives, the present invention also proposes a smart home device control system, the system comprising:

[0038] The user interface module is used to receive user control operations, generate device control command requests, and send the device control command requests to the control command scheduling module.

[0039] The channel health assessment module is used to monitor and assess the health status of each control channel, and outputs health status data including health score and health flag to the hysteresis state machine channel selection module. The control channels include cloud channels, local area network channels and infrared channels. The health score is calculated based on the assessment indicators of round-trip delay, jitter, packet loss rate, availability status and authentication status of each control channel.

[0040] The hysteresis state machine channel selection module is used to select the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm, and send the selected current control channel to the control command scheduling module. The hysteresis channel selection algorithm suppresses frequent switching of control channels by setting an upper cut-off threshold, an lower cut-off threshold, and a hold time.

[0041] The idempotency identifier generation module is used to generate a cross-channel unique idempotency identifier for the device control command request and send it to the control command scheduling module, and associate the idempotency identifier with the device control command request and store it in the consistency table module;

[0042] The control command scheduling module is used to coordinate the execution flow of the device control command request based on the received device control command request, the current control channel, and the idempotency flag, and to send the device control command request to the corresponding channel control module according to the selected current control channel.

[0043] The channel control module is used to send a device control command request carrying the idempotency identifier to the target device through the current control channel, and to listen for the execution receipt of the target device. The channel control module includes a cloud channel control module, a local area network channel control module, and an infrared channel control module.

[0044] The consistency table module is used to manage and verify the idempotency identifier and the execution status of the corresponding device control command request.

[0045] To achieve the above objectives, the present invention also proposes a multi-channel-based adaptive control device for smart home devices, comprising a processor, a memory, and a computer program stored in the memory, wherein the computer program is executed by the processor to implement the steps of the multi-channel-based adaptive control method for smart home devices as described in the above embodiments.

[0046] To achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a computer program that is executed by a processor to implement the steps of a multi-channel-based adaptive control method for smart home devices as described in the above embodiments.

[0047] To achieve the above objectives, the present invention also proposes a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of a multi-channel-based adaptive control method for smart home devices as described in the above embodiments.

[0048] Beneficial effects:

[0049] The above solution effectively addresses stability and consistency issues in multi-channel control by integrating channel health assessment, hysteresis selection, cross-channel idempotency identification, and consistency reconciliation mechanisms. This solution uses dynamic acquisition of channel health status combined with hysteresis algorithms for intelligent routing, effectively avoiding frequent channel switching caused by network jitter, reducing the channel switching frequency, and significantly improving the stability of the control process. Through a unified cross-channel idempotency identification and consistency table mechanism, it ensures that the same instruction is executed only once in any channel, reducing the rate of duplicate execution and fundamentally eliminating duplicate operations and state errors. By listening for acknowledgments and switching to backup channels for retrying as needed in case of failure, the success rate of control under weak network and abnormal environments is greatly enhanced. This solution enables the system to maintain stable and reliable operation in weak network and multi-channel environments, achieving end-to-end instruction execution consistency assurance and improving user experience.

[0050] By comprehensively weighting indicators such as round-trip latency, jitter, packet loss, availability, and authentication status, the channel health assessment becomes more accurate and comprehensive. The multi-dimensional assessment mechanism can reflect the true quality status of the channel in real time, avoiding the one-sidedness of assessment based on a single indicator (such as latency). This provides a reliable basis for subsequent channel selection, significantly improving the accuracy and robustness of channel selection, and indirectly enhancing the stability and security of the overall control process.

[0051] By employing a hysteresis channel selection algorithm and setting key parameters such as the up-cut threshold (T_up), down-cut threshold (T_down), and hold time (T_hold), a channel switching decision mechanism is established. This mechanism ensures that channel switching has both clear triggering conditions and a necessary stability maintenance period. In scenarios with weak networks or frequent jitter, this mechanism can maintain the continuous use of currently available channels, avoiding hasty degradation to less efficient channels due to instantaneous performance decline, thereby improving control success rate and response continuity. At the same time, it ensures timely switching when channel quality truly deteriorates, improving user experience.

[0052] By employing multiple encryption algorithms (hash algorithms, UUIDv7+ session salt, and device public key signatures) to generate globally unique idempotent identifiers and setting TTL constraints, the unforgeability and timeliness of idempotent identifiers are ensured from the source. This guarantees the global uniqueness and cross-channel consistency of the idempotent identifiers, keeping them unchanged during retries and degradation processes, providing a reliable foundation for end-to-end deduplication and reconciliation. The introduction of an effective lifespan enables automatic cleanup of expired records, avoiding long-term occupation of memory or storage resources and optimizing system operating efficiency. Combined with the structured storage of the consistency table (containing multiple fields), it provides complete data support for subsequent receipt reconciliation, which is a key support for ensuring the uniqueness of instruction execution and state consistency.

[0053] Different communication methods are adopted to address the characteristics of different channels. For example, the cloud channel uses MQTT to ensure remote reliability, while the LAN channel achieves low-latency direct connection via UDP. In particular, the gateway proxy receipt solves the problem of unreliability in the infrared channel. For the cloud and LAN channels, reliable transmission of commands and accurate acquisition of receipts are ensured, allowing idempotency flags to be correctly returned with the receipts, providing necessary input for consistency table reconciliation. For the infrared channel, the traditional one-way communication mode cannot provide feedback on execution results. This solution requires the gateway to generate proxy receipts immediately after sending infrared signals, incorporating IR control into a unified idempotency framework. This enables the reliability of IR commands, allowing the status of infrared devices to be tracked and synchronized, avoiding duplicate transmissions and status inconsistencies caused by lack of feedback, and significantly improving the reliability of infrared control and user experience.

[0054] Based on the consistency table query results, the system distinguishes between first-time valid receipts and duplicate / late receipts. A "first-come, first-served" strategy is implemented for multi-channel receipts to eliminate inconsistencies between the App and device states, preventing repeated device state updates or accidental operations, thus ensuring end-to-end state consistency. This mechanism significantly reduces the complexity of upper-layer business logic, minimizes unnecessary UI updates and state synchronization overhead, and improves overall system efficiency. Simultaneously, the explicit ignore policy for invalid receipts enhances the system's resistance to replay attacks, as forged or replayed receipts will fail state verification, thereby ensuring the security of control commands.

[0055] By employing a dual approach of pre-defined degradation sequences (Cloud→LAN→IR) and switching conditions corresponding to health scores, the degradation process is ensured to be orderly and reliable. This guarantees that the system prioritizes the use of fast-responding and highly reliable channels (such as LAN), only degrading to channels with higher latency or unidirectional transmission (such as infrared) when necessary. This optimizes the user experience while maintaining a high control success rate. This orderly degradation mechanism significantly improves the system's robustness and availability when some channels fail or the network is abnormal, enabling smart home control to maintain strong adaptability and recovery capabilities even in complex network environments. Attached Figure Description

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

[0057] Figure 1 This is a flowchart illustrating an adaptive control method for smart home devices based on multiple channels, as provided in an embodiment of the present invention.

[0058] Figure 2 This is a schematic diagram of the overall architecture of a smart home device control system provided in an embodiment of the present invention.

[0059] Figure 3 This is a schematic diagram of the overall process of controlling smart home devices according to an embodiment of the present invention.

[0060] Figure 4 This is a schematic diagram of the structure of a multi-channel-based adaptive control device for smart home devices, provided in an embodiment of the present invention.

[0061] The realization of the invention's objective, its functional characteristics, and advantages will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to represent selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0063] The present invention will be described in detail below with reference to the embodiments.

[0064] Reference Figure 1 The diagram shown is a flowchart of an adaptive control method for smart home devices based on multiple channels, according to an embodiment of the present invention.

[0065] In this embodiment, the method is implemented based on a smart home device control system; wherein, the system includes:

[0066] The user interface module is used to receive user control operations, generate device control command requests, and send the device control command requests to the control command scheduling module.

[0067] The channel health assessment module is used to monitor and assess the health status of each control channel, and outputs health status data including health score and health flag to the hysteresis state machine channel selection module. The control channels include cloud channels, local area network channels and infrared channels. The health score is calculated based on the assessment indicators of round-trip delay, jitter, packet loss rate, availability status and authentication status of each control channel.

[0068] The hysteresis state machine channel selection module is used to select the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm, and send the selected current control channel to the control command scheduling module. The hysteresis channel selection algorithm suppresses frequent switching of control channels by setting an upper cut-off threshold, an lower cut-off threshold, and a hold time.

[0069] The idempotency identifier generation module is used to generate a cross-channel unique idempotency identifier for the device control command request and send it to the control command scheduling module, and associate the idempotency identifier with the device control command request and store it in the consistency table module;

[0070] The control command scheduling module is used to coordinate the execution flow of the device control command request based on the received device control command request, the current control channel, and the idempotency flag, and to send the device control command request to the corresponding channel control module according to the selected current control channel.

[0071] The channel control module is used to send a device control command request carrying the idempotency identifier to the target device through the current control channel, and to listen for the execution receipt of the target device. The channel control module includes a cloud channel control module, a local area network channel control module, and an infrared channel control module.

[0072] The consistency table module is used to manage and verify the idempotency identifier and the execution status of the corresponding device control command request.

[0073] Reference Figure 2As shown, the system architecture includes a user interface module, a channel health assessment module, a hysteresis state machine channel selection module, an idempotent flag generation module, a control command scheduling module, channel control modules (including a cloud-based channel control module, a LAN channel control module, and an infrared channel control module), and a consistency table module. The user interface module generates control command requests, which are then sequentially called by the control command scheduling module to obtain the channel status from the channel health assessment module, to decide the channel using the hysteresis state machine channel selection module, and to obtain the req_id from the idempotent flag generation module. The control command scheduling module then sends the control command request to the corresponding channel control module (cloud-based channel control module / LAN channel control module / infrared channel control module) according to the selected channel. The cloud-based and LAN channel control modules obtain a receipt after execution and notify the control command scheduling module. The infrared channel control module does not receive a receipt and is directly timed out by the control command scheduling module. The control command scheduling module then submits the receipts from each channel to the consistency table module for comparison and processing, ultimately confirming the command execution result and ending the process. The system works collaboratively through the interconnections between its modules, enabling idempotent execution of smart home app control commands across cloud, local area network, and infrared channels.

[0074] The user interface module receives user input for control operations on the smart home app and generates corresponding device control command requests. This module then sends the user-issued device control command requests to the control command scheduling module for further processing.

[0075] The control command scheduling module coordinates the execution flow of device control command requests. Upon receiving a command request from the user interface module, this module first interacts with the channel health assessment module and the hysteresis state machine channel selection module to determine the control channel to use. Next, it calls the idempotent identifier generation module to obtain a unique request ID (req_id). Then, based on the selected control channel, it sends the device control command request to the corresponding channel control module (cloud channel control module / LAN channel control module / infrared channel control module). Finally, it monitors the command execution result feedback and verifies and compares the feedback through the consistency table module to ensure that the command is executed only once. The control command scheduling module, through the invocation and collaboration of various functional modules, realizes the flow control of the entire control command request from generation to completion.

[0076] The channel health assessment module is used to monitor and evaluate the communication status and availability of each control channel (Cloud / MQTT, LAN / UDP / CoAP, IR), and outputs a health score s_c∈[0,1] and a health flag flag_c∈{GOOD,DEGRADED,DOWN} for the hysteresis state machine channel selection module to perform hysteresis selection; the control command scheduling module calls this module to obtain the latest health status data before each issuance.

[0077] The hysteresis state machine channel selection module selects a suitable control channel based on channel health assessment results and avoids frequent channel switching through a hysteresis algorithm. Internally, the hysteresis state machine channel selection module contains a channel preference state machine: for example, it sets the current preferred channel state, and when the health of the preferred control channel is detected to decline and multiple consecutive failures reach a threshold, the state machine switches to a backup control channel; similarly, it only switches back to the original control channel after it recovers and stabilizes for a period of time. This hysteresis control strategy ensures that the system does not repeatedly switch control channels when channel conditions fluctuate in the cloud, LAN, etc., thereby improving the stability of instruction execution. The hysteresis state machine channel selection module returns the selected channel type to the scheduling control instruction scheduling module. Data involved in the channel selection decision process includes the current channel state, failure count, threshold, etc., which can be recorded using state variables and counters. The control instruction scheduling module calls the interface of the hysteresis state machine channel selection module to obtain the decision result each time it needs to select a channel.

[0078] The idempotency identifier generation module generates a unique request identifier (req_id) for each control command request across multiple channels. This module can generate unique IDs using a globally incrementing sequence, a UUID random number, or a combination of timestamps and random numbers. The generated req_id serves as the idempotency identifier for the control command and is appended to the control command request data, maintaining consistency across multiple channels. The idempotency identifier generation module ensures that the req_id for the same user request is identical regardless of the channel used, facilitating subsequent result comparison. The generated ID is registered in the consistency table module, serving as a unique index for the execution process of that control command request. The device firmware / gateway maintains a list of executed req_ids; duplicate commands are discarded and not executed again, only the result of the previous execution is returned.

[0079] The cloud-based channel control module sends control command requests to the target device via the cloud-based MQTT channel. It communicates with the remote cloud server, publishes the control command request data, including the `req_id`, to the device's MQTT topic, and waits for an execution receipt from the cloud or the device. The execution receipt should carry the corresponding `req_id` and the execution result status. The device / gateway stores the most recent `req_id` and filters duplicate commands. Upon receiving the execution receipt (or if timeout results in failure), the cloud-based channel control module / LAN channel control module first calls the `updateOnAck` interface of the channel health assessment module to update the channel's RTT and success / failure count, and then notifies the control command scheduling module of the receipt result.

[0080] The LAN channel control module is used to directly send control command requests to target devices via the LAN UDP channel. Devices within the local LAN listen for commands via the UDP protocol. The LAN channel control module constructs a command message containing a `req_id` and sends it to the target device's LAN address and port via UDP. After executing the control command request, the device replies via UDP with an acknowledgment receipt or status message containing the same `req_id`. The LAN channel control module reports the received execution receipt to the control command scheduling module or the consistency table update module, and feeds back the communication status (such as whether there was a timeout or packet loss) to the health assessment channel health assessment module for adjusting the LAN channel's health score.

[0081] The infrared channel control module acts as the infrared transmitter (gateway), serving as its hardware support. It transmits control command requests as infrared signals to the target device. The infrared channel control module generates the corresponding infrared encoding sequence based on the control command request and controls the infrared emitting diode to transmit it. Since infrared communication is typically unidirectional and feedback-free, the infrared channel control module does not receive a device acknowledgment after transmission. After the control command scheduling module calls the infrared channel control module to send the control command, the gateway immediately sends a proxy acknowledgment for recording (even though the device does not directly respond), thus working with the consistency table to ensure the verifiable execution of the infrared command. Afterward, the idempotency verification process can proceed directly. The transmission result of the infrared channel (whether successful or not is usually not directly known) may be indirectly evaluated in the channel health assessment module through the status of the infrared transmitter or user feedback. When using the infrared channel, this system records in the consistency table module that the `req_id` has been attempted to be sent to avoid duplicate transmissions. If the device simultaneously supports feedback from other channels (e.g., the device can both control via infrared and report status via the network), the system can combine the status updates of other channels to help confirm whether the infrared command has been executed.

[0082] The consistency table module is a data table structure used to store and compare the sending and receiving information of control command requests. This consistency table records the status of each control command request using `req_id` as an index, including fields such as command content, target device, selected channel, and execution result flags. When the control command scheduling module sends a control command request, it inserts a new record into the consistency table (status: "Pending Execution"). When any control channel returns a receipt, the control command scheduling module looks up the record corresponding to `req_id` and updates its status to "Executed" (the status fields in the consistency table are enumerated, such as "Pending Execution," "Executed," and "Execution Failed"). The consistency table is used to compare the consistency of receipts from multiple channels: when duplicate execution receipts exist (e.g., multiple feedbacks from multiple devices due to simultaneous sending from multiple channels), the system matches the same record based on `req_id`, only recognizing the earliest valid receipt and ignoring subsequent duplicate feedback, thus ensuring that the action of the same control command request is executed only once and not repeatedly. This consistency table can be stored in memory or persistent storage to ensure that idempotency flags and execution status are correctly identified even during channel switching or retransmission.

[0083] Reference Figure 1 As shown, the method includes:

[0084] S11 receives device control command requests initiated by users through smart home applications.

[0085] S12, according to the device control command, request to obtain the health status data of each control channel, the channel types of the control channels include cloud channel, local area network channel and infrared channel.

[0086] S13, Based on the health status data, select the current control channel from the control channels using a hysteresis channel selection algorithm.

[0087] S14, generate a cross-channel unique idempotent identifier for the device control command request, and associate the idempotent identifier with the device control command request and store it in a consistency table.

[0088] S15, send the device control command request carrying the idempotency identifier to the target device through the current control channel for control, and listen for the execution receipt of the target device.

[0089] S16. If an execution receipt is received and the idempotency identifier matches, the receipt processing procedure is initiated; otherwise, the status of the current control channel is updated and switched to the backup control channel, and the device control command request is resent using the same idempotency identifier until an execution receipt is received or all control channels fail to execute.

[0090] In this embodiment, after the user triggers the control command (S101), the health status assessment of each channel (S102), channel selection (S103), unique request ID generation (S104), and control command request sending are performed sequentially (S105). Then, the process enters the waiting for receipt stage (S106), and proceeds to different branches depending on whether a receipt is received: if a receipt is received, receipt verification and idempotency flag confirmation are processed (S107), and the process ends; if no receipt is received, channel failure handling (S108) and backup channel determination are performed (S109). If other available channels exist, the control command is resent via the switched channel, and the process waits for a receipt again (the process returns to S106 and loops), repeating this process until a receipt is successfully received or no available channel exists; when no channel is available, execution is marked as failed (S110), and the process ends. The entire process ensures that regardless of the number of retries, control commands with the same req_id will only be executed successfully once. Once a channel is successfully executed, subsequent feedback from other channels will be ignored, thus achieving one-time idempotent execution across channels. (Refer to...) Figure 3 As shown, it specifically includes:

[0091] S101: The user initiates a device control command request through the smart home app interface, such as clicking a button to turn a light on or off or adjusting the air conditioner temperature. The user interface module encapsulates this control command request into an internally unified control command object and submits it to the control command scheduling module for processing.

[0092] S102: After receiving a control command request from the user, the control command scheduling module calls the channel health assessment module to read the current health status data of each control channel. For example, the channel health assessment module returns the availability score or status indicator (such as cloud online and low latency, LAN unobstructed, IR idle, etc.) for each of the cloud MQTT channel, LAN channel, and IR channel. The control command scheduling module obtains this data for use in channel selection decisions.

[0093] S103: The control command scheduling module then calls the hysteresis state machine channel selection module to execute the channel selection algorithm. The hysteresis state machine channel selection module determines the type of control channel to be used based on the health data obtained in step S102, the previously selected channel, and the internal state of the state machine. For example, if the cloud channel has been used previously and its health is good, the cloud channel is selected again; if the cloud channel is detected to have multiple consecutive communication timeouts and instability, while the LAN channel is available, the state machine switches to select the LAN channel as the sending channel for this command. Through this step, the system determines the preferred control channel for this control command request.

[0094] S104: The control instruction scheduling module requests a new globally unique request identifier, `req_id`, from the idempotency identifier generation module. The control instruction scheduling module generates an unused `req_id` and returns it to the control instruction scheduling module. The control instruction scheduling module associates this `req_id` with the instruction content and stores it in a new record in the consistency table, initially marking its status as "pending execution". It is important to note that the `req_id` remains unchanged throughout the entire instruction execution process; even if the instruction is retransmitted due to a channel switch, this ID will not change, thus serving as the basis for idempotency.

[0095] S105: The control command scheduling module sends the control command request carrying the req_id out through the corresponding channel control module according to the control channel selected in step S103. For example: if the cloud channel is selected, the control command scheduling module is invoked to publish the command via MQTT; if the LAN channel is selected, the LAN channel control module is invoked to send the command via UDP; if the infrared channel is selected, the infrared channel control module emits an infrared signal. At this time, the command has been sent to the device or relevant server, and the system enters the waiting for acknowledgment stage.

[0096] S106: After sending a control command request, the control command scheduling module starts an acknowledgment listening timer to wait for feedback from the device regarding the execution result. For cloud channels, the cloud server or device is expected to return the command execution status (e.g., success / failure) within a short period; for LAN UDP channels, the target device should reply with a confirmation message via UDP; for infrared channels, since there is no direct acknowledgment, the system can only wait for a preset timeout period. During this step, the system continuously listens for acknowledgments from each control channel and determines whether a response matching the req_id has been received.

[0097] S107: If a receipt is received (from the cloud or LAN channel) and the req_id matches, the control command scheduling module immediately enters the receipt processing flow. First, the received receipt is compared and verified with the record for that req_id in the consistency table to ensure it has not been processed before (to avoid duplicate receipts). Then, the consistency table record status is updated to "executed," marking that the control command has been successfully executed once. Next, the control command scheduling module can notify the upper-layer user interface module of the execution result (e.g., device status updated to on / off), and stop subsequent retransmission operations. At this point, the control command has been successfully executed through a certain channel, and the process enters the final stage.

[0098] S108: If no response is received during the waiting period in step S106 (i.e., timeout), or if the received response indicates execution failure, the control command scheduling module determines that the currently selected channel is faulty or unreliable. Based on this, the control command scheduling module calls the channel health assessment module to update the channel's status (e.g., lowering the health score of the cloud channel, marking the channel as currently unavailable), and temporarily keeps the req_id record in the consistency table as "pending execution" but adds one failed attempt count. Subsequently, the process proceeds to channel switching judgment.

[0099] S109: The control command scheduling module queries the hysteresis state machine channel selection module to see if there is an available backup channel that can retransmit the control command (e.g., another channel with good health that has not been previously tried). If another channel is available, the control command scheduling module will reselect a new channel according to step S103 and execute step S105 to send the same control command (using the original req_id) through the new channel. It is important to note that the req_id used during retransmission remains unchanged, ensuring that regardless of which channel the acknowledgment is ultimately received, it will be mapped to the same record in the consistency table, thus guaranteeing idempotency.

[0100] S110: If the hysteresis state machine channel selection module determines that there are no other available channels (e.g., all channels have been tried and all have failed), the control instruction scheduling module abandons the retry. The instruction record in the consistency table will be marked as "execution failed," and the system will notify the upper layer of the operation failure. At this point, the process ends. If the channel recovers in the future, the instruction will not be executed again unless the user re-initiates the instruction and obtains a new req_id, ensuring that the instruction will not be blindly repeated in the event of failure.

[0101] Furthermore, in step S12, the health status data includes a health score and a health indicator; the step of requesting to obtain the health status data of each control channel according to the device control command includes:

[0102] A health score and a health indicator are calculated based on the evaluation indicators of each control channel, including round-trip delay, jitter, packet loss rate, availability status, and authentication status; wherein the health indicator includes a good, degraded, or unavailable status.

[0103] In this embodiment, the system calculates a health score by collecting and maintaining a series of multi-dimensional evaluation metrics. These metrics cover network performance, readiness status, resource load, and infrared channel-specific attributes. Network performance metrics include round-trip time (rtt_ms), jitter (jitter_ms, i.e., the average absolute deviation of the first-order difference of RTT), near-window packet loss rate, consecutive failures, and near-window success rate. Readiness status metrics include channel connectivity (avail, corresponding to MQTT online status for cloud channels, network reachability for LAN channels, and transmitter readiness for infrared channels) and authentication status (auth, representing the validity of communication keys or sessions). Resource load metrics are optional and include send queue backlog and channel rate limiting status (rate_limit). Furthermore, for the infrared channel, infrared transmit self-test status (ir_tx_ok) and proxy acknowledgment coverage rate (ir_proxy_ack_rate) are introduced as unique evaluation criteria.

[0104] Regarding data acquisition and update mechanisms, the system employs differentiated strategies for different types of control channels: For cloud channels, the round-trip latency (rtt_ms) is measured using the MQTT keepalive / ping mechanism, and timeout events for command publishing or subscription are included in the packet loss rate and consecutive failure count. The connection status and session validity are mapped to the availability status and authentication status, respectively. For LAN channels, the round-trip latency / packet loss rate is measured by periodically sending UDP or CoAP probe packets (or device heartbeats), and network reachability is determined using ARP or mDNS protocols to update the availability status. The authentication status is updated through a handshake or key verification process. For infrared channels, the availability status is determined through driver layer or transmitter self-test, and the proxy acknowledgment coverage rate (ir_proxy_ack_rate) and success rate (success_rate) are updated based on the proxy acknowledgment or lateral status awareness information returned by the gateway. To ensure data accuracy and stability, the system employs a sliding window (window size N=10) probe for all channels, with an update cycle T_probe = 1s (Cloud / LAN) / 5s (IR). This update cycle is set based on channel characteristics, with 1 second recommended for cloud and LAN channels and 5 seconds for infrared channels. Furthermore, EMA is used to smooth key network metrics such as round-trip latency, jitter, and packet loss rate, and winsorization is applied to suppress outliers. Through these comprehensive mechanisms, the system provides dynamic and reliable data for subsequent health scoring and channel decisions.

[0105] Key network metrics are normalized to a range of 0 to 1. Specifically: Normalized round-trip time (hat_rtt) is calculated as the ratio of actual round-trip time (rtt_ms) to reference time (rtt_ref), and is set to 1 when the ratio is greater than 1, i.e., hat_rtt = min(1, rtt_ms / rtt_ref). For cloud channels and LAN channels, the recommended values ​​for rtt_ref are 800ms and 400ms, respectively. Normalized packet loss rate (hat_loss) is directly taken as the actual near-window packet loss rate (loss). Normalized jitter (hat_jitter) is calculated as the ratio of actual jitter (jitter_ms) to reference jitter (jitter_ref), with the maximum value limited to no more than 1, i.e., hat_jitter = min(1, jitter_ms / jitter_ref). The recommended value for jitter_ref is 100ms.

[0106] Based on normalization, the health score (s_c) is calculated using a weighted summation method, expressed by the formula:

[0107] s_c=w1×(1-hat_rtt_c)+w2×(1-hat_loss_c)+w3×(1-hat_jitter_c)+w4×avail_c+w5×auth_c-w6×penalty_c;

[0108] Among them, hat_rtt_c, hat_loss_c, hat_jitter_c, etc. represent specific instantiated variable names, which represent the instantiated data of a specific channel, that is, the final normalized index value of the corresponding channel.

[0109] In the formula, hat_rtt_c represents normalized round-trip time, hat_loss_c represents normalized packet loss rate, hat_jitter_c represents normalized jitter, avail_c represents availability, auth_c represents authentication status, and penalty_c represents the penalty term; w1 to w6 are configurable weight coefficients used to adjust the contribution of each evaluation dimension to the total score, with default recommended values ​​of w1 = 0.25, w2 = 0.25, w3 = 0.20, w4 = 0.20, w5 = 0.10, and w6 = 0.10. The penalty term (penalty_c) is an optional component used to deduct points for abnormal channel conditions, and its calculation formula is as follows:

[0110] penalty_c=I(consecutive_fail>=K)×p_fail+I(queue_backlog>Q)×p_queue;

[0111] In the formula, I (condition) is an indicator function, which takes a value of 1 when the condition is met and 0 otherwise; K is the threshold for the number of consecutive failures that triggers the failure penalty (e.g., K=2); Q is the queue backlog threshold; p_fail and p_queue are the corresponding penalty scores, which can be set according to practical experience (e.g., 0.2). The s_c score obtained through the above process will serve as the core basis for determining the health status of the channel.

[0112] The health indicators (flag_c) include GOOD, DEGRADED, and DOWN.

[0113] GOOD: s_c≥0.65 and consecutive_fail=0;

[0114] DEGRADED: 0.45≤s_c<0.65 or consecutive_fail∈{1,2};

[0115] DOWN: s_c < 0.45 or avail = 0 or auth = 0;

[0116] After obtaining the health score and health flag, the system generates an output containing a 5-tuple: (channel, s_c, flag_c, metrics, ts), namely, channel type (e.g., Cloud / LAN / IR), health score, health flag (e.g., GOOD / DEGRADED / DOWN), raw metric data, and timestamp. The hysteresis state machine channel selection module then uses this information, along with hysteresis parameters (T_up / T_down / T_hold), to perform hysteresis routing decisions. Furthermore, the channel type can also include subsequent channels such as Zigbee, BTMesh, and Thread / Matter.

[0117] Furthermore, in step S13, the step of selecting the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm includes:

[0118] The hysteresis channel selection algorithm uses the setting of the upper cut-off threshold, the lower cut-off threshold, and the hold time as hysteresis parameters;

[0119] When the health score of the control channel is determined to be higher than the cut-off threshold and the stabilization time exceeds the hold time, the corresponding control channel is designated as the current control channel.

[0120] In this embodiment, a health score comparison logic is defined for the current channel and the alternative channels, using the "upward cut-off threshold / downward cut-off threshold"—if the current channel score is lower than T_down and fails N times consecutively, a switch is triggered. After the switch, the channel will only resume operation when its score recovers to above T_up and remains error-free for the T_hold time. Additionally, specific numerical examples can improve clarity (e.g., T_up = 0.6, T_down = 0.4, T_hold = 10s; specific values ​​can be adjusted based on testing).

[0121] Further, in step S14, generating a cross-channel unique idempotent identifier for the device control command request and associating the idempotent identifier with the device control command request and storing it in a consistency table includes:

[0122] Based on the user identifier, device identifier, instruction action digest, timestamp, and random number, the idempotent identifier is generated by using a hash algorithm, UUIDv7 combined with session salt, or a serial number signed by the device public key, and a valid lifespan is set for the idempotent identifier.

[0123] The idempotency identifier is associated with the device control command request and stored in the consistency table to generate a new record, and the record status corresponding to the device control command request is marked as pending execution; wherein, the consistency table includes an idempotency identifier, a device identifier, a channel type, a sending timestamp, a receipt timestamp, a record status, and a result summary, and the record status includes pending execution, executed, or execution failed.

[0124] In this embodiment, the fields of the consistency table include: idempotency identifier req_id (string), device identifier device_id (string), channel type channel (enum), sending timestamp ts_send (int64), receipt timestamp ts_ack (int64), record status status (enum: PENDING / SUCCESS / FAIL), result digest or hash value result_digest (bytes), number of retry attempts for the instruction retry_count (int), digital signature sig_app (bytes, optional), and device or gateway signature for receipt sig_dev (bytes, optional).

[0125] Furthermore, in step S15, sending the device control command request carrying the idempotency identifier to the target device through the current control channel for control, and listening for the execution receipt of the target device, includes:

[0126] When the current control channel is a cloud channel, the cloud channel is invoked to publish the device control command request containing the idempotency identifier to the MQTT topic of the target device, and wait for the execution receipt returned by the cloud or the target device. The execution receipt includes the corresponding idempotency identifier and the execution result status.

[0127] When the current control channel is a local area network (LAN) channel, the LAN channel is invoked to send the instruction message containing the device control instruction request with the idempotency identifier to the LAN address port of the target device via UDP, and wait for the target device to reply with an acknowledgment or status message via UDP.

[0128] When the current control channel is the infrared channel, the infrared channel is invoked to generate the corresponding infrared encoding sequence according to the device control command request, and the infrared emitting diode is controlled to send it to the target device, and a proxy receipt is fed back through the gateway.

[0129] Furthermore, in step S16, the receipt processing procedure includes:

[0130] The consistency table is queried based on the idempotency identifier in the execution receipt. If the record status corresponding to the idempotency identifier is pending execution, the execution receipt is treated as a valid receipt, the record status is updated to executed, and the successful execution of the device control command request is confirmed.

[0131] If the record status corresponding to the idempotent flag is "executed", then the execution receipt is treated as an invalid receipt and ignored.

[0132] Furthermore, in step S16, switching to the backup control channel and retransmitting the device control command request using the same idempotent identifier includes:

[0133] The backup control channel is selected according to a preset degradation sequence and the corresponding health score is evaluated; wherein, the preset degradation sequence is, in order, cloud channel, local area network channel and infrared channel;

[0134] When the health score is lower than the cut-off threshold and the duration exceeds the hold time, switch to the backup control channel where the health score is higher than the cut-off threshold, and resend the device control command request using the same idempotent identifier.

[0135] In this embodiment, when it is necessary to switch channels, they can be tried in a preset order (Cloud→LAN→IR). Alternatively, they can be dynamically sorted according to the real-time health score (s_c) of all backup channels, and the healthiest channel at present can be selected for retry first.

[0136] The above process ensures the one-time idempotent execution of control command requests in a multi-channel environment: the system tracks command status using a unique `req_id`, intelligently selects and switches channels using a hysteresis algorithm, and utilizes a consistency table to compare receipts to avoid duplicate execution. In particular, the consistency table mechanism is also applicable when sending commands simultaneously through multiple channels (this system primarily uses sequential switching and retransmission rather than parallel sending), preventing duplicate command actions caused by race conditions. This method is suitable for smart home apps controlling devices with multiple access methods, ensuring reliability while guaranteeing that the same command ultimately takes effect only once, avoiding inconsistent states or duplicate operations.

[0137] Reference Figure 4 The diagram shown is a structural schematic of a multi-channel-based adaptive control device for smart home devices according to an embodiment of the present invention.

[0138] In this embodiment, the device 20 includes:

[0139] Request receiving unit 21 is used to receive device control command requests initiated by users through smart home applications;

[0140] The health assessment unit 22 is used to request health status data of each control channel according to the device control command. The channel types of the control channels include cloud channels, local area network channels and infrared channels.

[0141] Channel selection unit 23 is used to select the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm;

[0142] The identifier generation unit 24 is used to generate a cross-channel unique idempotent identifier for the device control command request, and associate the idempotent identifier with the device control command request and store it in a consistency table;

[0143] Control unit 25 is used to send a device control command request carrying the idempotency identifier to the target device through the current control channel for control, and to listen for the execution receipt of the target device;

[0144] The receipt unit 26 is used to enter the receipt processing flow if an execution receipt is received and the idempotency identifier matches; otherwise, it updates the status of the current control channel and switches to the backup control channel and resends the device control command request using the same idempotency identifier until an execution receipt is received or all control channels fail to execute.

[0145] Each unit module of the device 20 can execute the corresponding steps in the above method embodiment, so the details of each unit module will not be elaborated here. Please refer to the description of the corresponding steps above for details.

[0146] This invention also provides a multi-channel adaptive control device for smart home devices, which includes the multi-channel adaptive control apparatus described above. The multi-channel adaptive control apparatus can employ... Figure 4 The structure of the embodiment, correspondingly, can be executed Figure 1 The technical solutions of the method embodiments shown are similar in implementation principle and technical effect. For details, please refer to the relevant records in the above embodiments, which will not be repeated here.

[0147] The device includes: a mobile phone, digital camera, or tablet computer, or other device with a camera function; or a device with an image processing function; or a device with an image display function. The device may include components such as a memory, processor, input unit, display unit, and power supply.

[0148] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory can also include a memory controller to provide access to the memory for the processor and input units.

[0149] The input unit can be used to receive input numerical, character, or image information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, in addition to a camera, the input unit of this embodiment may also include a touch-sensitive surface (e.g., a touch screen) and other input devices.

[0150] The display unit can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. The display unit may include a display panel, optionally configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or other similar display panel. Furthermore, a touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it transmits the information to the processor to determine the type of touch event. Subsequently, the processor provides corresponding visual output on the display panel based on the type of touch event.

[0151] This invention also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement... Figure 1 The illustrated method is an adaptive control method for smart home devices based on multiple channels. The computer-readable storage medium can be a read-only memory, a hard disk, or an optical disk, etc.

[0152] This invention also provides a computer program product, including a computer program / instructions, which are loaded and executed by a processor to implement... Figure 1 This paper presents an adaptive control method for smart home devices based on multi-channel technology.

[0153] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the device embodiments, equipment embodiments, and storage medium embodiments, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions in the method embodiments.

[0154] Furthermore, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0155] The foregoing description illustrates and describes preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept by means of the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. An adaptive control method for smart home devices based on multi-channel technology, characterized in that, The method includes: Receive device control command requests initiated by users through smart home applications; The device control command requests the acquisition of health status data for each control channel, and the channel types of the control channels include cloud channels, local area network channels, and infrared channels. Based on the health status data, the current control channel is selected from the control channels using a hysteresis channel selection algorithm; Generate a cross-channel unique idempotent identifier for the device control command request, and associate the idempotent identifier with the device control command request and store it in a consistency table; The device control command request carrying the idempotency identifier is sent to the target device through the current control channel for control, and the execution receipt of the target device is listened for. If an execution receipt is received and the idempotency identifier matches, the receipt processing procedure is initiated; otherwise, the status of the current control channel is updated and switched to the backup control channel, and the device control command request is resent using the same idempotency identifier until an execution receipt is received or all control channels fail to execute.

2. The adaptive control method for smart home devices based on multi-channel as described in claim 1, characterized in that, The health status data includes health scores and health indicators; The step of requesting to obtain health status data for each control channel according to the device control command includes: A health score and a health indicator are calculated based on the evaluation indicators of each control channel, including round-trip delay, jitter, packet loss rate, availability status, and authentication status; wherein the health indicator includes a good, degraded, or unavailable status.

3. The adaptive control method for smart home devices based on multi-channel as described in claim 1, characterized in that, The step of selecting the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm includes: The hysteresis channel selection algorithm uses the setting of the upper cut-off threshold, the lower cut-off threshold, and the hold time as hysteresis parameters; When the health score of the control channel is determined to be higher than the cut-off threshold and the stabilization time exceeds the hold time, the corresponding control channel is designated as the current control channel.

4. The adaptive control method for smart home devices based on multi-channel as described in claim 1, characterized in that, The step of generating a cross-channel unique idempotent identifier for the device control command request and associating the idempotent identifier with the device control command request and storing it in a consistency table includes: Based on the user identifier, device identifier, instruction action digest, timestamp, and random number, the idempotent identifier is generated by using a hash algorithm, UUIDv7 combined with session salt, or a serial number signed by the device public key, and a valid lifespan is set for the idempotent identifier. The idempotency identifier is associated with the device control command request and stored in the consistency table to generate a new record, and the record status corresponding to the device control command request is marked as pending execution; wherein, the consistency table includes an idempotency identifier, a device identifier, a channel type, a sending timestamp, a receipt timestamp, a record status, and a result summary, and the record status includes pending execution, executed, or execution failed.

5. The adaptive control method for smart home devices based on multi-channel as described in claim 1, characterized in that, The step of sending a device control command request carrying the idempotency identifier to the target device through the current control channel for control, and listening for the execution receipt of the target device, includes: When the current control channel is a cloud channel, the cloud channel is invoked to publish the device control command request containing the idempotency identifier to the MQTT topic of the target device, and wait for the execution receipt returned by the cloud or the target device. The execution receipt includes the corresponding idempotency identifier and the execution result status. When the current control channel is a local area network (LAN) channel, the LAN channel is invoked to send the instruction message containing the device control instruction request with the idempotency identifier to the LAN address port of the target device via UDP, and wait for the target device to reply with an acknowledgment or status message via UDP. When the current control channel is the infrared channel, the infrared channel is invoked to generate the corresponding infrared encoding sequence according to the device control command request, and the infrared emitting diode is controlled to send it to the target device, and a proxy receipt is fed back through the gateway.

6. The adaptive control method for smart home devices based on multi-channel as described in claim 1, characterized in that, The receipt processing procedure includes: The consistency table is queried based on the idempotency identifier in the execution receipt. If the record status corresponding to the idempotency identifier is pending execution, the execution receipt is treated as a valid receipt, the record status is updated to executed, and the successful execution of the device control command request is confirmed. If the record status corresponding to the idempotent flag is "executed", then the execution receipt is treated as an invalid receipt and ignored.

7. The adaptive control method for smart home devices based on multi-channel as described in claim 1, characterized in that, The step of switching to the backup control channel and retransmitting the device control command request using the same idempotent identifier includes: The backup control channel is selected according to a preset degradation sequence and the corresponding health score is evaluated; wherein, the preset degradation sequence is, in order, cloud channel, local area network channel and infrared channel; When the health score is lower than the cut-off threshold and the duration exceeds the hold time, switch to the backup control channel where the health score is higher than the cut-off threshold, and resend the device control command request using the same idempotent identifier.

8. A multi-channel-based adaptive control device for smart home devices, characterized in that, The device includes: The request receiving unit is used to receive device control command requests initiated by users through smart home applications. A health assessment unit is used to request health status data of each control channel according to the device control command. The channel types of the control channels include cloud channels, local area network channels, and infrared channels. A channel selection unit is used to select the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm. The identifier generation unit is used to generate a cross-channel unique idempotent identifier for the device control command request, and associate the idempotent identifier with the device control command request and store it in a consistency table; The control unit is used to send a device control command request carrying the idempotency identifier to the target device through the current control channel for control, and to listen for the execution receipt of the target device; The receipt unit is used to enter the receipt processing flow if an execution receipt is received and the idempotency identifier matches; otherwise, it updates the status of the current control channel and switches to the backup control channel and resends the device control command request using the same idempotency identifier until an execution receipt is received or all control channels fail to execute.

9. A smart home device control system, characterized in that, The system includes: The user interface module is used to receive user control operations, generate device control command requests, and send the device control command requests to the control command scheduling module. The channel health assessment module is used to monitor and assess the health status of each control channel, and outputs health status data including health score and health flag to the hysteresis state machine channel selection module. The control channels include cloud channels, local area network channels and infrared channels. The health score is calculated based on the assessment indicators of round-trip delay, jitter, packet loss rate, availability status and authentication status of each control channel. The hysteresis state machine channel selection module is used to select the current control channel from the control channels based on the health status data using a hysteresis channel selection algorithm, and send the selected current control channel to the control command scheduling module. The hysteresis channel selection algorithm suppresses frequent switching of control channels by setting an upper cut-off threshold, an lower cut-off threshold, and a hold time. The idempotency identifier generation module is used to generate a cross-channel unique idempotency identifier for the device control command request and send it to the control command scheduling module, and associate the idempotency identifier with the device control command request and store it in the consistency table module; The control command scheduling module is used to coordinate the execution flow of the device control command request based on the received device control command request, the current control channel, and the idempotency flag, and to send the device control command request to the corresponding channel control module according to the selected current control channel. The channel control module is used to send a device control command request carrying the idempotency identifier to the target device through the current control channel, and to listen for the execution receipt of the target device. The channel control module includes a cloud channel control module, a local area network channel control module, and an infrared channel control module. The consistency table module is used to manage and verify the idempotency identifier and the execution status of the corresponding device control command request.

10. A computer program product, characterized in that, It includes a computer program / instruction that, when executed by a processor, implements the steps of a multi-channel-based adaptive control method for smart home devices as described in any one of claims 1 to 7.