Control method and apparatus of home appliance, and home appliance
Patent Information
- Application Number
- CN202611190136.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-23
AI Technical Summary
相关技术中,冰箱控制系统的软件升级方式主要依赖整包式空中下载(Over-The-Air,简称为OTA)固件升级,至少存在以下局限性:需要下载和替换整个固件镜像,升级包体积大、升级时间长;升级过程需要重启设备,制冷控制中断,用户体验不佳;开发周期长,每次逻辑修改都需要重新编译、测试全量固件
[0007]本申请提出的家电设备的控制方法、装置和家电设备,通过在家电设备的内存资源受限的微控制单元中集成轻量级的目标控制引擎,并在其全局对象中预注册硬件驱动层函数,使得云端能够动态下发轻量级的目标控制程序(而非完整固件镜像),由目标控制引擎直接解释执行该目标控制程序,并基于其内含的控制逻辑,从全局对象中调用与之匹配的硬件驱动层函数,从而驱动相应的硬件部件运行,可以显著减小升级包体积、缩短部署时间,且无需重启设备即可使新功能或策略即时生效,有效避免了关键功能(如制冷、温度调节等功能)在升级过程中的中断,改善用户的使用体验。
Smart Images

Figure CN122962978A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a control method, device and appliance for home appliances. Background Technology
[0002] With the rapid development of IoT and smart home technologies, refrigerators have evolved from traditional refrigeration devices into intelligent terminals with network connectivity, intelligent sensing, and remote control capabilities. Among related technologies, the software upgrade method for refrigerator control systems mainly relies on over-the-air (OTA) firmware upgrades, which have at least the following limitations: the entire firmware image needs to be downloaded and replaced, resulting in a large upgrade package size and long upgrade time; the upgrade process requires a device restart, interrupting refrigeration control and leading to a poor user experience; and the development cycle is long, requiring recompilation and full firmware testing for each logic modification. Summary of the Invention
[0003] This application proposes a control method, apparatus, and appliance for home appliances, in order to at least partially solve one of the technical problems in the related art.
[0004] One embodiment of this application proposes a control method for a home appliance, wherein the microcontroller unit of the home appliance integrates a target control engine, the memory usage of the target control engine is less than a set value, and the global object of the target control engine registers the hardware driver layer functions of the home appliance; the method includes: Receive a target control program sent from the cloud; wherein the target control program is generated based on the business requirements associated with the home appliance. The target control program is sent to the target control engine so that the control logic in the target control program is executed by the target control engine, and the target function matching the control logic is called from the hardware driver layer function registered by the global object to drive the target component associated with the target function to run.
[0005] Another embodiment of this application proposes a control device for a home appliance, wherein the microcontroller unit of the home appliance integrates a target control engine, the memory usage of the target control engine is less than a set value, and the global object of the target control engine registers the hardware driver layer functions of the home appliance; the device includes: A receiving module is used to receive a target control program sent from the cloud; wherein the target control program is generated based on the business requirements associated with the home appliance. The processing module is used to send the target control program to the target control engine, so that the target control engine can execute the control logic in the target control program, and call the target function that matches the control logic from the hardware driver layer function registered by the global object, so as to drive the target component associated with the target function to run.
[0006] Another embodiment of this application provides a home appliance device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: implement the control method of the home appliance device as described in the foregoing aspect.
[0007] The control method, apparatus, and appliance proposed in this application integrate a lightweight target control engine into the microcontroller unit with limited memory resources of the appliance, and pre-register hardware driver layer functions in its global object. This allows the cloud to dynamically distribute lightweight target control programs (rather than complete firmware images). The target control engine directly interprets and executes these programs, and based on their built-in control logic, calls matching hardware driver layer functions from the global object to drive the corresponding hardware components. This significantly reduces the size of upgrade packages, shortens deployment time, and allows new functions or strategies to take effect immediately without restarting the device. It effectively avoids interruptions to critical functions (such as cooling and temperature regulation) during the upgrade process, improving the user experience.
[0008] Furthermore, by integrating a target control engine with control program parsing and hardware driver invocation capabilities into a microcontroller unit with limited memory resources, this application enables low-resource home appliances that typically only support static firmware or parameter configuration in related technologies to dynamically load and execute control logic without restarting. This effectively solves the technical problem of difficulty in implementing flexible and remote control of home appliances with limited memory resources in related technologies.
[0009] Building upon this, developers can independently iterate on the upper-layer control logic without recompiling, packaging, and fully verifying the firmware, significantly shortening the software delivery cycle and improving development efficiency. This not only lowers the barrier to entry for device hardware resources but also enhances the agile response capabilities, remote maintenance efficiency, and continuous availability of home appliances in the IoT environment.
[0010] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0011] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart illustrating a method for controlling a home appliance provided as an exemplary embodiment of this application; Figure 2 A schematic flowchart illustrating another method for controlling a home appliance provided as an exemplary embodiment of this application; Figure 3 A schematic flowchart illustrating another method for controlling a home appliance provided as an exemplary embodiment of this application; Figure 4 A schematic flowchart illustrating another method for controlling a home appliance provided as an exemplary embodiment of this application; Figure 5 A schematic diagram of the management process of a cloud-based proactive push and control program provided for an exemplary embodiment of this application; Figure 6 A schematic diagram of an update process for a temperature control program provided for an exemplary embodiment of this application; Figure 7 This is a schematic diagram of the structure of a control device for a household appliance provided as an exemplary embodiment of this application. Detailed Implementation
[0012] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0013] With the rapid development of IoT and smart home technologies, refrigerators have evolved from traditional refrigeration equipment into intelligent terminals with network connectivity, intelligent sensing, and remote control capabilities. Among these technologies, smart refrigerators are typically equipped with wireless communication modules (WiFi, Bluetooth, etc.) that enable real-time data transmission with the cloud, supporting remote monitoring, fault diagnosis, and online upgrades.
[0014] However, the software upgrade method of the refrigerator control system in related technologies mainly relies on the whole package OTA firmware upgrade, which has at least the following limitations: it requires downloading and replacing the entire firmware image, the upgrade package is large and the upgrade time is long; the upgrade process requires restarting the refrigerator, interrupting the cooling control and resulting in a poor user experience; the development cycle is long, and each modification of the control logic requires recompiling and testing the entire firmware; the iteration cost is high and it is impossible to achieve fine-grained rule-level dynamic adjustment.
[0015] As users' demands for refrigerator preservation, energy efficiency, and noise control become increasingly sophisticated, the aforementioned firmware upgrade methods are no longer sufficient to meet the needs of rapid iteration and personalized customization. Simultaneously, the exploration of artificial intelligence (AI) algorithms in refrigerator control is limited by the bottleneck of "only being able to output control parameters and not directly modify the control logic." For example, an AI-based intelligent refrigerator control solution includes: The system collects historical operating data of the refrigerator; using an offline-trained AI model, it predicts the future operating conditions of the refrigerator based on this historical operating data and outputs optimized control parameters (such as the target temperature setpoint, the proportional-integral-derivative (PID) coefficients of the compressor, the defrosting cycle, etc.); the control parameters output by the AI model are sent to the refrigerator microcontroller unit (MCU) in the form of a configuration file or parameter table; the refrigerator MCU reads the control parameters and executes them according to the control logic preset in the firmware.
[0016] However, the above control scheme has at least the following drawbacks: 1. The output of the AI model cannot directly drive the refrigerator hardware to execute: The AI model can only output adjustment suggestions at the "parameter layer", but cannot modify the underlying "logic layer" of the refrigerator (such as the PID control algorithm structure and the defrosting decision tree branch logic), which severely limits the optimization space; 2. There is a "semantic gap" between the AI model and the refrigerator's execution layer: the control strategies output by the AI model in the cloud (such as "perform a brief defrost every 30 minutes") need to be manually translated into C language code and the firmware recompiled before deployment. The iteration cycle can take several weeks, which cannot give full play to the advantages of AI's real-time decision-making. 3. High coupling between model updates and rule updates: When the optimization strategy of the AI model changes, it usually requires a complete upgrade of the refrigerator firmware. OTA upgrades are costly and have a strong impact on users, hindering the rapid iteration of AI algorithms. 4. Inability to deliver personalized AI strategies on demand: Different users have vastly different usage habits and environments. Theoretically, cloud-based AI models can generate personalized control strategies for each user, but related technologies cannot deliver personalized strategies to each refrigerator in a low-cost, high-frequency manner.
[0017] Therefore, there is an urgent need for a technical solution that can achieve dynamic control rule updates with low resource overhead, uninterrupted hot updates, and support direct deployment of AI strategies on the MCU of a refrigerator.
[0018] In view of at least one of the problems existing in the above-mentioned related technologies, this application proposes a control method and device for household appliances.
[0019] The control method and apparatus for home appliances according to embodiments of this application are described below with reference to the accompanying drawings.
[0020] Figure 1 This is a flowchart illustrating a method for controlling a home appliance, provided as an exemplary embodiment of this application.
[0021] It should be noted that the control method for home appliances in this application can be applied to a control device for home appliances. In some possible embodiments, the control device can be configured in the home appliance to enable the home appliance to perform device control functions. Additionally, in some possible embodiments, the control device can also be software within the home appliance.
[0022] like Figure 1 As shown, the control method for this household appliance may include the following steps S101 to S102: Step S101: Receive the target control program sent from the cloud; wherein, the target control program is generated according to the business requirements associated with the home appliance; the micro control unit (MCU) of the home appliance integrates the target control engine, and the global object of the target control engine registers the hardware driver layer functions of the home appliance.
[0023] As one possible implementation, the MCU of the home appliance can be a control unit with limited memory resources, that is, the memory resources of the MCU are less than a set resource threshold. The set resource threshold is a pre-set resource threshold with a relatively small value. For example, the set resource threshold is 64KB, 32KB, etc.
[0024] As one possible implementation, the target control engine can be integrated into the memory-constrained MCU, serving as a lightweight control engine. That is, the resource consumption of the target control engine is less than a set threshold (referred to as the set value in this application). It should be noted that this application does not limit the implementation language of the target control engine, including but not limited to: C language, C++ language, etc.
[0025] The set value can be less than the above-mentioned resource quantity threshold, that is, the memory resources occupied by the target control engine are less than the memory resources of the MCU.
[0026] Among them, the business requirements associated with home appliances are used to define the operational goals and functional boundaries that home appliances need to achieve in specific scenarios. These can be user-defined personalized usage requirements, optimized control strategies generated by the cloud based on device operation data and scenario environment, or functional upgrade requirements added during product iteration. This application embodiment does not limit these requirements.
[0027] The target control program is used to control target components in home appliances to achieve target functions related to the above-mentioned business requirements. The target functions include, but are not limited to, temperature control, humidity control, energy saving, and defrosting functions. The target component refers to the component to be controlled as indicated by the target control program.
[0028] For example, taking a refrigerator as an example of a home appliance with limited memory resources, the target components include, but are not limited to, the compressor, fan, damper, etc., and the target control program includes, but is not limited to, the adjusted PID coefficient of the compressor, the defrosting trigger condition, the fan speed curve, and other logic-level control strategies.
[0029] This application does not limit the number of target control programs, nor does it impose specific restrictions on the type / form of the target control programs. For example, the implementation forms of target control programs include, but are not limited to, interpreted script code, pre-compiled bytecode, etc.
[0030] The target control engine's global object registers hardware driver layer functions for home appliances. These hardware driver layer functions include, but are not limited to, hardware control functions for various components within the home appliances and sensor data reading functions.
[0031] For example, taking a refrigerator as an example of a memory-constrained home appliance, the hardware driver layer function (such as the compressor speed control function set_compressor_speed()) can be registered to a global object in the following way to expose it to the target control engine: XX_SetCFunction(global_obj, "set_compressor_speed", set_compressor_speed); Here, XX refers to the name or identifier of the target control engine, XX_SetCFunction is the setting function interface, and global_obj refers to the global variable.
[0032] For example, taking a refrigerator as an example of a memory-constrained home appliance, the hardware driver layer functions (such as the compartment temperature reading function) can be exposed to the target control engine as global variables in the following way: XX_SetNumberProperty(global_obj, "current_temp", get_temperature()); Among them, XX_SetNumberProperty is a global numerical attribute registration interface provided by the target control engine. It is used to mount the real-time hardware status data (including sensor data) collected by the hardware layer to the global object in the form of read-only numerical variables. This allows the target control engine to directly read the hardware status data without having to write additional underlying data interaction logic. current_temp refers to the current compartment temperature of the refrigerator, and get_temperature() refers to the compartment temperature reading function in the sensor data reading function.
[0033] The compartment temperature refers to the air temperature inside any independent storage space (including the refrigerator compartment, freezer compartment, or variable temperature compartment) within the refrigerator.
[0034] In this embodiment, the cloud can generate a target control program to achieve the business requirements associated with the home appliance, and send the target control program to the home appliance through communication protocols such as Message Queuing Telemetry Transport (MQTT) and Hypertext Transfer Protocol (HTTP). Correspondingly, the home appliance can receive the target control program sent by the cloud through its own wireless communication module.
[0035] For example, an AI model (or intelligent agent) can be deployed in the cloud, wherein the AI model has learned the correspondence between input data (such as textual descriptions related to business needs) and output data (such as control programs). Thus, in this application, the cloud can invoke the AI model to generate a target control program based on business needs associated with home appliances.
[0036] This application does not impose specific restrictions on the model structure of the AI model. For example, the AI model includes, but is not limited to, Recurrent Neural Network (RNN) and Long Short-Term Memory (LSTM).
[0037] In any embodiment of this application, the cloud can generate the target control program using at least one of the following methods: The first approach is to determine the first device control strategy based on the actual usage data of different users for the same model of home appliances, and then generate a target control program that matches the first device control strategy.
[0038] Among them, actual usage data is used to indicate users' preferences for using home appliances, such as preferred temperature settings, humidity settings, and operating modes.
[0039] In this application embodiment, the cloud can obtain actual usage data of different users for the same model of home appliances, and analyze the common control strategies of different user preferences based on the actual usage data, which are referred to as the first device control strategy in this application, and generate a target control program that matches the first device control strategy.
[0040] As an example, the cloud can invoke an AI model to generate a target control program to implement the first device control strategy based on the textual description information of the first device control strategy. The AI model has learned the correspondence between the input textual description information and the output control program.
[0041] For example, supervised training can be used to train the AI model so that the trained AI model learns the correspondence between the input text description information and the output control program. For example, training samples can be obtained; wherein, the training samples include text description information of the sample control strategy and sample control program for implementing the sample control strategy; the AI model generates a predictive control program based on the text description information of the sample control strategy; and the AI model is trained (or supervised learning) based on the difference between the predictive control program and the sample control program.
[0042] For example, taking a refrigerator as an example of a home appliance with limited memory resources, the first method described above can at least be applied to the scenario of optimizing the preservation effect of the refrigerator after it leaves the factory: Considering that the temperature control parameters of the refrigerator at the factory may not cover the actual usage environment of all users (such as ambient temperature fluctuations, different door opening and closing frequencies, etc.), in this application, when the cloud detects that the compartment temperature of a certain batch of refrigerators is generally too high, or when users report poor preservation effect, a new temperature control program can be quickly written and distributed in the cloud. The temperature control program is used to dynamically adjust the temperature set point and the compressor speed ratio coefficient, and correct the temperature deviation online to solve the problem of poor preservation effect that requires on-site repair and replacement of the control board in related technologies.
[0043] Understandably, generating target control programs based on actual usage data of different users on the same model of equipment can accurately match the usage habits of different users, avoid the adaptation deviation of fixed control strategies, and improve the user experience.
[0044] The second method involves generating a target control program based on equipment usage data during peak electricity price periods in the target season to control home appliances to enter energy-saving mode.
[0045] The target season refers to a pre-set designated season, which includes, but is not limited to, summer and winter.
[0046] As an example, the cloud can invoke an AI model to generate a target control program for controlling home appliances to enter energy-saving mode, based on device usage data during peak electricity price periods in a target season. The AI model has learned the correspondence between the input device usage data and the output control program.
[0047] For example, supervised training can be used to train the AI model so that the trained AI model learns the correspondence between input device usage data and output control programs. For instance, training samples can be obtained; these training samples include device usage data under sample energy-saving modes and sample control programs for entering those sample energy-saving modes; the AI model generates a predictive control program based on the device usage data under those sample energy-saving modes; and the AI model is trained (or supervised learning) based on the differences between the predictive control program and the sample control program.
[0048] For example, taking a refrigerator as an example of a home appliance with limited memory resources, the second method mentioned above can at least be applied to the scenario of dynamically issuing seasonal energy-saving strategies for refrigerators: during the peak electricity price period in summer, the cloud can actively issue an energy-saving mode control program to the refrigerator. This energy-saving mode control program is used to dynamically adjust the compressor's start-stop strategy and defrost cycle to reduce cooling energy consumption without requiring users to manually set it or wait for hardware upgrades.
[0049] Understandably, by combining equipment usage data during peak electricity price periods to generate target control programs for controlling home appliances to enter energy-saving mode, it is possible to reduce the electricity costs of equipment without affecting the basic user experience, while also helping the power grid to shave peaks and fill valleys, thereby improving energy efficiency.
[0050] The third method is to generate a target control program to achieve the target function based on the function description information of the target function of the home appliance; the target function includes updated existing functions and newly added functions.
[0051] As an example, the cloud can invoke an AI model to generate a target control program to achieve the target function based on the function description information of the target function. The AI model has learned the correspondence between the input function description information and the output control program.
[0052] For example, supervised training can be used to train the AI model so that the trained AI model learns the correspondence between the input functional description information and the output control program. For instance, training samples can be obtained; wherein, the training samples include functional description information of the sample function and a sample control program for implementing the sample function; the AI model generates a predictive control program based on the functional description information of the sample function; and the AI model is trained (or supervised learning) based on the difference between the predictive control program and the sample control program.
[0053] For example, taking a refrigerator as an example of a home appliance with limited memory resources, the third method described above can at least be applied to the scenario of rapid iteration of new refrigerator functions: Suppose a refrigerator manufacturer wants to add a "holiday mode" or "wine storage mode" to an existing refrigerator model. The upgrade method in the relevant technology requires the R&D team to modify the refrigerator's underlying C / C++ firmware, recompile, apply for a software version number, review the product, and then push it to the user's refrigerator through the OTA upgrade channel. In this application, however, the cloud only needs to write a target control program of a few KB in size and distribute it to the user's refrigerator. The target control engine dynamically executes the target control program, and the user can immediately use the new function / mode.
[0054] Understandably, by generating corresponding target control programs based on functional description information, existing functions can be updated and new functions can be launched quickly without the need to completely flash and upgrade the underlying firmware of the device, thus significantly reducing the maintenance costs of device iteration.
[0055] The fourth method: Obtain the user-defined operating rules of the home appliances and generate a target control program that is compatible with the operating rules.
[0056] As an example, the cloud can invoke an AI model to generate a target control program to implement custom device operating rules. The AI model has learned the correspondence between the input device operating rules and the output control program.
[0057] For example, supervised training can be used to train the AI model so that the trained AI model learns the correspondence between the input device operating rules and the output control program. For example, training samples can be obtained; wherein, the training samples include sample operating rules and sample control programs for implementing the sample operating rules; the AI model generates a predictive control program based on the sample operating rules; and the AI model is trained (or supervised learning) based on the difference between the predictive control program and the sample control program.
[0058] For example, taking a refrigerator as an example of a home appliance with limited memory resources, the fourth method described above can at least be applied to personalized customization scenarios for refrigerator users: allowing users to customize the refrigerator's operating rules for a certain period of time through a cloud platform of a mobile application (App). For example, the user can set "turn on energy-saving mode from 22:00 to 06:00 the next day". The cloud can convert the user-configured operating rules into a control program, store it in the cloud, and send it to the target control engine in the refrigerator for execution, thus realizing personalized device control on the user side.
[0059] Understandably, generating corresponding target control programs based on user-defined device operation rules can fully meet users' personalized customization needs, greatly improve the flexibility of device control, and adapt to more niche and special use cases.
[0060] The fifth method: Based on the historical and current operating data of home appliances, determine the second device control strategy according to the user's preferences, and generate a target control program that is compatible with the second device control strategy.
[0061] As an example, the cloud can invoke an AI model to analyze user preferences for device control strategies based on historical and current operating data of home appliances. This is referred to as the second device control strategy in this application. The cloud then generates a target control program to implement this second device control strategy. The AI model has learned the correspondence between the input device operating data (including historical and current operating data) and the output control program.
[0062] For example, supervised training can be used to train the AI model so that the trained AI model learns the correspondence between input device operating data and output control programs. For instance, training samples can be obtained; these training samples include sample operating data and corresponding sample control programs; the AI model generates a predictive control program based on the sample operating data; and the AI model is trained (or supervised learning) based on the difference between the predictive control program and the sample control program.
[0063] For example, taking a refrigerator as an example of a home appliance with limited memory resources, the fifth method described above can at least be applied to AI-enabled adaptive control scenarios for refrigerators: The AI model in the cloud analyzes the refrigerator's operating data in real time, automatically generates an optimized control program (e.g., containing an adjusted PID algorithm and new defrosting condition judgment logic), and actively sends it to the refrigerator via a wireless network. The target control engine on the refrigerator side interprets and executes the new control program, forming a closed loop of "perception-decision-execution," enabling the refrigerator control strategy to self-evolve and self-optimize.
[0064] Understandably, by combining historical and real-time operational data of the equipment to generate a suitable target control program, it is possible to dynamically track changes in user habits, achieve self-optimization of control logic, and enable the equipment to maintain optimal operating status in the long term, thereby reducing the probability of failure.
[0065] It should be noted that the above-described method of generating the target control program is merely an illustrative example, but this application is not limited thereto. The cloud can generate personalized target control programs based on the personalized application and business requirements of home appliances, and this application embodiment does not impose any limitations on this.
[0066] It should also be noted that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features.
[0067] Step S102: The target control program is sent to the target control engine so that the control logic in the target control program can be executed by the target control engine. The target function that matches the control logic is called from the hardware driver layer function registered in the global object, and the target component associated with the target function is driven to run.
[0068] In this embodiment of the application, after receiving the target control program, the home appliance can send the target control program to the target control engine. Correspondingly, after receiving the target control program, the target control engine can execute the control logic in the target control program, call the target function that matches the control logic from the hardware driver layer function registered in the global object, drive the operation of the target component in the home appliance associated with the target function, thereby completing the hot switching of the control logic.
[0069] The control method for home appliances in this application integrates a lightweight target control engine into the memory-constrained MCU of the home appliance and pre-registers hardware driver layer functions in its global object. This allows the cloud to dynamically distribute lightweight target control programs (rather than complete firmware images). The target control engine directly interprets and executes these programs, and based on their built-in control logic, calls matching hardware driver layer functions from the global object to drive the corresponding hardware components. This significantly reduces the size of upgrade packages, shortens deployment time, and allows new functions or strategies to take effect immediately without restarting the device. This effectively avoids interruptions to critical functions (such as cooling and temperature regulation) during upgrades, improving the user experience. Simultaneously, developers can independently iterate on the upper-layer control logic without recompiling, packaging, and fully verifying the firmware, significantly shortening the software delivery cycle and improving development efficiency. This not only lowers the barrier to entry for device hardware resources but also enhances the agile response capabilities, remote maintenance efficiency, and continuous availability of home appliances in the Internet of Things environment.
[0070] As one possible implementation method, Figure 2 A schematic flowchart illustrating another method for controlling a home appliance provided as an exemplary embodiment of this application.
[0071] It should be noted that the control method of this home appliance can be executed alone, or it can be executed together with any embodiment of this application or any possible implementation in the embodiment, or it can be executed together with any technical solution in related technologies. The embodiments of this application do not limit this.
[0072] like Figure 2 As shown, the control method for this household appliance may include the following steps S201 to S204: Step S201: Receive the target control program sent from the cloud; wherein, the target control program is generated according to the business requirements associated with the home appliance; the MCU of the home appliance integrates a target control engine, the memory usage of the target control engine is less than a set value, and the global object of the target control engine has registered the hardware driver layer functions of the home appliance.
[0073] The hardware driver layer functions include: hardware control functions for each controllable component within the home appliance and sensor data reading functions registered to the global object through the target binding interface.
[0074] Among them, the target binding interface can be, for example, the binding interface of the hardware driver layer / target control engine.
[0075] It should be noted that the explanation of step S201 can be found in the relevant description in the above embodiments of this application, and will not be repeated here.
[0076] It should be noted that because the MCUs of home appliances such as refrigerators, which have limited memory resources, are usually equipped with only a very limited amount of Random Access Memory (RAM) resources (such as tens of KB), and lack memory management units and virtual memory support, the ordinary control engine that relies on standard library dynamic memory allocation (such as malloc (a dynamic memory allocation function used to request memory blocks of arbitrary size from the heap at runtime)) is very prone to system freezes, restarts or unpredictable behavior when running on such home appliances due to memory fragmentation, heap space exhaustion or allocation failures. It is difficult to meet the requirements for long-term stable operation of home appliances.
[0077] To address the aforementioned issues, in any embodiment of this application, the target control engine may employ a pre-allocated static memory buffer. This static memory buffer stores variables, objects, functions, and function closures generated during the execution of the target control program through the target binding interface in the target control engine, thereby avoiding reliance on the standard library's dynamic memory allocation mechanism.
[0078] In this application, the target control engine does not rely on the full malloc implementation of the standard library. It can control memory through a simplified application programming interface (API) design and a pre-allocated static memory management mode. All variables (such as objects, strings, function closures, etc.) are managed in a controllable linear buffer, effectively avoiding the generation of memory fragmentation and eliminating runtime exceptions caused by dynamic memory allocation failure.
[0079] Therefore, in home appliances with limited memory resources, not only is the complexity of memory management and the uncertainty of operation reduced, but also the predictability of memory usage, the determinism of program execution, and the robustness of long-term system operation are achieved, enabling the lightweight target control engine to be stably deployed in embedded environments with limited memory resources.
[0080] In any embodiment of this application, the target binding interface includes a setting function interface for registering hardware driver layer functions to a global object, and a value acquisition interface for obtaining execution results from the target control program.
[0081] The setting function interface is used to register hardware driver layer functions to a global object. For example, the setting function interface is XX_SetCFunction interface, where XX refers to the name or identifier of the target control engine.
[0082] The numerical acquisition interface is used to obtain the execution result from the target control program. For example, the numerical acquisition interface is the XX_GetNumber interface.
[0083] In this application, the execution result of the target control program obtained through the numerical acquisition interface can be uploaded to the cloud through the transmission link of target control engine → MCU of home appliance → wireless communication module of home appliance → cloud. This allows the cloud to dynamically adjust the subsequent control strategies, optimize business logic, diagnose equipment operating status, or trigger remote operation and maintenance commands based on the execution result, thereby achieving closed-loop intelligent control and continuous iterative optimization.
[0084] In summary, a two-way pathway can be achieved for the standardized exposure of hardware capabilities and the feedback of control logic execution: On the one hand, the target control program does not need to be aware of the underlying hardware details, and can call the hardware driver layer functions registered on the global object through the target control engine to realize the corresponding hardware operation capabilities (such as reading temperature, starting the compressor, etc.), which significantly improves the portability and development efficiency of the control logic; on the other hand, the execution results can be captured by the system and reported to the cloud, supporting remote monitoring, strategy optimization and fault diagnosis, thereby significantly enhancing the programmability, observability and cloud collaboration capabilities of home appliances while ensuring the security of the embedded system.
[0085] In any embodiment of this application, the target control program may further include an execution cycle parameter, wherein the execution cycle parameter is used to indicate the repetitive execution interval of the control logic in the target control program. In this application, the target control engine can periodically repeat the control logic at the time interval of the execution cycle parameter by calling its internally integrated timed callback interface.
[0086] The timed callback interface is used to repeatedly execute the control logic in the target control program. The repetition cycle of the control logic is determined based on the execution cycle parameter in the target control program. For example, the timed callback interface is the set_interval interface.
[0087] For example, the target control program may include "set_interval(control_loop, 10000)" to instruct the target control engine to execute control logic once every 10 seconds.
[0088] For example, taking a refrigerator, a home appliance with limited memory resources, as an example, the cloud can dynamically send target control programs containing different execution cycle parameters based on the refrigerator's current operating status. For instance, in a scenario where the refrigerator compartment temperature needs to be quickly adjusted, the target control program sent from the cloud could include "set_interval(refrigeration_control_loop, 2000)" to instruct the target control engine to execute the compressor start / stop control logic every 2 seconds, deciding whether to start or stop the compressor based on the deviation between the actual temperature of the refrigerator compartment and the set temperature. As another example, in a scenario where the refrigerator compartment temperature has stabilized and entered the maintenance phase, the target control program sent from the cloud could include "set_interval(status_report_loop, 30000)" to instruct the target control engine to execute the defrost control logic every 30 seconds, determining whether the defrost conditions are met based on the evaporator temperature and the compressor's cumulative running time, and activating the defrost heater when the defrost conditions are met, continuing until the frost layer is completely melted.
[0089] Through the above mechanism, the refrigerator's periodic tasks such as temperature control and defrosting control are all uniformly scheduled by the target control engine, without relying on operating system-level timers or external hardware interrupts.
[0090] In summary, by calling its internal timed callback interface through the target control engine and repeatedly executing the control logic at time intervals specified in the target control program, the scheduling of control tasks is uniformly managed by the target control engine without relying on operating system-level timers or external interrupt mechanisms. On the one hand, this avoids scheduling jitter or resource conflicts caused by multi-task timer contention in memory-constrained embedded environments, ensuring the deterministic execution of critical control strategies. On the other hand, it allows the cloud to dynamically distribute control programs with different execution cycle parameters (such as high-frequency temperature control and low-frequency status reporting), enabling on-demand configuration and flexible adjustment of control frequency, significantly improving the deterministic nature of system scheduling, resource utilization efficiency, and remote programmability.
[0091] Step S202: The target control program is sent to the target control engine so that the control logic in the target control program can be executed by the target control engine. The target function that matches the control logic is determined and called from the sensor data reading functions on the global object to obtain the sensor values.
[0092] In this embodiment of the application, after receiving the target control program, the home appliance can send the target control program to the target control engine. Correspondingly, after receiving the target control program, the target control engine can execute the control logic in the target control program, determine and call the target function that matches the control logic from the sensor data reading functions registered in the global object, and obtain the sensor values.
[0093] For example, taking a refrigerator as an example of a home appliance with limited memory resources, the compartment temperature reading function on the global object can be called in the following way: let current_temp = get_temperature().
[0094] Step S203: Determine the control parameters of the target component in the home appliance that is associated with the control logic based on the control logic and sensor values.
[0095] In this embodiment, the target control engine can determine the control parameters of the target component associated with the control logic in the home appliance based on the control logic in the target control program and the sensor values.
[0096] For example, taking a refrigerator as a memory-constrained home appliance, a compressor as the target component, and rotation speed as the control parameter, if the temperature difference between the current compartment temperature (current_temp) obtained by the compartment temperature reading function and the target compartment temperature (target_temp) in the target control program is greater than a first set temperature difference, the compressor speed can be a relatively large set speed to make the compressor run at full speed; if the temperature difference between the current compartment temperature and the target compartment temperature is less than a second set temperature difference, the compressor speed can be 0 to make the compressor stop running; if the temperature difference between the current compartment temperature and the target compartment temperature is greater than or equal to the second set temperature difference and less than or equal to the first set temperature difference, the compressor speed can be a set multiple of the above temperature difference (such as 50 times) to achieve linear adjustment of the compressor speed.
[0097] The target compartment temperature refers to the desired compartment temperature of the refrigerator, while the current compartment temperature refers to the actual compartment temperature of the refrigerator.
[0098] Wherein, the second set temperature difference is less than the first set temperature difference. For example, the first set temperature difference is 1.0 and the second set temperature difference is -0.5.
[0099] Step S204: Based on the control parameters, call the hardware control function of the target component on the global object to drive the target component to run according to the control parameters.
[0100] In this embodiment of the application, the target control engine can call the hardware control function of the target component on the global object according to the control parameters, so as to drive the target component to run according to the control parameters.
[0101] Using the example above, the target control engine can control the compressor to run according to the control parameters (output) by calling the compressor speed control function set_compressor_speed(output).
[0102] The control method for home appliances in this application dynamically calls the corresponding sensor data reading function from the hardware driver layer function registered with the global object according to the control logic requirements to obtain real-time sensor values. Based on the sensor values and control logic, the control parameters of the target component are calculated, and then the corresponding hardware control function is called to drive the target component to run according to the control parameters. This ensures the consistency and timing controllability of data acquisition and execution actions, and provides a unified hardware abstraction interface and deterministic execution basis for lightweight, highly reliable, remotely programmable home appliances.
[0103] As one possible implementation method, Figure 3 A schematic flowchart illustrating another method for controlling a home appliance provided as an exemplary embodiment of this application.
[0104] It should be noted that the control method of this home appliance can be executed alone, or it can be executed together with any embodiment of this application or any possible implementation in the embodiment, or it can be executed together with any technical solution in related technologies. The embodiments of this application do not limit this.
[0105] like Figure 3 As shown, the control method for this household appliance may include the following steps S301 to S304: Step S301: Receive the target control program sent from the cloud; wherein, the target control program is generated according to the business requirements associated with the home appliance; the MCU of the home appliance integrates a target control engine, the memory usage of the target control engine is less than a set value, and the global object of the target control engine has registered the hardware driver layer functions of the home appliance.
[0106] It should be noted that the explanation of step S301 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0107] Step S302: The MCU performs an integrity check on the target control program and determines whether the target control program passes the integrity check. If yes, proceed to step S303; otherwise, proceed to step S304.
[0108] Integrity checks include, but are not limited to, hash checks and cyclic redundancy checks (CRC).
[0109] In this embodiment of the application, the MCU can perform integrity verification on the target control program and determine whether the target control program passes the integrity verification. If yes, step S303 is executed; if no, step S304 is executed. It should be noted that step S303 and step S304 are two possible implementation methods in parallel, and one of them can be executed.
[0110] Step S303: The target control program is sent to the target control engine through the MCU, so that the control logic in the target control program is executed by the target control engine, and the target function matching the control logic is called from the hardware driver layer function registered in the global object, so as to drive the target component associated with the target function to run.
[0111] In this embodiment, if the target control program passes the integrity check, the MCU can send the target control program to the target control engine so that the target control engine can execute the control logic in the target control program, call the target function that matches the control logic from the hardware driver layer function registered by the global object, and drive the target component to run. The implementation principle can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0112] Step S304, perform any of the following: discard the target control program to refuse to execute the control logic; send a retransmission request to the cloud; wherein the retransmission request is used to request the cloud to retransmit the target control program.
[0113] In this embodiment of the application, if the target control program fails the integrity check, the MCU may execute any of the following: First option: Discard the target control program to refuse to execute the control logic.
[0114] The second step: Sending a retransmission request to the cloud; wherein, the retransmission request is used to request the cloud to retransmit the target control program. For example, the MCU can report a retransmission request to the cloud through the wireless communication module in the home appliance, in order to request the cloud to resend the target control program to it.
[0115] Understandably, when a target control program fails integrity verification, it can be discarded to refuse execution of untrusted control logic, or a retransmission request can be proactively sent to the cloud to obtain the correct version of the target control program, thus forming a closed-loop fault tolerance and recovery mechanism. The former avoids equipment malfunctions (such as abnormal compressor start / stop, temperature control failure, etc.) caused by executing damaged or forged target control programs, ensuring user safety and equipment stability. The latter improves the system's robustness in non-ideal communication environments such as weak networks and interference, enabling the remote update process to have self-healing capabilities. These two strategies can be flexibly configured according to the device's security level or application scenario, balancing security and availability, and significantly enhancing the operational reliability and user experience continuity of home appliances in OTA dynamic update scenarios.
[0116] The control method for home appliances in this application integrates the target control engine directly into the MCU of the home appliance. Before the target control program is sent to the target control engine, the MCU performs an integrity check on it. This ensures that only verified, unaltered, and undamaged target control programs can be loaded and executed, effectively preventing the risk of illegal code injection due to network transmission errors, storage anomalies, or malicious attacks. At the same time, since the verification operation is completed locally by the MCU, it does not rely on external security chips or operating system-level security modules, which reduces system cost and complexity, improves verification efficiency and real-time response, and provides a lightweight and highly reliable technical guarantee for secure remote programming of home appliances in the Internet of Things environment.
[0117] As one possible implementation method, Figure 4 A schematic flowchart illustrating another method for controlling a home appliance provided as an exemplary embodiment of this application.
[0118] It should be noted that the control method of this home appliance can be executed alone, or it can be executed together with any embodiment of this application or any possible implementation in the embodiment, or it can be executed together with any technical solution in related technologies. The embodiments of this application do not limit this.
[0119] like Figure 4 As shown, the control method for this household appliance may include the following steps S401 to S403: Step S401: Based on the MQTT subscription mechanism, receive the target control program and corresponding program update instructions published by the cloud; wherein, the cloud publishes the target control program and corresponding program update instructions based on the MQTT publishing mechanism; the target control program is generated according to the business requirements associated with home appliances.
[0120] Among them, the program update instruction is used to instruct the home appliance to replace or update the source control policy (i.e., the old policy) stored locally according to the control logic in the target control program.
[0121] In this embodiment of the application, after the cloud generates a target control program to implement the business requirements associated with the home appliance, it can publish the target control program and the corresponding program update instructions based on the MQTT publishing mechanism. Correspondingly, the home appliance can receive the target control program and the corresponding program update instructions published by the cloud based on the MQTT subscription mechanism.
[0122] Step S402: The target control program is sent to the target control engine, and in response to the program update command, the source control strategy stored locally in the target control engine is replaced with the control logic in the target control program to obtain the target control strategy.
[0123] The MCU of the home appliance integrates a target control engine. The memory usage of the target control engine is less than a set value, and the global object of the target control engine has registered the hardware driver layer functions of the home appliance.
[0124] As an example, the target control program can be sent to the target control engine through the MCU in the home appliance, and in response to the program update instruction, the source control strategy stored locally in the target control engine can be replaced with the control logic in the target control program to obtain the target control strategy.
[0125] Step S403: The target control strategy is executed through the target control engine to call the target function that matches the control logic from the hardware driver layer function registered in the global object, and drive the target component associated with the target function to run.
[0126] It should be noted that the explanation of step S403 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0127] The home appliance control method of this application embodiment distributes target control programs and corresponding program update instructions to the cloud based on the MQTT publishing mechanism. The home appliance receives these instructions in real time based on the MQTT subscription mechanism. Upon receiving the program update instruction, the control logic in the new target control program dynamically replaces the source control strategy stored locally in the target control engine, forming a new target control strategy which is then executed by the target control engine. This enables lightweight and highly efficient hot updates of remote control strategies. On the one hand, leveraging the lightweight, low-bandwidth, publish / subscribe characteristics of the MQTT protocol, it is suitable for resource-constrained embedded devices and unstable network environments. On the other hand, the control logic exists independently of the firmware in the form of a strategy, allowing for hot switching of control logic without restarting the device or interrupting core services, thus avoiding the functional downtime and user experience interruption caused by OTA upgrades in related technologies. Simultaneously, the strategy update process is triggered by a clear "program + instruction" collaboration, ensuring version consistency and execution determinism, significantly improving the maintainability, responsiveness, and operational continuity of home appliances in IoT scenarios.
[0128] In any embodiment of this application, taking a refrigerator as an example and the target control engine as an engine implemented in C language, the technical solution provided by this application mainly includes the following parts: Part 1: Embedded Integration and Ultra-Low Resource Consumption Design of a Lightweight Target Control Engine In this application, a target control engine can be directly embedded on an ultra-low-resource MCU with only 32KB of random access memory (RAM). The target control engine does not rely on the full malloc implementation of the standard library. It controls memory through a simplified API design and a pre-allocated static memory management mode. All variables (such as objects, strings, function closures, etc.) are managed in a controllable linear buffer, which greatly reduces the risk of memory fragmentation common in embedded systems and ensures the robustness and determinism of the system's long-term operation.
[0129] Part Two: Bidirectional Interface Design: Exposing Hardware Driver Layer Functions to the Target Control Engine for Call In the C language main control program of the refrigerator MCU firmware, the key hardware control functions and sensor data reading functions in the hardware driver layer are mounted onto the global object through the C language binding API provided by the target control engine, so that the control program generated in the cloud can directly access the hardware layer.
[0130] Once the target control program detects a temperature change in the environment, it can call the compressor speed control function encapsulated in the hardware driver layer, such as set_compressor_speed(), to adjust the compressor speed to the required level. Conversely, the execution result of the target control program can also be returned to the hardware driver layer logic processing through a numerical acquisition interface (such as the XX_GetNumber interface).
[0131] Part Three: Management of Cloud-Based Active Push and Control Programs, the implementation principle of which can be described as follows: Figure 5 As shown, it mainly includes the following steps: Step S501: The cloud generates a target control program based on business requirements and encrypts (or compresses) the target control program to obtain an encrypted program. Step S502: The cloud sends the encryption program via the MQTT / HTTP protocol; In step S503, the refrigerator's wireless communication module receives the encryption program and forwards the encryption program to the refrigerator's MCU; In step S504, the refrigerator's MCU decrypts (or decompresses) the encryption program and verifies the integrity of the decrypted target control program. In step S505, in response to the target control program passing the integrity verification, the code dynamic execution function (such as XX_eval()) is called to execute the target control program; Step S506: The lightweight target control engine interprets and executes the control logic in the target control program; Step S507: Call the hardware driver interface function (or hardware control function) of the hardware driver layer to control the target component (such as compressor, fan, damper, etc.) to complete the hot switching of control logic; Step S508: Report the execution results of the target control program.
[0132] For example, in response to a target control program failing integrity verification, the target control program is discarded or a retransmission request is sent to the cloud.
[0133] Part Four: Control Program Structure Design and Loop Control The target control engine supports timed callback functions, such as the set_interval() callback function, and the main control loop of the refrigerator can be encapsulated in the control program.
[0134] Part 5: Hot Update Process (No Interruption, No Restart) During normal operation of a refrigerator while it is powered on, if the refrigerator manufacturer wants to remotely update the temperature control algorithm on a large number of users' refrigerators, they only need to update the temperature control program. For example, the update process for the temperature control program can be as follows: Figure 6 As shown, it mainly includes the following steps: Step S601: A new version of the temperature control program is generated in the cloud, and the temperature control program is encrypted (or compressed) to obtain an encrypted program. In step S602, the cloud sends the encryption program and the corresponding program control instructions (or program control signals) through the MQTT protocol. In step S603, the refrigerator's wireless communication module receives the encryption program and the corresponding program control instructions, and forwards them to the refrigerator's MCU. In step S604, the refrigerator's MCU decrypts (or decompresses) the encryption program and verifies the integrity of the decrypted target control program. In step S605, in response to the target control program passing the integrity verification, the code dynamic execution function (such as XX_eval()) is called to execute the target control program; Step S606: The lightweight target control engine interprets and executes the control logic in the target control program and automatically replaces the locally stored source control policy (i.e., the old policy). Step S607: Call the hardware driver interface function of the hardware driver layer to adjust the temperature control parameters in real time; Step S608: Report the execution result of the target control program.
[0135] In summary, the control strategy update process is seamless for the user, the refrigerator's cooling function remains uninterrupted, and there is no need for a restart or downloading and burning large amounts of firmware data. Compared to OTA firmware upgrades in related technologies, which often take several minutes to tens of minutes, this application can complete a control logic update within seconds.
[0136] Part 6: Automated Closed-Loop Deployment of AI Strategies The cloud-based AI decision-making unit collects real-time operating data from the refrigerator and automatically generates an optimized control program. This program can include adjusted PID coefficients, defrosting trigger conditions, fan speed curves, and other logic-level control strategies. The AI decision-making unit directly pushes the control strategy to the refrigerator via a wireless network. After the refrigerator's target control engine executes the control program, the refrigerator's control behavior changes accordingly. The execution effect data can be sent back to the AI decision-making unit for further model training, forming a fully automated "perception-decision-execution-feedback" closed loop.
[0137] In summary, compared with related technical solutions, this application has at least the following beneficial effects: (1) Extremely low resource consumption: The lightweight target control engine requires only about 10KB of RAM at the minimum during operation, and the total read-only memory (ROM) occupies about 100KB.
[0138] (2) Deterministic memory management with no memory leaks: The lightweight target control engine does not rely on complex malloc dynamic memory allocation. All objects are managed in a pre-allocated controllable linear buffer, which greatly reduces the risk of memory fragmentation and leakage during the operation of the embedded system and ensures the reliability of the embedded refrigerator in long-term operation.
[0139] (3) Rule-level hot update: The refrigerator's operating rules are managed independently in the form of control programs. The control programs of different functional modules (temperature control, defrosting, fan, etc.) can be updated separately. The upgrade package is small (usually less than 4KB), the update speed is fast (completed in seconds), and no restart is required during operation, so as not to affect the normal operation of the refrigerator's cooling. That is, the control program sent from the cloud is directly parsed and executed by the lightweight target control engine during runtime. It can complete the dynamic switching of control logic such as temperature control strategy, defrosting plan, and energy-saving mode without restarting the device, and achieve smooth updates with zero interruption.
[0140] (4) Proactive push to enhance refrigerator operability: The cloud can proactively push control programs for specific functions to the refrigerator, such as control programs for implementing holiday mode, energy-saving mode and other functions, giving manufacturers stronger means of full life cycle operation and management.
[0141] (5) Lowering the development threshold of embedded refrigerator control logic: Embedded development in related technologies requires writing C / C++ code → cross-compiling → burning and testing, which has a long iteration cycle. After adopting the technical solution provided in this application, the control strategy can be developed and debugged in the cloud, which greatly reduces the development and testing costs and the learning curve of the embedded team.
[0142] (6) Support personalized customization and improve user experience: Users can customize refrigerator control rules through mobile app, and the cloud will convert users' personalized needs into control programs and send them out for execution to meet the personalized control needs of different users.
[0143] (7) System security and controllability: The target control engine does not contain native system calls (no network library, no file system library, no dangerous system-level API). All access to external hardware must be done through the interface functions of the pre-registered hardware driver layer (referred to as hardware driver layer functions in this application). The control program issued by the cloud cannot bypass this security mechanism to perform illegal operations.
[0144] (8) Empowering the deep application of AI in refrigerator control: This application breaks through the limitation of related technologies where AI solutions can only optimize parameters and cannot modify control logic. The AI model in the cloud can directly generate control programs, which are executed in real time on the refrigerator through the target control engine, forming a complete data closed loop of "AI decision-making → program distribution → hot update of control logic → effect feedback", providing a technical foundation for the continuous learning and optimization of refrigerator control algorithms. At the same time, it supports the independent distribution of personalized control strategies to each refrigerator, providing personalized customization capabilities for smart refrigerators.
[0145] To achieve the above embodiments, this application also proposes a control device for home appliances.
[0146] Figure 7 This is a schematic diagram of the structure of a control device for a household appliance provided as an exemplary embodiment of this application.
[0147] The MCU of the home appliance integrates a target control engine. The memory usage of the target control engine is less than a set value, and the global object of the target control engine has registered the hardware driver layer functions of the home appliance.
[0148] like Figure 7 As shown, the control device 700 of the home appliance may include a receiving module 710 and a processing module 720.
[0149] The receiving module 710 is used to receive the target control program sent from the cloud; the target control program is generated based on the business requirements associated with the home appliances. The processing module 720 is used to send the target control program to the target control engine so that the target control engine can execute the control logic in the target control program and call the target function that matches the control logic from the hardware driver layer function registered in the global object, thereby driving the target component associated with the target function to run.
[0150] In one implementation of this application, the hardware driver layer function includes: hardware control functions for each component within the home appliance and sensor data reading functions registered to a global object through a target binding interface.
[0151] In one implementation of this application, the processing module 720 is configured to: determine and call a target function matching the control logic from the sensor data reading functions on the global object to obtain sensor values; determine the control parameters of the target component in the home appliance associated with the control logic based on the control logic and the sensor values; and call the hardware control function of the target component on the global object based on the control parameters to drive the target component to run according to the control parameters.
[0152] In one implementation of this application, the target control engine includes a pre-allocated static memory buffer, wherein the static memory buffer stores variables, objects, functions and function closures generated by the target control program during execution through the target binding interface in the target control engine.
[0153] In one implementation of this application, the target binding interface includes a setting function interface for registering hardware driver layer functions to a global object, and a value acquisition interface for obtaining execution results from the target control program.
[0154] In one implementation of this application, the target control program further includes: an execution cycle parameter, and the control device 700 of the home appliance may further include: The calling module is used to call the internal timed callback interface through the target control engine to repeatedly execute the control logic at intervals of the execution cycle parameter.
[0155] In one implementation of this application, the processing module 720 is used to: perform integrity verification on the target control program through the MCU; and in response to the target control program passing the integrity verification, send the target control program to the target control engine through the MCU.
[0156] In one implementation of this application, the control device 700 for the home appliance may further include: The execution module is used to perform any of the following actions in response to the target control program failing the integrity check: discard the target control program to refuse to execute the control logic; or send a retransmission request to the cloud; wherein the retransmission request is used to request the cloud to retransmit the target control program.
[0157] In one implementation of this application, the cloud publishes the target control program and the corresponding program update instruction based on the Message Queuing Telemetry Transport Protocol (MQTT) publishing mechanism. The receiving module is used to: receive the target control program and the corresponding program update instruction published by the cloud based on the MQTT subscription mechanism. The processing module 720 is used to: respond to a program update instruction, replace the source control strategy stored locally in the target control engine with the control logic in the target control program to obtain a target control strategy; execute the target control strategy through the target control engine to call the target function that matches the control logic from the hardware driver layer function registered in the global object, and drive the target component associated with the target function to run.
[0158] In one implementation of this application, the target control program is generated by a generation module, wherein the generation module is used to perform at least one of the following: Based on the actual usage data of different users for the same model of home appliances, determine the first device control strategy according to the preferences of different users, and generate a target control program that matches the first device control strategy. Based on equipment usage data during peak electricity price periods in the target season, generate a target control program to control home appliances to enter energy-saving mode. Based on the functional description information of the target functions of the home appliances, a target control program is generated to achieve the target functions; the target functions include updated existing functions and newly added functions. Obtain user-defined device operation rules for home appliances and generate target control programs that are compatible with these rules; Based on the historical and current operating data of home appliances, a second device control strategy is determined according to the user preferences of the home appliances, and a target control program adapted to the second device control strategy is generated.
[0159] It should be noted that the foregoing explanation of the control method embodiment for home appliances also applies to the control device of the home appliance in this embodiment, and will not be repeated here.
[0160] In the control device for home appliances in this application embodiment, a lightweight target control engine is integrated into the MCU with limited memory resources of the home appliance, and hardware driver layer functions are pre-registered in its global object. This allows the cloud to dynamically distribute lightweight target control programs (rather than complete firmware images). The target control engine directly interprets and executes the target control program, and based on its contained control logic, calls the matching hardware driver layer functions from the global object to drive the corresponding hardware components to run. This significantly reduces the size of the upgrade package, shortens the deployment time, and allows new functions or strategies to take effect immediately without restarting the device. This effectively avoids interruptions to critical functions (such as cooling and temperature regulation) during the upgrade process, improving the user experience. At the same time, developers can independently iterate on the upper-layer control logic without recompiling, packaging, and fully verifying the firmware, significantly shortening the software delivery cycle and improving development efficiency. This not only lowers the threshold of dependence on device hardware resources but also enhances the agile response capability, remote operation and maintenance efficiency, and continuous availability of home appliances in the Internet of Things environment.
[0161] To implement the above embodiments, this application also proposes a home appliance device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the control method of the home appliance device as described in any of the foregoing embodiments.
[0162] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for controlling a household appliance, characterized in that, The microcontroller unit of the home appliance integrates a target control engine, the memory usage of which is less than a set value, and the global object of the target control engine registers the hardware driver layer functions of the home appliance; the method includes: Receive a target control program sent from the cloud; wherein the target control program is generated based on the business requirements associated with the home appliance. The target control program is sent to the target control engine so that the control logic in the target control program is executed by the target control engine, and the target function matching the control logic is called from the hardware driver layer function registered by the global object to drive the target component associated with the target function to run.
2. The method according to claim 1, characterized in that, The hardware driver layer functions include: hardware control functions and sensor data reading functions for each component within the home appliance that are registered to the global object through the target binding interface; The step of calling a target function matching the control logic from the hardware driver layer function registered from the global object, and driving the target component associated with the target function to run, includes: From the sensor data reading functions on the global object, determine and call the target function that matches the control logic to obtain the sensor values; Based on the control logic and the sensor values, the control parameters of the target component in the home appliance associated with the control logic are determined; Based on the control parameters, the hardware control function of the target component on the global object is invoked to drive the target component to operate according to the control parameters.
3. The method according to claim 2, characterized in that, The target control engine includes a pre-allocated static memory buffer, wherein the static memory buffer stores variables, objects, functions, and function closures generated by the target control program during execution through the target binding interface in the target control engine.
4. The method according to claim 2 or 3, characterized in that, The target binding interface includes a setting function interface for registering the hardware driver layer function to the global object, and a value acquisition interface for obtaining the execution result from the target control program.
5. The method according to any one of claims 1-3, characterized in that, The target control program further includes: an execution cycle parameter, and the method further includes: The target control engine calls the internal timed callback interface to repeatedly execute the control logic at intervals defined by the execution cycle parameter.
6. The method according to any one of claims 1-3, characterized in that, The step of sending the target control program to the target control engine includes: The microcontroller unit performs integrity verification on the target control program. In response to the target control program passing the integrity verification, the target control program is sent to the target control engine through the microcontroller unit; After performing integrity verification on the target control program through the microcontroller unit, the method further includes: In response to the target control procedure failing the integrity check, one of the following is executed: Discard the target control program to refuse to execute the control logic; Send a retransmission request to the cloud; wherein the retransmission request is used to request the cloud to retransmit the target control program.
7. The method according to any one of claims 1-3, characterized in that, The cloud platform uses the Message Queuing Telemetry Transport Protocol (MQTT) publishing mechanism to publish the target control program and corresponding program update instructions. The target control program that receives data from the cloud includes: Based on the MQTT subscription mechanism, it receives the target control program and corresponding program update instructions published by the cloud; The step of executing the control logic in the target control program through the target control engine, calling the target function matching the control logic from the hardware driver layer function registered by the global object, and driving the target component associated with the target function to run includes: In response to the program update instruction, the source control strategy stored locally in the target control engine is replaced with the control logic in the target control program to obtain the target control strategy; The target control strategy is executed by the target control engine to call the target function that matches the control logic from the hardware driver layer function registered by the global object, and drive the target component associated with the target function to run.
8. The method according to any one of claims 1-3, characterized in that, The method for generating the target control program includes at least one of the following: Based on the actual usage data of different users for the same model of home appliances, a first device control strategy based on the preferences of the different users is determined, and a target control program matching the first device control strategy is generated. Based on equipment usage data during peak electricity price periods in the target season, a target control program is generated to control the home appliances to enter energy-saving mode. Based on the functional description information of the target function of the home appliance, a target control program is generated to implement the target function; wherein, the target function includes updated existing functions and newly added functions; Obtain the user-defined device operation rules of the home appliance and generate a target control program that is compatible with the device operation rules; Based on the historical and current operating data of the home appliances, a second device control strategy based on the user's preferences is determined, and a target control program adapted to the second device control strategy is generated.
9. A control device for a household appliance, characterized in that, The microcontroller unit of the home appliance integrates a target control engine, the memory usage of which is less than a set value, and the global object of the target control engine registers the hardware driver layer functions of the home appliance; the device includes: A receiving module is used to receive a target control program sent from the cloud; wherein the target control program is generated based on the business requirements associated with the home appliance. The processing module is used to send the target control program to the target control engine, so that the target control engine can execute the control logic in the target control program, and call the target function that matches the control logic from the hardware driver layer function registered by the global object, so as to drive the target component associated with the target function to run.
10. A household appliance, characterized in that, include: processor; A memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the method as described in any one of claims 1 to 8.